3 // ©1996-2000 Henrik Isaksson
5 // Graphic rendering routines
11 // Generic PM_Window graphics
14 void PM_DrawBg(struct PM_Window
*pw
, int x
, int y
, int xb
, int yb
)
19 WritePixelArray(pw
->bg
.BgArray
, x
, y
,
20 pw
->Width
*3, pw
->RPort
, xa
, ya
,
21 xb
-xa
, yb
-ya
, RECTFMT_RGB
);
24 SetAPen(pw
->RPort
, BGPEN(pw
->p
));
25 SetDrMd(pw
->RPort
, JAM1
);
26 RectFill(pw
->RPort
, xa
, ya
, xb
, yb
);
30 void PM_RectFill(struct PM_Window
*pw
, int xa
, int ya
, int xb
, int yb
)
32 SetDrMd(pw
->RPort
, JAM1
);
33 RectFill(pw
->RPort
, xa
, ya
, xb
, yb
);
36 void PM_Move(struct PM_Window
*pw
, int x
, int y
)
38 Move(pw
->RPort
, x
, y
);
41 void PM_Pixel(struct PM_Window
*pw
, int x
, int y
)
43 WritePixel(pw
->RPort
, x
, y
);
46 void PM_Draw(struct PM_Window
*pw
, int x
, int y
)
48 Draw(pw
->RPort
, x
, y
);
51 void PM_DrawImage(struct PM_Window
*pw
, struct Image
*img
, int x
, int y
, struct DrawInfo
*dri
, ULONG state
)
53 DrawImageState(pw
->RPort
, img
, x
, y
, state
, dri
);
60 void PM_Ghost(struct PM_Window
*w
, int x
, int y
, int xb
, int yb
, int pen
)
62 static UWORD ghostpat
[] = { 0x2222, 0x8888 };
64 SetAPen(w
->RPort
, pen
);
65 SetAfPt(w
->RPort
, ghostpat
, 1);
66 PM_RectFill(w
, x
, y
, xb
, yb
);
67 SetAfPt(w
->RPort
, NULL
, 0);
74 void ColourBox(struct PM_Window
*w
, int xa
, int ya
, int xb
, int yb
, int pen
, int shine
, int shade
, BOOL selected
)
77 PM_DrawBox(w
, xa
, ya
, xb
, yb
, shade
, shine
);
79 PM_DrawBox(w
, xa
, ya
, xb
, yb
, shine
, shade
);
82 SetAPen(w
->RPort
, pen
);
83 PM_RectFill(w
, xa
+1, ya
+1, xb
-1, yb
-1);
87 // This is used by the other functions.
90 void PM_DI_SetTextPen(struct PM_Window
*a
, struct PopupMenu
*pm
)
92 SetAPen(a
->RPort
, TEXT(a
->p
));
93 if(pm
->Flags
&NPM_FILLTEXT
) SetAPen(a
->RPort
, FILL(a
->p
));
94 if(pm
->Flags
&NPM_SHADOWTEXT
) SetAPen(a
->RPort
, SHADOW(a
->p
));
95 if(pm
->Flags
&NPM_SHINETEXT
) SetAPen(a
->RPort
, SHINE(a
->p
));
96 if(pm
->Flags
&NPM_HILITETEXT
) SetAPen(a
->RPort
, HILITE(a
->p
));
97 if(pm
->Flags
&NPM_CUSTOMPEN
) SetAPen(a
->RPort
, pm
->TextPen
);
100 ULONG
PM_RenderCheckMark(struct PM_Window
*a
, struct PopupMenu
*pm
, BOOL Selected
)
104 if(pm
->Flags
&NPM_CHECKIT
) { // Should this item have a checkmark?
106 if(pm
->Flags
&NPM_CHECKED
) {
107 xoff
=PM_Image_Draw(a
,
108 pm
->Exclude
?PMIMG_EXCLUDE
:PMIMG_CHECKMARK
,
109 pm
->Left
+PM_Prefs
->pmp_XSpace
+1,
111 Selected
?IDS_SELECTED
:IDS_INACTIVESELECTED
,
112 pm
) + PM_Prefs
->pmp_Intermediate
;
115 xoff=PM_Image_Draw(a,
116 pm->Exclude?PMIMG_EXCLUDE:PMIMG_CHECKMARK,
117 pm->Left+PM_Prefs->pmp_XSpace+1,
119 Selected?IDS_NORMAL:IDS_INACTIVENORMAL,
122 xoff
= PM_Image_Width(a
->p
, pm
->Exclude
?PMIMG_EXCLUDE
:PMIMG_CHECKMARK
, pm
) + PM_Prefs
->pmp_Intermediate
;
127 return xoff
+PM_Prefs
->pmp_XSpace
;
130 int PM_NewDrawItem(struct PM_Window
*a
, struct PopupMenu
*pm
, BOOL Selected
, BOOL Disabled
)
133 STRPTR pmtitle
=pm
->Title
;
135 if(pm
->Flags
&NPM_HIDDEN
) return 0;
137 if(GET_TXTMODE(pm
)==NPX_TXTLOCALE
)
138 pmtitle
=(STRPTR
)CallHookA(a
->p
->LocaleHook
, (Object
*)pm
, &pm
->TitleID
);
141 SetAPen(a
->RPort
, FILL(a
->p
));
142 PM_RectFill(a
, pm
->Left
, pm
->Top
, pm
->Left
+pm
->Width
, pm
->Top
+pm
->Height
);
144 // --- Test to see how it looks... --- //
145 //PM_DrawBg(a, pm->Left, pm->Top, pm->Left+pm->Width, pm->Top+pm->Height);
146 //PM_DrawShadow(a, pm->Left, pm->Top, pm->Left+pm->Width, pm->Top+pm->Height);
150 PM_DrawBg(a
, pm
->Left
, pm
->Top
, pm
->Left
+pm
->Width
, pm
->Top
+pm
->Height
);
153 if(pm
->Flags
&NPM_GROUP
) {
154 struct PopupMenu
*pmp
=pm
->Sub
;
157 PM_NewDrawItem(a
, pmp
, Selected
, Disabled
);
164 if(pm
->Flags
&NPM_HBAR_BIT
) {
165 PM_ShortSeparator(a
, pm
);
167 } else if(pm
->Flags
&NPM_WIDE_BAR_BIT
) {
168 PM_WideSeparator(a
, pm
);
172 if(!Selected
) { // Use RastPort Pen
173 PM_DI_SetTextPen(a
, pm
);
176 /* Text style and font */
178 SetFont(a
->RPort
, a
->p
->MenuFont
);
179 SetDrMd(a
->RPort
, JAM1
);
183 if(pm
->Flags
&NPM_UNDERLINEDTEXT
) style
|=FSF_UNDERLINED
;
184 if(pm
->Flags
&NPM_BOLDTEXT
) style
|=FSF_BOLD
;
185 if(pm
->Flags
&NPM_ITALICTEXT
) style
|=FSF_ITALIC
;
187 SetSoftStyle(a
->RPort
, style
, ~0);
189 xoff
=PM_RenderCheckMark(a
, pm
, Selected
);
191 if(pm
->Flags
&NPM_COLOURBOX
) {
192 if(pm
->Flags
&NPM_CHECKIT
) {
194 int x1
=(a
->Width
-3*a
->RPort
->Font
->tf_XSize
-PM_Prefs
->pmp_XSpace
-a
->p
->BorderWidth
)-a
->RPort
->Font
->tf_XSize
;
196 x1
-=a
->RPort
->Font
->tf_XSize
*3+PM_Prefs
->pmp_Intermediate
;
198 ColourBox(a
, x1
, pm
->Top
+PM_Prefs
->pmp_YSpace
+1, x1
+3*a
->RPort
->Font
->tf_XSize
, pm
->Top
+pm
->Height
-PM_Prefs
->pmp_YSpace
-1, pm
->CBox
, SHINE(a
->p
), SHADOW(a
->p
), Selected
);
200 int x1
= (pm
->Width
+ pm
->Left
- 3*a
->RPort
->Font
->tf_XSize
- PM_Prefs
->pmp_XSpace
- a
->p
->BorderWidth
);
201 ColourBox(a
, x1
, pm
->Top
+ PM_Prefs
->pmp_YSpace
+ 1,
202 x1
+ 3*a
->RPort
->Font
->tf_XSize
, pm
->Top
+ pm
->Height
- PM_Prefs
->pmp_YSpace
- 1,
203 pm
->CBox
, SHINE(a
->p
), SHADOW(a
->p
), Selected
);
206 ColourBox(a
, pm
->Left
+PM_Prefs
->pmp_XSpace
, pm
->Top
+PM_Prefs
->pmp_YSpace
+1, pm
->Left
+3*a
->RPort
->Font
->tf_XSize
, pm
->Top
+pm
->Height
-PM_Prefs
->pmp_YSpace
-1, pm
->CBox
, SHINE(a
->p
), SHADOW(a
->p
), Selected
);
207 xoff
+=PM_Prefs
->pmp_XSpace
+3*a
->RPort
->Font
->tf_XSize
;
211 if(!a
->p
->PullDown
) {
215 -PM_Prefs
->pmp_XSpace
,
217 Selected
?IDS_NORMAL
:IDS_INACTIVENORMAL
,
223 if(pm
->Flags
&NPM_ISIMAGE
) {
225 if(pm
->Flags
&NPM_CENTERED
) {
226 PM_DrawImage(a
, pm
->Images
[1],
227 pm
->Left
+PM_Prefs
->pmp_XSpace
+ (pm
->Width
/2-pm
->Images
[1]->Width
/2)>xoff
?pm
->Width
/2-pm
->Images
[1]->Width
/2:xoff
,
228 YPosImage_(a
, pm
, pm
->Images
[1]), a
->p
->DrawInfo
, IDS_SELECTED
);
230 PM_DrawImage(a
, pm
->Images
[1], pm
->Left
+PM_Prefs
->pmp_XSpace
+xoff
+a
->IconColumn
, YPosImage_(a
, pm
, pm
->Images
[1]), a
->p
->DrawInfo
, IDS_SELECTED
);
236 ixoff
=a
->IconColumn
/2-pm
->Images
[1]->Width
/2;
237 PM_DrawImage(a
, pm
->Images
[1], pm
->Left
+PM_Prefs
->pmp_XSpace
+ixoff
, YPosImage_(a
, pm
, pm
->Images
[1]), a
->p
->DrawInfo
, IDS_SELECTED
);
241 if(pm
->Flags
&NPM_ISIMAGE
) {
243 if(pm
->Flags
&NPM_CENTERED
) {
244 PM_DrawImage(a
, pm
->Images
[0],
245 pm
->Left
+PM_Prefs
->pmp_XSpace
+ (pm
->Width
/2-pm
->Images
[0]->Width
/2)>xoff
?pm
->Width
/2-pm
->Images
[0]->Width
/2:xoff
,
246 YPosImage_(a
, pm
, pm
->Images
[0]), a
->p
->DrawInfo
, IDS_SELECTED
);
248 PM_DrawImage(a
, pm
->Images
[0], pm
->Left
+PM_Prefs
->pmp_XSpace
+xoff
+a
->IconColumn
, YPosImage_(a
, pm
, pm
->Images
[0]), a
->p
->DrawInfo
, IDS_NORMAL
);
254 ixoff
=a
->IconColumn
/2-pm
->Images
[0]->Width
/2;
255 PM_DrawImage(a
, pm
->Images
[0], pm
->Left
+PM_Prefs
->pmp_XSpace
+ixoff
, YPosImage_(a
, pm
, pm
->Images
[0]), a
->p
->DrawInfo
, IDS_NORMAL
);
261 xoff
+=a
->IconColumn
+PM_Prefs
->pmp_Intermediate
;
264 if(pm
->Flags
&NPM_CENTERED
) {
267 tw
=TextLength(a
->RPort
,pmtitle
,strlen(pmtitle
));
268 offs
=pm
->Width
/2-tw
/2;
270 if(xoff
<offs
) xoff
=offs
;
273 if((pm
->Flags
&NPM_DISABLED
|| Disabled
) && !PM_Prefs
->pmp_SeparatorBar
) {
274 SetAPen(a
->RPort
, BGSHINE(a
->p
));
275 PM_Move(a
, pm
->Left
+xoff
+1, YPosText(a
, pm
)+1);
276 if(pmtitle
) Text(a
->RPort
, pmtitle
, strlen(pmtitle
));
277 } else if(pm
->Flags
&NPM_SHADOWED
) {
278 SetAPen(a
->RPort
, TEXTSHADOW(a
->p
));
279 PM_Move(a
, pm
->Left
+xoff
+1, YPosText(a
, pm
)+1);
280 if(pmtitle
) Text(a
->RPort
, pmtitle
, strlen(pmtitle
));
281 } else if(pm
->Flags
&NPM_OUTLINED
) {
283 SetAPen(a
->RPort
, TEXTOUTLINE(a
->p
));
284 PM_Move(a
, pm
->Left
+xoff
-1, YPosText(a
, pm
)-1);
285 Text(a
->RPort
, pmtitle
, strlen(pmtitle
));
286 PM_Move(a
, pm
->Left
+xoff
+1, YPosText(a
, pm
)+1);
287 Text(a
->RPort
, pmtitle
, strlen(pmtitle
));
288 PM_Move(a
, pm
->Left
+xoff
+1, YPosText(a
, pm
)-1);
289 Text(a
->RPort
, pmtitle
, strlen(pmtitle
));
290 PM_Move(a
, pm
->Left
+xoff
-1, YPosText(a
, pm
)+1);
291 Text(a
->RPort
, pmtitle
, strlen(pmtitle
));
292 PM_Move(a
, pm
->Left
+xoff
-1, YPosText(a
, pm
)+1);
293 Text(a
->RPort
, pmtitle
, strlen(pmtitle
));
294 PM_Move(a
, pm
->Left
+xoff
+1, YPosText(a
, pm
));
295 Text(a
->RPort
, pmtitle
, strlen(pmtitle
));
296 PM_Move(a
, pm
->Left
+xoff
-1, YPosText(a
, pm
));
297 Text(a
->RPort
, pmtitle
, strlen(pmtitle
));
298 PM_Move(a
, pm
->Left
+xoff
, YPosText(a
, pm
)+1);
299 Text(a
->RPort
, pmtitle
, strlen(pmtitle
));
300 PM_Move(a
, pm
->Left
+xoff
, YPosText(a
, pm
)-1);
301 Text(a
->RPort
, pmtitle
, strlen(pmtitle
));
303 } else if(pm
->Flags
&NPM_EMBOSSED
) {
305 SetAPen(a
->RPort
, SHINE(a
->p
));
306 PM_Move(a
, pm
->Left
+xoff
-1, YPosText(a
, pm
)-1);
307 Text(a
->RPort
, pmtitle
, strlen(pmtitle
));
308 PM_Move(a
, pm
->Left
+xoff
-1, YPosText(a
, pm
));
309 Text(a
->RPort
, pmtitle
, strlen(pmtitle
));
310 PM_Move(a
, pm
->Left
+xoff
, YPosText(a
, pm
)-1);
311 Text(a
->RPort
, pmtitle
, strlen(pmtitle
));
312 SetAPen(a
->RPort
, SHADOW(a
->p
));
313 PM_Move(a
, pm
->Left
+xoff
+1, YPosText(a
, pm
)+1);
314 Text(a
->RPort
, pmtitle
, strlen(pmtitle
));
315 PM_Move(a
, pm
->Left
+xoff
+1, YPosText(a
, pm
));
316 Text(a
->RPort
, pmtitle
, strlen(pmtitle
));
317 PM_Move(a
, pm
->Left
+xoff
, YPosText(a
, pm
)+1);
318 Text(a
->RPort
, pmtitle
, strlen(pmtitle
));
323 PM_DI_SetTextPen(a
, pm
);
325 SetAPen(a
->RPort
, FTPEN(a
->p
));
328 if(pm
->Flags
&NPM_ISSELECTED
) {
329 if(pm
->Flags
&NPM_CHECKIT
) {
330 if((!(pm
->Flags
&NPM_CHECKED
) && pm
->Flags
&NPM_INITIAL_CHECKED
) ||
331 ((pm
->Flags
&NPM_CHECKED
) && !(pm
->Flags
&NPM_INITIAL_CHECKED
))) {
332 SetAPen(a
->RPort
, HILITE(a
->p
));
335 SetAPen(a
->RPort
, HILITE(a
->p
));
344 -PM_Prefs
->pmp_XSpace
-a
->RPort
->Font
->tf_XSize
-PM_Prefs
->pmp_Intermediate
,
346 Selected
?IDS_NORMAL
:IDS_INACTIVENORMAL
,
350 PM_Move(a
, XPosLastCol(a
), YPosText(a
,pm
));
351 Text(a
->RPort
, x
, 1);
354 PM_Move(a
, pm
->Left
+xoff
, YPosText(a
, pm
));
355 if((pm
->Flags
&NPM_DISABLED
|| Disabled
) && !PM_Prefs
->pmp_SeparatorBar
) SetAPen(a
->RPort
, BGSHADOW(a
->p
)); // Set text colour to 'bgminus' if disabled
356 if(pmtitle
) Text(a
->RPort
, pmtitle
, strlen(pmtitle
));
358 if(PM_Prefs
->pmp_SelItemBorder
&& Selected
) {
359 if(PM_Prefs
->pmp_MenuBorder
==MAGIC_FRAME
) {
360 if(PM_Prefs
->pmp_SelItemBorder
==1) /* Raised */
361 PM_DrawBoxMM2(a
, pm
->Left
, pm
->Top
, pm
->Left
+pm
->Width
, pm
->Top
+pm
->Height
, SHINE(a
->p
), SHADOW(a
->p
), HALF(a
->p
));
363 PM_DrawBoxMM2(a
, pm
->Left
, pm
->Top
, pm
->Left
+pm
->Width
, pm
->Top
+pm
->Height
, SHADOW(a
->p
), SHINE(a
->p
), HALF(a
->p
));
365 if(PM_Prefs
->pmp_SelItemBorder
==1) /* Raised */
366 PM_DrawBox(a
, pm
->Left
, pm
->Top
, pm
->Left
+pm
->Width
, pm
->Top
+pm
->Height
, SHINE(a
->p
), SHADOW(a
->p
));
368 PM_DrawBox(a
, pm
->Left
, pm
->Top
, pm
->Left
+pm
->Width
, pm
->Top
+pm
->Height
, SHADOW(a
->p
), SHINE(a
->p
));
372 if(pm
->Flags
&NPM_DISABLED
&& PM_Prefs
->pmp_SeparatorBar
) {
373 PM_Ghost(a
, pm
->Left
, pm
->Top
, pm
->Left
+pm
->Width
, pm
->Top
+pm
->Height
, SHADOW(a
->p
));
380 // Draw a horizontal bar
383 void PM_Separator(struct PM_Window
*w
, int x
, int y
, int x2
, int shine
, int shadow
)
386 SetAPen(w
->RPort
, shadow
);
389 SetAPen(w
->RPort
, shine
);
393 void PM_XENSeparator(struct PM_Window
*w
, int x
, int y
, int x2
, int shine
, int shadow
, int bgplus
, int bgminus
)
395 PM_Move(w
, x
+1, y
-2);
396 SetAPen(w
->RPort
, bgminus
);
397 PM_Draw(w
, x2
-1, y
-2);
400 SetAPen(w
->RPort
, shadow
);
404 SetAPen(w
->RPort
, shine
);
407 PM_Move(w
, x
+1, y
+1);
408 SetAPen(w
->RPort
, bgplus
);
409 PM_Draw(w
, x2
-1, y
+1);
412 void PM_XENSeparatorHalf(struct PM_Window
*w
, int x
, int y
, int x2
, int shine
, int shadow
, int bgplus
, int bgminus
, int half
)
414 PM_Move(w
, x
+1, y
-2);
415 SetAPen(w
->RPort
, bgminus
);
416 PM_Draw(w
, x2
-1, y
-2);
419 SetAPen(w
->RPort
, shadow
);
423 SetAPen(w
->RPort
, shine
);
426 PM_Move(w
, x
+1, y
+1);
427 SetAPen(w
->RPort
, bgplus
);
428 PM_Draw(w
, x2
-1, y
+1);
431 void PM_NewSeparator(struct PM_Window
*w
, int x
, int y
, int x2
, int shine
, int shadow
)
434 SetAPen(w
->RPort
, shadow
);
436 PM_Draw(w
, x2
-1, y
-1);
438 SetAPen(w
->RPort
, shine
);
443 void PM_OldSeparator(struct PM_Window
*w
, int x
, int y
, int x2
, int shine
, int shadow
)
446 SetAPen(w
->RPort
, shadow
);
447 SetDrPt(w
->RPort
, 0xbbbb);
451 SetAPen(w
->RPort
, shadow
);
452 SetDrPt(w
->RPort
, 0xeeee);
455 SetDrPt(w
->RPort
, 0xffff);
458 void PM_ShortSeparator(struct PM_Window
*a
, struct PopupMenu
*pm
)
460 if(!PM_Prefs
->pmp_SeparatorBar
) {
461 if(PM_Prefs
->pmp_MenuBorder
==MAGIC_FRAME
)
462 PM_NewSeparator(a
, BarLeft(a
, pm
), BarTop(a
, pm
), BarRight(a
, pm
), BGSHINE(a
->p
), BGSHADOW(a
->p
));
463 else PM_NewSeparator(a
, BarLeft(a
, pm
), BarTop(a
, pm
), BarRight(a
, pm
), SHINE(a
->p
), SHADOW(a
->p
));
464 } else PM_OldSeparator(a
, BarLeft(a
, pm
), BarTop(a
, pm
), BarRight(a
, pm
), SHINE(a
->p
), SHADOW(a
->p
));
467 void PM_WideSeparator(struct PM_Window
*a
, struct PopupMenu
*pm
)
469 if(!PM_Prefs
->pmp_SeparatorBar
) {
470 if(PM_Prefs
->pmp_MenuBorder
==MAGIC_FRAME
) {
471 PM_XENSeparatorHalf(a
, 0, BarTop(a
, pm
), a
->Width
-2, SHINE(a
->p
), SHADOW(a
->p
), BGSHINE(a
->p
), BGSHADOW(a
->p
), HALF(a
->p
));
472 } else if(PM_Prefs
->pmp_MenuBorder
==DROPBOX_FRAME
) {
473 PM_Move(a
, a
->p
->BorderWidth
-1, BarTop(a
, pm
)-2);
474 SetAPen(a
->RPort
, SHINE(a
->p
));
475 PM_Draw(a
, a
->Width
-a
->p
->BorderWidth
, BarTop(a
, pm
)-2);
476 PM_Move(a
, a
->p
->BorderWidth
-1, BarTop(a
, pm
)+1);
477 SetAPen(a
->RPort
, SHADOW(a
->p
));
478 PM_Draw(a
, a
->Width
-a
->p
->BorderWidth
, BarTop(a
, pm
)+1);
480 SetAPen(a
->RPort
, BGPEN(a
->p
));
481 PM_Move(a
, a
->p
->BorderWidth
-1, BarTop(a
, pm
)-1);
482 PM_Draw(a
, a
->p
->BorderWidth
-1, BarTop(a
, pm
));
483 PM_Move(a
, a
->Width
-a
->p
->BorderWidth
, BarTop(a
, pm
)-1);
484 PM_Draw(a
, a
->Width
-a
->p
->BorderWidth
, BarTop(a
, pm
));
486 PM_Separator(a
, a
->p
->BorderWidth
-1, BarTop(a
, pm
), a
->Width
-a
->p
->BorderWidth
-1, SHINE(a
->p
), SHADOW(a
->p
));
489 SetAPen(a
->RPort
, SHADOW(a
->p
));
490 PM_Move(a
, a
->p
->BorderWidth
, BarTop(a
, pm
));
491 PM_Draw(a
, a
->Width
-a
->p
->BorderWidth
, BarTop(a
, pm
));
492 PM_Move(a
, a
->p
->BorderWidth
, BarTop(a
, pm
)+1);
493 PM_Draw(a
, a
->Width
-a
->p
->BorderWidth
, BarTop(a
, pm
)+1);
501 void PM_DrawBoxMM2(struct PM_Window
*w
, int x1
, int y1
, int x2
, int y2
, int shine
, int shadow
, int halfshine
)
503 SetAPen(w
->RPort
, halfshine
);
506 SetAPen(w
->RPort
, shine
);
507 PM_Move(w
, x1
, y2
-1);
509 PM_Draw(w
, x2
-1, y1
);
510 SetAPen(w
->RPort
, shadow
);
511 PM_Move(w
, x1
+1, y2
);
513 PM_Draw(w
, x2
, y1
+1);
516 void PM_DrawXENBoxMM2(struct PM_Window
*w
, int x1
, int y1
, int x2
, int y2
, int shine
, int shadow
, int bgplus
, int bgminus
, int halfshine
)
518 SetAPen(w
->RPort
, shine
);
522 SetAPen(w
->RPort
, bgplus
);
523 PM_Move(w
, x1
+1, y2
-1);
524 PM_Draw(w
, x1
+1, y1
+1);
525 PM_Draw(w
, x2
-1, y1
+1);
526 SetAPen(w
->RPort
, shadow
);
530 SetAPen(w
->RPort
, bgminus
);
531 PM_Move(w
, x1
+1, y2
-1);
532 PM_Draw(w
, x2
-1, y2
-1);
533 PM_Draw(w
, x2
-1, y1
+1);
534 SetAPen(w
->RPort
, halfshine
);
539 void PM_DrawBox(struct PM_Window
*w
, int x1
, int y1
, int x2
, int y2
, int shine
, int shadow
)
541 SetAPen(w
->RPort
, shine
);
542 PM_Move(w
, x1
, y2
-1);
544 PM_Draw(w
, x2
-1, y1
);
545 SetAPen(w
->RPort
, shadow
);
552 void PM_DrawIBox(struct PM_Window
*w
, int x1
, int y1
, int x2
, int y2
, int shine
, int shadow
)
554 SetAPen(w
->RPort
, shadow
);
563 PM_Move(w
, x1
+1, y1
);
564 PM_Draw(w
, x1
+1, y2
);
566 PM_Move(w
, x2
-1, y1
);
567 PM_Draw(w
, x2
-1, y2
);
570 void PM_DrawXENBox(struct PM_Window
*w
, int x1
, int y1
, int x2
, int y2
, int shine
, int shadow
, int bgplus
, int bgminus
)
572 SetAPen(w
->RPort
, shine
);
576 SetAPen(w
->RPort
, bgplus
);
577 PM_Move(w
, x1
+1, y2
-1);
578 PM_Draw(w
, x1
+1, y1
+1);
579 PM_Draw(w
, x2
-1, y1
+1);
580 SetAPen(w
->RPort
, shadow
);
584 SetAPen(w
->RPort
, bgminus
);
585 PM_Move(w
, x1
+1, y2
-1);
586 PM_Draw(w
, x2
-1, y2
-1);
587 PM_Draw(w
, x2
-1, y1
+1);
590 void PM_DrawDBLBox(struct PM_Window
*w
, int x1
, int y1
, int x2
, int y2
, int shine
, int shadow
)
592 PM_DrawBox(w
, x1
, y1
, x2
, y2
, shine
, shadow
);
593 PM_DrawBox(w
, x1
+1, y1
+1, x2
-1, y2
-1, shine
, shadow
);
596 void PM_DrawDropBox(struct PM_Window
*w
, int x1
, int y1
, int x2
, int y2
, int shine
, int shadow
)
598 SetAPen(w
->RPort
, shine
);
599 PM_Move(w
, x1
, y2
-1);
601 PM_Draw(w
, x2
-1, y1
);
602 PM_Move(w
, x1
+4, y2
-3);
603 PM_Draw(w
, x2
-3, y2
-3);
604 PM_Draw(w
, x2
-3, y1
+4);
605 SetAPen(w
->RPort
, shadow
);
606 PM_Move(w
, x1
+3, y2
-3);
607 PM_Draw(w
, x1
+3, y1
+3);
608 PM_Draw(w
, x2
-4, y1
+3);
614 void PM_DrawPrefBox(struct PM_Root
*p
, struct PM_Window
*w
, int x1
, int y1
, int x2
, int y2
)
616 switch(PM_Prefs
->pmp_MenuBorder
) {
618 PM_DrawBox(w
, x1
, y1
, x2
, y2
, SHINE(p
), SHADOW(p
));
621 PM_DrawXENBoxMM2(w
, x1
, y1
, x2
, y2
, SHINE(p
), SHADOW(p
), BGSHINE(p
), BGSHADOW(p
), HALF(p
));
623 case THICK_BUTTON_FRAME
:
624 PM_DrawXENBox(w
, x1
, y1
, x2
, y2
, SHINE(p
), SHADOW(p
), SHINE(p
), SHADOW(p
));
627 PM_DrawDBLBox(w
, x1
, y1
, x2
, y2
, SHINE(p
), SHADOW(p
));
630 PM_DrawDropBox(w
, x1
, y1
, x2
, y2
, SHINE(p
), SHADOW(p
));
633 PM_DrawIBox(w
, x1
, y1
, x2
, y2
, 0, SHADOW(p
));