void PopUpMenu::add_check_item(BitmapID p_icon, String p_text, const Method1<bool>& p_method, bool p_checked) { MenuButton *mb = vbc->add( GUI_NEW(MenuButton(p_text,p_icon,true)), 0 ); mb->set_id( id_count++ ); mb->toggled_signal.connect( p_method ); mb->set_checked(p_checked); vbc->adjust_minimum_size(); mb->menubutton_toggled_signal.connect( this, &PopUpMenu::menu_button_toggled ); }
void PopUpMenu::add_check_item(String p_text, bool p_checked,void *p_userdata) { MenuButton *mb = vbc->add( GUI_NEW(MenuButton(p_text,-1,true)), 0 ); mb->set_id( id_count++ ); mb->set_userdata( p_userdata ); mb->set_checked(p_checked); vbc->adjust_minimum_size(); mb->menubutton_toggled_signal.connect( this, &PopUpMenu::menu_button_toggled ); }
void PopUpMenu::add_check_item(BitmapID p_icon, String p_text, int p_ID, bool p_checked,void *p_userdata) { MenuButton *mb = vbc->add( GUI_NEW(MenuButton(p_text,p_icon,true)), 0 ); mb->set_id( p_ID ); mb->set_userdata( p_userdata ); mb->set_checked(p_checked); id_count=p_ID+1; vbc->adjust_minimum_size(); mb->menubutton_toggled_signal.connect( this, &PopUpMenu::menu_button_toggled ); }