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.
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.
42 extern IPTR grp_frmtype
,
52 extern IPTR inf_frmtype
,
56 extern IPTR ind_frmtype
,
59 extern struct NewMenu Menus
[];
114 BGP_PROPORTIONAL_PAGE1
,
139 BGP_PROPORTIONAL_PAGE2
,
151 Object
*BGUIPrefsObjs
[BGP_NUMGADS
];
153 UBYTE
*BGP_LISTVIEW1Entrys
[] = {
171 UBYTE
*BGP_FRAMELabels
[] = {
183 UBYTE
*BGP_CYC_SAMPLELabels
[] = {
192 UBYTE
*BGP_MX_SAMPLELabels
[] = {
198 UBYTE
*BGP_LST_SAMPLEEntrys
[] = {
207 UBYTE
*BGP_GEN_REFRESHLabels
[] = {
213 UBYTE
*BGP_GEN_BUFFERLabels
[] = {
219 UBYTE
*BGP_GEN_SIZINGLabels
[] = {
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
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
246 IPTR but_frmtype
= 1, // FRM_Type
247 but_recessed
= 0; // FRM_Recessed
250 IPTR str_frmtype
= 2, // FRM_Type
251 str_recessed
= 0; // FRM_Recessed
254 IPTR chk_frmtype
= 1, // FRM_Type
255 chk_recessed
= 0; // FRM_Recessed
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
264 IPTR inf_frmtype
= 1, // FRM_Type
265 inf_recessed
= 1; // FRM_Recessed
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
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
);
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
);
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
);
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
);
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
);
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
);
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
;
341 if(ar
[BGP_GENERAL_PAGE
]==NULL
)
345 ar
[BGP_GENERAL_PAGE
] = VGroupObject
,
348 BOffset( GRSPACE_NORMAL
),
349 FRM_Type
, FRTYPE_DEFAULT
,
351 FRM_Flags
, FRF_CENTER_TITLE
| FRF_HIGHLIGHT_TITLE
,
352 FRM_Title
, "General Settings",
364 ar
[BGP_GEN_TOOLTIPS
] = CheckBoxObject
,
365 LAB_Label
, "_Tooltips",
366 LAB_Place
, PLACE_LEFT
,
367 GA_ID
, BGP_GEN_TOOLTIPS
,
374 ar
[BGP_GEN_TICKS
] = StringObject
,
376 LAB_Place
, PLACE_LEFT
,
378 STRINGA_MaxChars
, 65,
379 STRINGA_MinCharsVisible
, 0,
380 GA_ID
, BGP_GEN_TICKS
,
386 // GENERAL: Refreshmode
388 ar
[BGP_GEN_REFRESH
] = CycleObject
,
389 LAB_Label
, "_Refreshmode",
390 CYC_Labels
, BGP_GEN_REFRESHLabels
,
391 GA_ID
, BGP_GEN_REFRESH
,
394 // GENERAL: Buffering
396 ar
[BGP_GEN_BUFFER
] = CycleObject
,
397 LAB_Label
, "_Buffering",
398 CYC_Labels
, BGP_GEN_BUFFERLabels
,
399 GA_ID
, BGP_GEN_BUFFER
,
402 // GENERAL: Size gadget
404 ar
[BGP_GEN_SIZING
] = CycleObject
,
405 LAB_Label
, "Size _Gadget",
406 CYC_Labels
, BGP_GEN_SIZINGLabels
,
407 GA_ID
, BGP_GEN_SIZING
,
417 return(ar
[BGP_GENERAL_PAGE
]);
420 if(ar
[BGP_SPACING_PAGE
]==NULL
)
424 ar
[BGP_SPACING_PAGE
] = VGroupObject
,
430 BOffset( GRSPACE_NORMAL
),
431 FRM_Type
, FRTYPE_DEFAULT
,
433 FRM_Flags
, FRF_CENTER_TITLE
| FRF_HIGHLIGHT_TITLE
,
434 FRM_Title
, "Narrow Spacing",
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,
448 STRINGA_MinCharsVisible
, 3,
449 STRINGA_Justification
, GACT_STRINGRIGHT
,
450 GA_ID
, BGP_SPC_HNAR_STR
,
455 ar
[BGP_SPC_HNAR_SLI
] = SliderObject
,
456 SLIDER_Level
, grp_hspnarrow
,
459 GA_ID
, BGP_SPC_HNAR_SLI
,
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,
477 STRINGA_MinCharsVisible
, 3,
478 STRINGA_Justification
, GACT_STRINGRIGHT
,
479 GA_ID
, BGP_SPC_VNAR_STR
,
484 ar
[BGP_SPC_VNAR_SLI
] = SliderObject
,
485 SLIDER_Level
, grp_vspnarrow
,
488 GA_ID
, BGP_SPC_VNAR_SLI
,
501 BOffset( GRSPACE_NORMAL
),
502 FRM_Type
, FRTYPE_DEFAULT
,
504 FRM_Flags
, FRF_CENTER_TITLE
| FRF_HIGHLIGHT_TITLE
,
505 FRM_Title
, "Normal Spacing",
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,
519 STRINGA_MinCharsVisible
, 3,
520 STRINGA_Justification
, GACT_STRINGRIGHT
,
521 GA_ID
, BGP_SPC_HNOR_STR
,
526 ar
[BGP_SPC_HNOR_SLI
] = SliderObject
,
527 SLIDER_Level
, grp_hspnormal
,
530 GA_ID
, BGP_SPC_HNOR_SLI
,
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,
548 STRINGA_MinCharsVisible
, 3,
549 STRINGA_Justification
, GACT_STRINGRIGHT
,
550 GA_ID
, BGP_SPC_VNOR_STR
,
555 ar
[BGP_SPC_VNOR_SLI
] = SliderObject
,
556 SLIDER_Level
, grp_vspnormal
,
559 GA_ID
, BGP_SPC_VNOR_SLI
,
572 BOffset( GRSPACE_NORMAL
),
573 FRM_Type
, FRTYPE_DEFAULT
,
575 FRM_Flags
, FRF_CENTER_TITLE
| FRF_HIGHLIGHT_TITLE
,
576 FRM_Title
, "Wide Spacing",
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,
590 STRINGA_MinCharsVisible
, 3,
591 STRINGA_Justification
, GACT_STRINGRIGHT
,
592 GA_ID
, BGP_SPC_HWID_STR
,
597 ar
[BGP_SPC_HWID_SLI
] = SliderObject
,
598 SLIDER_Level
, grp_hspwide
,
601 GA_ID
, BGP_SPC_HWID_SLI
,
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,
619 STRINGA_MinCharsVisible
, 3,
620 STRINGA_Justification
, GACT_STRINGRIGHT
,
621 GA_ID
, BGP_SPC_VWID_STR
,
626 ar
[BGP_SPC_VWID_SLI
] = SliderObject
,
627 SLIDER_Level
, grp_vspwide
,
630 GA_ID
, BGP_SPC_VWID_SLI
,
642 return(ar
[BGP_SPACING_PAGE
]);
645 if(ar
[BGP_GROUP_PAGE1
]==NULL
)
649 ar
[BGP_GROUP_PAGE1
] = VGroupObject
,
651 BOffset( GRSPACE_NORMAL
),
652 FRM_Type
, FRTYPE_DEFAULT
,
654 FRM_Flags
, FRF_CENTER_TITLE
| FRF_HIGHLIGHT_TITLE
,
655 FRM_Title
, "Group Settings",
663 ar
[BGP_GRP_FRMTYPE
] = CycleObject
,
664 LAB_Label
, "_Frame Type",
665 CYC_Labels
, BGP_FRAMELabels
,
666 GA_ID
, BGP_GRP_FRMTYPE
,
670 ar
[BGP_GRP_RECESSED
] = CheckBoxObject
,
671 LAB_Label
, "_Recessed",
672 LAB_Place
, PLACE_LEFT
,
673 GA_ID
, BGP_GRP_RECESSED
,
684 return(ar
[BGP_GROUP_PAGE1
]);
687 if(ar
[BGP_BUTTON_PAGE1
]==NULL
)
691 ar
[BGP_BUTTON_PAGE1
] = VGroupObject
,
693 BOffset( GRSPACE_NORMAL
),
694 FRM_Type
, FRTYPE_DEFAULT
,
696 FRM_Flags
, FRF_CENTER_TITLE
| FRF_HIGHLIGHT_TITLE
,
697 FRM_Title
, "Button Settings",
705 ar
[BGP_BUT_FRMTYPE
] = CycleObject
,
706 LAB_Label
, "_Frame Type",
707 CYC_Labels
, BGP_FRAMELabels
,
708 GA_ID
, BGP_BUT_FRMTYPE
,
712 ar
[BGP_BUT_RECESSED
] = CheckBoxObject
,
713 LAB_Label
, "_Recessed",
714 LAB_Place
, PLACE_LEFT
,
715 GA_ID
, BGP_BUT_RECESSED
,
726 return(ar
[BGP_BUTTON_PAGE1
]);
729 if(ar
[BGP_STRING_PAGE1
]==NULL
)
733 ar
[BGP_STRING_PAGE1
] = VGroupObject
,
735 BOffset( GRSPACE_NORMAL
),
736 FRM_Type
, FRTYPE_DEFAULT
,
738 FRM_Flags
, FRF_CENTER_TITLE
| FRF_HIGHLIGHT_TITLE
,
739 FRM_Title
, "String Settings",
747 ar
[BGP_STR_FRMTYPE
] = CycleObject
,
748 LAB_Label
, "_Frame Type",
749 CYC_Labels
, BGP_FRAMELabels
,
750 GA_ID
, BGP_STR_FRMTYPE
,
754 ar
[BGP_STR_RECESSED
] = CheckBoxObject
,
755 LAB_Label
, "_Recessed",
756 LAB_Place
, PLACE_LEFT
,
757 GA_ID
, BGP_STR_RECESSED
,
768 return(ar
[BGP_STRING_PAGE1
]);
771 if(ar
[BGP_CHECKBOX_PAGE1
]==NULL
)
774 // MISC: CHECKBOX PAGE
775 ar
[BGP_CHECKBOX_PAGE1
] = VGroupObject
,
777 BOffset( GRSPACE_NORMAL
),
778 FRM_Type
, FRTYPE_DEFAULT
,
780 FRM_Flags
, FRF_CENTER_TITLE
| FRF_HIGHLIGHT_TITLE
,
781 FRM_Title
, "Checkbox Settings",
789 ar
[BGP_CHK_FRMTYPE
] = CycleObject
,
790 LAB_Label
, "_Frame Type",
791 CYC_Labels
, BGP_FRAMELabels
,
792 GA_ID
, BGP_CHK_FRMTYPE
,
796 ar
[BGP_CHK_RECESSED
] = CheckBoxObject
,
797 LAB_Label
, "_Recessed",
798 LAB_Place
, PLACE_LEFT
,
799 GA_ID
, BGP_CHK_RECESSED
,
810 return(ar
[BGP_CHECKBOX_PAGE1
]);
813 if(ar
[BGP_CYCLE_PAGE1
]==NULL
)
817 ar
[BGP_CYCLE_PAGE1
] = VGroupObject
,
819 BOffset( GRSPACE_NORMAL
),
820 FRM_Type
, FRTYPE_DEFAULT
,
822 FRM_Flags
, FRF_CENTER_TITLE
| FRF_HIGHLIGHT_TITLE
,
823 FRM_Title
, "Cycle Settings",
831 ar
[BGP_CYC_FRMTYPE
] = CycleObject
,
832 LAB_Label
, "_Frame Type",
833 CYC_Labels
, BGP_FRAMELabels
,
834 GA_ID
, BGP_CYC_FRMTYPE
,
838 ar
[BGP_CYC_RECESSED
] = CheckBoxObject
,
839 LAB_Label
, "_Recessed",
840 LAB_Place
, PLACE_LEFT
,
841 GA_ID
, BGP_CYC_RECESSED
,
849 ar
[BGP_CYC_POPUP
] = CheckBoxObject
,
851 LAB_Place
, PLACE_LEFT
,
852 GA_ID
, BGP_CYC_POPUP
,
858 ar
[BGP_CYC_POPACTIVE
] = CheckBoxObject
,
859 LAB_Label
, "Pop Active",
860 LAB_Place
, PLACE_LEFT
,
861 GA_ID
, BGP_CYC_POPACTIVE
,
874 return(ar
[BGP_CYCLE_PAGE1
]);
877 if(ar
[BGP_INFO_PAGE1
]==NULL
)
881 ar
[BGP_INFO_PAGE1
] = VGroupObject
,
883 BOffset( GRSPACE_NORMAL
),
884 FRM_Type
, FRTYPE_DEFAULT
,
886 FRM_Flags
, FRF_CENTER_TITLE
| FRF_HIGHLIGHT_TITLE
,
887 FRM_Title
, "Info Settings",
895 ar
[BGP_INF_FRMTYPE
] = CycleObject
,
896 LAB_Label
, "_Frame Type",
897 CYC_Labels
, BGP_FRAMELabels
,
898 GA_ID
, BGP_INF_FRMTYPE
,
902 ar
[BGP_INF_RECESSED
] = CheckBoxObject
,
903 LAB_Label
, "_Recessed",
904 LAB_Place
, PLACE_LEFT
,
905 GA_ID
, BGP_INF_RECESSED
,
916 return(ar
[BGP_INFO_PAGE1
]);
919 if(ar
[BGP_PROGRESS_PAGE1
]==NULL
)
922 // MISC: PROGRESS PAGE
923 ar
[BGP_PROGRESS_PAGE1
] = VGroupObject
,
925 BOffset( GRSPACE_NORMAL
),
926 FRM_Type
, FRTYPE_DEFAULT
,
928 FRM_Flags
, FRF_CENTER_TITLE
| FRF_HIGHLIGHT_TITLE
,
929 FRM_Title
, "Progress Settings",
937 ar
[BGP_PRG_FRMTYPE
] = CycleObject
,
938 LAB_Label
, "_Frame Type",
939 CYC_Labels
, BGP_FRAMELabels
,
940 GA_ID
, BGP_PRG_FRMTYPE
,
944 ar
[BGP_PRG_RECESSED
] = CheckBoxObject
,
945 LAB_Label
, "_Recessed",
946 LAB_Place
, PLACE_LEFT
,
947 GA_ID
, BGP_PRG_RECESSED
,
957 return(ar
[BGP_PROGRESS_PAGE1
]);
960 if(ar
[BGP_INDICATOR_PAGE1
]==NULL
)
963 // MISC: INDICATOR PAGE
964 ar
[BGP_INDICATOR_PAGE1
] = VGroupObject
,
966 BOffset( GRSPACE_NORMAL
),
967 FRM_Type
, FRTYPE_DEFAULT
,
969 FRM_Flags
, FRF_CENTER_TITLE
| FRF_HIGHLIGHT_TITLE
,
970 FRM_Title
, "Indicator Settings",
978 ar
[BGP_IND_FRMTYPE
] = CycleObject
,
979 LAB_Label
, "_Frame Type",
980 CYC_Labels
, BGP_FRAMELabels
,
981 GA_ID
, BGP_IND_FRMTYPE
,
985 ar
[BGP_IND_RECESSED
] = CheckBoxObject
,
986 LAB_Label
, "_Recessed",
987 LAB_Place
, PLACE_LEFT
,
988 GA_ID
, BGP_IND_RECESSED
,
998 return(ar
[BGP_INDICATOR_PAGE1
]);
1001 if(ar
[BGP_SLIDER_PAGE1
]==NULL
)
1004 // MISC: SLIDER PAGE
1005 ar
[BGP_SLIDER_PAGE1
] = VGroupObject
,
1007 BOffset( GRSPACE_NORMAL
),
1008 FRM_Type
, FRTYPE_DEFAULT
,
1010 FRM_Flags
, FRF_CENTER_TITLE
| FRF_HIGHLIGHT_TITLE
,
1011 FRM_Title
, "Slider Settings",
1018 ar
[BGP_TEMP1
] = ButtonObject
,
1019 LAB_Label
, "Button",
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
,
1038 BOffset( GRSPACE_NORMAL
),
1039 FRM_Type
, FRTYPE_DEFAULT
,
1041 FRM_Flags
, FRF_CENTER_TITLE
| FRF_HIGHLIGHT_TITLE
,
1042 FRM_Title
, "Proportional Settings",
1049 ar
[BGP_TEMP2
] = ButtonObject
,
1050 LAB_Label
, "Button",
1061 return(ar
[BGP_PROPORTIONAL_PAGE1
]);
1064 if(ar
[BGP_MX_PAGE1
]==NULL
)
1068 ar
[BGP_MX_PAGE1
] = VGroupObject
,
1070 BOffset( GRSPACE_NORMAL
),
1071 FRM_Type
, FRTYPE_DEFAULT
,
1073 FRM_Flags
, FRF_CENTER_TITLE
| FRF_HIGHLIGHT_TITLE
,
1074 FRM_Title
, "MX Settings",
1081 ar
[BGP_TEMP3
] = ButtonObject
,
1082 LAB_Label
, "Button",
1093 return(ar
[BGP_MX_PAGE1
]);
1096 if(ar
[BGP_LISTVIEW_PAGE1
]==NULL
)
1099 // MISC: LISTVIEW PAGE
1100 ar
[BGP_LISTVIEW_PAGE1
] = VGroupObject
,
1102 BOffset( GRSPACE_NORMAL
),
1103 FRM_Type
, FRTYPE_DEFAULT
,
1105 FRM_Flags
, FRF_CENTER_TITLE
| FRF_HIGHLIGHT_TITLE
,
1106 FRM_Title
, "Listview Settings",
1113 ar
[BGP_TEMP4
] = ButtonObject
,
1114 LAB_Label
, "Button",
1125 return(ar
[BGP_LISTVIEW_PAGE1
]);
1132 static Object
*ExamplesPage(ULONG page
)
1134 Object
**ar
= BGUIPrefsObjs
;
1139 if(ar
[BGP_GROUP_PAGE2
]==NULL
)
1142 // EXAMPLES: GROUP SAMPLE
1143 ar
[BGP_GROUP_PAGE2
] = VGroupObject
,
1145 FRM_Type
, FRTYPE_DEFAULT
,
1147 FRM_Flags
, FRF_CENTER_TITLE
| FRF_HIGHLIGHT_TITLE
,
1148 FRM_Title
, "Example Group",
1154 ar
[BGP_GRP_SAMPLE
] = InfoObject
,
1155 FRM_Type
, grp_frmtype
,
1156 FRM_Recessed
, grp_recessed
,
1157 INFO_TextFormat
, " ",
1158 INFO_HorizOffset
, 4,
1160 GA_ID
, BGP_GRP_SAMPLE
,
1171 return(ar
[BGP_GROUP_PAGE2
]);
1174 if(ar
[BGP_BUTTON_PAGE2
]==NULL
)
1177 // EXAMPLES: BUTTON SAMPLE
1178 ar
[BGP_BUTTON_PAGE2
] = VGroupObject
,
1180 FRM_Type
, FRTYPE_DEFAULT
,
1182 FRM_Flags
, FRF_CENTER_TITLE
| FRF_HIGHLIGHT_TITLE
,
1183 FRM_Title
, "Example Button",
1189 ar
[BGP_BUT_SAMPLE
] = ButtonObject
,
1190 LAB_Label
, "Button",
1191 GA_ID
, BGP_BUT_SAMPLE
,
1202 return(ar
[BGP_BUTTON_PAGE2
]);
1205 if(ar
[BGP_STRING_PAGE2
]==NULL
)
1208 // EXAMPLES: STRING SAMPLE
1209 ar
[BGP_STRING_PAGE2
] = VGroupObject
,
1211 FRM_Type
, FRTYPE_DEFAULT
,
1213 FRM_Flags
, FRF_CENTER_TITLE
| FRF_HIGHLIGHT_TITLE
,
1214 FRM_Title
, "Example String",
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
,
1236 return(ar
[BGP_STRING_PAGE2
]);
1239 if(ar
[BGP_CHECKBOX_PAGE2
]==NULL
)
1242 // EXAMPLES: CHECKBOX SAMPLE
1243 ar
[BGP_CHECKBOX_PAGE2
] = VGroupObject
,
1245 FRM_Type
, FRTYPE_DEFAULT
,
1247 FRM_Flags
, FRF_CENTER_TITLE
| FRF_HIGHLIGHT_TITLE
,
1248 FRM_Title
, "Example Checkbox",
1254 ar
[BGP_CHK_SAMPLE
] = CheckBoxObject
,
1255 LAB_Label
, "_CheckBox",
1256 LAB_Place
, PLACE_LEFT
,
1257 GA_ID
, BGP_CHK_SAMPLE
,
1269 return(ar
[BGP_CHECKBOX_PAGE2
]);
1272 if(ar
[BGP_CYCLE_PAGE2
]==NULL
)
1274 // EXAMPLES: CYCLE SAMPLE
1275 ar
[BGP_CYCLE_PAGE2
] = VGroupObject
,
1277 FRM_Type
, FRTYPE_DEFAULT
,
1279 FRM_Flags
, FRF_CENTER_TITLE
| FRF_HIGHLIGHT_TITLE
,
1280 FRM_Title
, "Example Cycle",
1286 ar
[BGP_CYC_SAMPLE
] = CycleObject
,
1287 CYC_Labels
, BGP_CYC_SAMPLELabels
,
1288 GA_ID
, BGP_CYC_SAMPLE
,
1299 return(ar
[BGP_CYCLE_PAGE2
]);
1302 if(ar
[BGP_INFO_PAGE2
]==NULL
)
1304 // EXAMPLES: INFO SAMPLE
1305 ar
[BGP_INFO_PAGE2
] = VGroupObject
,
1307 FRM_Type
, FRTYPE_DEFAULT
,
1309 FRM_Flags
, FRF_CENTER_TITLE
| FRF_HIGHLIGHT_TITLE
,
1310 FRM_Title
, "Example Info",
1316 ar
[BGP_INF_SAMPLE
] = InfoObject
,
1317 FRM_Type
, inf_frmtype
,
1318 FRM_Recessed
, inf_recessed
,
1319 INFO_TextFormat
, "Info",
1320 INFO_HorizOffset
, 6,
1332 return(ar
[BGP_INFO_PAGE2
]);
1335 if(ar
[BGP_PROGRESS_PAGE2
]==NULL
)
1338 // EXAMPLES: PROGRESS SAMPLE
1339 ar
[BGP_PROGRESS_PAGE2
] = VGroupObject
,
1341 FRM_Type
, FRTYPE_DEFAULT
,
1343 FRM_Flags
, FRF_CENTER_TITLE
| FRF_HIGHLIGHT_TITLE
,
1344 FRM_Title
, "Example Progress",
1350 ar
[BGP_PRG_SAMPLE
] = ProgressObject
,
1351 PROGRESS_FormatString
, " ",
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
,
1371 FRM_Type
, FRTYPE_DEFAULT
,
1373 FRM_Flags
, FRF_CENTER_TITLE
| FRF_HIGHLIGHT_TITLE
,
1374 FRM_Title
, "Example Indicator",
1380 ar
[BGP_IND_SAMPLE
] = IndicatorObject
,
1381 FRM_Type
, ind_frmtype
,
1382 FRM_Recessed
, ind_recessed
,
1384 INDIC_FormatString
, "%ld",
1385 INDIC_Justification
, IDJ_CENTER
,
1396 return(ar
[BGP_INDICATOR_PAGE2
]);
1399 if(ar
[BGP_SLIDER_PAGE2
]==NULL
)
1402 // EXAMPLES: SLIDER SAMPLE
1403 ar
[BGP_SLIDER_PAGE2
] = VGroupObject
,
1405 FRM_Type
, FRTYPE_DEFAULT
,
1407 FRM_Flags
, FRF_CENTER_TITLE
| FRF_HIGHLIGHT_TITLE
,
1408 FRM_Title
, "Example Slider",
1414 ar
[BGP_SLI_SAMPLE
] = SliderObject
,
1415 LAB_Label
, "S_lider",
1416 LAB_Place
, PLACE_LEFT
,
1418 GA_ID
, BGP_SLI_SAMPLE
,
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
,
1438 FRM_Type
, FRTYPE_DEFAULT
,
1440 FRM_Flags
, FRF_CENTER_TITLE
| FRF_HIGHLIGHT_TITLE
,
1441 FRM_Title
, "Example Proportional",
1447 ar
[BGP_PRO_SAMPLE
] = PropObject
,
1449 PGA_Freedom
, FREEHORIZ
,
1455 GA_ID
, BGP_PRO_SAMPLE
,
1466 return(ar
[BGP_PROPORTIONAL_PAGE2
]);
1469 if(ar
[BGP_MX_PAGE2
]==NULL
)
1472 // EXAMPLES: MX SAMPLE
1473 ar
[BGP_MX_PAGE2
] = HGroupObject
,
1475 FRM_Type
, FRTYPE_DEFAULT
,
1477 FRM_Flags
, FRF_CENTER_TITLE
| FRF_HIGHLIGHT_TITLE
,
1478 FRM_Title
, "Example MX",
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
,
1500 return(ar
[BGP_MX_PAGE2
]);
1503 if(ar
[BGP_LISTVIEW_PAGE2
]==NULL
)
1506 // EXAMPLES: LISTVIEW SAMPLE
1507 ar
[BGP_LISTVIEW_PAGE2
] = VGroupObject
,
1509 FRM_Type
, FRTYPE_DEFAULT
,
1511 FRM_Flags
, FRF_CENTER_TITLE
| FRF_HIGHLIGHT_TITLE
,
1512 FRM_Title
, "Example Listview",
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
,
1532 return(ar
[BGP_LISTVIEW_PAGE2
]);
1539 static void DisposePreferencesPage(ULONG page
)
1541 Object
**ar
= BGUIPrefsObjs
;
1546 DisposeObject(ar
[BGP_GENERAL_PAGE
]);
1547 ar
[BGP_GENERAL_PAGE
]=NULL
;
1550 DisposeObject(ar
[BGP_SPACING_PAGE
]);
1551 ar
[BGP_SPACING_PAGE
]=NULL
;
1554 DisposeObject(ar
[BGP_GROUP_PAGE1
]);
1555 ar
[BGP_GROUP_PAGE1
]=NULL
;
1558 DisposeObject(ar
[BGP_BUTTON_PAGE1
]);
1559 ar
[BGP_BUTTON_PAGE1
]=NULL
;
1562 DisposeObject(ar
[BGP_STRING_PAGE1
]);
1563 ar
[BGP_STRING_PAGE1
]=NULL
;
1566 DisposeObject(ar
[BGP_CHECKBOX_PAGE1
]);
1567 ar
[BGP_CHECKBOX_PAGE1
]=NULL
;
1570 DisposeObject(ar
[BGP_CYCLE_PAGE1
]);
1571 ar
[BGP_CYCLE_PAGE1
]=NULL
;
1574 DisposeObject(ar
[BGP_INFO_PAGE1
]);
1575 ar
[BGP_INFO_PAGE1
]=NULL
;
1578 DisposeObject(ar
[BGP_PROGRESS_PAGE1
]);
1579 ar
[BGP_PROGRESS_PAGE1
]=NULL
;
1581 case PAGE_INDICATOR
:
1582 DisposeObject(ar
[BGP_INDICATOR_PAGE1
]);
1583 ar
[BGP_INDICATOR_PAGE1
]=NULL
;
1586 DisposeObject(ar
[BGP_SLIDER_PAGE1
]);
1587 ar
[BGP_SLIDER_PAGE1
]=NULL
;
1589 case PAGE_PROPORTIONAL
:
1590 DisposeObject(ar
[BGP_PROPORTIONAL_PAGE1
]);
1591 ar
[BGP_PROPORTIONAL_PAGE1
]=NULL
;
1594 DisposeObject(ar
[BGP_MX_PAGE1
]);
1595 ar
[BGP_MX_PAGE1
]=NULL
;
1598 DisposeObject(ar
[BGP_LISTVIEW_PAGE1
]);
1599 ar
[BGP_LISTVIEW_PAGE1
]=NULL
;
1604 static void DisposeExamplesPage(ULONG page
)
1606 Object
**ar
= BGUIPrefsObjs
;
1611 DisposeObject(ar
[BGP_GROUP_PAGE2
]);
1612 ar
[BGP_GROUP_PAGE2
]=NULL
;
1615 DisposeObject(ar
[BGP_BUTTON_PAGE2
]);
1616 ar
[BGP_BUTTON_PAGE2
]=NULL
;
1619 DisposeObject(ar
[BGP_STRING_PAGE2
]);
1620 ar
[BGP_STRING_PAGE2
]=NULL
;
1623 DisposeObject(ar
[BGP_CHECKBOX_PAGE2
]);
1624 ar
[BGP_CHECKBOX_PAGE2
]=NULL
;
1627 DisposeObject(ar
[BGP_CYCLE_PAGE2
]);
1628 ar
[BGP_CYCLE_PAGE2
]=NULL
;
1631 DisposeObject(ar
[BGP_INFO_PAGE2
]);
1632 ar
[BGP_INFO_PAGE2
]=NULL
;
1635 DisposeObject(ar
[BGP_PROGRESS_PAGE2
]);
1636 ar
[BGP_PROGRESS_PAGE2
]=NULL
;
1638 case PAGE_INDICATOR
:
1639 DisposeObject(ar
[BGP_INDICATOR_PAGE2
]);
1640 ar
[BGP_INDICATOR_PAGE2
]=NULL
;
1643 DisposeObject(ar
[BGP_SLIDER_PAGE2
]);
1644 ar
[BGP_SLIDER_PAGE2
]=NULL
;
1646 case PAGE_PROPORTIONAL
:
1647 DisposeObject(ar
[BGP_PROPORTIONAL_PAGE2
]);
1648 ar
[BGP_PROPORTIONAL_PAGE2
]=NULL
;
1651 DisposeObject(ar
[BGP_MX_PAGE2
]);
1652 ar
[BGP_MX_PAGE2
]=NULL
;
1655 DisposeObject(ar
[BGP_LISTVIEW_PAGE2
]);
1656 ar
[BGP_LISTVIEW_PAGE2
]=NULL
;
1662 ** ULONG = Frame2Cycle( ULONG )
1664 ** Translate a FRTYPE_xxx value into a value suitable
1665 ** for use with a cyclegadget. See also Cycle2Frame[].
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;
1685 ** SetGadgets( void )
1687 ** Update the gadgets of the user interface to
1688 ** reflect the current settings.
1691 SetGadgets(ULONG page
)
1693 Object
**ar
= BGUIPrefsObjs
;
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
);
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
);
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
);
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
);
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
);
1736 SetAttrs( ar
[ BGP_CYC_POPACTIVE
], GA_Selected
, cyc_popactive
, TAG_DONE
);
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
);
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
);
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
);
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 );
1776 ** SetCondits( void )
1778 ** Set the conditions for different settings.
1781 SetCondits( ULONG page
)
1783 Object
**ar
= BGUIPrefsObjs
;
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
1832 ULONG PreferencesPage
;
1835 Object
*Preferences
;
1838 pages_map
[PAGE_COUNT
];
1840 ULONG total_pages
=0,total_preferences_pages
=0,total_example_pages
=0;
1843 InitBGUIPrefs( ULONG page
)
1846 Object
**ar
= BGUIPrefsObjs
;
1849 memset(pages_map
,'\0',sizeof(pages_map
));
1850 gadget_page
=(page
<=PAGE_GROUP
? PAGE_GROUP
: page
);
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
,
1872 BOffset( GRSPACE_NORMAL
),
1873 FRM_Type
, FRTYPE_DEFAULT
,
1875 FRM_Flags
, FRF_CENTER_TITLE
| FRF_HIGHLIGHT_TITLE
,
1878 ar
[BGP_LISTVIEW1
] = ListviewObject
,
1880 LISTV_EntryArray
, BGP_LISTVIEW1Entrys
,
1881 GA_ID
, BGP_LISTVIEW1
,
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
),
1894 PageMember
, ar
[BGP_MISC_PAGE
] = VGroupObject
,
1897 StartMember
, ar
[BGP_SETTING_PAGES
] = PageObject
,
1899 PageMember
, pages_map
[gadget_page
].Preferences
=PreferencesPage(gadget_page
),
1903 StartMember
, ar
[BGP_EXAMPLE_PAGES
] = PageObject
,
1905 PageMember
, pages_map
[gadget_page
].Example
=ExamplesPage(gadget_page
),
1916 // Horizontal separator.
1925 // Action buttons (Save/Use/Cancel).
1929 ar
[BGP_SAVE
] = ButtonObject
,
1936 ar
[BGP_USE
] = ButtonObject
,
1943 ar
[BGP_CANCEL
] = ButtonObject
,
1944 LAB_Label
, "_Cancel",
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.
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
;
1994 BOOL
SetNewPage(struct Window
*window
,ULONG page
)
1996 Object
**ar
= BGUIPrefsObjs
;
2001 SetGadgetAttrs( ( struct Gadget
* )ar
[ BGP_MAIN_PAGES
], window
, NULL
, PAGE_Active
, pages_map
[page
].PreferencesPage
, TAG_DONE
);
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
)
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
--;
2030 pages_map
[page
].ExamplePage
=total_example_pages
;
2031 total_example_pages
++;
2034 // Set the gadgets to the correct states.
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
--;
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
--;
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
--;
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
);
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
);