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.2 2003/01/18 19:10:07 chodorowski
14 * Instead of using the _AROS or __AROS preprocessor symbols, use __AROS__.
16 * Revision 42.1 2000/07/09 18:06:21 bergers
17 * Made the Preferences tool compilable for AROS. This one has an MMakefile!
19 * Revision 42.0 2000/05/09 22:16:54 mlemos
20 * Bumped to revision 42.0 before handing BGUI to AROS team
22 * Revision 41.11 2000/05/09 20:29:45 mlemos
23 * Bumped to revision 41.11
25 * Revision 1.2 2000/05/09 19:56:46 mlemos
26 * Merged with the branch Manuel_Lemos_fixes.
28 * Revision 1.1.2.4 1999/08/30 05:02:19 mlemos
29 * Updated the copyright and the version information.
31 * Revision 1.1.2.3 1999/08/29 20:42:43 mlemos
32 * Removed window opening and disposing timing code.
34 * Revision 1.1.2.2 1999/08/29 17:11:07 mlemos
35 * Made the preferences and example pages be created and added on demand.
37 * Revision 1.1.2.1 1998/09/20 17:28:35 mlemos
38 * Peter Bornhall sources.
45 extern struct Library
* BGUIBase
;
51 #include "BGUIPrefs_rev.h"
52 #include "BGUIPrefs.h"
53 #include "BGUIPrefs_gui.c"
54 #include "BGUIPrefs_iff.c"
60 const static char VersTag
[] = VERSTAG
,
61 PrefDir
[] = "SYS:Prefs/Presets";
63 const static UBYTE Cycle2Frame
[] = {
79 extern Object
*BGUIPrefsObjs
[ BGP_NUMGADS
];
81 extern Object
*InitBGUIPrefs( ULONG page
);
82 extern void SaveBGUIPrefs( char *dirname
, char *name
);
83 //extern Object *FrameFrom( Object *o );
89 struct Library
*BGUIBase
;
90 struct Window
*window
= NULL
;
92 struct NewMenu Menus
[] = {
93 { NM_TITLE
, "Project", NULL
, 0, 0, NULL
},
94 { NM_ITEM
, "Open...", "O", 0, 0, (APTR
)MNU_OPEN
},
95 { NM_ITEM
, "Save As...", "A", 0, 0, (APTR
)MNU_SAVEAS
},
96 { NM_ITEM
, NM_BARLABEL
, NULL
, 0, 0, NULL
},
97 { NM_ITEM
, "About...", "?", 0, 0, (APTR
)MNU_ABOUT
},
98 { NM_ITEM
, NM_BARLABEL
, NULL
, 0, 0, NULL
},
99 { NM_ITEM
, "Quit", "Q", 0, 0, (APTR
)MNU_QUIT
},
100 { NM_TITLE
, "Edit", NULL
, 0, 0, NULL
},
101 { NM_ITEM
, "Reset To Defaults", "D", 0, 0, (APTR
)MNU_DEFAULTS
},
102 { NM_ITEM
, "Last Saved", "L", 0, 0, (APTR
)MNU_LASTSAVED
},
103 { NM_ITEM
, "Restore", "R", 0, 0, (APTR
)MNU_RESTORE
},
104 { NM_TITLE
, "Presets", NULL
, 0, 0, NULL
},
105 { NM_ITEM
, "Normal", "N", 0, 0, (APTR
)MNU_PRE_NORM
},
106 { NM_ITEM
, "Fuzzy", "F", 0, 0, (APTR
)MNU_PRE_FUZZ
},
107 { NM_ITEM
, "XEN", "X", 0, 0, (APTR
)MNU_PRE_XEN
},
108 { NM_END
, NULL
, NULL
, 0, 0, NULL
}
112 ULONG prf_drawer
, // = NULL,
117 ULONG VSpNar1[] = { STRINGA_LongVal, SLIDER_Level, TAG_END },
118 VSpNar2[] = { SLIDER_Level, STRINGA_LongVal, TAG_END },
119 HSpNar1[] = { STRINGA_LongVal, SLIDER_Level, TAG_END },
120 HSpNar2[] = { SLIDER_Level, STRINGA_LongVal, TAG_END },
121 VSpNor1[] = { STRINGA_LongVal, SLIDER_Level, TAG_END },
122 VSpNor2[] = { SLIDER_Level, STRINGA_LongVal, TAG_END },
123 HSpNor1[] = { STRINGA_LongVal, SLIDER_Level, TAG_END },
124 HSpNor2[] = { SLIDER_Level, STRINGA_LongVal, TAG_END },
125 VSpWid1[] = { STRINGA_LongVal, SLIDER_Level, TAG_END },
126 VSpWid2[] = { SLIDER_Level, STRINGA_LongVal, TAG_END },
127 HSpWid1[] = { STRINGA_LongVal, SLIDER_Level, TAG_END },
128 HSpWid2[] = { SLIDER_Level, STRINGA_LongVal, TAG_END };
132 ** SetGadgets2( void )
134 ** Update the gadgets of the user interface to
135 ** reflect the current settings.
142 SetGadgetAttrs( ( struct Gadget
* )ar
[ BGP_SPC_VNOR_STR
], window
, NULL
, STRINGA_LongVal
, grp_vspnormal
, TAG_DONE
);
143 SetGadgetAttrs( ( struct Gadget
* )ar
[ BGP_SPC_HNOR_STR
], window
, NULL
, STRINGA_LongVal
, grp_hspnormal
, TAG_DONE
);
145 // GROUP PAGE [1997-02-17]
146 frame
= Frame2Cycle( grp_frmtype
);
147 SetGadgetAttrs( ( struct Gadget
* )ar
[ BGP_GRP_FRMTYPE
], window
, NULL
, CYC_Active
, frame
, TAG_DONE
);
148 SetGadgetAttrs( ( struct Gadget
* )ar
[ BGP_GRP_SAMPLE
], window
, NULL
, FRM_Recessed
, grp_recessed
, TAG_DONE
);
149 SetGadgetAttrs( ( struct Gadget
* )ar
[ BGP_GRP_SAMPLE
], window
, NULL
, FRM_Type
, grp_frmtype
, TAG_DONE
);
150 if( grp_frmtype
== FRTYPE_NONE
)
151 SetGadgetAttrs( ( struct Gadget
* )ar
[ BGP_GRP_RECESSED
], window
, NULL
, GA_Selected
, 0, TAG_DONE
);
153 SetGadgetAttrs( ( struct Gadget
* )ar
[ BGP_GRP_RECESSED
], window
, NULL
, GA_Selected
, grp_recessed
, TAG_DONE
);
158 GetFilename( int mode
)
164 prf_drawer
= ( ULONG
)&PrefDir
;
167 filereq
= FileReqObject
,
168 ASLFR_TitleText
, "Load BGUI Preferences",
169 FRQ_Drawer
, prf_drawer
,
173 filereq
= FileReqObject
,
174 ASLFR_DoSaveMode
, TRUE
,
175 ASLFR_TitleText
, "Save BGUI Preferences",
176 FRQ_Drawer
, prf_drawer
,
183 if( !DoRequest( filereq
) ) {
185 GetAttr( FRQ_Path
, filereq
, &pf
);
186 GetAttr( FRQ_File
, filereq
, &prf_file
);
187 GetAttr( FRQ_Drawer
, filereq
, &prf_drawer
);
197 struct IntuitionBase
* IntuitionBase
;
198 struct UtilityBase
* UtilityBase
;
199 struct Library
* IFFParseBase
;
203 IntuitionBase
= (struct IntuitionBase
*)OpenLibrary("intuition.library",0);
204 UtilityBase
= (struct UtilityBase
*)OpenLibrary("utility.library",0);
205 IFFParseBase
= OpenLibrary("iffparse.library",0);
207 if(IntuitionBase
&& UtilityBase
&& IFFParseBase
)
215 if (IntuitionBase
) CloseLibrary((struct Library
*)IntuitionBase
);
216 if (UtilityBase
) CloseLibrary((struct Library
*)UtilityBase
);
217 if (IFFParseBase
) CloseLibrary((struct Library
*)IFFParseBase
);
223 ** int = main( int, char ** )
225 ** Main program starts and ends here.
227 int main( int count
, char **args
)
230 struct bguiRequest AboutRequest
= { NULL
};
239 if (FALSE
== openlibs())
242 printf("Failed to open lib!\n");
247 // Open the library, at least version 41 required.
248 if( BGUIBase
= OpenLibrary( "bgui.library", 41 )) {
250 // Get the default settings.
253 // Create the window object.
254 if( WO_Window
= InitBGUIPrefs(INITIAL_PAGE
) ) {
257 if( window
= WindowOpen( WO_Window
) ) {
259 // Get a signal for our window.
260 GetAttr( WINDOW_SigMask
, WO_Window
, &signal
);
265 // Wait for a signal.
268 // Process all events.
269 while( ( rc
= HandleEvent( WO_Window
) ) != WMHI_NOMORE
) {
274 // Save and use settings and exit.
277 // Use settings and exit.
280 SaveBGUIPrefs( "ENVARC:BGUI", "Default.prefs" );
281 SaveBGUIPrefs( "ENV:BGUI", "Default.prefs" );
293 pf
= GetFilename( 0 );
295 BGUI_LoadPrefs( ( UBYTE
* )pf
);
297 //grp_defaults = BGUI_GetDefaultTags( BGUI_GROUP_GADGET );
298 //grp_vspnormal = GetTagData( GROUP_DefVSpaceNormal, grp_vspnormal, grp_defaults );
299 //grp_hspnormal = GetTagData( GROUP_DefHSpaceNormal, grp_hspnormal, grp_defaults );
300 //SetGadgetAttrs( ( struct Gadget * )ar[ BGP_SPC_VNOR_STR ], window, NULL, STRINGA_LongVal, grp_vspnormal, TAG_DONE);
301 //SetGadgetAttrs( ( struct Gadget * )ar[ BGP_SPC_HNOR_STR ], window, NULL, STRINGA_LongVal, grp_hspnormal, TAG_DONE);
308 pf
= GetFilename( 1 );
310 SaveBGUIPrefs( ( char * )prf_drawer
, ( char * )prf_file
);
313 // We need to quit, right now.
319 // User is searching for knowledge.
321 if( !AboutRequest
.br_Title
) {
322 AboutRequest
.br_Title
= "About " PRGNAME
;
323 AboutRequest
.br_GadgetFormat
= "*_OK";
324 AboutRequest
.br_Underscore
= '_';
325 AboutRequest
.br_TextFormat
= ISEQ_C ISEQ_B VSTR ISEQ_N
"\n----\nCopyright ©" _COPYRIGHTYEARS_
", BGUI Developers Team\nAll rights reserved.";
326 AboutRequest
.br_Flags
= BREQF_AUTO_ASPECT
|BREQF_FAST_KEYS
|BREQF_LOCKWINDOW
;
327 AboutRequest
.br_ReqPos
= POS_CENTERSCREEN
;
329 BGUI_RequestA( window
, &AboutRequest
, NULL
);
333 // Handle page switching.
335 GetAttr( LISTV_LastClickedNum
, ar
[ BGP_LISTVIEW1
], &frame
);
336 SetNewPage(window
,frame
);
340 case BGP_SPC_HNAR_STR
:
341 GetAttr( STRINGA_LongVal
, ar
[ BGP_SPC_HNAR_STR
], &grp_hspnarrow
);
342 SetGadgetAttrs( ( struct Gadget
* )ar
[ BGP_SPC_HNAR_SLI
], window
, NULL
, SLIDER_Level
, grp_hspnarrow
, TAG_DONE
);
344 case BGP_SPC_HNAR_SLI
:
345 GetAttr( SLIDER_Level
, ar
[ BGP_SPC_HNAR_SLI
], &grp_hspnarrow
);
346 SetGadgetAttrs( ( struct Gadget
* )ar
[ BGP_SPC_HNAR_STR
], window
, NULL
, STRINGA_LongVal
, grp_hspnarrow
, TAG_DONE
);
348 case BGP_SPC_VNAR_STR
:
349 GetAttr( STRINGA_LongVal
, ar
[ BGP_SPC_VNAR_STR
], &grp_vspnarrow
);
350 SetGadgetAttrs( ( struct Gadget
* )ar
[ BGP_SPC_VNAR_SLI
], window
, NULL
, SLIDER_Level
, grp_vspnarrow
, TAG_DONE
);
352 case BGP_SPC_VNAR_SLI
:
353 GetAttr( SLIDER_Level
, ar
[ BGP_SPC_VNAR_SLI
], &grp_vspnarrow
);
354 SetGadgetAttrs( ( struct Gadget
* )ar
[ BGP_SPC_VNAR_STR
], window
, NULL
, STRINGA_LongVal
, grp_vspnarrow
, TAG_DONE
);
356 case BGP_SPC_HNOR_STR
:
357 GetAttr( STRINGA_LongVal
, ar
[ BGP_SPC_HNOR_STR
], &grp_hspnormal
);
358 SetGadgetAttrs( ( struct Gadget
* )ar
[ BGP_SPC_HNOR_SLI
], window
, NULL
, SLIDER_Level
, grp_hspnormal
, TAG_DONE
);
360 case BGP_SPC_HNOR_SLI
:
361 GetAttr( SLIDER_Level
, ar
[ BGP_SPC_HNOR_SLI
], &grp_hspnormal
);
362 SetGadgetAttrs( ( struct Gadget
* )ar
[ BGP_SPC_HNOR_STR
], window
, NULL
, STRINGA_LongVal
, grp_hspnormal
, TAG_DONE
);
364 case BGP_SPC_VNOR_STR
:
365 GetAttr( STRINGA_LongVal
, ar
[ BGP_SPC_VNOR_STR
], &grp_vspnormal
);
366 SetGadgetAttrs( ( struct Gadget
* )ar
[ BGP_SPC_VNOR_SLI
], window
, NULL
, SLIDER_Level
, grp_vspnormal
, TAG_DONE
);
368 case BGP_SPC_VNOR_SLI
:
369 GetAttr( SLIDER_Level
, ar
[ BGP_SPC_VNOR_SLI
], &grp_vspnormal
);
370 SetGadgetAttrs( ( struct Gadget
* )ar
[ BGP_SPC_VNOR_STR
], window
, NULL
, STRINGA_LongVal
, grp_vspnormal
, TAG_DONE
);
372 case BGP_SPC_HWID_STR
:
373 GetAttr( STRINGA_LongVal
, ar
[ BGP_SPC_HWID_STR
], &grp_hspwide
);
374 SetGadgetAttrs( ( struct Gadget
* )ar
[ BGP_SPC_HWID_SLI
], window
, NULL
, SLIDER_Level
, grp_hspwide
, TAG_DONE
);
376 case BGP_SPC_HWID_SLI
:
377 GetAttr( SLIDER_Level
, ar
[ BGP_SPC_HWID_SLI
], &grp_hspwide
);
378 SetGadgetAttrs( ( struct Gadget
* )ar
[ BGP_SPC_HWID_STR
], window
, NULL
, STRINGA_LongVal
, grp_hspwide
, TAG_DONE
);
380 case BGP_SPC_VWID_STR
:
381 GetAttr( STRINGA_LongVal
, ar
[ BGP_SPC_VWID_STR
], &grp_vspwide
);
382 SetGadgetAttrs( ( struct Gadget
* )ar
[ BGP_SPC_VWID_SLI
], window
, NULL
, SLIDER_Level
, grp_vspwide
, TAG_DONE
);
384 case BGP_SPC_VWID_SLI
:
385 GetAttr( SLIDER_Level
, ar
[ BGP_SPC_VWID_SLI
], &grp_vspwide
);
386 SetGadgetAttrs( ( struct Gadget
* )ar
[ BGP_SPC_VWID_STR
], window
, NULL
, STRINGA_LongVal
, grp_vspwide
, TAG_DONE
);
389 case BGP_SPC_VNAR_STR:
390 case BGP_SPC_VNAR_SLI:
391 GetAttr( STRINGA_LongVal, ar[ BGP_SPC_VNAR_STR ], &grp_vspnarrow );
393 case BGP_SPC_HNOR_STR:
394 case BGP_SPC_HNOR_SLI:
395 GetAttr( STRINGA_LongVal, ar[ BGP_SPC_HNOR_STR ], &grp_hspnormal );
397 case BGP_SPC_VNOR_STR:
398 case BGP_SPC_VNOR_SLI:
399 GetAttr( STRINGA_LongVal, ar[ BGP_SPC_VNOR_STR ], &grp_vspnormal );
401 case BGP_SPC_HWID_STR:
402 case BGP_SPC_HWID_SLI:
403 GetAttr( STRINGA_LongVal, ar[ BGP_SPC_HWID_STR ], &grp_hspwide );
405 case BGP_SPC_VWID_STR:
406 case BGP_SPC_VWID_SLI:
407 GetAttr( STRINGA_LongVal, ar[ BGP_SPC_VWID_STR ], &grp_vspwide );
412 case BGP_GRP_RECESSED
:
413 GetAttr( GA_Selected
, ar
[ BGP_GRP_RECESSED
], &grp_recessed
);
414 SetGadgetAttrs((struct Gadget
*)ar
[ BGP_GRP_SAMPLE
], window
, NULL
, FRM_Recessed
, grp_recessed
, TAG_DONE
);
416 case BGP_GRP_FRMTYPE
:
417 GetAttr( CYC_Active
, ar
[ BGP_GRP_FRMTYPE
], &frame
);
418 grp_frmtype
= Cycle2Frame
[ frame
];
419 SetGadgetAttrs((struct Gadget
*)ar
[ BGP_GRP_SAMPLE
], window
, NULL
, FRM_Type
, grp_frmtype
, TAG_DONE
);
420 if( grp_frmtype
== FRTYPE_NONE
)
421 SetGadgetAttrs((struct Gadget
*)ar
[ BGP_GRP_RECESSED
], window
, NULL
, GA_Selected
, 0, TAG_DONE
);
423 SetGadgetAttrs((struct Gadget
*)ar
[ BGP_GRP_RECESSED
], window
, NULL
, GA_Selected
, grp_recessed
, TAG_DONE
);
427 case BGP_BUT_RECESSED
:
428 GetAttr( GA_Selected
, ar
[ BGP_BUT_RECESSED
], &but_recessed
);
429 SetGadgetAttrs((struct Gadget
*)ar
[ BGP_BUT_SAMPLE
], window
, NULL
, FRM_Recessed
, but_recessed
, TAG_DONE
);
431 case BGP_BUT_FRMTYPE
:
432 GetAttr( CYC_Active
, ar
[ BGP_BUT_FRMTYPE
], &frame
);
433 but_frmtype
= Cycle2Frame
[ frame
];
434 SetGadgetAttrs((struct Gadget
*)ar
[ BGP_BUT_SAMPLE
], window
, NULL
, FRM_Type
, but_frmtype
, TAG_DONE
);
435 if( but_frmtype
== FRTYPE_NONE
)
436 SetGadgetAttrs((struct Gadget
*)ar
[ BGP_BUT_RECESSED
], window
, NULL
, GA_Selected
, 0, TAG_DONE
);
438 SetGadgetAttrs((struct Gadget
*)ar
[ BGP_BUT_RECESSED
], window
, NULL
, GA_Selected
, but_recessed
, TAG_DONE
);
442 case BGP_STR_RECESSED
:
443 GetAttr( GA_Selected
, ar
[ BGP_STR_RECESSED
], &str_recessed
);
444 SetGadgetAttrs((struct Gadget
*)ar
[ BGP_STR_SAMPLE
], window
, NULL
, FRM_Recessed
, str_recessed
, TAG_DONE
);
446 case BGP_STR_FRMTYPE
:
447 GetAttr( CYC_Active
, ar
[ BGP_STR_FRMTYPE
], &frame
);
448 str_frmtype
= Cycle2Frame
[ frame
];
449 SetGadgetAttrs((struct Gadget
*)ar
[ BGP_STR_SAMPLE
], window
, NULL
, FRM_Type
, str_frmtype
, TAG_DONE
);
450 if( str_frmtype
== FRTYPE_NONE
)
451 SetGadgetAttrs((struct Gadget
*)ar
[ BGP_STR_RECESSED
], window
, NULL
, GA_Selected
, 0, TAG_DONE
);
453 SetGadgetAttrs((struct Gadget
*)ar
[ BGP_STR_RECESSED
], window
, NULL
, GA_Selected
, str_recessed
, TAG_DONE
);
457 case BGP_CHK_RECESSED
:
458 GetAttr( GA_Selected
, ar
[ BGP_CHK_RECESSED
], &chk_recessed
);
459 SetGadgetAttrs((struct Gadget
*)ar
[ BGP_CHK_SAMPLE
], window
, NULL
, FRM_Recessed
, chk_recessed
, TAG_DONE
);
461 case BGP_CHK_FRMTYPE
:
462 GetAttr( CYC_Active
, ar
[ BGP_CHK_FRMTYPE
], &frame
);
463 chk_frmtype
= Cycle2Frame
[ frame
];
464 SetGadgetAttrs((struct Gadget
*)ar
[ BGP_CHK_SAMPLE
], window
, NULL
, FRM_Type
, chk_frmtype
, TAG_DONE
);
465 if( chk_frmtype
== FRTYPE_NONE
)
466 SetGadgetAttrs((struct Gadget
*)ar
[ BGP_CHK_RECESSED
], window
, NULL
, GA_Selected
, 0, TAG_DONE
);
468 SetGadgetAttrs((struct Gadget
*)ar
[ BGP_CHK_RECESSED
], window
, NULL
, GA_Selected
, chk_recessed
, TAG_DONE
);
472 case BGP_CYC_RECESSED
:
473 GetAttr( GA_Selected
, ar
[ BGP_CYC_RECESSED
], &cyc_recessed
);
474 SetGadgetAttrs((struct Gadget
*)ar
[ BGP_CYC_SAMPLE
], window
, NULL
, FRM_Recessed
, cyc_recessed
, TAG_DONE
);
476 case BGP_CYC_FRMTYPE
:
477 GetAttr( CYC_Active
, ar
[ BGP_CYC_FRMTYPE
], &frame
);
478 cyc_frmtype
= Cycle2Frame
[ frame
];
479 SetGadgetAttrs((struct Gadget
*)ar
[ BGP_CYC_SAMPLE
], window
, NULL
, FRM_Type
, cyc_frmtype
, TAG_DONE
);
480 if( cyc_frmtype
== FRTYPE_NONE
)
481 SetGadgetAttrs((struct Gadget
*)ar
[ BGP_CYC_RECESSED
], window
, NULL
, GA_Selected
, 0, TAG_DONE
);
483 SetGadgetAttrs((struct Gadget
*)ar
[ BGP_CYC_RECESSED
], window
, NULL
, GA_Selected
, cyc_recessed
, TAG_DONE
);
486 GetAttr( GA_Selected
, ar
[ BGP_CYC_POPUP
], &cyc_popup
);
487 SetGadgetAttrs((struct Gadget
*)ar
[ BGP_CYC_SAMPLE
], window
, NULL
, CYC_Popup
, cyc_popup
, TAG_DONE
);
489 SetGadgetAttrs((struct Gadget
*)ar
[ BGP_CYC_POPACTIVE
], window
, NULL
, GA_Selected
, 0, TAG_DONE
);
491 SetGadgetAttrs((struct Gadget
*)ar
[ BGP_CYC_POPACTIVE
], window
, NULL
, GA_Selected
, cyc_popactive
, TAG_DONE
);
493 case BGP_CYC_POPACTIVE
:
494 GetAttr( GA_Selected
, ar
[ BGP_CYC_POPACTIVE
], &cyc_popactive
);
495 SetGadgetAttrs((struct Gadget
*)ar
[ BGP_CYC_SAMPLE
], window
, NULL
, CYC_PopActive
, cyc_popactive
, TAG_DONE
);
499 case BGP_INF_RECESSED
:
500 GetAttr( GA_Selected
, ar
[ BGP_INF_RECESSED
], &inf_recessed
);
501 SetGadgetAttrs((struct Gadget
*)ar
[ BGP_INF_SAMPLE
], window
, NULL
, FRM_Recessed
, inf_recessed
, TAG_DONE
);
503 case BGP_INF_FRMTYPE
:
504 GetAttr( CYC_Active
, ar
[ BGP_INF_FRMTYPE
], &frame
);
505 inf_frmtype
= Cycle2Frame
[ frame
];
506 SetGadgetAttrs((struct Gadget
*)ar
[ BGP_INF_SAMPLE
], window
, NULL
, FRM_Type
, inf_frmtype
, TAG_DONE
);
507 if( inf_frmtype
== FRTYPE_NONE
)
508 SetGadgetAttrs((struct Gadget
*)ar
[ BGP_INF_RECESSED
], window
, NULL
, GA_Selected
, 0, TAG_DONE
);
510 SetGadgetAttrs((struct Gadget
*)ar
[ BGP_INF_RECESSED
], window
, NULL
, GA_Selected
, inf_recessed
, TAG_DONE
);
514 case BGP_PRG_RECESSED
:
515 GetAttr( GA_Selected
, ar
[ BGP_PRG_RECESSED
], &prg_recessed
);
516 SetGadgetAttrs((struct Gadget
*)ar
[ BGP_PRG_SAMPLE
], window
, NULL
, FRM_Recessed
, prg_recessed
, TAG_DONE
);
518 case BGP_PRG_FRMTYPE
:
519 GetAttr( CYC_Active
, ar
[ BGP_PRG_FRMTYPE
], &frame
);
520 prg_frmtype
= Cycle2Frame
[ frame
];
521 SetGadgetAttrs((struct Gadget
*)ar
[ BGP_PRG_SAMPLE
], window
, NULL
, FRM_Type
, prg_frmtype
, TAG_DONE
);
522 if( prg_frmtype
== FRTYPE_NONE
)
523 SetGadgetAttrs((struct Gadget
*)ar
[ BGP_PRG_RECESSED
], window
, NULL
, GA_Selected
, 0, TAG_DONE
);
525 SetGadgetAttrs((struct Gadget
*)ar
[ BGP_PRG_RECESSED
], window
, NULL
, GA_Selected
, prg_recessed
, TAG_DONE
);
529 case BGP_IND_RECESSED
:
530 GetAttr( GA_Selected
, ar
[ BGP_IND_RECESSED
], &ind_recessed
);
531 SetGadgetAttrs((struct Gadget
*)ar
[ BGP_IND_SAMPLE
], window
, NULL
, FRM_Recessed
, ind_recessed
, TAG_DONE
);
533 case BGP_IND_FRMTYPE
:
534 GetAttr( CYC_Active
, ar
[ BGP_IND_FRMTYPE
], &frame
);
535 ind_frmtype
= Cycle2Frame
[ frame
];
536 SetGadgetAttrs((struct Gadget
*)ar
[ BGP_IND_SAMPLE
], window
, NULL
, FRM_Type
, ind_frmtype
, TAG_DONE
);
537 if( ind_frmtype
== FRTYPE_NONE
)
538 SetGadgetAttrs((struct Gadget
*)ar
[ BGP_IND_RECESSED
], window
, NULL
, GA_Selected
, 0, TAG_DONE
);
540 SetGadgetAttrs((struct Gadget
*)ar
[ BGP_IND_RECESSED
], window
, NULL
, GA_Selected
, ind_recessed
, TAG_DONE
);
545 case BGP_SLI_RECESSED:
546 GetAttr( GA_Selected, ar[ BGP_SLI_RECESSED ], &frame );
547 SetGadgetAttrs((struct Gadget *)ar[ BGP_SLI_SAMPLE ], window, NULL, FRM_Recessed, frame, TAG_DONE);
550 GetAttr( CYC_Active, ar[ BGP_SLIFRAME ], &frame );
551 SetGadgetAttrs((struct Gadget *)ar[ BGP_SLI_SAMPLE ], window, NULL, FRM_Type, Cycle2Frame[ frame ], TAG_DONE);
552 if( Cycle2Frame[ frame ] == FRTYPE_NONE )
553 SetGadgetAttrs((struct Gadget *)ar[ BGP_SLI_RECESSED ], window, NULL, GA_Selected, 0, TAG_DONE);
555 SetGadgetAttrs((struct Gadget *)ar[ BGP_SLI_RECESSED ], window, NULL, GA_Selected, frame, TAG_DONE);
558 GetAttr( GA_Selected, ar[ BGP_SLINLOOK ], &frame );
559 SetGadgetAttrs((struct Gadget *)ar[ BGP_SLI_SAMPLE ], window, NULL, PGA_NewLook, frame, TAG_DONE);
571 // Dispose (automatically close) our window object.
572 DisposeObject( WO_Window
);
576 // Close the library when we're done with it.
577 CloseLibrary( BGUIBase
);
584 // Return error code.