@@ -960,7 +960,7 @@ Boolean MCButton::mfocus(int2 x, int2 y)
960960 return True;
961961 }
962962 if (!(flags & F_VISIBLE || MCshowinvisibles)
963- || flags & F_DISABLED && getstack ()->gettool (this ) == T_BROWSE)
963+ || ( flags & F_DISABLED && getstack ()->gettool (this ) == T_BROWSE) )
964964 return False;
965965 Tool tool = getstack ()->gettool (this );
966966
@@ -1019,9 +1019,9 @@ Boolean MCButton::mfocus(int2 x, int2 y)
10191019 && (menumode != WM_TOP_LEVEL || getstyleint (flags) != F_MENU)
10201020 && state & CS_MFOCUSED && !(state & CS_SELECTED))
10211021 {
1022- if (MClook == LF_MOTIF || flags & F_SHOW_ICON
1023- || getstyleint (flags) != F_RADIO
1024- && getstyleint (flags) != F_CHECK)
1022+ if (MClook == LF_MOTIF || flags & F_SHOW_ICON ||
1023+ ( getstyleint (flags) != F_RADIO &&
1024+ getstyleint (flags) != F_CHECK) )
10251025 {
10261026 if (MCU_point_in_rect (rect, x, y))
10271027 {
@@ -1231,10 +1231,12 @@ Boolean MCButton::mdown(uint2 which)
12311231 entry->mdown (which);
12321232 }
12331233 else
1234+ {
12341235 if (flags & F_AUTO_HILITE || family != 0 )
1235- if (MClook == LF_MOTIF || flags & F_SHOW_ICON
1236- || getstyleint (flags) != F_RADIO
1237- && getstyleint (flags) != F_CHECK)
1236+ {
1237+ if (MClook == LF_MOTIF || flags & F_SHOW_ICON ||
1238+ (getstyleint (flags) != F_RADIO &&
1239+ getstyleint (flags) != F_CHECK))
12381240 {
12391241 if (getstyleint (flags) != F_RADIO || !(state & CS_HILITED))
12401242 {
@@ -1257,6 +1259,8 @@ Boolean MCButton::mdown(uint2 which)
12571259 // MW-2011-08-18: [[ Layers ]] Invalidate the whole object.
12581260 layer_redrawall ();
12591261 }
1262+ }
1263+ }
12601264 if ((!IsMacLF () || entry != NULL )
12611265 && flags & F_TRAVERSAL_ON && !(state & CS_KFOCUSED))
12621266 getstack ()->kfocusset (this );
@@ -1425,10 +1429,12 @@ Boolean MCButton::mup(uint2 which, bool p_release)
14251429 if (state & CS_GRAB)
14261430 {
14271431 if (flags && F_AUTO_HILITE)
1432+ {
14281433 if (starthilite)
14291434 state &= ~CS_HILITED;
14301435 else
14311436 state |= CS_HILITED;
1437+ }
14321438 ungrab (which);
14331439 return True;
14341440 }
@@ -1472,16 +1478,18 @@ Boolean MCButton::mup(uint2 which, bool p_release)
14721478 || getstyleint (flags) == F_CHECK))
14731479 {
14741480 if (MCU_point_in_rect (rect, mx, my))
1481+ {
14751482 if (getstyleint (flags) == F_CHECK)
14761483 state ^= CS_HILITED;
14771484 else
14781485 state |= CS_HILITED;
1486+ }
14791487 // MW-2011-08-18: [[ Layers ]] Invalidate the whole object.
14801488 layer_redrawall ();
14811489 }
14821490 else
1483- if (state & CS_HILITED && (flags & F_AUTO_HILITE || family != 0 )
1484- || state & CS_ARMED && flags & F_AUTO_ARM)
1491+ if (( state & CS_HILITED && (flags & F_AUTO_HILITE || family != 0 )) ||
1492+ ( state & CS_ARMED && flags & F_AUTO_ARM) )
14851493 {
14861494 if (getstyleint (flags) == F_CHECK)
14871495 {
@@ -1493,10 +1501,12 @@ Boolean MCButton::mup(uint2 which, bool p_release)
14931501 if (getstyleint (flags) == F_RADIO)
14941502 {
14951503 if (flags & F_AUTO_ARM && flags & F_AUTO_HILITE)
1504+ {
14961505 if (state & CS_ARMED)
14971506 state |= CS_HILITED;
14981507 else
14991508 state &= ~CS_HILITED;
1509+ }
15001510 }
15011511 else
15021512 state &= ~CS_HILITED;
@@ -3505,7 +3515,7 @@ Boolean MCButton::findmenu(bool p_just_for_accel)
35053515 {
35063516 uint2 fheight;
35073517 fheight = gettextheight ();
3508- if ((!IsMacLFAM () || MCModeMakeLocalWindows ()) && menumode == WM_COMBO || menumode == WM_OPTION && MClook == LF_WIN95)
3518+ if ((( !IsMacLFAM () || MCModeMakeLocalWindows ()) && menumode == WM_COMBO) || ( menumode == WM_OPTION && MClook == LF_WIN95) )
35093519 {
35103520 uindex_t nlines = 1 ;
35113521 // major menustring
@@ -3561,9 +3571,9 @@ Boolean MCButton::findmenu(bool p_just_for_accel)
35613571 /* UNCHECKED */ MCArrayFetchValueAtIndex (tabs, i + 1 , t_tabval);
35623572 MCStringRef t_tab;
35633573 t_tab = (MCStringRef)t_tabval;
3564- if (MCStringGetCharAtIndex (t_tab, 0 ) == ' !'
3565- || MCStringGetCharAtIndex (t_tab, 0 ) == ' ('
3566- && MCStringGetCharAtIndex (t_tab, 1 ) == ' !' )
3574+ if (MCStringGetCharAtIndex (t_tab, 0 ) == ' !' ||
3575+ ( MCStringGetCharAtIndex (t_tab, 0 ) == ' (' &&
3576+ MCStringGetCharAtIndex (t_tab, 1 ) == ' !' ) )
35673577 {
35683578 menuflags &= ~F_STYLE;
35693579 menuflags |= F_CHECK;
@@ -3740,13 +3750,15 @@ void MCButton::freemenu(Boolean force)
37403750 macfreemenu ();
37413751#endif
37423752 if (menu != NULL && !(state & CS_SUBMENU))
3753+ {
37433754 if (!MCNameIsEmpty (menuname))
37443755 {
37453756 menu->removeaccels (getstack ());
37463757 menu->removeneed (this );
37473758 menu = NULL ;
37483759 }
37493760 else
3761+ {
37503762 if (!MCStringIsEmpty (menustring) || force)
37513763 {
37523764 closemenu (False, True);
@@ -3756,6 +3768,8 @@ void MCButton::freemenu(Boolean force)
37563768 delete menu;
37573769 menu = NULL ;
37583770 }
3771+ }
3772+ }
37593773}
37603774
37613775void MCButton::docascade (MCStringRef p_pick)
@@ -4719,7 +4733,7 @@ IO_stat MCButton::load(IO_handle stream, uint32_t version)
47194733 {
47204734 if (menumode != WM_CASCADE)
47214735 flags &= ~F_AUTO_ARM;
4722- flags = flags & ~F_STYLE | F_MENU | F_OPAQUE;
4736+ flags = ( flags & ~F_STYLE) | F_MENU | F_OPAQUE;
47234737 }
47244738 if (flags & F_AUTO_ARM)
47254739 flags |= F_OPAQUE | F_TRAVERSAL_ON;
0 commit comments