Moved DejaVue fonts to contrib. They are only needed by applications
[AROS-Contrib.git] / bgui / Prefs / BGUIPrefs_gui.c
blob86e3ff350cffdc2ea152a8b267c18f0d7c454e7d
1 /*
2 * @(#) $Header$
4 * BGUI Prefs Editor
5 * BGUIPrefs_gui.c
7 * (C) Copyright 1998 Manuel Lemos.
8 * (C) Copyright 1996-1997 Respect Software
9 * (C) Copyright 1996-1997 Ian J. Einman.
10 * All Rights Reserved.
12 * $Log$
13 * Revision 42.0 2000/05/09 22:17:00 mlemos
14 * Bumped to revision 42.0 before handing BGUI to AROS team
16 * Revision 41.11 2000/05/09 20:29:50 mlemos
17 * Bumped to revision 41.11
19 * Revision 1.2 2000/05/09 19:56:50 mlemos
20 * Merged with the branch Manuel_Lemos_fixes.
22 * Revision 1.1.2.4 1999/08/30 05:02:21 mlemos
23 * Updated the copyright and the version information.
25 * Revision 1.1.2.3 1999/08/30 00:25:38 mlemos
26 * Removed window creation timing code.
27 * Removed GRM_REPLACEMEMBER test code.
28 * Made the relayout of the added pages be done after the preferences and
29 * example pages are added.
31 * Revision 1.1.2.2 1999/08/29 17:11:10 mlemos
32 * Made the preferences and example pages be created and added on demand.
34 * Revision 1.1.2.1 1998/09/20 17:28:45 mlemos
35 * Peter Bornhall sources.
41 // GROUP DEFAULTS
42 extern IPTR grp_frmtype,
43 grp_recessed,
44 grp_vspnarrow,
45 grp_hspnarrow,
46 grp_vspnormal,
47 grp_hspnormal,
48 grp_vspwide,
49 grp_hspwide;
51 // INFO DEFAULTS
52 extern IPTR inf_frmtype,
53 inf_recessed;
55 // INDICATOR DEFAULTS
56 extern IPTR ind_frmtype,
57 ind_recessed;
59 extern struct NewMenu Menus[];
61 enum {
62 BGP_MASTER,
63 BGP_LISTVIEW1,
64 BGP_MAIN_PAGES,
65 BGP_GENERAL_PAGE,
66 BGP_GEN_TOOLTIPS,
67 BGP_GEN_TICKS,
68 BGP_GEN_REFRESH,
69 BGP_GEN_BUFFER,
70 BGP_GEN_SIZING,
71 BGP_SPACING_PAGE,
72 BGP_SPC_HNAR_STR,
73 BGP_SPC_HNAR_SLI,
74 BGP_SPC_VNAR_STR,
75 BGP_SPC_VNAR_SLI,
76 BGP_SPC_HNOR_STR,
77 BGP_SPC_HNOR_SLI,
78 BGP_SPC_VNOR_STR,
79 BGP_SPC_VNOR_SLI,
80 BGP_SPC_HWID_STR,
81 BGP_SPC_HWID_SLI,
82 BGP_SPC_VWID_STR,
83 BGP_SPC_VWID_SLI,
84 BGP_MISC_PAGE,
85 BGP_SETTING_PAGES,
86 BGP_GROUP_PAGE1,
87 BGP_GRP_FRMTYPE,
88 BGP_GRP_RECESSED,
89 BGP_BUTTON_PAGE1,
90 BGP_BUT_FRMTYPE,
91 BGP_BUT_RECESSED,
92 BGP_STRING_PAGE1,
93 BGP_STR_FRMTYPE,
94 BGP_STR_RECESSED,
95 BGP_CHECKBOX_PAGE1,
96 BGP_CHK_FRMTYPE,
97 BGP_CHK_RECESSED,
98 BGP_CYCLE_PAGE1,
99 BGP_CYC_FRMTYPE,
100 BGP_CYC_RECESSED,
101 BGP_CYC_POPUP,
102 BGP_CYC_POPACTIVE,
103 BGP_INFO_PAGE1,
104 BGP_INF_FRMTYPE,
105 BGP_INF_RECESSED,
106 BGP_PROGRESS_PAGE1,
107 BGP_PRG_FRMTYPE,
108 BGP_PRG_RECESSED,
109 BGP_INDICATOR_PAGE1,
110 BGP_IND_FRMTYPE,
111 BGP_IND_RECESSED,
112 BGP_SLIDER_PAGE1,
113 BGP_TEMP1,
114 BGP_PROPORTIONAL_PAGE1,
115 BGP_TEMP2,
116 BGP_MX_PAGE1,
117 BGP_TEMP3,
118 BGP_LISTVIEW_PAGE1,
119 BGP_TEMP4,
120 BGP_EXAMPLE_PAGES,
121 BGP_GROUP_PAGE2,
122 BGP_GRP_SAMPLE,
123 BGP_BUTTON_PAGE2,
124 BGP_BUT_SAMPLE,
125 BGP_STRING_PAGE2,
126 BGP_STR_SAMPLE,
127 BGP_CHECKBOX_PAGE2,
128 BGP_CHK_SAMPLE,
129 BGP_CYCLE_PAGE2,
130 BGP_CYC_SAMPLE,
131 BGP_INFO_PAGE2,
132 BGP_INF_SAMPLE,
133 BGP_PROGRESS_PAGE2,
134 BGP_PRG_SAMPLE,
135 BGP_INDICATOR_PAGE2,
136 BGP_IND_SAMPLE,
137 BGP_SLIDER_PAGE2,
138 BGP_SLI_SAMPLE,
139 BGP_PROPORTIONAL_PAGE2,
140 BGP_PRO_SAMPLE,
141 BGP_MX_PAGE2,
142 BGP_MX_SAMPLE,
143 BGP_LISTVIEW_PAGE2,
144 BGP_LST_SAMPLE,
145 BGP_SAVE,
146 BGP_USE,
147 BGP_CANCEL,
148 BGP_NUMGADS
151 Object *BGUIPrefsObjs[BGP_NUMGADS];
153 UBYTE *BGP_LISTVIEW1Entrys[] = {
154 "General",
155 "Spacing",
156 "Group",
157 "Button",
158 "String",
159 "Checkbox",
160 "Cycle",
161 "Info",
162 "Progress",
163 "Indicator",
164 "(Slider)",
165 "(Proportional)",
166 "(MX)",
167 "(Listview)",
168 NULL
171 UBYTE *BGP_FRAMELabels[] = {
172 "Button",
173 "Fuzz Button",
174 "Xen Button",
175 "Ridge",
176 "Fuzz Ridge",
177 "Drop Box",
178 "NeXT",
179 "None",
180 NULL
183 UBYTE *BGP_CYC_SAMPLELabels[] = {
184 "#1",
185 "#2",
186 "#3",
187 "#4",
188 "#5",
189 NULL
192 UBYTE *BGP_MX_SAMPLELabels[] = {
193 "Entry 1",
194 "Entry 2",
195 NULL
198 UBYTE *BGP_LST_SAMPLEEntrys[] = {
199 "Entry 1",
200 "Entry 2",
201 "Entry 3",
202 "Entry 4",
203 "Entry 5",
204 NULL
207 UBYTE *BGP_GEN_REFRESHLabels[] = {
208 "Simple",
209 "Smart",
210 NULL
213 UBYTE *BGP_GEN_BUFFERLabels[] = {
214 "Standard",
215 "No Buffering",
216 NULL
219 UBYTE *BGP_GEN_SIZINGLabels[] = {
220 "Bottom",
221 "Left",
222 NULL
225 // DEFAULTS
226 struct TagItem *grp_defaults, // BGUI_GROUP_GADGET
227 *but_defaults, // BGUI_BUTTON_GADGET
228 *str_defaults, // BGUI_STRING_GADGET
229 *chk_defaults, // BGUI_CHECKBOX_GADGET
230 *cyc_defaults, // BGUI_CYCLE_GADGET
231 *inf_defaults, // BGUI_INFO_GADGET
232 *prg_defaults, // BGUI_PROGRESS_GADGET
233 *ind_defaults; // BGUI_INDICATOR_GADGET
235 // GROUP DEFAULTS
236 IPTR grp_frmtype = 4, // FRM_DefaultType
237 grp_recessed = 0, // FRM_Recessed
238 grp_vspnarrow = 2, // GROUP_DefVSpaceNarrow
239 grp_hspnarrow = 2, // GROUP_DefHSpaceNarrow
240 grp_vspnormal = 4, // GROUP_DefVSpaceNormal
241 grp_hspnormal = 4, // GROUP_DefHSpaceNormal
242 grp_vspwide = 8, // GROUP_DefVSpaceWide
243 grp_hspwide = 8; // GROUP_DefHSpaceWide
245 // BUTTON DEFAULTS
246 IPTR but_frmtype = 1, // FRM_Type
247 but_recessed = 0; // FRM_Recessed
249 // STRING DEFAULTS
250 IPTR str_frmtype = 2, // FRM_Type
251 str_recessed = 0; // FRM_Recessed
253 // CHECKBOX DEFAULTS
254 IPTR chk_frmtype = 1, // FRM_Type
255 chk_recessed = 0; // FRM_Recessed
257 // CYCLE DEFAULTS
258 IPTR cyc_frmtype = 1, // FRM_Type
259 cyc_recessed = 0, // FRM_Recessed
260 cyc_popup = 0, // CYC_Popup
261 cyc_popactive = 0; // CYC_PopActive
263 // INFO DEFAULTS
264 IPTR inf_frmtype = 1, // FRM_Type
265 inf_recessed = 1; // FRM_Recessed
267 // PROGRESS DEFAULTS
268 IPTR prg_frmtype = 1, // FRM_Type
269 prg_recessed = 1; // FRM_Recessed
271 // INDICATOR DEFAULTS
272 IPTR ind_frmtype = 1, // FRM_Type
273 ind_recessed = 1; // FRM_Recessed
276 ** GetDefaults( void )
278 ** Get the defaults at startup. These might be the
279 ** real defaults, or defaults previously stored by
280 ** the user.
282 void
283 GetDefaults( void )
285 // group defaults
286 grp_defaults = BGUI_GetDefaultTags( BGUI_GROUP_GADGET );
287 grp_frmtype = GetTagData( FRM_DefaultType, grp_frmtype, grp_defaults );
288 grp_recessed = GetTagData( FRM_Recessed, grp_recessed, grp_defaults );
289 grp_vspnarrow = GetTagData( GROUP_DefVSpaceNarrow, grp_vspnarrow, grp_defaults );
290 grp_hspnarrow = GetTagData( GROUP_DefHSpaceNarrow, grp_hspnarrow, grp_defaults );
291 grp_vspnormal = GetTagData( GROUP_DefVSpaceNormal, grp_vspnormal, grp_defaults );
292 grp_hspnormal = GetTagData( GROUP_DefHSpaceNormal, grp_hspnormal, grp_defaults );
293 grp_vspwide = GetTagData( GROUP_DefVSpaceWide, grp_vspwide, grp_defaults );
294 grp_hspwide = GetTagData( GROUP_DefHSpaceWide, grp_hspwide, grp_defaults );
296 // button defaults
297 but_defaults = BGUI_GetDefaultTags( BGUI_BUTTON_GADGET );
298 but_frmtype = GetTagData( FRM_Type, but_frmtype, but_defaults );
299 but_recessed = GetTagData( FRM_Recessed, but_recessed, but_defaults );
301 // string defaults
302 str_defaults = BGUI_GetDefaultTags( BGUI_STRING_GADGET );
303 str_frmtype = GetTagData( FRM_Type, str_frmtype, str_defaults );
304 str_recessed = GetTagData( FRM_Recessed, str_recessed, str_defaults );
306 // checkbox defaults
307 chk_defaults = BGUI_GetDefaultTags( BGUI_CHECKBOX_GADGET );
308 chk_frmtype = GetTagData( FRM_Type, chk_frmtype, chk_defaults );
309 chk_recessed = GetTagData( FRM_Recessed, chk_recessed, chk_defaults );
311 // cycle defaults
312 cyc_defaults = BGUI_GetDefaultTags( BGUI_CYCLE_GADGET );
313 cyc_frmtype = GetTagData( FRM_Type, cyc_frmtype, cyc_defaults );
314 cyc_recessed = GetTagData( FRM_Recessed, cyc_recessed, cyc_defaults );
315 cyc_popup = GetTagData( CYC_Popup, cyc_popup, cyc_defaults );
316 cyc_popactive = GetTagData( CYC_PopActive, cyc_popactive, cyc_defaults );
318 // info defaults
319 inf_defaults = BGUI_GetDefaultTags( BGUI_INFO_GADGET );
320 inf_frmtype = GetTagData( FRM_DefaultType, inf_frmtype, inf_defaults );
321 inf_recessed = GetTagData( FRM_Recessed, inf_recessed, inf_defaults );
323 // progress defaults
324 prg_defaults = BGUI_GetDefaultTags( BGUI_PROGRESS_GADGET );
325 prg_frmtype = GetTagData( FRM_Type, prg_frmtype, prg_defaults );
326 prg_recessed = GetTagData( FRM_Recessed, prg_recessed, prg_defaults );
328 // indicator defaults
329 ind_defaults = BGUI_GetDefaultTags( BGUI_INDICATOR_GADGET );
330 ind_frmtype = GetTagData( FRM_DefaultType, ind_frmtype, ind_defaults );
331 ind_recessed = GetTagData( FRM_Recessed, ind_recessed, ind_defaults );
334 static Object *PreferencesPage(ULONG page)
336 Object **ar = BGUIPrefsObjs;
338 switch(page)
340 case PAGE_GENERAL:
341 if(ar[BGP_GENERAL_PAGE]==NULL)
344 // GENERAL
345 ar[BGP_GENERAL_PAGE] = VGroupObject,
346 NormalSpacing,
347 NormalHOffset,
348 BOffset( GRSPACE_NORMAL ),
349 FRM_Type, FRTYPE_DEFAULT,
350 //NeXTFrame,
351 FRM_Flags, FRF_CENTER_TITLE | FRF_HIGHLIGHT_TITLE,
352 FRM_Title, "General Settings",
353 VarSpace (50),
354 StartMember,
355 VGroupObject,
356 NormalSpacing,
357 NormalHOffset,
358 EqualHeight,
359 StartMember,
360 HGroupObject,
361 NormalSpacing,
362 // GENERAL: Tooltips
363 StartMember,
364 ar[BGP_GEN_TOOLTIPS] = CheckBoxObject,
365 LAB_Label, "_Tooltips",
366 LAB_Place, PLACE_LEFT,
367 GA_ID, BGP_GEN_TOOLTIPS,
368 EndObject,
369 FixMinWidth,
370 EndMember,
371 VarSpace (50),
372 // GENERAL: Ticks
373 StartMember,
374 ar[BGP_GEN_TICKS] = StringObject,
375 LAB_Label, "T_icks",
376 LAB_Place, PLACE_LEFT,
377 STRINGA_TextVal, "",
378 STRINGA_MaxChars, 65,
379 STRINGA_MinCharsVisible, 0,
380 GA_ID, BGP_GEN_TICKS,
381 EndObject,
382 FixMinWidth,
383 EndMember,
384 EndObject,
385 EndMember,
386 // GENERAL: Refreshmode
387 StartMember,
388 ar[BGP_GEN_REFRESH] = CycleObject,
389 LAB_Label, "_Refreshmode",
390 CYC_Labels, BGP_GEN_REFRESHLabels,
391 GA_ID, BGP_GEN_REFRESH,
392 EndObject,
393 EndMember,
394 // GENERAL: Buffering
395 StartMember,
396 ar[BGP_GEN_BUFFER] = CycleObject,
397 LAB_Label, "_Buffering",
398 CYC_Labels, BGP_GEN_BUFFERLabels,
399 GA_ID, BGP_GEN_BUFFER,
400 EndObject,
401 EndMember,
402 // GENERAL: Size gadget
403 StartMember,
404 ar[BGP_GEN_SIZING] = CycleObject,
405 LAB_Label, "Size _Gadget",
406 CYC_Labels, BGP_GEN_SIZINGLabels,
407 GA_ID, BGP_GEN_SIZING,
408 EndObject,
409 EndMember,
410 EndObject,
411 FixMinHeight,
412 EndMember,
413 VarSpace (50),
414 EndObject;
417 return(ar[BGP_GENERAL_PAGE]);
419 case PAGE_SPACING:
420 if(ar[BGP_SPACING_PAGE]==NULL)
423 // SPACING
424 ar[BGP_SPACING_PAGE] = VGroupObject,
425 NormalSpacing,
426 StartMember,
427 VGroupObject,
428 NormalSpacing,
429 NormalHOffset,
430 BOffset( GRSPACE_NORMAL ),
431 FRM_Type, FRTYPE_DEFAULT,
432 //NeXTFrame,
433 FRM_Flags, FRF_CENTER_TITLE | FRF_HIGHLIGHT_TITLE,
434 FRM_Title, "Narrow Spacing",
435 VarSpace (50),
436 // SPACING: Narrow H
437 StartMember,
438 HGroupObject,
439 NormalHOffset,
440 StartMember,
441 ar[BGP_SPC_HNAR_STR] = StringObject,
442 LAB_Label, "Horizontal",
443 LAB_Place, PLACE_LEFT,
444 STRINGA_LongVal, grp_hspnarrow,
445 STRINGA_IntegerMin, 0,
446 STRINGA_IntegerMax, 64,
447 STRINGA_MaxChars, 2,
448 STRINGA_MinCharsVisible, 3,
449 STRINGA_Justification, GACT_STRINGRIGHT,
450 GA_ID, BGP_SPC_HNAR_STR,
451 EndObject,
452 FixMinWidth,
453 EndMember,
454 StartMember,
455 ar[BGP_SPC_HNAR_SLI] = SliderObject,
456 SLIDER_Level, grp_hspnarrow,
457 SLIDER_Max, 64,
458 PGA_NewLook, TRUE,
459 GA_ID, BGP_SPC_HNAR_SLI,
460 EndObject,
461 EndMember,
462 EndObject,
463 FixMinHeight,
464 EndMember,
465 // SPACING: Narrow V
466 StartMember,
467 HGroupObject,
468 NormalHOffset,
469 StartMember,
470 ar[BGP_SPC_VNAR_STR] = StringObject,
471 LAB_Label, "Vertical",
472 LAB_Place, PLACE_LEFT,
473 STRINGA_LongVal, grp_vspnarrow,
474 STRINGA_IntegerMin, 0,
475 STRINGA_IntegerMax, 64,
476 STRINGA_MaxChars, 2,
477 STRINGA_MinCharsVisible, 3,
478 STRINGA_Justification, GACT_STRINGRIGHT,
479 GA_ID, BGP_SPC_VNAR_STR,
480 EndObject,
481 FixMinWidth,
482 EndMember,
483 StartMember,
484 ar[BGP_SPC_VNAR_SLI] = SliderObject,
485 SLIDER_Level, grp_vspnarrow,
486 SLIDER_Max, 64,
487 PGA_NewLook, TRUE,
488 GA_ID, BGP_SPC_VNAR_SLI,
489 EndObject,
490 EndMember,
491 EndObject,
492 FixMinHeight,
493 EndMember,
494 VarSpace (50),
495 EndObject,
496 EndMember,
497 StartMember,
498 VGroupObject,
499 NormalSpacing,
500 NormalHOffset,
501 BOffset( GRSPACE_NORMAL ),
502 FRM_Type, FRTYPE_DEFAULT,
503 //NeXTFrame,
504 FRM_Flags, FRF_CENTER_TITLE | FRF_HIGHLIGHT_TITLE,
505 FRM_Title, "Normal Spacing",
506 VarSpace (50),
507 // SPACING: Normal H
508 StartMember,
509 HGroupObject,
510 NormalHOffset,
511 StartMember,
512 ar[BGP_SPC_HNOR_STR] = StringObject,
513 LAB_Label, "Horizontal",
514 LAB_Place, PLACE_LEFT,
515 STRINGA_LongVal, grp_hspnormal,
516 STRINGA_IntegerMin, 0,
517 STRINGA_IntegerMax, 64,
518 STRINGA_MaxChars, 2,
519 STRINGA_MinCharsVisible, 3,
520 STRINGA_Justification, GACT_STRINGRIGHT,
521 GA_ID, BGP_SPC_HNOR_STR,
522 EndObject,
523 FixMinWidth,
524 EndMember,
525 StartMember,
526 ar[BGP_SPC_HNOR_SLI] = SliderObject,
527 SLIDER_Level, grp_hspnormal,
528 SLIDER_Max, 64,
529 PGA_NewLook, TRUE,
530 GA_ID, BGP_SPC_HNOR_SLI,
531 EndObject,
532 EndMember,
533 EndObject,
534 FixMinHeight,
535 EndMember,
536 // SPACING: Normal V
537 StartMember,
538 HGroupObject,
539 NormalHOffset,
540 StartMember,
541 ar[BGP_SPC_VNOR_STR] = StringObject,
542 LAB_Label, "Vertical",
543 LAB_Place, PLACE_LEFT,
544 STRINGA_LongVal, grp_vspnormal,
545 STRINGA_IntegerMin, 0,
546 STRINGA_IntegerMax, 64,
547 STRINGA_MaxChars, 2,
548 STRINGA_MinCharsVisible, 3,
549 STRINGA_Justification, GACT_STRINGRIGHT,
550 GA_ID, BGP_SPC_VNOR_STR,
551 EndObject,
552 FixMinWidth,
553 EndMember,
554 StartMember,
555 ar[BGP_SPC_VNOR_SLI] = SliderObject,
556 SLIDER_Level, grp_vspnormal,
557 SLIDER_Max, 64,
558 PGA_NewLook, TRUE,
559 GA_ID, BGP_SPC_VNOR_SLI,
560 EndObject,
561 EndMember,
562 EndObject,
563 FixMinHeight,
564 EndMember,
565 VarSpace (50),
566 EndObject,
567 EndMember,
568 StartMember,
569 VGroupObject,
570 NormalSpacing,
571 NormalHOffset,
572 BOffset( GRSPACE_NORMAL ),
573 FRM_Type, FRTYPE_DEFAULT,
574 //NeXTFrame,
575 FRM_Flags, FRF_CENTER_TITLE | FRF_HIGHLIGHT_TITLE,
576 FRM_Title, "Wide Spacing",
577 VarSpace (50),
578 // SPACING: Wide H
579 StartMember,
580 HGroupObject,
581 NormalHOffset,
582 StartMember,
583 ar[BGP_SPC_HWID_STR] = StringObject,
584 LAB_Label, "Horizontal",
585 LAB_Place, PLACE_LEFT,
586 STRINGA_LongVal, grp_hspwide,
587 STRINGA_IntegerMin, 0,
588 STRINGA_IntegerMax, 64,
589 STRINGA_MaxChars, 2,
590 STRINGA_MinCharsVisible, 3,
591 STRINGA_Justification, GACT_STRINGRIGHT,
592 GA_ID, BGP_SPC_HWID_STR,
593 EndObject,
594 FixMinWidth,
595 EndMember,
596 StartMember,
597 ar[BGP_SPC_HWID_SLI] = SliderObject,
598 SLIDER_Level, grp_hspwide,
599 SLIDER_Max, 64,
600 PGA_NewLook, TRUE,
601 GA_ID, BGP_SPC_HWID_SLI,
602 EndObject,
603 EndMember,
604 EndObject,
605 FixMinHeight,
606 EndMember,
607 // SPACING: Wide V
608 StartMember,
609 HGroupObject,
610 NormalHOffset,
611 StartMember,
612 ar[BGP_SPC_VWID_STR] = StringObject,
613 LAB_Label, "Vertical",
614 LAB_Place, PLACE_LEFT,
615 STRINGA_LongVal, grp_vspwide,
616 STRINGA_IntegerMin, 0,
617 STRINGA_IntegerMax, 64,
618 STRINGA_MaxChars, 2,
619 STRINGA_MinCharsVisible, 3,
620 STRINGA_Justification, GACT_STRINGRIGHT,
621 GA_ID, BGP_SPC_VWID_STR,
622 EndObject,
623 FixMinWidth,
624 EndMember,
625 StartMember,
626 ar[BGP_SPC_VWID_SLI] = SliderObject,
627 SLIDER_Level, grp_vspwide,
628 SLIDER_Max, 64,
629 PGA_NewLook, TRUE,
630 GA_ID, BGP_SPC_VWID_SLI,
631 EndObject,
632 EndMember,
633 EndObject,
634 FixMinHeight,
635 EndMember,
636 VarSpace (50),
637 EndObject,
638 EndMember,
639 EndObject;
642 return(ar[BGP_SPACING_PAGE]);
644 case PAGE_GROUP:
645 if(ar[BGP_GROUP_PAGE1]==NULL)
648 // MISC: GROUP PAGE
649 ar[BGP_GROUP_PAGE1] = VGroupObject,
650 NormalHOffset,
651 BOffset( GRSPACE_NORMAL ),
652 FRM_Type, FRTYPE_DEFAULT,
653 //NeXTFrame,
654 FRM_Flags, FRF_CENTER_TITLE | FRF_HIGHLIGHT_TITLE,
655 FRM_Title, "Group Settings",
656 VarSpace (50),
657 StartMember,
658 VGroupObject,
659 NormalSpacing,
660 NormalHOffset,
661 EqualHeight,
662 StartMember,
663 ar[BGP_GRP_FRMTYPE] = CycleObject,
664 LAB_Label, "_Frame Type",
665 CYC_Labels, BGP_FRAMELabels,
666 GA_ID, BGP_GRP_FRMTYPE,
667 EndObject,
668 EndMember,
669 StartMember,
670 ar[BGP_GRP_RECESSED] = CheckBoxObject,
671 LAB_Label, "_Recessed",
672 LAB_Place, PLACE_LEFT,
673 GA_ID, BGP_GRP_RECESSED,
674 EndObject,
675 FixMinWidth,
676 EndMember,
677 EndObject,
678 FixMinHeight,
679 EndMember,
680 VarSpace (50),
681 EndObject;
684 return(ar[BGP_GROUP_PAGE1]);
686 case PAGE_BUTTON:
687 if(ar[BGP_BUTTON_PAGE1]==NULL)
690 // MISC: BUTTON PAGE
691 ar[BGP_BUTTON_PAGE1] = VGroupObject,
692 NormalHOffset,
693 BOffset( GRSPACE_NORMAL ),
694 FRM_Type, FRTYPE_DEFAULT,
695 //NeXTFrame,
696 FRM_Flags, FRF_CENTER_TITLE | FRF_HIGHLIGHT_TITLE,
697 FRM_Title, "Button Settings",
698 VarSpace (50),
699 StartMember,
700 VGroupObject,
701 NormalSpacing,
702 NormalHOffset,
703 EqualHeight,
704 StartMember,
705 ar[BGP_BUT_FRMTYPE] = CycleObject,
706 LAB_Label, "_Frame Type",
707 CYC_Labels, BGP_FRAMELabels,
708 GA_ID, BGP_BUT_FRMTYPE,
709 EndObject,
710 EndMember,
711 StartMember,
712 ar[BGP_BUT_RECESSED] = CheckBoxObject,
713 LAB_Label, "_Recessed",
714 LAB_Place, PLACE_LEFT,
715 GA_ID, BGP_BUT_RECESSED,
716 EndObject,
717 FixMinWidth,
718 EndMember,
719 EndObject,
720 FixMinHeight,
721 EndMember,
722 VarSpace (50),
723 EndObject;
726 return(ar[BGP_BUTTON_PAGE1]);
728 case PAGE_STRING:
729 if(ar[BGP_STRING_PAGE1]==NULL)
732 // MISC: STRING PAGE
733 ar[BGP_STRING_PAGE1] = VGroupObject,
734 NormalHOffset,
735 BOffset( GRSPACE_NORMAL ),
736 FRM_Type, FRTYPE_DEFAULT,
737 //NeXTFrame,
738 FRM_Flags, FRF_CENTER_TITLE | FRF_HIGHLIGHT_TITLE,
739 FRM_Title, "String Settings",
740 VarSpace (50),
741 StartMember,
742 VGroupObject,
743 NormalSpacing,
744 NormalHOffset,
745 EqualHeight,
746 StartMember,
747 ar[BGP_STR_FRMTYPE] = CycleObject,
748 LAB_Label, "_Frame Type",
749 CYC_Labels, BGP_FRAMELabels,
750 GA_ID, BGP_STR_FRMTYPE,
751 EndObject,
752 EndMember,
753 StartMember,
754 ar[BGP_STR_RECESSED] = CheckBoxObject,
755 LAB_Label, "_Recessed",
756 LAB_Place, PLACE_LEFT,
757 GA_ID, BGP_STR_RECESSED,
758 EndObject,
759 FixMinWidth,
760 EndMember,
761 EndObject,
762 FixMinHeight,
763 EndMember,
764 VarSpace (50),
765 EndObject;
768 return(ar[BGP_STRING_PAGE1]);
770 case PAGE_CHECKBOX:
771 if(ar[BGP_CHECKBOX_PAGE1]==NULL)
774 // MISC: CHECKBOX PAGE
775 ar[BGP_CHECKBOX_PAGE1] = VGroupObject,
776 NormalHOffset,
777 BOffset( GRSPACE_NORMAL ),
778 FRM_Type, FRTYPE_DEFAULT,
779 //NeXTFrame,
780 FRM_Flags, FRF_CENTER_TITLE | FRF_HIGHLIGHT_TITLE,
781 FRM_Title, "Checkbox Settings",
782 VarSpace (50),
783 StartMember,
784 VGroupObject,
785 NormalSpacing,
786 NormalHOffset,
787 EqualHeight,
788 StartMember,
789 ar[BGP_CHK_FRMTYPE] = CycleObject,
790 LAB_Label, "_Frame Type",
791 CYC_Labels, BGP_FRAMELabels,
792 GA_ID, BGP_CHK_FRMTYPE,
793 EndObject,
794 EndMember,
795 StartMember,
796 ar[BGP_CHK_RECESSED] = CheckBoxObject,
797 LAB_Label, "_Recessed",
798 LAB_Place, PLACE_LEFT,
799 GA_ID, BGP_CHK_RECESSED,
800 EndObject,
801 FixMinWidth,
802 EndMember,
803 EndObject,
804 FixMinHeight,
805 EndMember,
806 VarSpace (50),
807 EndObject;
810 return(ar[BGP_CHECKBOX_PAGE1]);
812 case PAGE_CYCLE:
813 if(ar[BGP_CYCLE_PAGE1]==NULL)
816 // MISC: CYCLE PAGE
817 ar[BGP_CYCLE_PAGE1] = VGroupObject,
818 NormalHOffset,
819 BOffset( GRSPACE_NORMAL ),
820 FRM_Type, FRTYPE_DEFAULT,
821 //NeXTFrame,
822 FRM_Flags, FRF_CENTER_TITLE | FRF_HIGHLIGHT_TITLE,
823 FRM_Title, "Cycle Settings",
824 VarSpace (50),
825 StartMember,
826 VGroupObject,
827 NormalSpacing,
828 NormalHOffset,
829 EqualHeight,
830 StartMember,
831 ar[BGP_CYC_FRMTYPE] = CycleObject,
832 LAB_Label, "_Frame Type",
833 CYC_Labels, BGP_FRAMELabels,
834 GA_ID, BGP_CYC_FRMTYPE,
835 EndObject,
836 EndMember,
837 StartMember,
838 ar[BGP_CYC_RECESSED] = CheckBoxObject,
839 LAB_Label, "_Recessed",
840 LAB_Place, PLACE_LEFT,
841 GA_ID, BGP_CYC_RECESSED,
842 EndObject,
843 FixMinWidth,
844 EndMember,
845 StartMember,
846 HGroupObject,
847 NormalSpacing,
848 StartMember,
849 ar[BGP_CYC_POPUP] = CheckBoxObject,
850 LAB_Label, "Popup",
851 LAB_Place, PLACE_LEFT,
852 GA_ID, BGP_CYC_POPUP,
853 EndObject,
854 FixMinWidth,
855 EndMember,
856 VarSpace (50),
857 StartMember,
858 ar[BGP_CYC_POPACTIVE] = CheckBoxObject,
859 LAB_Label, "Pop Active",
860 LAB_Place, PLACE_LEFT,
861 GA_ID, BGP_CYC_POPACTIVE,
862 EndObject,
863 FixMinWidth,
864 EndMember,
865 EndObject,
866 EndMember,
867 EndObject,
868 FixMinHeight,
869 EndMember,
870 VarSpace (50),
871 EndObject;
874 return(ar[BGP_CYCLE_PAGE1]);
876 case PAGE_INFO:
877 if(ar[BGP_INFO_PAGE1]==NULL)
880 // MISC: INFO PAGE
881 ar[BGP_INFO_PAGE1] = VGroupObject,
882 NormalHOffset,
883 BOffset( GRSPACE_NORMAL ),
884 FRM_Type, FRTYPE_DEFAULT,
885 //NeXTFrame,
886 FRM_Flags, FRF_CENTER_TITLE | FRF_HIGHLIGHT_TITLE,
887 FRM_Title, "Info Settings",
888 VarSpace (50),
889 StartMember,
890 VGroupObject,
891 NormalSpacing,
892 NormalHOffset,
893 EqualHeight,
894 StartMember,
895 ar[BGP_INF_FRMTYPE] = CycleObject,
896 LAB_Label, "_Frame Type",
897 CYC_Labels, BGP_FRAMELabels,
898 GA_ID, BGP_INF_FRMTYPE,
899 EndObject,
900 EndMember,
901 StartMember,
902 ar[BGP_INF_RECESSED] = CheckBoxObject,
903 LAB_Label, "_Recessed",
904 LAB_Place, PLACE_LEFT,
905 GA_ID, BGP_INF_RECESSED,
906 EndObject,
907 FixMinWidth,
908 EndMember,
909 EndObject,
910 FixMinHeight,
911 EndMember,
912 VarSpace (50),
913 EndObject;
916 return(ar[BGP_INFO_PAGE1]);
918 case PAGE_PROGRESS:
919 if(ar[BGP_PROGRESS_PAGE1]==NULL)
922 // MISC: PROGRESS PAGE
923 ar[BGP_PROGRESS_PAGE1] = VGroupObject,
924 NormalHOffset,
925 BOffset( GRSPACE_NORMAL ),
926 FRM_Type, FRTYPE_DEFAULT,
927 //NeXTFrame,
928 FRM_Flags, FRF_CENTER_TITLE | FRF_HIGHLIGHT_TITLE,
929 FRM_Title, "Progress Settings",
930 VarSpace (50),
931 StartMember,
932 VGroupObject,
933 NormalSpacing,
934 NormalHOffset,
935 EqualHeight,
936 StartMember,
937 ar[BGP_PRG_FRMTYPE] = CycleObject,
938 LAB_Label, "_Frame Type",
939 CYC_Labels, BGP_FRAMELabels,
940 GA_ID, BGP_PRG_FRMTYPE,
941 EndObject,
942 EndMember,
943 StartMember,
944 ar[BGP_PRG_RECESSED] = CheckBoxObject,
945 LAB_Label, "_Recessed",
946 LAB_Place, PLACE_LEFT,
947 GA_ID, BGP_PRG_RECESSED,
948 EndObject,
949 FixMinWidth,
950 EndMember,
951 EndObject,
952 FixMinHeight,
953 EndMember,
954 VarSpace (50),
955 EndObject;
957 return(ar[BGP_PROGRESS_PAGE1]);
959 case PAGE_INDICATOR:
960 if(ar[BGP_INDICATOR_PAGE1]==NULL)
963 // MISC: INDICATOR PAGE
964 ar[BGP_INDICATOR_PAGE1] = VGroupObject,
965 NormalHOffset,
966 BOffset( GRSPACE_NORMAL ),
967 FRM_Type, FRTYPE_DEFAULT,
968 //NeXTFrame,
969 FRM_Flags, FRF_CENTER_TITLE | FRF_HIGHLIGHT_TITLE,
970 FRM_Title, "Indicator Settings",
971 VarSpace (50),
972 StartMember,
973 VGroupObject,
974 NormalSpacing,
975 NormalHOffset,
976 EqualHeight,
977 StartMember,
978 ar[BGP_IND_FRMTYPE] = CycleObject,
979 LAB_Label, "_Frame Type",
980 CYC_Labels, BGP_FRAMELabels,
981 GA_ID, BGP_IND_FRMTYPE,
982 EndObject,
983 EndMember,
984 StartMember,
985 ar[BGP_IND_RECESSED] = CheckBoxObject,
986 LAB_Label, "_Recessed",
987 LAB_Place, PLACE_LEFT,
988 GA_ID, BGP_IND_RECESSED,
989 EndObject,
990 FixMinWidth,
991 EndMember,
992 EndObject,
993 FixMinHeight,
994 EndMember,
995 VarSpace (50),
996 EndObject;
998 return(ar[BGP_INDICATOR_PAGE1]);
1000 case PAGE_SLIDER:
1001 if(ar[BGP_SLIDER_PAGE1]==NULL)
1004 // MISC: SLIDER PAGE
1005 ar[BGP_SLIDER_PAGE1] = VGroupObject,
1006 NormalHOffset,
1007 BOffset( GRSPACE_NORMAL ),
1008 FRM_Type, FRTYPE_DEFAULT,
1009 //NeXTFrame,
1010 FRM_Flags, FRF_CENTER_TITLE | FRF_HIGHLIGHT_TITLE,
1011 FRM_Title, "Slider Settings",
1012 VarSpace (50),
1013 StartMember,
1014 VGroupObject,
1015 NormalSpacing,
1016 NormalHOffset,
1017 StartMember,
1018 ar[BGP_TEMP1] = ButtonObject,
1019 LAB_Label, "Button",
1020 GA_ID, BGP_TEMP1,
1021 EndObject,
1022 EndMember,
1023 EndObject,
1024 FixMinHeight,
1025 EndMember,
1026 VarSpace (50),
1027 EndObject;
1029 return(ar[BGP_SLIDER_PAGE1]);
1031 case PAGE_PROPORTIONAL:
1032 if(ar[BGP_PROPORTIONAL_PAGE1]==NULL)
1035 // MISC: PROPORTIONAL PAGE
1036 ar[BGP_PROPORTIONAL_PAGE1] = VGroupObject,
1037 NormalHOffset,
1038 BOffset( GRSPACE_NORMAL ),
1039 FRM_Type, FRTYPE_DEFAULT,
1040 //NeXTFrame,
1041 FRM_Flags, FRF_CENTER_TITLE | FRF_HIGHLIGHT_TITLE,
1042 FRM_Title, "Proportional Settings",
1043 VarSpace (50),
1044 StartMember,
1045 VGroupObject,
1046 NormalSpacing,
1047 NormalHOffset,
1048 StartMember,
1049 ar[BGP_TEMP2] = ButtonObject,
1050 LAB_Label, "Button",
1051 GA_ID, BGP_TEMP2,
1052 EndObject,
1053 EndMember,
1054 EndObject,
1055 FixMinHeight,
1056 EndMember,
1057 VarSpace (50),
1058 EndObject;
1061 return(ar[BGP_PROPORTIONAL_PAGE1]);
1063 case PAGE_MX:
1064 if(ar[BGP_MX_PAGE1]==NULL)
1067 // MISC: MX PAGE
1068 ar[BGP_MX_PAGE1] = VGroupObject,
1069 NormalHOffset,
1070 BOffset( GRSPACE_NORMAL ),
1071 FRM_Type, FRTYPE_DEFAULT,
1072 //NeXTFrame,
1073 FRM_Flags, FRF_CENTER_TITLE | FRF_HIGHLIGHT_TITLE,
1074 FRM_Title, "MX Settings",
1075 VarSpace (50),
1076 StartMember,
1077 VGroupObject,
1078 NormalSpacing,
1079 NormalHOffset,
1080 StartMember,
1081 ar[BGP_TEMP3] = ButtonObject,
1082 LAB_Label, "Button",
1083 GA_ID, BGP_TEMP3,
1084 EndObject,
1085 EndMember,
1086 EndObject,
1087 FixMinHeight,
1088 EndMember,
1089 VarSpace (50),
1090 EndObject;
1093 return(ar[BGP_MX_PAGE1]);
1095 case PAGE_LISTVIEW:
1096 if(ar[BGP_LISTVIEW_PAGE1]==NULL)
1099 // MISC: LISTVIEW PAGE
1100 ar[BGP_LISTVIEW_PAGE1] = VGroupObject,
1101 NormalHOffset,
1102 BOffset( GRSPACE_NORMAL ),
1103 FRM_Type, FRTYPE_DEFAULT,
1104 //NeXTFrame,
1105 FRM_Flags, FRF_CENTER_TITLE | FRF_HIGHLIGHT_TITLE,
1106 FRM_Title, "Listview Settings",
1107 VarSpace (50),
1108 StartMember,
1109 VGroupObject,
1110 NormalSpacing,
1111 NormalHOffset,
1112 StartMember,
1113 ar[BGP_TEMP4] = ButtonObject,
1114 LAB_Label, "Button",
1115 GA_ID, BGP_TEMP4,
1116 EndObject,
1117 EndMember,
1118 EndObject,
1119 FixMinHeight,
1120 EndMember,
1121 VarSpace (50),
1122 EndObject;
1125 return(ar[BGP_LISTVIEW_PAGE1]);
1129 return NULL;
1132 static Object *ExamplesPage(ULONG page)
1134 Object **ar = BGUIPrefsObjs;
1136 switch(page)
1138 case PAGE_GROUP:
1139 if(ar[BGP_GROUP_PAGE2]==NULL)
1142 // EXAMPLES: GROUP SAMPLE
1143 ar[BGP_GROUP_PAGE2] = VGroupObject,
1144 NormalOffset,
1145 FRM_Type, FRTYPE_DEFAULT,
1146 //NeXTFrame,
1147 FRM_Flags, FRF_CENTER_TITLE | FRF_HIGHLIGHT_TITLE,
1148 FRM_Title, "Example Group",
1149 VarSpace (20),
1150 StartMember,
1151 HGroupObject,
1152 VarSpace (20),
1153 StartMember,
1154 ar[BGP_GRP_SAMPLE] = InfoObject,
1155 FRM_Type, grp_frmtype,
1156 FRM_Recessed, grp_recessed,
1157 INFO_TextFormat, " ",
1158 INFO_HorizOffset, 4,
1159 INFO_VertOffset, 4,
1160 GA_ID, BGP_GRP_SAMPLE,
1161 EndObject,
1162 FixMinHeight,
1163 EndMember,
1164 VarSpace (20),
1165 EndObject,
1166 EndMember,
1167 VarSpace (20),
1168 EndObject;
1171 return(ar[BGP_GROUP_PAGE2]);
1173 case PAGE_BUTTON:
1174 if(ar[BGP_BUTTON_PAGE2]==NULL)
1177 // EXAMPLES: BUTTON SAMPLE
1178 ar[BGP_BUTTON_PAGE2] = VGroupObject,
1179 NormalOffset,
1180 FRM_Type, FRTYPE_DEFAULT,
1181 //NeXTFrame,
1182 FRM_Flags, FRF_CENTER_TITLE | FRF_HIGHLIGHT_TITLE,
1183 FRM_Title, "Example Button",
1184 VarSpace (20),
1185 StartMember,
1186 HGroupObject,
1187 VarSpace (20),
1188 StartMember,
1189 ar[BGP_BUT_SAMPLE] = ButtonObject,
1190 LAB_Label, "Button",
1191 GA_ID, BGP_BUT_SAMPLE,
1192 EndObject,
1193 FixMinHeight,
1194 EndMember,
1195 VarSpace (20),
1196 EndObject,
1197 EndMember,
1198 VarSpace (20),
1199 EndObject;
1202 return(ar[BGP_BUTTON_PAGE2]);
1204 case PAGE_STRING:
1205 if(ar[BGP_STRING_PAGE2]==NULL)
1208 // EXAMPLES: STRING SAMPLE
1209 ar[BGP_STRING_PAGE2] = VGroupObject,
1210 NormalOffset,
1211 FRM_Type, FRTYPE_DEFAULT,
1212 //NeXTFrame,
1213 FRM_Flags, FRF_CENTER_TITLE | FRF_HIGHLIGHT_TITLE,
1214 FRM_Title, "Example String",
1215 VarSpace (20),
1216 StartMember,
1217 HGroupObject,
1218 VarSpace (20),
1219 StartMember,
1220 ar[BGP_STR_SAMPLE] = StringObject,
1221 STRINGA_TextVal, "String",
1222 STRINGA_MaxChars, 65,
1223 STRINGA_MinCharsVisible, 0,
1224 STRINGA_Justification, GACT_STRINGCENTER,
1225 GA_ID, BGP_STR_SAMPLE,
1226 EndObject,
1227 FixMinHeight,
1228 EndMember,
1229 VarSpace (20),
1230 EndObject,
1231 EndMember,
1232 VarSpace (20),
1233 EndObject;
1236 return(ar[BGP_STRING_PAGE2]);
1238 case PAGE_CHECKBOX:
1239 if(ar[BGP_CHECKBOX_PAGE2]==NULL)
1242 // EXAMPLES: CHECKBOX SAMPLE
1243 ar[BGP_CHECKBOX_PAGE2] = VGroupObject,
1244 NormalOffset,
1245 FRM_Type, FRTYPE_DEFAULT,
1246 //NeXTFrame,
1247 FRM_Flags, FRF_CENTER_TITLE | FRF_HIGHLIGHT_TITLE,
1248 FRM_Title, "Example Checkbox",
1249 VarSpace (20),
1250 StartMember,
1251 HGroupObject,
1252 VarSpace (20),
1253 StartMember,
1254 ar[BGP_CHK_SAMPLE] = CheckBoxObject,
1255 LAB_Label, "_CheckBox",
1256 LAB_Place, PLACE_LEFT,
1257 GA_ID, BGP_CHK_SAMPLE,
1258 EndObject,
1259 FixMinWidth,
1260 FixMinHeight,
1261 EndMember,
1262 VarSpace (20),
1263 EndObject,
1264 EndMember,
1265 VarSpace (20),
1266 EndObject;
1269 return(ar[BGP_CHECKBOX_PAGE2]);
1271 case PAGE_CYCLE:
1272 if(ar[BGP_CYCLE_PAGE2]==NULL)
1274 // EXAMPLES: CYCLE SAMPLE
1275 ar[BGP_CYCLE_PAGE2] = VGroupObject,
1276 NormalOffset,
1277 FRM_Type, FRTYPE_DEFAULT,
1278 //NeXTFrame,
1279 FRM_Flags, FRF_CENTER_TITLE | FRF_HIGHLIGHT_TITLE,
1280 FRM_Title, "Example Cycle",
1281 VarSpace (20),
1282 StartMember,
1283 HGroupObject,
1284 VarSpace (20),
1285 StartMember,
1286 ar[BGP_CYC_SAMPLE] = CycleObject,
1287 CYC_Labels, BGP_CYC_SAMPLELabels,
1288 GA_ID, BGP_CYC_SAMPLE,
1289 EndObject,
1290 FixMinHeight,
1291 EndMember,
1292 VarSpace (20),
1293 EndObject,
1294 EndMember,
1295 VarSpace (20),
1296 EndObject;
1299 return(ar[BGP_CYCLE_PAGE2]);
1301 case PAGE_INFO:
1302 if(ar[BGP_INFO_PAGE2]==NULL)
1304 // EXAMPLES: INFO SAMPLE
1305 ar[BGP_INFO_PAGE2] = VGroupObject,
1306 NormalOffset,
1307 FRM_Type, FRTYPE_DEFAULT,
1308 //NeXTFrame,
1309 FRM_Flags, FRF_CENTER_TITLE | FRF_HIGHLIGHT_TITLE,
1310 FRM_Title, "Example Info",
1311 VarSpace (20),
1312 StartMember,
1313 HGroupObject,
1314 VarSpace (20),
1315 StartMember,
1316 ar[BGP_INF_SAMPLE] = InfoObject,
1317 FRM_Type, inf_frmtype,
1318 FRM_Recessed, inf_recessed,
1319 INFO_TextFormat, "Info",
1320 INFO_HorizOffset, 6,
1321 INFO_VertOffset, 4,
1322 EndObject,
1323 FixMinHeight,
1324 EndMember,
1325 VarSpace (20),
1326 EndObject,
1327 EndMember,
1328 VarSpace (20),
1329 EndObject;
1332 return(ar[BGP_INFO_PAGE2]);
1334 case PAGE_PROGRESS:
1335 if(ar[BGP_PROGRESS_PAGE2]==NULL)
1338 // EXAMPLES: PROGRESS SAMPLE
1339 ar[BGP_PROGRESS_PAGE2] = VGroupObject,
1340 NormalOffset,
1341 FRM_Type, FRTYPE_DEFAULT,
1342 //NeXTFrame,
1343 FRM_Flags, FRF_CENTER_TITLE | FRF_HIGHLIGHT_TITLE,
1344 FRM_Title, "Example Progress",
1345 VarSpace (20),
1346 StartMember,
1347 HGroupObject,
1348 VarSpace (20),
1349 StartMember,
1350 ar[BGP_PRG_SAMPLE] = ProgressObject,
1351 PROGRESS_FormatString, " ",
1352 PROGRESS_Done, 45,
1353 EndObject,
1354 FixMinHeight,
1355 EndMember,
1356 VarSpace (20),
1357 EndObject,
1358 EndMember,
1359 VarSpace (20),
1360 EndObject;
1363 return(ar[BGP_PROGRESS_PAGE2]);
1365 case PAGE_INDICATOR:
1366 if(ar[BGP_INDICATOR_PAGE2]==NULL)
1368 // EXAMPLES: INDICATOR SAMPLE
1369 ar[BGP_INDICATOR_PAGE2] = VGroupObject,
1370 NormalOffset,
1371 FRM_Type, FRTYPE_DEFAULT,
1372 //NeXTFrame,
1373 FRM_Flags, FRF_CENTER_TITLE | FRF_HIGHLIGHT_TITLE,
1374 FRM_Title, "Example Indicator",
1375 VarSpace (20),
1376 StartMember,
1377 HGroupObject,
1378 VarSpace (20),
1379 StartMember,
1380 ar[BGP_IND_SAMPLE] = IndicatorObject,
1381 FRM_Type, ind_frmtype,
1382 FRM_Recessed, ind_recessed,
1383 INDIC_Level, 50,
1384 INDIC_FormatString, "%ld",
1385 INDIC_Justification, IDJ_CENTER,
1386 EndObject,
1387 FixMinHeight,
1388 EndMember,
1389 VarSpace (20),
1390 EndObject,
1391 EndMember,
1392 VarSpace (20),
1393 EndObject;
1396 return(ar[BGP_INDICATOR_PAGE2]);
1398 case PAGE_SLIDER:
1399 if(ar[BGP_SLIDER_PAGE2]==NULL)
1402 // EXAMPLES: SLIDER SAMPLE
1403 ar[BGP_SLIDER_PAGE2] = VGroupObject,
1404 NormalOffset,
1405 FRM_Type, FRTYPE_DEFAULT,
1406 //NeXTFrame,
1407 FRM_Flags, FRF_CENTER_TITLE | FRF_HIGHLIGHT_TITLE,
1408 FRM_Title, "Example Slider",
1409 VarSpace (20),
1410 StartMember,
1411 HGroupObject,
1412 VarSpace (20),
1413 StartMember,
1414 ar[BGP_SLI_SAMPLE] = SliderObject,
1415 LAB_Label, "S_lider",
1416 LAB_Place, PLACE_LEFT,
1417 SLIDER_Max, 10,
1418 GA_ID, BGP_SLI_SAMPLE,
1419 EndObject,
1420 FixMinHeight,
1421 EndMember,
1422 VarSpace (20),
1423 EndObject,
1424 EndMember,
1425 VarSpace (20),
1426 EndObject;
1429 return(ar[BGP_SLIDER_PAGE2]);
1431 case PAGE_PROPORTIONAL:
1432 if(ar[BGP_PROPORTIONAL_PAGE2]==NULL)
1435 // EXAMPLES: PROPORTIONAL SAMPLE
1436 ar[BGP_PROPORTIONAL_PAGE2] = VGroupObject,
1437 NormalOffset,
1438 FRM_Type, FRTYPE_DEFAULT,
1439 //NeXTFrame,
1440 FRM_Flags, FRF_CENTER_TITLE | FRF_HIGHLIGHT_TITLE,
1441 FRM_Title, "Example Proportional",
1442 VarSpace (20),
1443 StartMember,
1444 HGroupObject,
1445 VarSpace (20),
1446 StartMember,
1447 ar[BGP_PRO_SAMPLE] = PropObject,
1448 LAB_Label, "_Prop",
1449 PGA_Freedom, FREEHORIZ,
1450 PGA_Total, 25,
1451 PGA_Visible, 5,
1452 PGA_Top, 0,
1453 PGA_Total, 25,
1454 PGA_Arrows, TRUE,
1455 GA_ID, BGP_PRO_SAMPLE,
1456 EndObject,
1457 FixMinHeight,
1458 EndMember,
1459 VarSpace (20),
1460 EndObject,
1461 EndMember,
1462 VarSpace (20),
1463 EndObject;
1466 return(ar[BGP_PROPORTIONAL_PAGE2]);
1468 case PAGE_MX:
1469 if(ar[BGP_MX_PAGE2]==NULL)
1472 // EXAMPLES: MX SAMPLE
1473 ar[BGP_MX_PAGE2] = HGroupObject,
1474 NormalOffset,
1475 FRM_Type, FRTYPE_DEFAULT,
1476 //NeXTFrame,
1477 FRM_Flags, FRF_CENTER_TITLE | FRF_HIGHLIGHT_TITLE,
1478 FRM_Title, "Example MX",
1479 VarSpace (20),
1480 StartMember,
1481 VGroupObject,
1482 VarSpace (20),
1483 StartMember,
1484 ar[BGP_MX_SAMPLE] = MxObject,
1485 GROUP_Style, GRSTYLE_VERTICAL,
1486 LAB_Label, "S_elect",
1487 LAB_Place, PLACE_LEFT,
1488 MX_LabelPlace, PLACE_RIGHT,
1489 MX_Labels, BGP_MX_SAMPLELabels,
1490 GA_ID, BGP_MX_SAMPLE,
1491 EndObject,
1492 EndMember,
1493 VarSpace (20),
1494 EndObject,
1495 EndMember,
1496 VarSpace (20),
1497 EndObject;
1500 return(ar[BGP_MX_PAGE2]);
1502 case PAGE_LISTVIEW:
1503 if(ar[BGP_LISTVIEW_PAGE2]==NULL)
1506 // EXAMPLES: LISTVIEW SAMPLE
1507 ar[BGP_LISTVIEW_PAGE2] = VGroupObject,
1508 NormalOffset,
1509 FRM_Type, FRTYPE_DEFAULT,
1510 //NeXTFrame,
1511 FRM_Flags, FRF_CENTER_TITLE | FRF_HIGHLIGHT_TITLE,
1512 FRM_Title, "Example Listview",
1513 VarSpace (20),
1514 StartMember,
1515 HGroupObject,
1516 VarSpace (20),
1517 StartMember,
1518 ar[BGP_LST_SAMPLE] = ListviewObject,
1519 LAB_Label, "S_elect",
1520 LAB_Place, PLACE_LEFT,
1521 LISTV_EntryArray, BGP_LST_SAMPLEEntrys,
1522 GA_ID, BGP_LST_SAMPLE,
1523 EndObject,
1524 EndMember,
1525 VarSpace (20),
1526 EndObject,
1527 EndMember,
1528 VarSpace (20),
1529 EndObject;
1532 return(ar[BGP_LISTVIEW_PAGE2]);
1536 return NULL;
1539 static void DisposePreferencesPage(ULONG page)
1541 Object **ar = BGUIPrefsObjs;
1543 switch(page)
1545 case PAGE_GENERAL:
1546 DisposeObject(ar[BGP_GENERAL_PAGE]);
1547 ar[BGP_GENERAL_PAGE]=NULL;
1548 break;
1549 case PAGE_SPACING:
1550 DisposeObject(ar[BGP_SPACING_PAGE]);
1551 ar[BGP_SPACING_PAGE]=NULL;
1552 break;
1553 case PAGE_GROUP:
1554 DisposeObject(ar[BGP_GROUP_PAGE1]);
1555 ar[BGP_GROUP_PAGE1]=NULL;
1556 break;
1557 case PAGE_BUTTON:
1558 DisposeObject(ar[BGP_BUTTON_PAGE1]);
1559 ar[BGP_BUTTON_PAGE1]=NULL;
1560 break;
1561 case PAGE_STRING:
1562 DisposeObject(ar[BGP_STRING_PAGE1]);
1563 ar[BGP_STRING_PAGE1]=NULL;
1564 break;
1565 case PAGE_CHECKBOX:
1566 DisposeObject(ar[BGP_CHECKBOX_PAGE1]);
1567 ar[BGP_CHECKBOX_PAGE1]=NULL;
1568 break;
1569 case PAGE_CYCLE:
1570 DisposeObject(ar[BGP_CYCLE_PAGE1]);
1571 ar[BGP_CYCLE_PAGE1]=NULL;
1572 break;
1573 case PAGE_INFO:
1574 DisposeObject(ar[BGP_INFO_PAGE1]);
1575 ar[BGP_INFO_PAGE1]=NULL;
1576 break;
1577 case PAGE_PROGRESS:
1578 DisposeObject(ar[BGP_PROGRESS_PAGE1]);
1579 ar[BGP_PROGRESS_PAGE1]=NULL;
1580 break;
1581 case PAGE_INDICATOR:
1582 DisposeObject(ar[BGP_INDICATOR_PAGE1]);
1583 ar[BGP_INDICATOR_PAGE1]=NULL;
1584 break;
1585 case PAGE_SLIDER:
1586 DisposeObject(ar[BGP_SLIDER_PAGE1]);
1587 ar[BGP_SLIDER_PAGE1]=NULL;
1588 break;
1589 case PAGE_PROPORTIONAL:
1590 DisposeObject(ar[BGP_PROPORTIONAL_PAGE1]);
1591 ar[BGP_PROPORTIONAL_PAGE1]=NULL;
1592 break;
1593 case PAGE_MX:
1594 DisposeObject(ar[BGP_MX_PAGE1]);
1595 ar[BGP_MX_PAGE1]=NULL;
1596 break;
1597 case PAGE_LISTVIEW:
1598 DisposeObject(ar[BGP_LISTVIEW_PAGE1]);
1599 ar[BGP_LISTVIEW_PAGE1]=NULL;
1600 break;
1604 static void DisposeExamplesPage(ULONG page)
1606 Object **ar = BGUIPrefsObjs;
1608 switch(page)
1610 case PAGE_GROUP:
1611 DisposeObject(ar[BGP_GROUP_PAGE2]);
1612 ar[BGP_GROUP_PAGE2]=NULL;
1613 break;
1614 case PAGE_BUTTON:
1615 DisposeObject(ar[BGP_BUTTON_PAGE2]);
1616 ar[BGP_BUTTON_PAGE2]=NULL;
1617 break;
1618 case PAGE_STRING:
1619 DisposeObject(ar[BGP_STRING_PAGE2]);
1620 ar[BGP_STRING_PAGE2]=NULL;
1621 break;
1622 case PAGE_CHECKBOX:
1623 DisposeObject(ar[BGP_CHECKBOX_PAGE2]);
1624 ar[BGP_CHECKBOX_PAGE2]=NULL;
1625 break;
1626 case PAGE_CYCLE:
1627 DisposeObject(ar[BGP_CYCLE_PAGE2]);
1628 ar[BGP_CYCLE_PAGE2]=NULL;
1629 break;
1630 case PAGE_INFO:
1631 DisposeObject(ar[BGP_INFO_PAGE2]);
1632 ar[BGP_INFO_PAGE2]=NULL;
1633 break;
1634 case PAGE_PROGRESS:
1635 DisposeObject(ar[BGP_PROGRESS_PAGE2]);
1636 ar[BGP_PROGRESS_PAGE2]=NULL;
1637 break;
1638 case PAGE_INDICATOR:
1639 DisposeObject(ar[BGP_INDICATOR_PAGE2]);
1640 ar[BGP_INDICATOR_PAGE2]=NULL;
1641 break;
1642 case PAGE_SLIDER:
1643 DisposeObject(ar[BGP_SLIDER_PAGE2]);
1644 ar[BGP_SLIDER_PAGE2]=NULL;
1645 break;
1646 case PAGE_PROPORTIONAL:
1647 DisposeObject(ar[BGP_PROPORTIONAL_PAGE2]);
1648 ar[BGP_PROPORTIONAL_PAGE2]=NULL;
1649 break;
1650 case PAGE_MX:
1651 DisposeObject(ar[BGP_MX_PAGE2]);
1652 ar[BGP_MX_PAGE2]=NULL;
1653 break;
1654 case PAGE_LISTVIEW:
1655 DisposeObject(ar[BGP_LISTVIEW_PAGE2]);
1656 ar[BGP_LISTVIEW_PAGE2]=NULL;
1657 break;
1662 ** ULONG = Frame2Cycle( ULONG )
1664 ** Translate a FRTYPE_xxx value into a value suitable
1665 ** for use with a cyclegadget. See also Cycle2Frame[].
1667 ULONG
1668 Frame2Cycle( ULONG tmp_frame )
1670 ULONG ret_frame = 0;
1671 switch( tmp_frame ) {
1672 case FRTYPE_BUTTON: ret_frame = 0; break;
1673 case FRTYPE_FUZZ_BUTTON: ret_frame = 1; break;
1674 case FRTYPE_XEN_BUTTON: ret_frame = 2; break;
1675 case FRTYPE_RIDGE: ret_frame = 3; break;
1676 case FRTYPE_FUZZ_RIDGE: ret_frame = 4; break;
1677 case FRTYPE_DROPBOX: ret_frame = 5; break;
1678 case FRTYPE_NEXT: ret_frame = 6; break;
1679 case FRTYPE_NONE: ret_frame = 7; break;
1681 return ret_frame;
1685 ** SetGadgets( void )
1687 ** Update the gadgets of the user interface to
1688 ** reflect the current settings.
1690 void
1691 SetGadgets(ULONG page)
1693 Object **ar = BGUIPrefsObjs;
1695 ULONG frame = 0;
1697 switch(page)
1699 case PAGE_GROUP:
1700 // GROUP PAGE [1997-02-17]
1701 frame = Frame2Cycle( grp_frmtype );
1702 SetAttrs( ar[ BGP_GRP_FRMTYPE ], CYC_Active, frame, TAG_DONE );
1703 SetAttrs( ar[ BGP_GRP_RECESSED ], GA_Selected, grp_recessed, TAG_DONE );
1704 break;
1706 case PAGE_BUTTON:
1707 // BUTTON PAGE [1997-02-16]
1708 frame = Frame2Cycle( but_frmtype );
1709 SetAttrs( ar[ BGP_BUT_FRMTYPE ], CYC_Active, frame, TAG_DONE );
1710 SetAttrs( ar[ BGP_BUT_RECESSED ], GA_Selected, but_recessed, TAG_DONE );
1711 break;
1713 case PAGE_STRING:
1714 // STRING PAGE [1997-02-16]
1715 frame = Frame2Cycle( str_frmtype );
1716 SetAttrs( ar[ BGP_STR_FRMTYPE ], CYC_Active, frame, TAG_DONE );
1717 SetAttrs( ar[ BGP_STR_RECESSED ], GA_Selected, str_recessed, TAG_DONE );
1718 break;
1720 case PAGE_CHECKBOX:
1721 // CHECKBOX PAGE [1997-02-16]
1722 frame = Frame2Cycle( chk_frmtype );
1723 SetAttrs( ar[ BGP_CHK_FRMTYPE ], CYC_Active, frame, TAG_DONE );
1724 SetAttrs( ar[ BGP_CHK_RECESSED ], GA_Selected, chk_recessed, TAG_DONE );
1725 break;
1727 case PAGE_CYCLE:
1728 // CYCLE PAGE [1997-02-16]
1729 frame = Frame2Cycle( cyc_frmtype );
1730 SetAttrs( ar[ BGP_CYC_FRMTYPE ], CYC_Active, frame , TAG_DONE) ;
1731 SetAttrs( ar[ BGP_CYC_RECESSED ], GA_Selected, cyc_recessed, TAG_DONE );
1732 SetAttrs( ar[ BGP_CYC_POPUP ], GA_Selected, cyc_popup, TAG_DONE );
1733 if( 0 == cyc_popup )
1734 SetAttrs( ar[ BGP_CYC_POPACTIVE ], GA_Disabled, TRUE, TAG_DONE );
1735 else
1736 SetAttrs( ar[ BGP_CYC_POPACTIVE ], GA_Selected, cyc_popactive, TAG_DONE );
1737 break;
1739 case PAGE_INFO:
1740 // INFO PAGE [1997-02-16]
1741 frame = Frame2Cycle( inf_frmtype );
1742 SetAttrs( ar[ BGP_INF_FRMTYPE ], CYC_Active, frame, TAG_DONE );
1743 SetAttrs( ar[ BGP_INF_RECESSED ], GA_Selected, inf_recessed, TAG_DONE );
1744 break;
1746 case PAGE_PROGRESS:
1747 // PROGRESS PAGE [1997-02-16]
1748 frame = Frame2Cycle( prg_frmtype );
1749 SetAttrs( ar[ BGP_PRG_FRMTYPE ], CYC_Active, frame, TAG_DONE );
1750 SetAttrs( ar[ BGP_PRG_RECESSED ], GA_Selected, prg_recessed, TAG_DONE );
1751 break;
1753 case PAGE_INDICATOR:
1754 // INDICATOR PAGE [1997-02-16]
1755 frame = Frame2Cycle( ind_frmtype );
1756 SetAttrs( ar[ BGP_IND_FRMTYPE ], CYC_Active, frame, TAG_DONE );
1757 SetAttrs( ar[ BGP_IND_RECESSED ], GA_Selected, ind_recessed, TAG_DONE );
1758 break;
1761 case PAGE_SLIDER:
1762 // SLIDER PAGE
1763 SetAttrs( ar[ BGP_SLIFRAME ], CYC_Active, sli_frame, TAG_DONE );
1764 SetAttrs( ar[ BGP_SLIRECES ], GA_Selected, sli_reces, TAG_DONE );
1765 SetAttrs( ar[ BGP_SLINLOOK ], GA_Selected, sli_nlook, TAG_DONE );
1766 SetAttrs( ar[ BGP_SAMPLE_SLIDER ], FRM_Type, Cycle2Frame[ sli_frame ], TAG_DONE );
1767 SetAttrs( ar[ BGP_SAMPLE_SLIDER ], FRM_Recessed, sli_reces, TAG_DONE );
1768 SetAttrs( ar[ BGP_SAMPLE_SLIDER ], PGA_NewLook, sli_nlook, TAG_DONE );
1769 AddCondit( ar[ BGP_SLIFRAME ], ar[ BGP_SLIRECES ], CYC_Active, 7, GA_Disabled, TRUE, GA_Disabled, FALSE );
1770 break;
1776 ** SetCondits( void )
1778 ** Set the conditions for different settings.
1780 void
1781 SetCondits( ULONG page)
1783 Object **ar = BGUIPrefsObjs;
1785 switch(page)
1787 case PAGE_GROUP:
1788 // GROUP PAGE [1997-02-17]
1789 AddCondit( ar[ BGP_GRP_FRMTYPE ], ar[ BGP_GRP_RECESSED ], CYC_Active, 7, GA_Disabled, TRUE, GA_Disabled, FALSE );
1790 break;
1792 case PAGE_BUTTON:
1793 // BUTTON PAGE [1997-02-16]
1794 AddCondit( ar[ BGP_BUT_FRMTYPE ], ar[ BGP_BUT_RECESSED ], CYC_Active, 7, GA_Disabled, TRUE, GA_Disabled, FALSE );
1795 break;
1797 case PAGE_STRING:
1798 // STRING PAGE [1997-02-16]
1799 AddCondit( ar[ BGP_STR_FRMTYPE ], ar[ BGP_STR_RECESSED ], CYC_Active, 7, GA_Disabled, TRUE, GA_Disabled, FALSE );
1800 break;
1802 case PAGE_CHECKBOX:
1803 // CHECKBOX PAGE [1997-02-16]
1804 AddCondit( ar[ BGP_CHK_FRMTYPE ], ar[ BGP_CHK_RECESSED ], CYC_Active, 7, GA_Disabled, TRUE, GA_Disabled, FALSE );
1805 break;
1807 case PAGE_CYCLE:
1808 // CYCLE PAGE [1997-02-16]
1809 AddCondit( ar[ BGP_CYC_FRMTYPE ], ar[ BGP_CYC_RECESSED ], CYC_Active, 7, GA_Disabled, TRUE, GA_Disabled, FALSE );
1810 AddCondit( ar[ BGP_CYC_POPUP ], ar[ BGP_CYC_POPACTIVE ], GA_Selected, 0, GA_Disabled, TRUE, GA_Disabled, FALSE );
1811 break;
1813 case PAGE_INFO:
1814 // INFO PAGE [1997-02-16]
1815 AddCondit( ar[ BGP_INF_FRMTYPE ], ar[ BGP_INF_RECESSED ], CYC_Active, 7, GA_Disabled, TRUE, GA_Disabled, FALSE );
1816 break;
1818 case PAGE_PROGRESS:
1819 // PROGRESS PAGE [1997-02-16]
1820 AddCondit( ar[ BGP_PRG_FRMTYPE ], ar[ BGP_PRG_RECESSED ], CYC_Active, 7, GA_Disabled, TRUE, GA_Disabled, FALSE );
1821 break;
1823 case PAGE_INDICATOR:
1824 // INDICATOR PAGE [1997-02-16]
1825 AddCondit( ar[ BGP_IND_FRMTYPE ], ar[ BGP_IND_RECESSED ], CYC_Active, 7, GA_Disabled, TRUE, GA_Disabled, FALSE );
1826 break;
1830 struct
1832 ULONG PreferencesPage;
1833 ULONG ExamplePage;
1834 BOOL Set;
1835 Object *Preferences;
1836 Object *Example;
1838 pages_map[PAGE_COUNT];
1840 ULONG total_pages=0,total_preferences_pages=0,total_example_pages=0;
1842 Object *
1843 InitBGUIPrefs( ULONG page)
1845 Object *win;
1846 Object **ar = BGUIPrefsObjs;
1847 ULONG gadget_page;
1849 memset(pages_map,'\0',sizeof(pages_map));
1850 gadget_page=(page<=PAGE_GROUP ? PAGE_GROUP : page);
1851 win = WindowObject,
1852 WINDOW_Title, "BGUI Preferences",
1853 WINDOW_ScreenTitle, "BGUI Preferences 41.10 - Copyright ©1996-1999, BGUI Developers Team",
1854 WINDOW_SmartRefresh, TRUE,
1855 WINDOW_AutoAspect, TRUE,
1856 WINDOW_AutoKeyLabel, TRUE,
1857 WINDOW_ScaleWidth, 50,
1858 WINDOW_CloseGadget, FALSE,
1859 WINDOW_ShowTitle, TRUE,
1860 WINDOW_MenuStrip, Menus,
1861 WINDOW_MasterGroup, ar[BGP_MASTER] = VGroupObject,
1862 NormalSpacing,
1863 NormalOffset,
1864 StartMember,
1865 HGroupObject,
1866 NormalSpacing,
1868 // Mode listview.
1869 StartMember,
1870 VGroupObject,
1871 NormalHOffset,
1872 BOffset( GRSPACE_NORMAL ),
1873 FRM_Type, FRTYPE_DEFAULT,
1874 //NeXTFrame,
1875 FRM_Flags, FRF_CENTER_TITLE | FRF_HIGHLIGHT_TITLE,
1876 FRM_Title, "Mode",
1877 StartMember,
1878 ar[BGP_LISTVIEW1] = ListviewObject,
1879 PGA_NewLook, TRUE,
1880 LISTV_EntryArray, BGP_LISTVIEW1Entrys,
1881 GA_ID, BGP_LISTVIEW1,
1882 EndObject,
1883 EndMember,
1884 EndObject,
1885 Weight (20),
1886 EndMember,
1888 StartMember, ar[BGP_MAIN_PAGES] = PageObject,
1889 PAGE_Active,page>=PAGE_GROUP ? PAGE_GROUP : page,
1891 PageMember, PreferencesPage(PAGE_GENERAL),
1892 PageMember, PreferencesPage(PAGE_SPACING),
1893 // GADGET SETTINGS
1894 PageMember, ar[BGP_MISC_PAGE] = VGroupObject,
1895 NormalSpacing,
1896 // MISC
1897 StartMember, ar[BGP_SETTING_PAGES] = PageObject,
1898 PAGE_Active, 0,
1899 PageMember, pages_map[gadget_page].Preferences=PreferencesPage(gadget_page),
1900 EndObject,
1901 EndMember,
1902 // EXAMPLES
1903 StartMember, ar[BGP_EXAMPLE_PAGES] = PageObject,
1904 PAGE_Active, 0,
1905 PageMember, pages_map[gadget_page].Example=ExamplesPage(gadget_page),
1906 EndObject,
1907 FixMinHeight,
1908 EndMember,
1909 EndObject,
1910 EndObject,
1911 EndMember,
1912 EndObject,
1913 EndMember,
1916 // Horizontal separator.
1917 StartMember,
1918 SeparatorObject,
1919 SEP_Horiz, TRUE,
1920 EndObject,
1921 FixMinHeight,
1922 EndMember,
1925 // Action buttons (Save/Use/Cancel).
1926 StartMember,
1927 HGroupObject,
1928 StartMember,
1929 ar[BGP_SAVE] = ButtonObject,
1930 LAB_Label, "_Save",
1931 GA_ID, BGP_SAVE,
1932 EndObject,
1933 EndMember,
1934 VarSpace (50),
1935 StartMember,
1936 ar[BGP_USE] = ButtonObject,
1937 LAB_Label, "_Use",
1938 GA_ID, BGP_USE,
1939 EndObject,
1940 EndMember,
1941 VarSpace (50),
1942 StartMember,
1943 ar[BGP_CANCEL] = ButtonObject,
1944 LAB_Label, "_Cancel",
1945 GA_ID, BGP_CANCEL,
1946 EndObject,
1947 EndMember,
1948 EndObject,
1949 FixMinHeight,
1950 EndMember,
1952 EndObject,
1954 EndObject;
1956 if(win)
1958 // Add notification for the spacing.
1960 AddMap( ar[ BGP_SPC_VNAR_STR ], ar[ BGP_SPC_VNAR_SLI ], VSpNar1 );
1961 AddMap( ar[ BGP_SPC_VNAR_SLI ], ar[ BGP_SPC_VNAR_STR ], VSpNar2 );
1962 AddMap( ar[ BGP_SPC_HNAR_STR ], ar[ BGP_SPC_HNAR_SLI ], HSpNar1 );
1963 AddMap( ar[ BGP_SPC_HNAR_SLI ], ar[ BGP_SPC_HNAR_STR ], HSpNar2 );
1964 AddMap( ar[ BGP_SPC_VNOR_STR ], ar[ BGP_SPC_VNOR_SLI ], VSpNor1 );
1965 AddMap( ar[ BGP_SPC_VNOR_SLI ], ar[ BGP_SPC_VNOR_STR ], VSpNor2 );
1966 AddMap( ar[ BGP_SPC_HNOR_STR ], ar[ BGP_SPC_HNOR_SLI ], HSpNor1 );
1967 AddMap( ar[ BGP_SPC_HNOR_SLI ], ar[ BGP_SPC_HNOR_STR ], HSpNor2 );
1968 AddMap( ar[ BGP_SPC_VWID_STR ], ar[ BGP_SPC_VWID_SLI ], VSpWid1 );
1969 AddMap( ar[ BGP_SPC_VWID_SLI ], ar[ BGP_SPC_VWID_STR ], VSpWid2 );
1970 AddMap( ar[ BGP_SPC_HWID_STR ], ar[ BGP_SPC_HWID_SLI ], HSpWid1 );
1971 AddMap( ar[ BGP_SPC_HWID_SLI ], ar[ BGP_SPC_HWID_STR ], HSpWid2 );
1974 // Activate the very first entry.
1975 SetAttrs( ar[ BGP_LISTVIEW1 ], LISTV_Select, LISTV_Select_First, TAG_DONE );
1977 // Set the gadgets to the correct states.
1978 SetGadgets(page);
1980 // Set conditions.
1981 SetCondits(page);
1983 pages_map[PAGE_GENERAL].PreferencesPage=total_pages++;
1984 pages_map[PAGE_GENERAL].Set=TRUE;
1985 pages_map[PAGE_SPACING].PreferencesPage=total_pages++;
1986 pages_map[PAGE_SPACING].Set=TRUE;
1987 pages_map[gadget_page].PreferencesPage=total_preferences_pages++;
1988 pages_map[gadget_page].ExamplePage=total_example_pages++;
1989 pages_map[gadget_page].Set=TRUE;
1991 return( win );
1994 BOOL SetNewPage(struct Window *window,ULONG page)
1996 Object **ar = BGUIPrefsObjs;
1998 switch( page ) {
1999 case PAGE_GENERAL:
2000 case PAGE_SPACING:
2001 SetGadgetAttrs( ( struct Gadget * )ar[ BGP_MAIN_PAGES ], window, NULL, PAGE_Active, pages_map[page].PreferencesPage, TAG_DONE );
2002 break;
2003 default:
2005 IPTR cur_page;
2006 BOOL add_preferences,add_example;
2008 if(!pages_map[page].Set)
2010 IPTR previous_preferences_page, previous_example_page;
2012 GetAttr( PAGE_Active, ar[ BGP_SETTING_PAGES ], &previous_preferences_page);
2013 GetAttr( PAGE_Active, ar[ BGP_EXAMPLE_PAGES ], &previous_example_page);
2014 if((add_preferences=(pages_map[page].Preferences==NULL)))
2016 if((pages_map[page].Preferences=PreferencesPage(page))==NULL)
2017 return(FALSE);
2018 pages_map[page].PreferencesPage=total_preferences_pages;
2019 total_preferences_pages++;
2021 if((add_example=(pages_map[page].Example==NULL)))
2023 if((pages_map[page].Example=ExamplesPage(page))==NULL)
2025 DisposePreferencesPage(page);
2026 pages_map[page].Preferences=NULL;
2027 total_preferences_pages--;
2028 return(FALSE);
2030 pages_map[page].ExamplePage=total_example_pages;
2031 total_example_pages++;
2034 // Set the gadgets to the correct states.
2035 SetGadgets(page);
2037 if(add_preferences
2038 && !DoMethod(ar[BGP_SETTING_PAGES],GRM_ADDMEMBER,pages_map[page].Preferences,LGO_Relayout,FALSE,TAG_END))
2040 DisposeExamplesPage(page);
2041 pages_map[page].Example=NULL;
2042 total_example_pages--;
2043 DisposePreferencesPage(page);
2044 pages_map[page].Preferences=NULL;
2045 total_preferences_pages--;
2046 return(FALSE);
2049 if(add_example
2050 && !DoMethod(ar[BGP_EXAMPLE_PAGES],GRM_ADDMEMBER,pages_map[page].Example,LGO_Relayout,FALSE,TAG_END))
2052 if(DoMethod(ar[BGP_SETTING_PAGES],GRM_REMMEMBER,pages_map[page].Preferences))
2054 DisposePreferencesPage(page);
2055 pages_map[page].Preferences=NULL;
2056 total_preferences_pages--;
2058 DisposeExamplesPage(page);
2059 pages_map[page].Example=NULL;
2060 total_example_pages--;
2061 return(FALSE);
2064 SetAttrs( ar[ BGP_SETTING_PAGES ], PAGE_Active, pages_map[page].PreferencesPage, TAG_DONE);
2065 SetAttrs( ar[ BGP_EXAMPLE_PAGES ], PAGE_Active, pages_map[page].ExamplePage, TAG_DONE);
2068 struct bmRelayout bmr;
2070 bmr.MethodID = BASE_RELAYOUT;
2071 bmr.bmr_GInfo = NULL;
2072 bmr.bmr_RPort = window->RPort;
2074 if(!BGUI_DoGadgetMethodA(ar[BGP_MISC_PAGE], window, NULL, (Msg)&bmr))
2076 SetAttrs( ar[ BGP_SETTING_PAGES ], PAGE_Active, previous_preferences_page, TAG_DONE);
2077 SetAttrs( ar[ BGP_EXAMPLE_PAGES ], PAGE_Active, previous_example_page, TAG_DONE);
2079 if(DoMethod(ar[BGP_SETTING_PAGES],GRM_REMMEMBER,pages_map[page].Preferences))
2081 DisposePreferencesPage(page);
2082 pages_map[page].Preferences=NULL;
2083 total_preferences_pages--;
2085 if(DoMethod(ar[BGP_EXAMPLE_PAGES],GRM_REMMEMBER,pages_map[page].Example))
2087 DisposeExamplesPage(page);
2088 pages_map[page].Example=NULL;
2089 total_example_pages--;
2091 return(FALSE);
2095 // Set conditions.
2096 SetCondits(page);
2098 pages_map[page].Set=TRUE;
2101 GetAttr( PAGE_Active, ar[ BGP_MAIN_PAGES ], &cur_page );
2102 if( cur_page < PAGE_GROUP ) {
2103 SetAttrs( ar[ BGP_SETTING_PAGES ], PAGE_Active, pages_map[page].PreferencesPage, TAG_DONE);
2104 SetAttrs( ar[ BGP_EXAMPLE_PAGES ], PAGE_Active, pages_map[page].ExamplePage, TAG_DONE);
2105 SetGadgetAttrs((struct Gadget *)ar[ BGP_MAIN_PAGES ], window, NULL, PAGE_Active, PAGE_GROUP, TAG_DONE);
2107 else {
2108 SetGadgetAttrs((struct Gadget *)ar[ BGP_SETTING_PAGES ], window, NULL, PAGE_Active, pages_map[page].PreferencesPage, TAG_DONE);
2109 SetGadgetAttrs((struct Gadget *)ar[ BGP_EXAMPLE_PAGES ], window, NULL, PAGE_Active, pages_map[page].ExamplePage, TAG_DONE);
2111 break;
2114 return(TRUE);