1 /*   smdlg2.c
2 * ===========================================================================
3 *
4 *                            PUBLIC DOMAIN NOTICE
5 *            National Center for Biotechnology Information (NCBI)
6 *
7 *  This software/database is a "United States Government Work" under the
8 *  terms of the United States Copyright Act.  It was written as part of
9 *  the author's official duties as a United States Government employee and
10 *  thus cannot be copyrighted.  This software/database is freely available
11 *  to the public for use. The National Library of Medicine and the U.S.
12 *  Government do not place any restriction on its use or reproduction.
13 *  We would, however, appreciate having the NCBI and the author cited in
14 *  any work or product based on this material
15 *
16 *  Although all reasonable efforts have been taken to ensure the accuracy
17 *  and reliability of the software and data, the NLM and the U.S.
18 *  Government do not and cannot warrant the performance or results that
19 *  may be obtained by using this software or data. The NLM and the U.S.
20 *  Government disclaim all warranties, express or implied, including
21 *  warranties of performance, merchantability or fitness for any particular
22 *  purpose.
23 *
24 * ===========================================================================
25 *
26 * File Name:  smdlg2.c
27 *
28 * Author:  Alex Smirnov
29 *
30 * Version Creation Date:   8/10/95
31 *
32 * $Revision: 6.1 $
33 *
34 * File Description:
35 *
36 * Modifications:
37 * --------------------------------------------------------------------------
38 * Date     Name        Description of modification
39 * -------  ----------  -----------------------------------------------------
40 *
41 *
42 * ==========================================================================
43 */
44 
45 /**************************************************************************/
46 /* INCLUDE */
47 /**************************************************************************/
48 #include <vibrant.h>
49 #include <picture.h>
50 #include <fstyle.h>
51 #include <fstylep.h>
52 
53 /**************************************************************************/
54 /* DEFINES */
55 /**************************************************************************/
56 
57 /**************************************************************************/
58 /* TYPEDEFS */
59 /**************************************************************************/
60 typedef struct a_group {
61   struct a_group PNTR next;
62   Char           GroupName[64];
63   Uint1          total;
64   Uint1          hide;
65   Uint1          farray[100];
66 } Nlm_AGroup, PNTR Nlm_AGroupPtr;
67 
68 
69 /**************************************************************************/
70 /* EXTERN VARIABLE */
71 /**************************************************************************/
72 extern CharPtr mSM_allfeatureNames[];
73 
74 /**************************************************************************/
75 /* STATIC VARIABLE */
76 /**************************************************************************/
77 static ButtoN groupDelButton;
78 static ButtoN groupHideButton;
79 static ButtoN groupCompBox;
80 static ButtoN newButton;
81 static TexT   groupDialog;
82 static LisT   groupList;
83 static LisT   featList;
84 static ButtoN featHideButton;
85 static GrouP  featGroup;
86 static PopuP  featPopup;
87 
88 static Int2   curGroupInd;
89 static Int2   totalGroups;
90 static Int2   nHideGroups;
91 static Int2   curFeatureInd;
92 static Int2   totalFeatures;
93 static Int2   nHideFeatures;
94 static Int2   groupAr[10];
95 static Int2   featAr[100];
96 
97 static Boolean wasModified = FALSE;
98 static CharPtr unknownName = "<unknown>";
99 
100 /**************************************************************************/
101 /* STATIC FUNCTION */
102 /**************************************************************************/
103 static void
LoadGroupArray(void)104 /*FCN*/LoadGroupArray(
105   void
106 ){
107   Int2 i,j,k;
108 
109   curGroupInd = 0;
110   totalGroups = (Int2)Nlm_GetMuskCParamEd(MSM_GROUPS,MSM_NOSUBCLASS,MSM_NUM);
111   nHideGroups = 0;
112   for ( i=1; i<=totalGroups; i++ ){
113     j = (Int2)Nlm_GetMuskCParamEd(MSM_GROUPS,i,MSM_NUM );
114     if ( j != 0 ) {
115       groupAr[j-1] = i;
116       nHideGroups++;
117     }
118   }
119   k = nHideGroups;
120   for ( i=1; i<=totalGroups; i++ ){
121     j = (Int2)Nlm_GetMuskCParamEd(MSM_GROUPS,i,MSM_NUM );
122     if ( j == 0 ) groupAr[k++] = i;
123   }
124 }
125 
126 static void
SaveGroupArray(void)127 /*FCN*/SaveGroupArray (
128   void
129 ){
130   Int2 i;
131 
132   for (i=0; i<nHideGroups; i++ ){
133     Nlm_SetMuskCParamEd(MSM_GROUPS, groupAr[i], MSM_NUM, (BigScalar)(i+1) );
134   }
135   for (i=nHideGroups; i<totalGroups; i++ ){
136     Nlm_SetMuskCParamEd(MSM_GROUPS, groupAr[i], MSM_NUM, 0 );
137   }
138   wasModified = TRUE;
139 }
140 
141 static void
LoadFeatureArray(void)142 /*FCN*/LoadFeatureArray(
143   void
144 ){
145   Int2 i,j,k;
146 
147   nHideFeatures = 0;
148   for ( i=1; i<=MSM_TOTAL_POSITIVE; i++ ){
149     j = (Int2)Nlm_GetMuskCParamEd(i,MSM_FGROUP,MSM_NUM );
150     if ( j==groupAr[curGroupInd] ) {
151       j = (Int2)Nlm_GetMuskCParamEd(i,MSM_FORDER,MSM_NUM );
152       if ( j != 0 ){
153         featAr[j-1] = i;
154         nHideFeatures++;
155       }
156     }
157   }
158   k = nHideFeatures;
159   for ( i=1; i<=MSM_TOTAL_POSITIVE; i++ ){
160     j = (Int2)Nlm_GetMuskCParamEd(i,MSM_FGROUP,MSM_NUM );
161     if ( j==groupAr[curGroupInd] ) {
162       j = (Int2)Nlm_GetMuskCParamEd(i,MSM_FORDER,MSM_NUM );
163       if ( j == 0 ) featAr[k++] = i;
164     }
165   }
166   totalFeatures = k;
167 }
168 
169 static void
SaveFeatureArray(void)170 /*FCN*/SaveFeatureArray(
171   void
172 ){
173   Int2 i;
174 
175   for (i=0; i<nHideFeatures; i++ ){
176     Nlm_SetMuskCParamEd(featAr[i],MSM_FORDER,MSM_NUM,(BigScalar)(i+1) );
177   }
178   for (i=nHideFeatures; i<totalFeatures; i++ ){
179     Nlm_SetMuskCParamEd(featAr[i],MSM_FORDER,MSM_NUM,0 );
180   }
181   wasModified = TRUE;
182 }
183 
184 static void
UpdateDlgControls(void)185 /*FCN*/UpdateDlgControls (
186   void
187 ){
188   if ( totalFeatures == 0 ){
189     Disable ( featGroup );
190     Enable ( groupDelButton );
191   } else {
192     if ( curFeatureInd < nHideFeatures ) Enable ( featHideButton );
193     else Disable ( featHideButton );
194     Enable ( featGroup );
195     Disable ( groupDelButton );
196   }
197   if ( totalGroups < 6 ){
198     Enable ( newButton );
199   } else {
200     Disable ( newButton );
201   }
202   if ( curGroupInd < nHideGroups ) Enable (groupHideButton);
203   else Disable ( groupHideButton );
204   if ( (Int2)Nlm_GetMuskCParamEd(MSM_GROUPS,groupAr[curGroupInd],MSM_STYLE)
205        == MSM_SPREAD ) SetStatus (groupCompBox,FALSE);
206   else SetStatus (groupCompBox,TRUE);
207 }
208 
209 static void
FillGroupList(Boolean needHide)210 /*FCN*/FillGroupList (
211   Boolean needHide
212 ){
213   Int2    i;
214   CharPtr name;
215 
216   if ( needHide ){
217     Hide( groupList );
218     Reset ( groupList );
219   }
220   for ( i=0; i<nHideGroups; i++ ){
221     name = (CharPtr)Nlm_GetMuskCParamEd(MSM_GROUPS, groupAr[i],MSM_STRING);
222     if ( (name == NULL) || (*name == 0) ) ListItem ( groupList, unknownName );
223     else ListItem ( groupList, name );
224   }
225   if ( nHideGroups != totalGroups ) {
226     ListItem ( groupList, "-- Hidden groups: --" );
227     for ( ; i<totalGroups; i++ ){
228       name = (CharPtr)Nlm_GetMuskCParamEd(MSM_GROUPS, groupAr[i],MSM_STRING);
229       if ( (name == NULL) || (*name == 0) ) ListItem ( groupList, unknownName );
230       else ListItem ( groupList, name );
231     }
232   }
233   if ( needHide ) {
234     Show( groupList);
235   }
236 }
237 
238 static void
FillFeatPopup(Boolean needHide)239 /*FCN*/FillFeatPopup (
240   Boolean needHide
241 ){
242   Int2    i;
243   CharPtr name;
244 
245   if ( needHide ){
246     Hide( featPopup );
247     Reset ( featPopup );
248   }
249   for ( i=1; i<=totalGroups; i++ ){
250     if ( i== groupAr[curGroupInd] ) continue;
251     name = (CharPtr)Nlm_GetMuskCParamEd(MSM_GROUPS, i, MSM_STRING);
252     if ( (name == NULL) || (*name == 0) ) PopupItem ( featPopup,unknownName );
253     else PopupItem ( featPopup, name );
254   }
255   SetValue ( featPopup, 1 );
256   if ( needHide ) {
257     Show ( featPopup );
258   }
259 }
260 
261 static void
FillFeatList(Boolean needHide)262 /*FCN*/FillFeatList (
263   Boolean needHide
264 ){
265   Int2    i;
266   Int2    feat;
267   CharPtr name;
268 
269   if ( needHide ){
270     Hide( featList );
271     Reset ( featList );
272   }
273   for ( i=0; i<nHideFeatures; i++ ){
274     feat = featAr[i];
275     name = mSM_allfeatureNames[feat];
276     if ( (name==NULL) || (*name=='\0') ) ListItem ( featList, unknownName );
277 	else ListItem ( featList, name );
278   }
279   if ( nHideFeatures != totalFeatures ){
280     ListItem ( featList, "-- Hidden features --" );
281     for ( ; i<totalFeatures; i++ ){
282       feat = featAr[i];
283       name = mSM_allfeatureNames[feat];
284       if ( (name==NULL) || (*name=='\0') ) ListItem ( featList, unknownName );
285 	  else ListItem ( featList, name );
286     }
287   }
288   if ( needHide ) Show( featList);
289 }
290 
291 static void
SetGroupValue(Int2 val)292 /*FCN*/SetGroupValue (
293   Int2 val
294 ){
295   if ( val < nHideGroups ) val++;
296   else val += 2;
297   SetValue ( groupList, val );
298 }
299 
300 static void
SetFeatValue(Int2 val)301 /*FCN*/SetFeatValue (
302   Int2 val
303 ){
304   if ( val >= 0 ){
305     if ( val < nHideFeatures ) val++;
306     else val += 2;
307     SetValue ( featList, val );
308   }
309 }
310 
311 static void
OnGroupTop(ButtoN b)312 /*FCN*/OnGroupTop (
313   ButtoN b
314 ){
315   Int2 i;
316 
317   if ( curGroupInd >= nHideGroups ) nHideGroups++;
318   i = groupAr[curGroupInd];
319   MemMove ( &(groupAr[1]), &(groupAr[0]), curGroupInd*sizeof(Int2) );
320   groupAr[0] = i;
321   curGroupInd = 0;
322   FillGroupList(TRUE);
323   SetGroupValue ( curGroupInd );
324   SaveGroupArray();
325   UpdateDlgControls();
326 }
327 
328 static void
OnGroupBottom(ButtoN b)329 /*FCN*/OnGroupBottom (
330   ButtoN b
331 ){
332   Int2 i;
333 
334   i = groupAr[curGroupInd];
335   if ( curGroupInd >= nHideGroups ) {
336     MemMove ( &(groupAr[nHideGroups+1]),
337               &(groupAr[nHideGroups]),
338               (curGroupInd-nHideGroups)*sizeof(Int2) );
339     nHideGroups++;
340   } else {
341     MemMove ( &(groupAr[curGroupInd]),
342               &(groupAr[curGroupInd+1]),
343               (nHideGroups-curGroupInd-1)*sizeof(Int2) );
344   }
345   curGroupInd = nHideGroups-1;
346   groupAr[curGroupInd] = i;
347   FillGroupList(TRUE);
348   SetGroupValue ( curGroupInd );
349   SaveGroupArray();
350   UpdateDlgControls();
351 }
352 
353 static void
OnGroupNew(ButtoN b)354 /*FCN*/OnGroupNew (
355   ButtoN b
356 ){
357   Int2 i;
358   Char newName[64];
359 
360   GetTitle ( groupDialog, &(newName[0]), 64 );
361   if ( newName[0] == 0 ) return;
362   newName[63] = 0;
363   for ( i=1; i<=totalGroups; i++ ){
364     if ( StringCmp ( (CharPtr)Nlm_GetMuskCParamEd(MSM_GROUPS,
365                       i,MSM_STRING), &(newName[0]) ) == 0 ) return;
366   }
367   MemMove ( &(groupAr[1]), &(groupAr[0]), totalGroups*sizeof(Int2) );
368   totalGroups++;
369   nHideGroups++;
370   groupAr[0] = totalGroups;
371   Nlm_SetMuskCParamEd(MSM_GROUPS,MSM_NOSUBCLASS,MSM_NUM,(BigScalar)totalGroups);
372   Nlm_SetMuskCParamEd(MSM_GROUPS,totalGroups,MSM_STRING,(BigScalar)&(newName[0]));
373   curGroupInd = 0;
374   FillGroupList(TRUE);
375   SetGroupValue ( curGroupInd );
376   FillFeatPopup(TRUE);
377   LoadFeatureArray();
378   FillFeatList(TRUE);
379   if ( totalFeatures == 0 ){
380     curFeatureInd = -1;
381   } else {
382     curFeatureInd = 0;
383     SetFeatValue ( curFeatureInd );
384   }
385   UpdateDlgControls();
386   SaveGroupArray();
387 }
388 
389 static void
OnGroupDelete(ButtoN b)390 /*FCN*/OnGroupDelete (
391   ButtoN b
392 ){
393   Int2      i,j;
394   BigScalar k;
395   CharPtr   name;
396 
397   name = (CharPtr)Nlm_GetMuskCParamEd(MSM_GROUPS,
398          groupAr[curGroupInd],MSM_STRING);
399   if ( (name == NULL) || (*name == 0) ) name = unknownName;
400   if ( Message ( MSG_YN, "Delete group %s ?", name ) == ANS_YES ){
401     if ( curGroupInd < nHideGroups ) nHideGroups--;
402     i = groupAr[curGroupInd];
403     for ( j=1; j<=MSM_TOTAL_POSITIVE; j++ ){
404       k = Nlm_GetMuskCParamEd(j,MSM_FGROUP,MSM_NUM);
405       if ( k > i ) {
406         Nlm_SetMuskCParamEd(j,MSM_FGROUP,MSM_NUM,k-1);
407       }
408     }
409     for ( j=i+1; j<=totalGroups; j++ ){
410       k = Nlm_GetMuskCParamEd(MSM_GROUPS,j,MSM_TRUEFALSE);
411       Nlm_SetMuskCParamEd(MSM_GROUPS,(Int2)(j-1),MSM_TRUEFALSE,k);
412       k = Nlm_GetMuskCParamEd(MSM_GROUPS,j,MSM_STYLE);
413       Nlm_SetMuskCParamEd(MSM_GROUPS,(Int2)(j-1),MSM_STYLE,k);
414       k = Nlm_GetMuskCParamEd(MSM_GROUPS,j,MSM_STRING);
415       Nlm_SetMuskCParamEd(MSM_GROUPS,(Int2)(j-1),MSM_STRING,k);
416     }
417     Nlm_SetMuskCParamEd(MSM_GROUPS,totalGroups,MSM_STRING,(BigScalar)NULL);
418     for ( j=0; j<totalGroups; j++ ){
419       if ( groupAr[j] > i )  groupAr[j] -= 1;
420     }
421     if ( curGroupInd != (totalGroups-1) ){
422       MemMove ( &(groupAr[curGroupInd]), &(groupAr[curGroupInd+1]),
423                 (totalGroups-curGroupInd-1)*sizeof(Int2) );
424     } else curGroupInd--;
425     totalGroups--;
426 	Nlm_SetMuskCParamEd(MSM_GROUPS,MSM_NOSUBCLASS,MSM_NUM,(BigScalar)totalGroups);
427     FillGroupList(TRUE);
428     SetGroupValue ( curGroupInd );
429     FillFeatPopup(TRUE);
430     LoadFeatureArray();
431     FillFeatList(TRUE);
432     if ( totalFeatures == 0 ){
433       curFeatureInd = -1;
434     } else {
435       curFeatureInd = 0;
436       SetFeatValue ( curFeatureInd );
437     }
438     SaveGroupArray();
439     UpdateDlgControls();
440   }
441 }
442 
443 static void
OnGroupHide(ButtoN b)444 /*FCN*/OnGroupHide (
445   ButtoN b
446 ){
447   Int2 i;
448 
449   i = groupAr[curGroupInd];
450   if ( curGroupInd >= nHideGroups ) return;
451   MemMove ( &(groupAr[curGroupInd]),
452             &(groupAr[curGroupInd+1]),
453             (nHideGroups-curGroupInd-1)*sizeof(Int2) );
454   nHideGroups--;
455   groupAr[nHideGroups] = i;
456   curGroupInd = nHideGroups;
457   FillGroupList(TRUE);
458   SetGroupValue ( curGroupInd );
459   SaveGroupArray();
460   UpdateDlgControls();
461 }
462 
463 static void
OnGroupCompress(ButtoN b)464 /*FCN*/OnGroupCompress (
465   ButtoN b
466 ){
467   if ( GetStatus(b) ){
468     Nlm_SetMuskCParamEd(MSM_GROUPS,groupAr[curGroupInd],MSM_STYLE,
469                         MSM_COMPRESS);
470   } else {
471     Nlm_SetMuskCParamEd(MSM_GROUPS,groupAr[curGroupInd],MSM_STYLE,MSM_SPREAD);
472   }
473 }
474 
475 static void
OnGroupList(LisT l)476 /*FCN*/OnGroupList (
477   LisT l
478 ){
479   curGroupInd = GetValue ( groupList ) - 1;
480   if ( curGroupInd == nHideGroups ) {
481     SetValue ( (Handle)groupList, (Int2)(curGroupInd+2));
482     curGroupInd = GetValue ( groupList ) - 1;
483   }
484   if ( curGroupInd > nHideGroups ) curGroupInd--;
485   LoadFeatureArray();
486   FillFeatList(TRUE);
487   FillFeatPopup(TRUE);
488   if ( totalFeatures == 0 ){
489     curFeatureInd = -1;
490   } else {
491     curFeatureInd = 0;
492     SetFeatValue ( curFeatureInd );
493   }
494   UpdateDlgControls();
495 }
496 
497 static void
OnFeatureList(LisT l)498 /*FCN*/OnFeatureList (
499   LisT l
500 ){
501   curFeatureInd = GetValue ( featList ) - 1;
502   if ( curFeatureInd == nHideFeatures ) {
503     SetValue( (Handle)featList, (Int2)(curFeatureInd+2) );
504     curFeatureInd = GetValue ( featList ) - 1;
505   }
506   if ( curFeatureInd > nHideFeatures ) curFeatureInd--;
507   UpdateDlgControls();
508 }
509 
510 static void
OnFeatTop(ButtoN b)511 /*FCN*/OnFeatTop (
512   ButtoN b
513 ){
514   Int2 i;
515 
516   if ( curFeatureInd >= nHideFeatures ) nHideFeatures++;
517   i = featAr[curFeatureInd];
518   MemMove ( &(featAr[1]), &(featAr[0]), curFeatureInd*sizeof(Int2) );
519   featAr[0] = i;
520   curFeatureInd = 0;
521   FillFeatList(TRUE);
522   SetFeatValue ( curFeatureInd );
523   SaveFeatureArray();
524   UpdateDlgControls();
525 }
526 
527 static void
OnFeatBottom(ButtoN b)528 /*FCN*/OnFeatBottom (
529   ButtoN b
530 ){
531   Int2 i;
532 
533   i = featAr[curFeatureInd];
534   if ( curFeatureInd >= nHideFeatures ) {
535     MemMove ( &(featAr[nHideFeatures+1]),
536               &(featAr[nHideFeatures]),
537               (curFeatureInd-nHideFeatures)*sizeof(Int2) );
538     nHideFeatures++;
539   } else {
540     MemMove ( &(featAr[curFeatureInd]),
541               &(featAr[curFeatureInd+1]),
542               (nHideFeatures-curFeatureInd-1)*sizeof(Int2) );
543   }
544   curFeatureInd = nHideFeatures-1;
545   featAr[curFeatureInd] = i;
546   FillFeatList(TRUE);
547   SetFeatValue ( curFeatureInd );
548   SaveFeatureArray();
549   UpdateDlgControls();
550 }
551 
552 static void
OnFeatMove(ButtoN b)553 /*FCN*/OnFeatMove (
554   ButtoN b
555 ){
556   Int2 i,j,k;
557   Int2 movFeat;
558 
559   movFeat = featAr[curFeatureInd];
560   i = GetValue ( featPopup );
561   if ( groupAr[curGroupInd] <= i ) i++;
562   MemMove ( &(featAr[curFeatureInd]), &(featAr[curFeatureInd+1]),
563             (totalFeatures - curFeatureInd - 1)*sizeof(Int2) );
564   if ( curFeatureInd >= nHideFeatures ){
565     Nlm_SetMuskCParamEd(movFeat,MSM_FGROUP,MSM_NUM,(BigScalar)i);
566   } else {
567     nHideFeatures--;
568     for ( j=1; j<=MSM_TOTAL_POSITIVE; j++ ){
569       if ( (Int2)Nlm_GetMuskCParamEd(j,MSM_FGROUP,MSM_NUM ) == i ){
570         k = (Int2)Nlm_GetMuskCParamEd(j,MSM_FORDER,MSM_NUM );
571         if ( k > 0 ){
572           Nlm_SetMuskCParamEd(j,MSM_FORDER,MSM_NUM,(BigScalar)(k+1));
573         }
574       }
575     }
576     Nlm_SetMuskCParamEd(movFeat,MSM_FGROUP,MSM_NUM,(BigScalar)i);
577     Nlm_SetMuskCParamEd(movFeat,MSM_FORDER,MSM_NUM,1);
578   }
579   totalFeatures--;
580   if ( curFeatureInd == totalFeatures ) curFeatureInd--;
581   FillFeatList(TRUE);
582   SetFeatValue ( curFeatureInd );
583   SaveFeatureArray();
584   UpdateDlgControls();
585 }
586 
587 static void
OnFeatHide(ButtoN b)588 /*FCN*/OnFeatHide (
589   ButtoN b
590 ){
591   Int2 i;
592 
593   i = featAr[curFeatureInd];
594   if ( curFeatureInd >= nHideFeatures ) return;
595   MemMove ( &(featAr[curFeatureInd]),
596             &(featAr[curFeatureInd+1]),
597             (nHideFeatures-curFeatureInd-1)*sizeof(Int2) );
598   nHideFeatures--;
599   featAr[nHideFeatures] = i;
600   curFeatureInd = nHideFeatures;
601   FillFeatList(TRUE);
602   SetFeatValue ( curFeatureInd );
603   SaveFeatureArray();
604   UpdateDlgControls();
605 }
606 
607 static void
OnText16(TexT t)608 /*FCN*/OnText16 (
609   TexT t
610 ){
611   Char curVal[20];
612 
613   GetTitle ( t, &(curVal[0]), 20 );
614   curVal[19] = 0;
615   if ( StringLen ( &(curVal[0]) ) > 16 ){
616     Nlm_Beep();
617     curVal[17] = 0;
618     SetTitle ( t, &(curVal[0]) );
619   }
620 }
621 
622 
623 /***************************************************************************/
624 /* GLOBAL FUNCTIONS */
625 /**************************************************************************/
626 GrouP
Nlm_CreateDlgGroup(GrouP gTop)627 /*FCN*/Nlm_CreateDlgGroup (
628   GrouP gTop
629 ){
630   GrouP    g, glr, g1, g2;
631   Handle   toAlign[3];
632 
633   g = HiddenGroup ( gTop, 2, 1, NULL);
634   SetGroupSpacing ( g, 1, 1 );
635   glr = NormalGroup ( g, 1, 2, "Groups:", systemFont, NULL );
636 #ifdef WIN_MOTIF
637   SetGroupSpacing ( glr, 12, 12 );
638   SetGroupMargins ( glr, 8, 8 );
639 #else
640   SetGroupSpacing ( glr, 6, 6 );
641   SetGroupMargins ( glr, 6, 6 );
642 #endif
643   g1 = HiddenGroup ( glr, 2, 1, NULL );
644   g2 = HiddenGroup ( g1, 1, 0, NULL );
645   PushButton ( g2, "Top", OnGroupTop );
646   PushButton ( g2, "Bottom", OnGroupBottom );
647   groupHideButton = PushButton ( g2, "Hide", OnGroupHide );
648   groupCompBox = CheckBox ( g2, "Compress", OnGroupCompress );
649   groupDelButton = PushButton ( g2, "Delete", OnGroupDelete );
650   groupList = SingleList ( g1, 10, 8, OnGroupList );
651   curGroupInd = 0;
652   LoadGroupArray();
653   g2 = HiddenGroup ( glr, 3, 0, NULL );
654   toAlign[2] = (Handle)PushButton ( g2, "Create", OnGroupNew );
655   toAlign[0] = (Handle)StaticPrompt ( g2, "Group", 0, 0, systemFont, 'l');
656 #ifdef WIN_MOTIF
657   groupDialog = DialogText ( g2, "", 7, OnText16 );
658 #else
659   groupDialog = DialogText ( g2, "", 9, OnText16 );
660 #endif
661   toAlign[1] = (Handle)groupDialog;
662   AlignObjects ( ALIGN_CENTER, (HANDLE)g1, (HANDLE)g2, NULL );
663 
664   featGroup = glr = NormalGroup ( g, 1, 2, "Features:", systemFont, NULL );
665 #ifdef WIN_MOTIF
666   SetGroupSpacing ( glr, 12, 12 );
667   SetGroupMargins ( glr, 8, 8 );
668 #else
669   SetGroupSpacing ( glr, 6, 6 );
670   SetGroupMargins ( glr, 6, 6 );
671 #endif
672   g1 = HiddenGroup ( glr, 2, 1, NULL );
673   featList = SingleList ( g1, 10, 8, OnFeatureList );
674   LoadFeatureArray();
675   FillFeatList( FALSE );
676   if ( totalFeatures == 0 ){
677     curFeatureInd = -1;
678   } else {
679     curFeatureInd = 0;
680     SetValue ( featList, 1 );
681   }
682   g2 = HiddenGroup ( g1, 1, 0, NULL );
683   PushButton ( g2, "Top", OnFeatTop );
684   PushButton ( g2, " Bottom ", OnFeatBottom );
685   featHideButton = PushButton ( g2, "Hide", OnFeatHide );
686   g2 = HiddenGroup ( glr, 3, 0, NULL );
687 #ifdef WIN_MOTIF
688   SetGroupMargins ( g2, 8, 8 );
689 #endif
690   toAlign[0] = (Handle)PushButton ( g2, "Move", OnFeatMove );
691   toAlign[1] = (Handle)StaticPrompt ( g2, "To", 0, 0, systemFont, 'l');
692   featPopup = PopupList ( g2, FALSE, NULL );
693   toAlign[2] = (Handle)featPopup;
694   FillGroupList(FALSE);
695   SetGroupValue (curGroupInd);
696   FillFeatPopup(FALSE);
697   UpdateDlgControls ();
698   return g;
699 }
700 
701 
702 
703 void
Nlm_ToolDlgGroup(Int2 tools)704 /*FCN*/Nlm_ToolDlgGroup (
705   Int2 tools
706 ){
707 }
708 
Nlm_SetTDefGroup(void)709 void  Nlm_SetTDefGroup (
710   void
711 ){
712   Nlm_ShowToolsSM (0);
713 }
714 
715 Boolean
Msk_OrderWasModified(void)716 /*FCN*/Msk_OrderWasModified (
717   void
718 ){
719   if ( wasModified == TRUE ){
720     wasModified = FALSE;
721     return TRUE;
722   }
723   return FALSE;
724 }
725 
726 /* END */
727