@@ -499,7 +499,7 @@ void MCButton::open()
499499 default :
500500 findmenu (true );
501501 if (!MCNameIsEmpty (menuname) && menu.IsValid ())
502- menu. GetAs <MCStack>() ->installaccels (getstack ());
502+ menu->installaccels (getstack ());
503503 break ;
504504 }
505505 }
@@ -716,15 +716,15 @@ Boolean MCButton::kdown(MCStringRef p_string, KeySym key)
716716 case XK_WheelUp:
717717 case XK_WheelLeft:
718718 case XK_WheelRight:
719- if (menu. GetAs <MCStack>() -> getcontrols () -> gettype () == CT_FIELD)
720- if (menu. GetAs <MCStack>() -> getcontrols () -> kdown (p_string, key))
719+ if (menu-> getcontrols ()-> gettype () == CT_FIELD)
720+ if (menu-> getcontrols ()-> kdown (p_string, key))
721721 return True;
722722 break ;
723723 case XK_space:
724724 case XK_Return:
725725 case XK_KP_Enter:
726726 closemenu (False, True);
727- menu. GetAs <MCStack>() ->menukdown (p_string, key, &t_pick, menuhistory);
727+ menu->menukdown (p_string, key, &t_pick, menuhistory);
728728
729729 // This check must be for null (not empty) because an empty pick
730730 // indicates that the function succeeded while a null pick means
@@ -755,10 +755,10 @@ Boolean MCButton::kdown(MCStringRef p_string, KeySym key)
755755 message_with_args (MCM_mouse_release, menubutton);
756756 state &= ~CS_IGNORE_MENU;
757757 if (MCmenuobjectptr == this )
758- MCmenuobjectptr = NULL ;
758+ MCmenuobjectptr = nil ;
759759 return True;
760760 default :
761- MCButton *mbptr = menu. GetAs <MCStack>() ->findmnemonic (t_char);
761+ MCButton *mbptr = menu->findmnemonic (t_char);
762762 if (mbptr != NULL )
763763 {
764764 closemenu (False, True);
@@ -772,13 +772,13 @@ Boolean MCButton::kdown(MCStringRef p_string, KeySym key)
772772 else
773773 t_label = mbptr->getlabeltext ();
774774
775- menu. GetAs <MCStack>() ->menukdown (p_string, key, &t_pick, menuhistory);
775+ menu->menukdown (p_string, key, &t_pick, menuhistory);
776776 Exec_stat es = handlemenupick (t_label, nil);
777777 if (es == ES_NOT_HANDLED || es == ES_PASS)
778778 message_with_args (MCM_mouse_up, menubutton);
779779 }
780780 if (MCmenuobjectptr == this )
781- MCmenuobjectptr = NULL ;
781+ MCmenuobjectptr = nil ;
782782 return True;
783783 }
784784 else
@@ -860,7 +860,7 @@ Boolean MCButton::mfocus(int2 x, int2 y)
860860 if (!(menu.IsValid ()))
861861 return False;
862862
863- sptr->translatecoords (menu. GetAs <MCStack>() , tx, ty);
863+ sptr->translatecoords (menu, tx, ty);
864864 MCRectangle trect = sptr->getrect ();
865865 Boolean handled = menu->mfocus (tx, ty);
866866 tx = x + trect.x ;
@@ -940,7 +940,7 @@ Boolean MCButton::mfocus(int2 x, int2 y)
940940 {
941941 uint2 fheight;
942942 fheight = gettextheight ();
943- MCField *fptr = (MCField *)menu. GetAs <MCStack>() ->getcontrols ();
943+ MCField *fptr = (MCField *)menu->getcontrols ();
944944 fptr->vscroll (my < rect.y + rect.height ? -fheight : fheight, True);
945945 fptr->resetscrollbars (True);
946946 }
@@ -1354,7 +1354,7 @@ Boolean MCButton::mup(uint2 which, bool p_release)
13541354 // MW-2008-03-27; [[ Bug 6225 ]] Make sure we send a mouseUp in this case
13551355 // by setting the menupoppedup global.
13561356 MCmenupoppedup = true ;
1357- menu. GetAs <MCStack>() ->menumup (which, &t_pick, menuhistory);
1357+ menu->menumup (which, &t_pick, menuhistory);
13581358 MCmenupoppedup = false ;
13591359 if (state & CS_IGNORE_MENU)
13601360 closemenu (True, True);
@@ -1416,7 +1416,7 @@ Boolean MCButton::mup(uint2 which, bool p_release)
14161416 }
14171417 state &= ~CS_IGNORE_MENU;
14181418 if (MCmenuobjectptr == this )
1419- MCmenuobjectptr = NULL ;
1419+ MCmenuobjectptr = nil ;
14201420 // MW-2011-08-18: [[ Layers ]] Invalidate the whole object.
14211421 layer_redrawall ();
14221422 if (!opened)
@@ -1759,12 +1759,12 @@ void MCButton::closemenu(Boolean kfocus, Boolean disarm)
17591759 menu->kunfocus ();
17601760 }
17611761
1762- MCButton *focused = (MCButton *)menu. GetAs <MCStack>() ->getcurcard ()->getmfocused ();
1762+ MCButton *focused = (MCButton *)menu->getcurcard ()->getmfocused ();
17631763 if (focused != NULL && focused->gettype () == CT_BUTTON
17641764 && focused->getmenumode () == WM_CASCADE)
17651765 focused->closemenu (kfocus, disarm);
17661766
1767- menu. GetAs <MCStack>() -> mode_closeasmenu ();
1767+ menu-> mode_closeasmenu ();
17681768 menu->close ();
17691769 }
17701770 state &= ~(CS_SUBMENU | CS_MOUSE_UP_MENU);
@@ -1957,7 +1957,7 @@ void MCButton::activate(Boolean notify, KeySym p_key)
19571957 MCAutoStringRef t_pick;
19581958
19591959 if (menu.IsValid ())
1960- menu. GetAs <MCStack>() ->findaccel (p_key, &t_pick, t_disabled);
1960+ menu->findaccel (p_key, &t_pick, t_disabled);
19611961#ifdef _MAC_DESKTOP
19621962 else if (m_system_menu != nil)
19631963 getmacmenuitemtextfromaccelerator (m_system_menu, p_key, MCmodifierstate, &t_pick, false );
@@ -1987,7 +1987,7 @@ void MCButton::activate(Boolean notify, KeySym p_key)
19871987 // MH-2007-03-20: [[ Bug 2581 ]] If a radio button is hilited using the keyboard, others in the group are not unhilited (when radioBehavior is set).
19881988 if (parent->gettype () == CT_GROUP)
19891989 {
1990- MCGroup *gptr = ( MCGroup *)parent ;
1990+ MCGroup *gptr = parent. GetAs < MCGroup>() ;
19911991 gptr->radio (0 , this );
19921992 }
19931993 reseticon ();
@@ -2705,7 +2705,7 @@ bool MCSystemPick(MCStringRef p_options, bool p_use_checkmark, uint32_t p_initia
27052705
27062706void MCButton::openmenu (Boolean grab)
27072707{
2708- if (!opened || MCmousestackptr == NULL )
2708+ if (!opened || ! MCmousestackptr)
27092709 return ;
27102710 if (!MCNameIsEmpty (menuname) && !MCModeMakeLocalWindows ())
27112711 return ;
@@ -2775,7 +2775,7 @@ void MCButton::openmenu(Boolean grab)
27752775 {
27762776 state |= CS_SUBMENU | CS_ARMED;
27772777 reseticon ();
2778- if (MCmenuobjectptr == NULL )
2778+ if (! MCmenuobjectptr)
27792779 MCmenuobjectptr = this ;
27802780 mymenudepth = ++menudepth;
27812781 MCStack *sptr = menumode == WM_POPUP ? MCmousestackptr : getstack ();
@@ -2811,17 +2811,17 @@ void MCButton::openmenu(Boolean grab)
28112811 }
28122812 rel.x += labelwidth;
28132813 rel.width -= labelwidth;
2814- menu. GetAs <MCStack>() ->menuset (menuhistory, rect.height >> 1 );
2814+ menu->menuset (menuhistory, rect.height >> 1 );
28152815 }
28162816
2817- menu. GetAs <MCStack>() ->openrect (rel, (Window_mode)menumode, NULL , WP_DEFAULT, OP_NONE);
2818- menu. GetAs <MCStack>() -> mode_openasmenu (t_did_grab ? sptr : NULL );
2817+ menu->openrect (rel, (Window_mode)menumode, NULL , WP_DEFAULT, OP_NONE);
2818+ menu-> mode_openasmenu (t_did_grab ? sptr : NULL );
28192819
28202820 // MW-2014-03-11: [[ Bug 11893 ]] Make sure we don't do anything to a stack panel.
28212821 if (menumode == WM_OPTION && MCNameIsEmpty (menuname))
28222822 {
28232823 MCField *t_field = NULL ;
2824- MCObjptr *t_obj = menu. GetAs <MCStack>() ->getcurcard ()->getrefs ();
2824+ MCObjptr *t_obj = menu->getcurcard ()->getrefs ();
28252825 MCObjptr *t_iter = t_obj;
28262826 do
28272827 {
@@ -2842,9 +2842,9 @@ void MCButton::openmenu(Boolean grab)
28422842 }
28432843 int2 tx = mx;
28442844 int2 ty = my;
2845- sptr->translatecoords (menu. GetAs <MCStack>() , tx, ty);
2845+ sptr->translatecoords (menu, tx, ty);
28462846 menu->mfocus (tx, ty);
2847- menu. GetAs <MCStack>() ->resetcursor (True);
2847+ menu->resetcursor (True);
28482848 if (!(state & CS_MFOCUSED))
28492849 menu->kfocusnext (True);
28502850 // MW-2011-08-18: [[ Layers ]] Invalidate the whole object.
@@ -2863,18 +2863,18 @@ void MCButton::freemenu(Boolean force)
28632863 {
28642864 if (!MCNameIsEmpty (menuname))
28652865 {
2866- menu. GetAs <MCStack>() ->removeaccels (getstack ());
2867- menu. GetAs <MCStack>() ->removeneed (this );
2866+ menu->removeaccels (getstack ());
2867+ menu->removeneed (this );
28682868 menu = nil;
28692869 }
28702870 else
28712871 {
28722872 if (!MCStringIsEmpty (menustring) || force)
28732873 {
28742874 closemenu (False, True);
2875- MCdispatcher->removepanel (menu. GetAs <MCStack>() );
2875+ MCdispatcher->removepanel (menu);
28762876 MCstacks->deleteaccelerator (this , NULL );
2877- menu. GetAs <MCStack>() ->removeneed (this );
2877+ menu->removeneed (this );
28782878 menu = nil;
28792879 }
28802880 }
@@ -3892,7 +3892,7 @@ IO_stat MCButton::load(IO_handle stream, uint32_t version)
38923892
38933893MCStack * MCButton::getmenu ()
38943894{
3895- return menu. GetAs <MCStack>() ;
3895+ return menu;
38963896}
38973897
38983898// //////////////////////////////////////////////////////////////////////////////
0 commit comments