1 #include <exec/types.h>
2 #include <intuition/intuition.h>
3 #include <intuition/classes.h>
4 #include <intuition/classusr.h>
5 #include <intuition/imageclass.h>
6 #include <intuition/gadgetclass.h>
7 #include <libraries/gadtools.h>
8 #include <libraries/reqtools.h>
9 #include <graphics/displayinfo.h>
10 #include <graphics/gfxbase.h>
11 #include <proto/exec.h>
12 #include <proto/intuition.h>
13 #include <proto/gadtools.h>
14 #include <proto/graphics.h>
19 #include <proto/alib.h>
20 #include <aros/asmcall.h>
22 extern struct ReqToolsBase
*ReqToolsBase
;
28 #include <proto/reqtools.h>
32 #define max(a,b) ( ( a ) > ( b ) ? ( a ) : ( b ) )
35 // static struct GfxBase *GfxBase;
39 struct Gadget
*glist
, *xoffgad
, *yoffgad
, *mixdirsgad
, *dirsfirstgad
, *mmbgad
;
40 struct Gadget
*sizegad
, *immsortgad
, *popgad
, *mingad
, *maxgad
, *defposgad
;
41 struct Gadget
*testgad
, *noledgad
, *deffontgad
, *fkeysgad
, *dowheelgad
;
44 UBYTE
*DefaultPosLabels
[] =
46 MSG_POINTER
, MSG_CENTERWIN
, MSG_CENTERSCR
, MSG_TOPLEFTWIN
, MSG_TOPLEFTSCR
,
52 MSG_FILEREQ
, MSG_FONTREQ
, MSG_PALETTEREQ
, MSG_SCRMODEREQ
, MSG_VOLUMEREQ
, MSG_OTHERREQ
,
56 STRPTR WheelLabels
[] =
58 MSG_WHEEL_NONE
, MSG_WHEEL_SIMPLE
, MSG_WHEEL_FANCY
,
63 struct TextAttr topaz8
= { (STRPTR
)"topaz.font", 8, 0x00, 0x01 };
65 struct IntuiText GeneralText
, FileReqText
, DefSizeText
, NrOfEntriesText
;
67 LONG BevelLeft
, BevelTop
, BevelHeight
, BevelWidth
;
70 AROS_UFH3(void, IntuiMsgFunc
,
71 AROS_UFHA(struct Hook
*, hook
, A0
),
72 AROS_UFHA(APTR
, req
, A2
),
73 AROS_UFHA(struct IntuiMessage
*, imsg
, A1
))
77 void __asm __saveds
IntuiMsgFunc( register __a0
struct Hook
*hook
,
78 register __a2 APTR req
,
79 register __a1
struct IntuiMessage
*imsg
)
82 if (imsg
->Class
== IDCMP_REFRESHWINDOW
)
84 GT_BeginRefresh( WindowPtr
);
86 GT_EndRefresh ( WindowPtr
, TRUE
);
95 GadgetOff( struct Gadget
*gad
)
97 if (gad
->Flags
& GFLG_DISABLED
) return;
98 GT_SetGadgetAttrs (gad
, WindowPtr
, NULL
, GA_Disabled
, TRUE
, TAG_END
);
102 GadgetOn( struct Gadget
*gad
)
104 if (!(gad
->Flags
& GFLG_DISABLED
)) return;
105 GT_SetGadgetAttrs (gad
, WindowPtr
, NULL
, GA_Disabled
, FALSE
, TAG_END
);
110 SetCheckState( struct Gadget
*gad
, BOOL state
)
112 GT_SetGadgetAttrs( gad
, WindowPtr
, NULL
, GTCB_Checked
, state
,
118 SetIntGad( struct Gadget
*gad
, LONG val
)
120 GT_SetGadgetAttrs( gad
, WindowPtr
, NULL
, GA_Disabled
, FALSE
,
127 IntGadValue( struct Gadget
*gad
)
129 return( ( ( struct StringInfo
* )( gad
->SpecialInfo
) )->LongInt
);
134 RenderPrefsWindow( VOID
)
136 struct RastPort
*rp
= WindowPtr
->RPort
;
138 PrintIText( rp
, &GeneralText
, 0, 0 );
139 PrintIText( rp
, &FileReqText
, 0, 0 );
140 PrintIText( rp
, &DefSizeText
, 0, 0 );
141 PrintIText( rp
, &NrOfEntriesText
, 0, 0 );
143 DrawBevelBox( rp
, BevelLeft
, BevelTop
, BevelWidth
, BevelHeight
, GT_VisualInfo
, (IPTR
) VisualInfo
,
144 GTBB_Recessed
, TRUE
,
149 static struct NewGadget NewGadget
;
150 static struct IntuiText IntuiText
;
153 STRPTR Column1Text
[] =
155 MSG_POPSCREEN
, MSG_DEFAULTFONT
, MSG_FKEYS
,
156 MSG_IMMEDIATESORT
, MSG_DRAWERSFIRST
, MSG_DRAWERSMIXED
, MSG_LED
, MSG_MMB_PARENT
,
160 STRPTR SaveUseCancel
[] =
162 MSG_SAVE
, MSG_USE
, MSG_CANCEL
,
166 STRPTR PositionOffset
[] =
168 MSG_POSITION
, MSG_OFFSET
,
174 InitNewGadget( WORD x
, LONG y
, WORD w
, WORD h
, STRPTR str
, UWORD id
)
176 NewGadget
.ng_LeftEdge
= x
;
177 NewGadget
.ng_TopEdge
= y
;
178 NewGadget
.ng_Width
= w
;
179 NewGadget
.ng_Height
= h
;
180 NewGadget
.ng_GadgetText
= str
;
181 NewGadget
.ng_GadgetID
= id
;
186 ArrayWidth_Localize( STRPTR
*array
)
194 IntuiText
.IText
= GetString( *array
);
195 len
= IntuiTextLength( &IntuiText
);
210 ArrayWidth( STRPTR
*array
)
218 IntuiText
.IText
= *array
;
219 len
= IntuiTextLength( &IntuiText
);
234 ObjectWidth( struct NewGadget
*ng
, LONG normalw
, LONG normalh
)
236 if( ( GadToolsBase
->lib_Version
>= 39 ) && ( ng
->ng_TextAttr
->ta_YSize
> normalh
) )
238 return( normalw
+ ( ng
->ng_TextAttr
->ta_YSize
- normalh
) * 2 );
246 ObjectHeight( struct NewGadget
*ng
, int normalh
)
248 if( ( GadToolsBase
->lib_Version
>= 39 ) && ( ng
->ng_TextAttr
->ta_YSize
> normalh
) )
250 return( ng
->ng_TextAttr
->ta_YSize
);
258 CheckBoxWidth( struct NewGadget
*ng
)
260 return( ObjectWidth( ng
, CHECKBOX_WIDTH
, CHECKBOX_HEIGHT
) );
265 CheckBoxHeight( struct NewGadget
*ng
)
267 return( ObjectHeight( ng
, CHECKBOX_HEIGHT
) );
271 const static struct TextAttr Topaz80
=
273 "topaz.font", 8, FS_NORMAL
, FPF_ROMFONT
| FPF_DESIGNED
277 long OpenPrefsWindow (void)
280 struct TextAttr
*font
;
281 struct ReqDefaults
*filereqdefs
= &RTPrefs
.ReqDefaults
[RTPREF_FILEREQ
];
282 ULONG flags
= RTPrefs
.Flags
;
284 int offy
, col1
, fontht
, top
, scrwidth
, scrheight
, spacing
;
285 int len
, left
, intgadwidth
, col1ht
, col2ht
, proptop
, len2
;
286 int width
, winwidth
, dis
;
287 int checkw
, checkh
, checkskip
;
289 /* First localize some stuff */
290 LocalizeLabels( DefaultPosLabels
);
291 LocalizeLabels( TypeLabels
);
292 LocalizeLabels( WheelLabels
);
294 GeneralText
.IText
= GetString( MSG_GENERAL
);
295 FileReqText
.IText
= GetString( MSG_FILEREQUESTER
);
296 DefSizeText
.IText
= GetString( MSG_SIZE
);
297 NrOfEntriesText
.IText
= GetString( MSG_NR_OF_ENTRIES
);
300 spacing
= rtGetVScreenSize( Screen
, ( ULONG
* ) &scrwidth
, ( ULONG
* ) &scrheight
);
307 IntuiText
.ITextFont
= font
;
308 fontht
= font
->ta_YSize
;
309 offy
= Screen
->WBorTop
+ Screen
->Font
->ta_YSize
+ 1;
311 NewGadget
.ng_TextAttr
= font
;
312 NewGadget
.ng_VisualInfo
= VisualInfo
;
314 checkw
= CheckBoxWidth (&NewGadget
);
315 checkh
= checkskip
= CheckBoxHeight (&NewGadget
);
316 if (fontht
> checkskip
) checkskip
= fontht
;
318 /* Calculate width of first column */
319 col1
= ArrayWidth_Localize ( Column1Text
) + checkw
+ 8;
320 top
= ArrayWidth( WheelLabels
) + 36;
321 col1
= max( col1
, top
);
323 if (!(gad
= CreateContext (&glist
))) return (1);
327 top
= offy
+ spacing
+ 3;
329 GeneralText
.FrontPen
= Pens
[HIGHLIGHTTEXTPEN
];
330 GeneralText
.ITextFont
= font
;
331 GeneralText
.TopEdge
= top
;
332 GeneralText
.LeftEdge
= 12 + ((col1
- IntuiTextLength (&GeneralText
)) / 2);
333 top
+= fontht
+ spacing
/ 2;
335 InitNewGadget (12, top
, checkw
, checkh
,
336 GetString (MSG_POPSCREEN
), NOSCRTOFRONT_GADID
);
337 NewGadget
.ng_Flags
= PLACETEXT_RIGHT
;
338 popgad
= gad
= CreateGadget (CHECKBOX_KIND
, gad
, &NewGadget
, GTCB_Scaled
, TRUE
,
339 GTCB_Checked
, !(flags
& RTPRF_NOSCRTOFRONT
),
341 top
+= checkskip
+ spacing
;
343 NewGadget
.ng_TopEdge
= top
;
344 NewGadget
.ng_GadgetText
= GetString (MSG_DEFAULTFONT
);
345 NewGadget
.ng_GadgetID
= DEFAULTFONT_GADID
;
346 deffontgad
= gad
= CreateGadget (CHECKBOX_KIND
, gad
, &NewGadget
, GTCB_Scaled
, TRUE
,
347 GTCB_Checked
, flags
& RTPRF_DEFAULTFONT
,
350 top
+= checkskip
+ spacing
;
352 NewGadget
.ng_TopEdge
= top
;
353 NewGadget
.ng_GadgetText
= GetString( MSG_FKEYS
);
354 NewGadget
.ng_GadgetID
= FKEYS_GADID
;
355 fkeysgad
= gad
= CreateGadget (CHECKBOX_KIND
, gad
, &NewGadget
, GTCB_Scaled
, TRUE
,
356 GTCB_Checked
, flags
& RTPRF_FKEYS
,
359 top
+= checkskip
+ spacing
;
361 NewGadget
.ng_TopEdge
= top
;
362 NewGadget
.ng_Width
= ArrayWidth( WheelLabels
) + 36;
363 NewGadget
.ng_Height
= fontht
+ 6;
364 NewGadget
.ng_GadgetText
= NULL
;
365 NewGadget
.ng_GadgetID
= DOWHEEL_GADID
;
366 dowheelgad
= gad
= CreateGadget (CYCLE_KIND
, gad
, &NewGadget
, GTCY_Labels
, (IPTR
) WheelLabels
,
367 GTCY_Active
, WheelType
,
370 top
+= checkskip
+ 6 + spacing
;
373 FileReqText
.FrontPen
= Pens
[HIGHLIGHTTEXTPEN
];
374 FileReqText
.ITextFont
= font
;
375 FileReqText
.TopEdge
= top
;
376 FileReqText
.LeftEdge
= 12 + ((col1
- IntuiTextLength (&FileReqText
)) / 2);
377 top
+= fontht
+ spacing
/ 2;
379 NewGadget
.ng_TopEdge
= top
;
380 NewGadget
.ng_Width
= checkw
;
381 NewGadget
.ng_Height
= checkh
;
382 NewGadget
.ng_GadgetText
= (UBYTE
*)GetString (MSG_IMMEDIATESORT
);
383 NewGadget
.ng_GadgetID
= IMMSORT_GADID
;
384 immsortgad
= gad
= CreateGadget (CHECKBOX_KIND
, gad
, &NewGadget
, GTCB_Scaled
, TRUE
,
385 GTCB_Checked
, flags
& RTPRF_IMMSORT
,
387 top
+= checkskip
+ spacing
;
389 NewGadget
.ng_TopEdge
= top
;
390 NewGadget
.ng_GadgetText
= GetString (MSG_DRAWERSFIRST
);
391 NewGadget
.ng_GadgetID
= DIRSFIRST_GADID
;
392 dirsfirstgad
= gad
= CreateGadget (CHECKBOX_KIND
, gad
, &NewGadget
, GTCB_Scaled
, TRUE
,
393 GTCB_Checked
, flags
& RTPRF_DIRSFIRST
,
395 top
+= checkskip
+ spacing
;
397 NewGadget
.ng_TopEdge
= top
;
398 NewGadget
.ng_GadgetText
= GetString (MSG_DRAWERSMIXED
);
399 NewGadget
.ng_GadgetID
= DIRSMIXED_GADID
;
400 mixdirsgad
= gad
= CreateGadget (CHECKBOX_KIND
, gad
, &NewGadget
, GTCB_Scaled
, TRUE
,
401 GTCB_Checked
, flags
& RTPRF_DIRSMIXED
,
403 top
+= checkskip
+ spacing
;
405 NewGadget
.ng_TopEdge
= top
;
406 NewGadget
.ng_GadgetText
= GetString (MSG_LED
);
407 NewGadget
.ng_GadgetID
= NOLED_GADID
;
408 noledgad
= gad
= CreateGadget (CHECKBOX_KIND
, gad
, &NewGadget
, GTCB_Scaled
, TRUE
,
409 GTCB_Checked
, !(flags
& RTPRF_NOLED
),
411 top
+= checkskip
+ spacing
;
413 NewGadget
.ng_TopEdge
= top
;
414 NewGadget
.ng_GadgetText
= GetString (MSG_MMB_PARENT
);
415 NewGadget
.ng_GadgetID
= MMB_GADID
;
416 mmbgad
= gad
= CreateGadget (CHECKBOX_KIND
, gad
, &NewGadget
, GTCB_Scaled
, TRUE
,
417 GTCB_Checked
, flags
& RTPRF_MMBPARENT
,
419 top
+= checkskip
+ spacing
;
425 top
= offy
+ spacing
;
429 str
= GetString (MSG_REQUESTER
);
430 IntuiText
.IText
= str
;
431 len
= IntuiTextLength (&IntuiText
);
432 InitNewGadget (left
+ len
+ 8, top
, ArrayWidth (TypeLabels
) + 36, fontht
+ 6, str
, REQTYPE_GADID
);
433 NewGadget
.ng_Flags
= PLACETEXT_LEFT
|NG_HIGHLABEL
;
434 gad
= CreateGadget (CYCLE_KIND
, gad
, &NewGadget
, GTCY_Labels
, (IPTR
) TypeLabels
, TAG_DONE
);
435 top
+= fontht
+ 6 + spacing
;
436 winwidth
= NewGadget
.ng_LeftEdge
+ NewGadget
.ng_Width
;
443 DefSizeText
.FrontPen
= Pens
[HIGHLIGHTTEXTPEN
];
444 DefSizeText
.ITextFont
= font
;
445 DefSizeText
.TopEdge
= top
;
446 DefSizeText
.LeftEdge
= left
;
447 top
+= fontht
+ spacing
/ 2;
448 width
= IntuiTextLength (&DefSizeText
) + 20;
449 if (width
> winwidth
) winwidth
= width
;
452 top
+= fontht
+ 6 + spacing
;
454 IntuiText
.IText
= "000";
455 intgadwidth
= IntuiTextLength (&IntuiText
) + 12;
457 NrOfEntriesText
.FrontPen
= Pens
[HIGHLIGHTTEXTPEN
];
458 NrOfEntriesText
.ITextFont
= font
;
459 NrOfEntriesText
.TopEdge
= top
;
460 NrOfEntriesText
.LeftEdge
= left
;
461 top
+= fontht
+ spacing
/ 2;
462 width
= IntuiTextLength (&NrOfEntriesText
) + 20;
463 if (width
> winwidth
) winwidth
= width
;
465 str
= GetString (MSG_MIN
);
466 IntuiText
.IText
= str
;
467 len
= IntuiTextLength (&IntuiText
);
468 InitNewGadget (left
+ len
+ 8, top
, intgadwidth
, fontht
+ 6, str
, MINENTRIES_GADID
);
470 NewGadget
.ng_Flags
= NG_HIGHLABEL
| PLACETEXT_LEFT
;
472 NewGadget
.ng_Flags
= NG_HIGHLABEL
;
474 mingad
= gad
= CreateGadget (INTEGER_KIND
, gad
, &NewGadget
, GTIN_Number
, filereqdefs
->MinEntries
,
478 str
= GetString (MSG_MAX
);
479 IntuiText
.IText
= str
;
480 len
= IntuiTextLength (&IntuiText
);
481 NewGadget
.ng_LeftEdge
+= intgadwidth
+ 16 + len
+ 8;
482 NewGadget
.ng_GadgetText
= str
;
483 NewGadget
.ng_GadgetID
= MAXENTRIES_GADID
;
484 maxgad
= gad
= CreateGadget (INTEGER_KIND
, gad
, &NewGadget
, GTIN_Number
, filereqdefs
->MaxEntries
,
488 top
+= fontht
+ 6 + spacing
;
489 width
= NewGadget
.ng_LeftEdge
+ NewGadget
.ng_Width
+ 10;
490 if (width
> winwidth
) winwidth
= width
;
492 len
= ArrayWidth_Localize (PositionOffset
) + 8;
494 InitNewGadget (left
+ len
, top
, ArrayWidth (DefaultPosLabels
) + 36,
495 fontht
+ 6, GetString (MSG_POSITION
), POSITION_GADID
);
496 defposgad
= gad
= CreateGadget (CYCLE_KIND
, gad
, &NewGadget
, GTCY_Labels
, (IPTR
) DefaultPosLabels
,
497 GTCY_Active
, filereqdefs
->ReqPos
,
499 top
+= fontht
+ 6 + spacing
;
500 width
= NewGadget
.ng_LeftEdge
+ NewGadget
.ng_Width
+ 10;
501 if (width
> winwidth
) winwidth
= width
;
503 IntuiText
.IText
= "0000";
504 intgadwidth
= IntuiTextLength (&IntuiText
) + 12;
506 dis
= (filereqdefs
->ReqPos
<= REQPOS_CENTERSCR
);
508 InitNewGadget (left
+ len
, top
, intgadwidth
, fontht
+ 6, GetString (MSG_OFFSET
), OFFSETX_GADID
);
509 xoffgad
= gad
= CreateGadget (INTEGER_KIND
, gad
, &NewGadget
, GA_Disabled
, dis
,
510 GTIN_Number
, filereqdefs
->LeftOffset
,
513 NewGadget
.ng_LeftEdge
+= intgadwidth
;
514 NewGadget
.ng_GadgetText
= NULL
;
515 NewGadget
.ng_GadgetID
= OFFSETY_GADID
;
516 yoffgad
= gad
= CreateGadget (INTEGER_KIND
, gad
, &NewGadget
, GA_Disabled
, dis
,
517 GTIN_Number
, filereqdefs
->TopOffset
,
520 top
+= fontht
+ 6 + spacing
;
523 str
= GetString (MSG_TEST
);
524 IntuiText
.IText
= str
;
525 len
= IntuiTextLength (&IntuiText
);
526 NewGadget
.ng_LeftEdge
+= NewGadget
.ng_Width
+ 32;
527 NewGadget
.ng_Width
= len
+ 16;
528 NewGadget
.ng_GadgetText
= str
;
529 NewGadget
.ng_Flags
= 0;
530 NewGadget
.ng_GadgetID
= TEST_GADID
;
531 testgad
= gad
= CreateGadget (BUTTON_KIND
, gad
, &NewGadget
, TAG_END
);
532 ng
.ng_Flags
= NG_HIGHLABEL
;
535 width
= NewGadget
.ng_LeftEdge
+ NewGadget
.ng_Width
+ 10;
536 if (width
> winwidth
) winwidth
= width
;
538 BevelWidth
= winwidth
- BevelLeft
;
540 /* Prop gadget + Set gadget */
542 IntuiText
.IText
= "100%";
543 len
= IntuiTextLength (&IntuiText
) + 8;
545 str
= GetString (MSG_SET
);
546 IntuiText
.IText
= str
;
547 len2
= IntuiTextLength (&IntuiText
) + 16;
551 InitNewGadget (left
+ len
, proptop
, winwidth
- left
- 10 - len
- len2
,
552 fontht
+ 6, NULL
, DEFSIZE_GADID
);
553 sizegad
= gad
= CreateGadget (SLIDER_KIND
, gad
, &NewGadget
, GTSL_Min
, 25, GTSL_Max
, 100,
554 GTSL_Level
, filereqdefs
->Size
,
555 GTSL_MaxLevelLen
, 6, GTSL_LevelFormat
, (IPTR
) "%3ld%%",
556 PGA_Freedom
, LORIENT_HORIZ
, GA_RelVerify
, TRUE
,
559 InitNewGadget (NewGadget
.ng_LeftEdge
+ NewGadget
.ng_Width
, proptop
, len2
, fontht
+ 6, str
, SETSIZE_GADID
);
560 NewGadget
.ng_Flags
= 0;
561 setgad
= gad
= CreateGadget (BUTTON_KIND
, gad
, &NewGadget
, TAG_END
);
566 BevelHeight
= top
- BevelTop
+ 1;
571 /* Save, Use, Cancel */
573 top
= max (col1ht
, col2ht
) + spacing
;
574 len
= ArrayWidth_Localize (SaveUseCancel
) + 16;
575 if (len
< 87) len
= 87;
576 InitNewGadget (12, top
, len
, fontht
+ 6, GetString (MSG_SAVE
), SAVE_GADID
);
577 gad
= CreateGadget (BUTTON_KIND
, gad
, &NewGadget
, TAG_END
);
579 NewGadget
.ng_LeftEdge
= (winwidth
- len
) / 2;
580 NewGadget
.ng_GadgetText
= GetString (MSG_USE
);
581 NewGadget
.ng_GadgetID
= USE_GADID
;
582 gad
= CreateGadget (BUTTON_KIND
, gad
, &NewGadget
, TAG_END
);
584 NewGadget
.ng_LeftEdge
= winwidth
- 12 - len
;
585 NewGadget
.ng_GadgetText
= GetString (MSG_CANCEL
);
586 NewGadget
.ng_GadgetID
= CANCEL_GADID
;
587 gad
= CreateGadget (BUTTON_KIND
, gad
, &NewGadget
, TAG_END
);
589 top
+= fontht
+ 6 + spacing
;
591 if (!gad
) return (2);
593 if (winwidth
> scrwidth
|| (top
+ Screen
->WBorBottom
) > scrheight
)
596 if (font
->ta_YSize
> 8)
604 if (!( WindowPtr
= OpenWindowTags (NULL
,
606 WA_Top
, Screen
->BarHeight
+ 1,
608 WA_Height
, top
+ Screen
->WBorBottom
,
609 WA_DepthGadget
, FALSE
,
610 WA_Zoom
, (IPTR
) Zoom
,
611 WA_IDCMP
, CHECKBOXIDCMP
|BUTTONIDCMP
|SLIDERIDCMP
|INTEGERIDCMP
|CYCLEIDCMP
|IDCMP_CLOSEWINDOW
612 |IDCMP_VANILLAKEY
|IDCMP_MOUSEMOVE
|IDCMP_REFRESHWINDOW
|IDCMP_MENUPICK
,
613 WA_Flags
, WFLG_DRAGBAR
|WFLG_DEPTHGADGET
|WFLG_ACTIVATE
|WFLG_SIMPLE_REFRESH
|WFLG_CLOSEGADGET
,
614 WA_Gadgets
, (IPTR
) glist
,
615 WA_Title
, (IPTR
) GetString (MSG_WINDOW_TITLE
),
616 WA_PubScreen
, (IPTR
) Screen
,
617 WA_NewLookMenus
, TRUE
, TAG_DONE
)))
620 if (font
->ta_YSize
> 8)
628 SetMenuStrip ( WindowPtr
, Menus
);
629 GT_RefreshWindow ( WindowPtr
, NULL
);
635 void UpdatePrefsWindow (int onlydefs
)
637 struct ReqDefaults
*reqdefs
= &RTPrefs
.ReqDefaults
[ CurrentReq
];
640 if( CurrentReq
== RTPREF_OTHERREQ
|| CurrentReq
== RTPREF_PALETTEREQ
)
642 GT_SetGadgetAttrs (sizegad
, WindowPtr
, NULL
, GA_Disabled
, TRUE
, TAG_END
);
643 // GT_SetGadgetAttrs (setgad, WindowPtr, NULL, GA_Disabled, TRUE, TAG_END);
644 GT_SetGadgetAttrs (mingad
, WindowPtr
, NULL
, GA_Disabled
, TRUE
, TAG_END
);
645 GT_SetGadgetAttrs (maxgad
, WindowPtr
, NULL
, GA_Disabled
, TRUE
, TAG_END
);
649 GT_SetGadgetAttrs (sizegad
, WindowPtr
, NULL
, GA_Disabled
, FALSE
,
650 GTSL_Level
, reqdefs
->Size
,
652 // GT_SetGadgetAttrs (setgad, WindowPtr, NULL, GA_Disabled, FALSE,
654 GT_SetGadgetAttrs (mingad
, WindowPtr
, NULL
, GA_Disabled
, FALSE
,
655 GTIN_Number
, reqdefs
->MinEntries
,
657 GT_SetGadgetAttrs (maxgad
, WindowPtr
, NULL
, GA_Disabled
, FALSE
,
658 GTIN_Number
, reqdefs
->MaxEntries
,
661 GT_SetGadgetAttrs (defposgad
, WindowPtr
, NULL
, GTCY_Active
, reqdefs
->ReqPos
,
663 dis
= (reqdefs
->ReqPos
<= REQPOS_CENTERSCR
);
664 GT_SetGadgetAttrs (xoffgad
, WindowPtr
, NULL
, GA_Disabled
, dis
,
665 GTIN_Number
, reqdefs
->LeftOffset
,
667 GT_SetGadgetAttrs (yoffgad
, WindowPtr
, NULL
, GA_Disabled
, dis
,
668 GTIN_Number
, reqdefs
->TopOffset
,
673 GT_SetGadgetAttrs (popgad
, WindowPtr
, NULL
, GTCB_Checked
, !(RTPrefs
.Flags
& RTPRF_NOSCRTOFRONT
),
675 GT_SetGadgetAttrs (deffontgad
, WindowPtr
, NULL
, GTCB_Checked
, RTPrefs
.Flags
& RTPRF_DEFAULTFONT
,
677 GT_SetGadgetAttrs (dowheelgad
, WindowPtr
, NULL
, GTCB_Checked
, RTPrefs
.Flags
& RTPRF_DOWHEEL
,
679 GT_SetGadgetAttrs (fkeysgad
, WindowPtr
, NULL
, GTCB_Checked
, RTPrefs
.Flags
& RTPRF_FKEYS
,
681 GT_SetGadgetAttrs (immsortgad
, WindowPtr
, NULL
, GTCB_Checked
, RTPrefs
.Flags
& RTPRF_IMMSORT
,
683 GT_SetGadgetAttrs (dirsfirstgad
, WindowPtr
, NULL
, GTCB_Checked
, RTPrefs
.Flags
& RTPRF_DIRSFIRST
,
685 GT_SetGadgetAttrs (mixdirsgad
, WindowPtr
, NULL
, GTCB_Checked
, RTPrefs
.Flags
& RTPRF_DIRSMIXED
,
687 GT_SetGadgetAttrs (noledgad
, WindowPtr
, NULL
, GTCB_Checked
, !( RTPrefs
.Flags
& RTPRF_NOLED
),
690 /* AROS/AmigaOS bug fix: this "!" seems to be wrong */
691 GT_SetGadgetAttrs (mmbgad
, WindowPtr
, NULL
, GTCB_Checked
, ( RTPrefs
.Flags
& RTPRF_MMBPARENT
),
694 GT_SetGadgetAttrs (mmbgad
, WindowPtr
, NULL
, GTCB_Checked
, !( RTPrefs
.Flags
& RTPRF_MMBPARENT
),
701 void ClosePrefsWindow (void)
705 CloseWindow (WindowPtr
);
721 // GfxBase = (struct GfxBase *)OpenLibrary ("graphics.library", 37);
723 Pens
= DrawInfo
->dri_Pens
;
725 if( !OpenPrefsWindow() )
740 // CloseLibrary( GfxBase );
752 struct IntuiMessage im
, *imsg
;
754 signals
= Wait(1L << WindowPtr
->UserPort
->mp_SigBit
| SIGBREAKF_CTRL_C
);
756 if( signals
& (1L << WindowPtr
->UserPort
->mp_SigBit
) )
759 while( ( imsg
= ( struct IntuiMessage
* ) GT_GetIMsg( WindowPtr
->UserPort
) ) )
765 GT_ReplyIMsg( imsg
);
766 gad
= ( struct Gadget
* ) im
.IAddress
;
770 case IDCMP_REFRESHWINDOW
:
771 GT_BeginRefresh( WindowPtr
);
773 GT_EndRefresh( WindowPtr
, TRUE
);
777 run
= ProcessGadget( gad
->GadgetID
, im
.Code
);
783 while( run
&& ( code
!= MENUNULL
) )
785 run
= ProcessMenuItem( code
);
786 code
= ItemAddress( Menus
, code
)->NextSelect
;
791 case IDCMP_VANILLAKEY
:
794 case 27: /* User has pressed the escape key */
800 case IDCMP_CLOSEWINDOW
:
806 if( signals
& SIGBREAKF_CTRL_C
)