@@ -125,12 +125,12 @@ void MCButton::draw(MCDC *dc, const MCRectangle& p_dirty, bool p_isolated, bool
125125 Boolean macoption = IsMacEmulatedLF () && style == F_MENU
126126 && (menumode == WM_OPTION || menumode == WM_COMBO);
127127 Boolean white = MClook != LF_MOTIF && !macoption && !(t_isvista && style == F_MENU && menumode == WM_OPTION)
128- && (style == F_MENU && (menumode == WM_OPTION || menumode == WM_COMBO)
129- || flags & F_AUTO_ARM && state & CS_ARMED
130- && !(flags & F_SHOW_BORDER));
128+ && (( style == F_MENU && (menumode == WM_OPTION || menumode == WM_COMBO) )
129+ || ( flags & F_AUTO_ARM && state & CS_ARMED
130+ && !(flags & F_SHOW_BORDER))) ;
131131 if (flags & F_3D && MClook == LF_WIN95
132132 && state & CS_HILITED && (style == F_STANDARD
133- || indicator && flags & F_SHOW_ICON))
133+ || ( indicator && flags & F_SHOW_ICON) ))
134134 loff = 1 ;
135135
136136 if (style == F_MENU && menumode == WM_PULLDOWN && MCcurtheme != NULL &&
@@ -152,10 +152,10 @@ void MCButton::draw(MCDC *dc, const MCRectangle& p_dirty, bool p_isolated, bool
152152 else
153153 {
154154 if (flags & F_OPAQUE && (MCcurtheme == NULL || !noback
155- || (style == F_STANDARD && (MCcurtheme != NULL &&
156- !MCcurtheme->iswidgetsupported (WTHEME_TYPE_PUSHBUTTON)) ||
157- style == F_RECTANGLE && (MCcurtheme != NULL &&
158- !MCcurtheme->iswidgetsupported (WTHEME_TYPE_BEVELBUTTON)))
155+ || (( style == F_STANDARD && (MCcurtheme != NULL &&
156+ !MCcurtheme->iswidgetsupported (WTHEME_TYPE_PUSHBUTTON))) ||
157+ ( style == F_RECTANGLE && (MCcurtheme != NULL &&
158+ !MCcurtheme->iswidgetsupported (WTHEME_TYPE_BEVELBUTTON))))
159159 || !(flags & F_SHOW_BORDER)
160160 || flags & F_SHADOW))
161161 {// define when to not draw using themes
@@ -169,16 +169,15 @@ void MCButton::draw(MCDC *dc, const MCRectangle& p_dirty, bool p_isolated, bool
169169 if (flags & F_SHOW_BORDER)
170170 trect = MCU_reduce_rect (trect, borderwidth >> 1 );
171171 setforeground (dc, DI_BACK,
172- (state & CS_HILITED && flags & F_HILITE_FILL
173- || state & CS_ARMED && flags & F_ARM_FILL
174- || state & CS_ARMED && !(flags & F_SHOW_BORDER)
175-
176- && MClook != LF_MOTIF) && loff == 0
177- && (flags & F_SHOW_ICON || !indicator)
178- || white && state & CS_KFOCUSED && !(state & CS_SUBMENU)
179- || macoption && state & CS_SUBMENU,
180- (white || state & CS_ARMED && !(flags & F_SHOW_BORDER))
181- && !macoption);
172+ (((state & CS_HILITED && flags & F_HILITE_FILL)
173+ || (state & CS_ARMED && flags & F_ARM_FILL)
174+ || (state & CS_ARMED && !(flags & F_SHOW_BORDER)
175+ && MClook != LF_MOTIF)) && loff == 0
176+ && (flags & F_SHOW_ICON || !indicator))
177+ || (white && state & CS_KFOCUSED && !(state & CS_SUBMENU))
178+ || (macoption && state & CS_SUBMENU),
179+ (white || ((state & CS_ARMED && !(flags & F_SHOW_BORDER))
180+ && !macoption)));
182181 switch (style)
183182 {
184183 case F_MENU:
@@ -247,9 +246,8 @@ void MCButton::draw(MCDC *dc, const MCRectangle& p_dirty, bool p_isolated, bool
247246 switch (menumode)
248247 {
249248 case WM_PULLDOWN:
250- if (state & CS_ARMED && !(flags & F_SHOW_BORDER) &&
251- (MClook == LF_MOTIF || MCcurtheme &&
252- MCcurtheme->getthemeid () == LF_NATIVEGTK)
249+ if ((state & CS_ARMED && !(flags & F_SHOW_BORDER) &&
250+ (MClook == LF_MOTIF || (MCcurtheme && MCcurtheme->getthemeid () == LF_NATIVEGTK)))
253251 || flags & F_SHOW_BORDER)
254252 drawpulldown (dc, shadowrect);
255253 break ;
@@ -272,9 +270,9 @@ void MCButton::draw(MCDC *dc, const MCRectangle& p_dirty, bool p_isolated, bool
272270 drawshadow (dc, rect, shadowoffset);
273271 if (flags & F_3D)
274272 {
275- if (state & CS_HILITED && flags & F_HILITE_BORDER
276- || flags & F_AUTO_ARM && state & CS_ARMED && flags & F_ARM_BORDER
277- && !indicator && MClook == LF_MOTIF)
273+ if (( state & CS_HILITED && flags & F_HILITE_BORDER)
274+ || ( flags & F_AUTO_ARM && state & CS_ARMED && flags & F_ARM_BORDER
275+ && !indicator && MClook == LF_MOTIF))
278276 if (isstdbtn && noback)
279277 drawstandardbutton (dc, shadowrect);
280278 else
@@ -288,16 +286,16 @@ void MCButton::draw(MCDC *dc, const MCRectangle& p_dirty, bool p_isolated, bool
288286 draw3d (dc, shadowrect, flags & F_SHOW_BORDER ? ETCH_SUNKEN_BUTTON
289287 : ETCH_RAISED, borderwidth);
290288 else
291- if (flags & F_SHOW_BORDER || MClook == LF_MOTIF
292- && state & (CS_ARMED | CS_KFOCUSED) && flags & F_ARM_BORDER)
289+ if (flags & F_SHOW_BORDER || ( MClook == LF_MOTIF
290+ && ( state & (CS_ARMED | CS_KFOCUSED)) && flags & F_ARM_BORDER) )
293291 {
294292 if (isstdbtn && noback)
295293 drawstandardbutton (dc, shadowrect);
296294 else
297295 {
298296 uint2 bwidth = borderwidth;
299297 draw3d (dc, shadowrect, shadowrect.height <= bwidth
300- || state & CS_HILITED && flags & F_HILITE_BORDER
298+ || ( state & CS_HILITED && flags & F_HILITE_BORDER)
301299 ? ETCH_SUNKEN_BUTTON : ETCH_RAISED, bwidth);
302300 }
303301 }
@@ -321,9 +319,9 @@ void MCButton::draw(MCDC *dc, const MCRectangle& p_dirty, bool p_isolated, bool
321319
322320 }
323321 else
324- if (state & CS_HILITED && flags & F_HILITE_BORDER
322+ if (( state & CS_HILITED && flags & F_HILITE_BORDER)
325323 || flags & F_SHOW_BORDER
326- || state & (CS_ARMED | CS_KFOCUSED) && flags & F_ARM_BORDER)
324+ || (( state & (CS_ARMED | CS_KFOCUSED)) && flags & F_ARM_BORDER) )
327325 drawborder (dc, shadowrect, borderwidth);
328326 break ;
329327 case F_ROUNDRECT:
@@ -339,9 +337,9 @@ void MCButton::draw(MCDC *dc, const MCRectangle& p_dirty, bool p_isolated, bool
339337 }
340338 break ;
341339 case F_OVAL_BUTTON:
342- if (state & CS_HILITED && flags & F_HILITE_BORDER
340+ if (( state & CS_HILITED && flags & F_HILITE_BORDER)
343341 || flags & F_SHOW_BORDER
344- || state & (CS_ARMED | CS_KFOCUSED) && flags & F_ARM_BORDER)
342+ || (( state & (CS_ARMED | CS_KFOCUSED)) && flags & F_ARM_BORDER) )
345343 {
346344 setforeground (dc, DI_FORE, False);
347345 dc->drawarc (shadowrect, 0 , 360 );
@@ -371,8 +369,8 @@ void MCButton::draw(MCDC *dc, const MCRectangle& p_dirty, bool p_isolated, bool
371369 (MClook != LF_MOTIF && style == F_MENU && flags & F_OPAQUE && state & CS_ARMED && !(flags & F_SHOW_BORDER)))
372370 setforeground (dc, DI_PSEUDO_BUTTON_TEXT_SEL, False, True);
373371 else
374- setforeground (dc, DI_FORE, (state & CS_HILITED && flags & F_HILITE_FILL
375- || state & CS_ARMED && flags & F_ARM_FILL) && flags & F_OPAQUE && ((MClook != LF_WIN95 && !MCaqua)
372+ setforeground (dc, DI_FORE, (( state & CS_HILITED && flags & F_HILITE_FILL)
373+ || (( state & CS_ARMED && flags & F_ARM_FILL) && flags & F_OPAQUE && ((MClook != LF_WIN95 && !MCaqua)) )
376374 || style != F_STANDARD), False);
377375 }
378376 }
@@ -510,8 +508,8 @@ void MCButton::draw(MCDC *dc, const MCRectangle& p_dirty, bool p_isolated, bool
510508 }
511509 }
512510 if (MCaqua && IsMacLFAM ()
513- && ((style == F_STANDARD && noback)|| style == F_MENU
514- && menumode == WM_OPTION))
511+ && ((style == F_STANDARD && noback)|| ( style == F_MENU
512+ && menumode == WM_OPTION) ))
515513 sx += 5 ;
516514 }
517515 break ;
@@ -520,7 +518,7 @@ void MCButton::draw(MCDC *dc, const MCRectangle& p_dirty, bool p_isolated, bool
520518 if (menumode == WM_OPTION || menumode == WM_COMBO)
521519 sx -= optionrect.width ;
522520 // MH-2007-03-16 [[ Bug 3598 ]] Centering of the label did not work correctly on mac os classic and non vista windows option buttons.
523- if (menumode == WM_OPTION && (MClook == LF_WIN95 && !t_themed_menu || MClook == LF_MAC))
521+ if (menumode == WM_OPTION && (( MClook == LF_WIN95 && !t_themed_menu) || MClook == LF_MAC))
524522 sx = t_content_rect . x + (t_content_rect . width - leftmargin) / 2 - twidth / 2 ;
525523 if (menumode == WM_CASCADE)
526524 sx -= rect.height >> 1 ;
@@ -564,7 +562,7 @@ void MCButton::draw(MCDC *dc, const MCRectangle& p_dirty, bool p_isolated, bool
564562
565563 if (getstyleint (flags) == F_MENU && menumode == WM_CASCADE && !t_themed_menu)
566564 drawcascade (dc, shadowrect); // draw arrow in text color
567- if (flags & F_DISABLED && MClook == LF_WIN95 || t_themed_menu)
565+ if (( flags & F_DISABLED && MClook == LF_WIN95) || t_themed_menu)
568566 setforeground (dc, DI_TOP, False);
569567 sy += fheight;
570568
@@ -1518,7 +1516,7 @@ void MCButton::drawtabs(MCDC *dc, MCRectangle &srect)
15181516 twidth += 12 ;
15191517 uint2 index;
15201518 if (i + 1 == menuhistory
1521- || !getcindex (DI_SHADOW, index) && !getpindex (DI_SHADOW, index))
1519+ || ( !getcindex (DI_SHADOW, index) && !getpindex (DI_SHADOW, index) ))
15221520 setforeground (dc, DI_BACK, False); // fill with background color
15231521 else
15241522 setforeground (dc, DI_SHADOW, False);
0 commit comments