2 Copyright 1995-2011, The AROS Development Team. All rights reserved.
3 Copyright 2001-2003, The MorphOS Development Team. All Rights Reserved.
7 #include <proto/graphics.h>
8 #include <proto/intuition.h>
9 #include <proto/cybergraphics.h>
10 #include <proto/layers.h>
11 #include <proto/utility.h>
12 #include <graphics/gfxmacros.h>
13 #include <intuition/cghooks.h>
14 #include <intuition/intuition.h>
15 #include <intuition/imageclass.h>
16 #include <intuition/windecorclass.h>
17 #include <cybergraphx/cybergraphics.h>
18 #include <graphics/rpattr.h>
19 #include "intuition_intern.h"
20 #include "propgadgets.h"
22 #include "intuition_customize.h"
23 #include "intuition_customizesupport.h"
24 #include "morphos/proprender.h"
28 extern IPTR
HookEntry();
32 # include <aros/debug.h>
34 BOOL
isonborder(struct Gadget
*gadget
,struct Window
*window
);
36 static void RenderPropBackground(struct Gadget
*gad
, struct Window
*win
, struct DrawInfo
*dri
,
37 struct Rectangle
*rect
, struct Rectangle
*proprect
,
38 struct Rectangle
*knobrect
, struct PropInfo
*pi
,
39 struct RastPort
*rp
, BOOL onborder
,
40 struct IntuitionBase
*IntuitionBase
)
42 struct GfxBase
*GfxBase
= GetPrivIBase(IntuitionBase
)->GfxBase
;
43 struct Library
*UtilityBase
= GetPrivIBase(IntuitionBase
)->UtilityBase
;
47 struct wdpDrawBorderPropBack msg
;
49 msg
.MethodID
= WDM_DRAW_BORDERPROPBACK
;
52 msg
.wdp_TrueColor
= (((struct IntScreen
*)win
->WScreen
)->DInfo
.dri
.dri_Flags
& DRIF_DIRECTCOLOR
);
53 msg
.wdp_UserBuffer
= ((struct IntWindow
*)win
)->DecorUserBuffer
;
57 msg
.wdp_RenderRect
= rect
;
58 msg
.wdp_PropRect
= proprect
;
59 msg
.wdp_KnobRect
= knobrect
;
63 DoMethodA(((struct IntScreen
*)(win
->WScreen
))->WinDecorObj
, (Msg
)&msg
);
67 static CONST UWORD pattern
[] = {0x5555,0xAAAA};
68 struct Hook
*dhook
= NULL
;
70 if ((gad
->Flags
& GFLG_EXTENDED
) != 0)
72 if ((((struct ExtGadget
*) gad
)->MoreFlags
& GMORE_BOOPSIGADGET
) != 0)
74 GetAttr(PGA_DisplayHook
, (Object
*) gad
, (IPTR
*)&dhook
);
79 struct wdpDrawBorderPropBack msg
;
81 msg
.MethodID
= WDM_DRAW_BORDERPROPBACK
;
84 msg
.wdp_TrueColor
= (((struct IntScreen
*)win
->WScreen
)->DInfo
.dri
.dri_Flags
& DRIF_DIRECTCOLOR
);
87 msg
.wdp_RenderRect
= rect
;
88 msg
.wdp_PropRect
= proprect
;
89 msg
.wdp_KnobRect
= knobrect
;
93 CallHookPkt(dhook
, (Object
*) gad
, (Msg
)&msg
);
99 if (pi
->Flags
& PROPNEWLOOK
)
101 SetAfPt(rp
, pattern
, 1);
102 SetAPen(rp
, dri
->dri_Pens
[SHADOWPEN
]);
103 SetBPen(rp
, dri
->dri_Pens
[BACKGROUNDPEN
]);
105 RectFill(rp
, rect
->MinX
, rect
->MinY
, rect
->MaxX
, rect
->MaxY
);
106 SetAfPt(rp
, NULL
, 0);
110 SetAPen(rp
, dri
->dri_Pens
[BACKGROUNDPEN
]);
111 RectFill(rp
, rect
->MinX
, rect
->MinY
, rect
->MaxX
, rect
->MaxY
);
118 VOID
HandlePropSelectDown(struct Gadget
*gadget
, struct Window
*w
, struct Requester
*req
,
119 UWORD mouse_x
, UWORD mouse_y
, struct IntuitionBase
*IntuitionBase
)
125 pi
= (struct PropInfo
*)gadget
->SpecialInfo
;
130 CalcBBox (w
, req
, gadget
, &knob
);
132 /* This func gets mouse coords relative to gadget box */
134 mouse_x
+= knob
.Left
;
137 if (!CalcKnobSize (gadget
, &knob
))
140 GetPrivIBase(IntuitionBase
)->prop_clickoffset_x
= mouse_x
- knob
.Left
;
141 GetPrivIBase(IntuitionBase
)->prop_clickoffset_y
= mouse_y
- knob
.Top
;
146 if (pi
->Flags
& FREEHORIZ
)
148 if (mouse_x
< knob
.Left
)
150 if (dx
> pi
->HPotRes
)
155 else if (mouse_x
>= knob
.Left
+ knob
.Width
)
157 if (dx
< MAXPOT
- pi
->HPotRes
)
164 if (pi
->Flags
& FREEVERT
)
166 if (mouse_y
< knob
.Top
)
168 if (dy
> pi
->VPotRes
)
173 else if (mouse_y
>= knob
.Top
+ knob
.Height
)
175 if (dy
< MAXPOT
- pi
->VPotRes
)
184 /* jDc: when clicked on frame, prop gadget also gets activated! */
185 if (!(flags
& PROPBORDERLESS
))
187 if (pi
->Flags
& FREEVERT
)
197 if (mouse_x
>= knob
.Left
&&
198 mouse_y
>= knob
.Top
&&
199 mouse_x
< knob
.Left
+ knob
.Width
&&
200 mouse_y
< knob
.Top
+ knob
.Height
)
209 gadget
->Flags
|= GFLG_SELECTED
;
211 D(bug("New HPot: %d, new VPot: %d\n", dx
, dy
));
213 NewModifyProp(gadget
, w
, req
, flags
, dx
, dy
, pi
->HorizBody
, pi
->VertBody
, 1);
218 VOID
HandlePropSelectUp(struct Gadget
*gadget
, struct Window
*w
,
219 struct Requester
*req
, struct IntuitionBase
*IntuitionBase
)
221 struct PropInfo
* pi
;
223 pi
= (struct PropInfo
*)gadget
->SpecialInfo
;
225 gadget
->Flags
&= ~GFLG_SELECTED
;
226 if (pi
) pi
->Flags
&= ~KNOBHIT
;
228 if (pi
) RefreshPropGadget (gadget
, w
, req
, IntuitionBase
);
231 NewModifyProp (gadget
234 , pi->Flags &= ~KNOBHIT
245 VOID
HandlePropMouseMove(struct Gadget
*gadget
, struct Window
*w
,struct Requester
*req
,
246 LONG dx
, LONG dy
, struct IntuitionBase
*IntuitionBase
)
251 pi
= (struct PropInfo
*)gadget
->SpecialInfo
;
253 /* Has propinfo and the mouse was over the knob */
254 if (pi
&& (pi
->Flags
& KNOBHIT
))
256 CalcBBox (w
, req
, gadget
, &knob
);
258 if (!CalcKnobSize (gadget
, &knob
))
261 /* Move the knob the same amount, ie.
262 knob.Left += dx; knob.Top += dy;
264 knob.Left = knob.Left
265 + (pi->CWidth - knob.Width)
266 * pi->HorizPot / MAXPOT;
268 ie. dx = (pi->CWidth - knob.Width)
269 * pi->HorizPot / MAXPOT;
273 pi->HorizPot = (dx * MAXPOT) /
274 (pi->CWidth - knob.Width);
277 /* stegerg: dx and dy are not delta values
278 anymore but relative to gadget
281 dx
= dx
- GetPrivIBase(IntuitionBase
)->prop_clickoffset_x
;
282 dy
= dy
- GetPrivIBase(IntuitionBase
)->prop_clickoffset_y
;
284 if (pi
->Flags
& FREEHORIZ
285 && pi
->CWidth
!= knob
.Width
)
288 dx
= (dx
* MAXPOT
) / (pi
->CWidth
- knob
.Width
);
293 else if (dx
> MAXPOT
)
300 if (pi
->Flags
& FREEVERT
301 && pi
->CHeight
!= knob
.Height
)
303 dy
= (dy
* MAXPOT
) / (pi
->CHeight
- knob
.Height
);
309 else if (dy
> MAXPOT
)
316 if ( ((pi
->Flags
& FREEHORIZ
) && (dx
!= pi
->HorizPot
)) ||
317 ((pi
->Flags
& FREEVERT
) && (dy
!= pi
->VertPot
)) )
320 NewModifyProp (gadget
, w
, req
, pi
->Flags
, dx
, dy
, pi
->HorizBody
, pi
->VertBody
, 1);
323 } /* Has PropInfo and Mouse is over knob */
328 int CalcKnobSize (struct Gadget
* propGadget
, struct BBox
* knobbox
)
333 pi
= (struct PropInfo
*)propGadget
->SpecialInfo
;
335 //dprintf("CalcKnobSize(%lx,%d,%d,%d,%d)\n", propGadget,
336 // propGadget->LeftEdge, propGadget->TopEdge, propGadget->Width, propGadget->Height);
337 //dprintf("knob(%d,%d,%d,%d)\n", knobbox->Left, knobbox->Top, knobbox->Width, knobbox->Height);
339 if (pi
->Flags
& PROPBORDERLESS
)
350 knobbox
->Width
-= x
* 2;
351 knobbox
->Height
-= y
* 2;
355 //dprintf("knob(%d,%d,%d,%d)\n", knobbox->Left, knobbox->Top, knobbox->Width, knobbox->Height);
357 pi
->CWidth
= knobbox
->Width
;
358 pi
->CHeight
= knobbox
->Height
;
360 if ((!(pi
->Flags
& AUTOKNOB
)) && propGadget
->GadgetRender
)
362 struct Image
*im
= propGadget
->GadgetRender
;
364 knobbox
->Width
= im
->Width
;
365 knobbox
->Height
= im
->Height
;
368 if (pi
->Flags
& FREEHORIZ
)
370 if (pi
->Flags
& AUTOKNOB
)
372 knobbox
->Width
= pi
->CWidth
* pi
->HorizBody
/ MAXBODY
;
373 if (knobbox
->Width
< KNOBHMIN
) knobbox
->Width
= KNOBHMIN
;
376 knobbox
->Left
= knobbox
->Left
+ (pi
->CWidth
- knobbox
->Width
)
377 * pi
->HorizPot
/ MAXPOT
;
381 if (pi
->HorizBody
< MAXBODY
/2)
382 pi
->HPotRes
= MAXPOT
* 32768 / ((MAXBODY
* 32768 / pi
->HorizBody
) - 32768);
384 pi
->HPotRes
= MAXPOT
;
390 if (pi
->Flags
& FREEVERT
)
392 if (pi
->Flags
& AUTOKNOB
)
394 knobbox
->Height
= pi
->CHeight
* pi
->VertBody
/ MAXBODY
;
395 if (knobbox
->Height
< KNOBVMIN
) knobbox
->Height
= KNOBVMIN
;
398 knobbox
->Top
= knobbox
->Top
+ (pi
->CHeight
- knobbox
->Height
)
399 * pi
->VertPot
/ MAXPOT
;
403 if (pi
->VertBody
< MAXBODY
/2)
404 pi
->VPotRes
= MAXPOT
* 32768 / ((MAXBODY
* 32768 / pi
->VertBody
) - 32768);
406 pi
->VPotRes
= MAXPOT
;
411 //dprintf("knob(%d,%d,%d,%d)\n", knobbox->Left, knobbox->Top, knobbox->Width, knobbox->Height);
417 void RefreshPropGadget (struct Gadget
* gadget
, struct Window
* window
,
418 struct Requester
* req
, struct IntuitionBase
* IntuitionBase
)
420 struct GfxBase
*GfxBase
= GetPrivIBase(IntuitionBase
)->GfxBase
;
422 struct DrawInfo
*dri
;
423 struct GadgetInfo gi
;
424 struct RastPort
*rp
= 0;
425 struct BBox bbox
, kbox
;
428 D(bug("RefreshPropGadget(gad=%p, win=%s, req=%p)\n", gadget
, window
->Title
, req
));
430 onborder
= (IS_BORDER_GADGET(gadget
) || isonborder(gadget
,window
));
432 if ((dri
= GetScreenDrawInfo(window
->WScreen
)))
435 SetupGInfo(&gi
, window
, req
, gadget
, IntuitionBase
);
437 if ((rp
= ObtainGIRPort(&gi
)))
441 CalcBBox (window
, req
, gadget
, &bbox
);
444 if (bbox
.Width
<= 0 || bbox
.Height
<= 0)
447 if (CalcKnobSize (gadget
, &kbox
))
449 pi
= (struct PropInfo
*)gadget
->SpecialInfo
;
456 if (!(pi
->Flags
& PROPBORDERLESS
))
458 SetAPen(rp
,dri
->dri_Pens
[SHADOWPEN
]);
459 drawrect(rp
,bbox
.Left
,
461 bbox
.Left
+ bbox
.Width
- 1,
462 bbox
.Top
+ bbox
.Height
- 1,
465 bbox
.Left
++; bbox
.Top
++;
466 bbox
.Width
-= 2; bbox
.Height
-= 2;
469 RefreshPropGadgetKnob (gadget
, &bbox
, &kbox
, window
, req
, IntuitionBase
);
474 pi
= (struct PropInfo
*)gadget
->SpecialInfo
;
481 if (!(pi
->Flags
& PROPBORDERLESS
))
483 SetAPen(rp
,dri
->dri_Pens
[SHADOWPEN
]);
484 drawrect(rp
,bbox
.Left
,
486 bbox
.Left
+ bbox
.Width
- 1,
487 bbox
.Top
+ bbox
.Height
- 1,
490 bbox
.Left
++; bbox
.Top
++;
491 bbox
.Width
-= 2; bbox
.Height
-= 2;
496 struct Rectangle tmprect
;
498 tmprect
.MinX
= bbox
.Left
;
499 tmprect
.MaxX
= bbox
.Left
+ bbox
.Width
- 1;
500 tmprect
.MinY
= bbox
.Top
;
501 tmprect
.MaxY
= bbox
.Top
+ bbox
.Height
- 1;
503 RenderPropBackground(gadget
, window
, dri
, &tmprect
, &tmprect
, NULL
,
504 pi
, rp
, onborder
, IntuitionBase
);
510 } /* if ((rp = ObtainGIRPort(&gi))) */
512 if (rp
&& gadget
->Flags
& GFLG_DISABLED
)
514 CalcBBox (window
, req
, gadget
, &bbox
);
516 RenderDisabledPattern(rp
, (struct DrawInfo
*)dri
, bbox
.Left
,
518 bbox
.Left
+ bbox
.Width
- 1,
519 bbox
.Top
+ bbox
.Height
- 1,
523 if (rp
) ReleaseGIRPort(rp
);
525 FreeScreenDrawInfo(window
->WScreen
, (struct DrawInfo
*)dri
);
527 } /* if ((dri = GetScreenDrawInfo(window->WScreen))) */
529 ReturnVoid("RefreshPropGadget");
530 } /* RefreshPropGadget */
533 void RefreshPropGadgetKnob (struct Gadget
* gadget
, struct BBox
* clear
,
534 struct BBox
* knob
, struct Window
* window
, struct Requester
* req
,
535 struct IntuitionBase
* IntuitionBase
)
537 struct GfxBase
*GfxBase
= GetPrivIBase(IntuitionBase
)->GfxBase
;
538 struct Library
*UtilityBase
= GetPrivIBase(IntuitionBase
)->UtilityBase
;
539 struct DrawInfo
*dri
;
542 struct GadgetInfo gi
;
546 D(bug("RefresPropGadgetKnob(flags=%d, clear=%p, knob = %p, win=%s)\n",
547 flags
, clear
, knob
, window
->Title
));
549 if ((knob
->Width
< 1) || (knob
->Height
< 1)) return;
551 onborder
= (IS_BORDER_GADGET(gadget
) || isonborder(gadget
,window
));
553 pi
= (struct PropInfo
*)gadget
->SpecialInfo
;
556 if ((dri
= GetScreenDrawInfo(window
->WScreen
)))
558 SetupGInfo(&gi
, window
, req
, gadget
, IntuitionBase
);
560 if ((rp
= ObtainGIRPort(&gi
)))
563 struct Rectangle brect
;
564 struct Rectangle krect
;
566 CalcBBox (window
, req
, gadget
, &bbox
);
568 if ((bbox
.Width
< 1) || (bbox
.Height
< 1))
571 FreeScreenDrawInfo(window
->WScreen
, (struct DrawInfo
*)dri
);
576 brect
.MinX
= bbox
.Left
;
577 brect
.MinY
= bbox
.Top
;
578 brect
.MaxX
= bbox
.Left
+ bbox
.Width
- 1;
579 brect
.MaxY
= bbox
.Top
+ bbox
.Height
- 1;
581 krect
.MinX
= knob
->Left
;
582 krect
.MinY
= knob
->Top
;
583 krect
.MaxX
= knob
->Left
+ knob
->Width
- 1;
584 krect
.MaxY
= knob
->Top
+ knob
->Height
- 1;
590 struct Rectangle a
, b
, clearrects
[4];
593 #if (!(PROP_RENDER_OPTIMIZATION))
594 if (!(flags
& PROPBORDERLESS
))
596 clear
->Left
++; clear
->Top
++;
597 clear
->Width
-= 2; clear
->Height
-= 2;
602 D(bug("RefresPropGadgetKnob: clear Left %d Top %d Width %d Height %d\n",
608 D(bug("RefresPropGadgetKnob: knob Left %d Top %d Width %d Height %d\n",
615 a
.MinX
= clear
->Left
;
617 a
.MaxX
= clear
->Left
+ clear
->Width
- 1;
618 a
.MaxY
= clear
->Top
+ clear
->Height
- 1;
622 b
.MaxX
= knob
->Left
+ knob
->Width
- 1;
623 b
.MaxY
= knob
->Top
+ knob
->Height
- 1;
626 D(bug("RefresPropGadgetKnob: a MinX %d MinY %d MaxX %d MaxY %d\n",
632 D(bug("RefresPropGadgetKnob: a MinX %d MinY %d MaxX %d MaxY %d\n",
639 nrects
= SubtractRectFromRect(&a
, &b
, clearrects
);
641 D(bug("RefresPropGadgetKnob: nrects %d\n",
644 D(bug("RefresPropGadgetKnob: clearrects[0] MinX %d MinY %d MaxX %d MaxY %d\n",
648 clearrects
[0].MaxY
));
650 D(bug("RefresPropGadgetKnob: clearrects[1] MinX %d MinY %d MaxX %d MaxY %d\n",
654 clearrects
[1].MaxY
));
656 D(bug("RefresPropGadgetKnob: clearrects[2] MinX %d MinY %d MaxX %d MaxY %d\n",
660 clearrects
[2].MaxY
));
662 D(bug("RefresPropGadgetKnob: clearrects[3] MinX %d MinY %d MaxX %d MaxY %d\n",
666 clearrects
[3].MaxY
));
669 /*kprintf("\n=== oldknob = %d,%d-%d,%d newknob = %d,%d-%d,%d\n",
679 for(i
= 0; i
< nrects
; i
++)
681 RenderPropBackground(gadget
, window
, dri
, &clearrects
[i
], &brect
, &krect
,
682 pi
, rp
, onborder
, IntuitionBase
);
687 if (flags
& AUTOKNOB
)
689 int hit
= ((flags
& KNOBHIT
) != 0);
691 D(bug("RefresPropGadgetKnob: draw knob Left %d Top %d Width %d Height %d\n",
699 struct wdpDrawBorderPropKnob msg
;
700 struct Rectangle knobrect
;
701 knobrect
.MinX
= knob
->Left
;
702 knobrect
.MinY
= knob
->Top
;
703 knobrect
.MaxX
= knob
->Left
+ knob
->Width
- 1;
704 knobrect
.MaxY
= knob
->Top
+ knob
->Height
- 1;
706 msg
.MethodID
= WDM_DRAW_BORDERPROPKNOB
;
707 msg
.wdp_TrueColor
= (((struct IntScreen
*)window
->WScreen
)->DInfo
.dri
.dri_Flags
& DRIF_DIRECTCOLOR
);
708 msg
.wdp_UserBuffer
= ((struct IntWindow
*)window
)->DecorUserBuffer
;
709 msg
.wdp_Window
= window
;
711 msg
.wdp_Gadget
= gadget
;
712 msg
.wdp_RenderRect
= &knobrect
;
713 msg
.wdp_PropRect
= &brect
;
714 msg
.wdp_Flags
= hit
? WDF_DBPK_HIT
: 0;
717 DoMethodA(((struct IntScreen
*)(window
->WScreen
))->WinDecorObj
, (Msg
)&msg
);
719 } /* gadget inside window border */
722 struct Hook
*dhook
= NULL
;
724 if ((gadget
->Flags
& GFLG_EXTENDED
) != 0)
726 if ((((struct ExtGadget
*) gadget
)->MoreFlags
& GMORE_BOOPSIGADGET
) != 0)
728 GetAttr(PGA_DisplayHook
, (Object
*) gadget
, (IPTR
*)&dhook
);
732 struct wdpDrawBorderPropKnob msg
;
733 struct Rectangle knobrect
;
734 knobrect
.MinX
= knob
->Left
;
735 knobrect
.MinY
= knob
->Top
;
736 knobrect
.MaxX
= knob
->Left
+ knob
->Width
- 1;
737 knobrect
.MaxY
= knob
->Top
+ knob
->Height
- 1;
738 msg
.MethodID
= WDM_DRAW_BORDERPROPKNOB
;
739 msg
.wdp_TrueColor
= (((struct IntScreen
*)window
->WScreen
)->DInfo
.dri
.dri_Flags
& DRIF_DIRECTCOLOR
);
740 msg
.wdp_Window
= window
;
742 msg
.wdp_Gadget
= gadget
;
743 msg
.wdp_RenderRect
= &knobrect
;
744 msg
.wdp_PropRect
= &brect
;
745 msg
.wdp_Flags
= hit
? WDF_DBPK_HIT
: 0;
748 CallHookPkt(dhook
, (Object
*) gadget
, (Msg
)&msg
);
756 stdlook
= RenderPropKnob(window
,dri
,rp
,pi
,knob
,hit
,IntuitionBase
);
761 if (flags
& PROPBORDERLESS
)
763 SetAPen(rp
,dri
->dri_Pens
[SHADOWPEN
]);
765 /* paint black right and bottom edges */
767 RectFill(rp
,knob
->Left
+ knob
->Width
- 1,
769 knob
->Left
+ knob
->Width
- 1,
770 knob
->Top
+ knob
->Height
- 1);
772 RectFill(rp
,knob
->Left
,
773 knob
->Top
+ knob
->Height
- 1,
774 knob
->Left
+ knob
->Width
- 2,
775 knob
->Top
+ knob
->Height
- 1);
780 } /* propborderless */
783 SetAPen(rp
,dri
->dri_Pens
[SHADOWPEN
]);
785 if (flags
& FREEHORIZ
)
787 /* black line at the left and at the right */
789 RectFill(rp
,knob
->Left
,
792 knob
->Top
+ knob
->Height
- 1);
794 RectFill(rp
,knob
->Left
+ knob
->Width
- 1,
796 knob
->Left
+ knob
->Width
- 1,
797 knob
->Top
+ knob
->Height
- 1);
802 if (flags
& FREEVERT
)
804 /* black line at the top and at the bottom */
806 RectFill(rp
,knob
->Left
,
808 knob
->Left
+ knob
->Width
- 1,
811 RectFill(rp
,knob
->Left
,
812 knob
->Top
+ knob
->Height
- 1,
813 knob
->Left
+ knob
->Width
- 1,
814 knob
->Top
+ knob
->Height
- 1);
820 } /* not propborderless */
823 SetAPen(rp
, dri
->dri_Pens
[SHINEPEN
]);
826 RectFill(rp
,knob
->Left
,
828 knob
->Left
+ knob
->Width
- 1,
829 knob
->Top
+ knob
->Height
- 1);
831 } /* gadget has no display (render) hook */
832 } /* gadget not inside window border */
834 } /* if (flags & AUTOKNOB) */
837 struct Image
*image
= (struct Image
*)gadget
->GadgetRender
;
840 if (knob
->Top
+ image
->Height
<= bbox
.Top
+ bbox
.Height
&&
841 knob
->Left
+ image
->Width
<= bbox
.Left
+ bbox
.Width
)
845 image
->LeftEdge
= knob
->Left
- bbox
.Left
;
846 image
->TopEdge
= knob
->Top
- bbox
.Top
;
847 // image->Width = knob->Width;
848 // image->Height = knob->Height;
855 (struct DrawInfo
*)dri
);
865 (struct DrawInfo
*)dri
);
870 if (gadget
->Flags
& GFLG_DISABLED
)
872 RenderDisabledPattern(rp
, (struct DrawInfo
*)dri
,
873 brect
.MinX
, brect
.MinY
,
874 brect
.MaxX
, brect
.MaxY
, IntuitionBase
);
879 } /* if ((rp = ObtainGIRPort(&gi))) */
881 FreeScreenDrawInfo(window
->WScreen
, (struct DrawInfo
*)dri
);
883 } /* if ((dri = GetScreenDrawInfo(window->WScreen))) */
885 ReturnVoid("RefreshPropGadgetKnob");
887 } /* RefreshPropGadgetKnob */
889 BOOL
isonborder(struct Gadget
*gadget
, struct Window
*window
)
891 if ((window
->BorderBottom
> 2) && (gadget
->Flags
& GFLG_RELBOTTOM
))
892 if (window
->Height
+ gadget
->TopEdge
>= window
->Height
- window
->BorderBottom
) return TRUE
;
894 if ((window
->BorderRight
> 2) && (gadget
->Flags
& GFLG_RELRIGHT
))
895 if (window
->Width
+ gadget
->LeftEdge
>= window
->Width
- window
->BorderRight
) return TRUE
;