CheckBox::CheckBox(const String &p_text): Button(p_text) { set_toggle_mode(true); set_text_align(ALIGN_LEFT); }
CheckButton::CheckButton() { set_toggle_mode(true); set_text_align(ALIGN_LEFT); _set_internal_margin(MARGIN_RIGHT, get_icon_size().width); }
MenuButton::MenuButton(String p_text,BitmapID p_icon,bool p_has_check) : Button(p_text,p_icon) { id=-1; set_toggle_mode(p_has_check); has_check=p_has_check; userdata=0; }
// Set the desired message and then show the OSD void OSDPretty::ShowMessage(const QString& summary, const QString& message, const QImage& image) { SetMessage(summary, message, image); if (isVisible() && mode_ == Mode_Popup) { // The OSD is already visible, toggle or restart the timer if (toggle_mode()) { set_toggle_mode(false); // If timeout is disabled, timer hadn't been started if (!disable_duration()) timeout_->stop(); hide(); } else { if (!disable_duration()) timeout_->start(); // Restart the timer } } else { if (toggle_mode()) set_toggle_mode(false); // The OSD is not visible, show it show(); } }
MenuButton::MenuButton() { switch_on_hover = false; set_flat(true); set_toggle_mode(true); set_disable_shortcuts(false); set_enabled_focus_mode(FOCUS_NONE); set_process_unhandled_key_input(true); set_action_mode(ACTION_MODE_BUTTON_PRESS); popup = memnew(PopupMenu); popup->hide(); add_child(popup); popup->set_pass_on_modal_close_click(false); popup->connect("about_to_show", this, "set_pressed", varray(true)); // For when switching from another MenuButton. popup->connect("popup_hide", this, "set_pressed", varray(false)); }
CheckButton::CheckButton(String p_text,BitmapID p_icon) : Button(p_text,p_icon) { set_toggle_mode(true); }
CheckButton::CheckButton(BitmapID p_icon) : Button(p_icon) { set_toggle_mode(true); }
CheckBox::CheckBox(const String &p_text) : Button(p_text) { set_toggle_mode(true); set_text_align(ALIGN_LEFT); _set_internal_margin(MARGIN_LEFT, get_icon_size().width); }