15 #ifndef GUI_WIDGETS_TOGGLE_PANEL_HPP_INCLUDED
16 #define GUI_WIDGETS_TOGGLE_PANEL_HPP_INCLUDED
49 const std::map<std::string /* widget id */, string_map>&
data);
55 const bool must_be_active)
override;
59 const bool must_be_active)
const override;
62 virtual void set_active(
const bool active)
override;
68 virtual unsigned get_state()
const override;
111 std::function<
void(
twidget&)> callback)
164 int y_offset)
override;
169 int y_offset)
override;
void signal_handler_mouse_enter(const event::tevent event, bool &handled)
void signal_handler_left_button_click(const event::tevent event, bool &handled)
void signal_handler_pre_left_button_click(const event::tevent event)
virtual unsigned get_state() const override
See tcontrol::get_state.
tstate state_
Current state of the widget.
void set_state(const tstate state)
virtual void impl_draw_foreground(surface &frame_buffer, int x_offset, int y_offset) override
See twidget::impl_draw_foreground.
GLint GLenum GLsizei GLint GLsizei const GLvoid * data
Base class of a resolution, contains the common keys for a resolution.
A class inherited from ttext_box that displays its input as stars.
void set_callback_mouse_left_double_click(std::function< void(twidget &)> callback)
tstate
Possible states of the widget.
void signal_handler_mouse_leave(const event::tevent event, bool &handled)
tevent
The event send to the dispatcher.
void set_retval(const int retval)
Visible container to hold multiple widgets.
int retval_
The return value of the button.
Small abstract helper class.
virtual tpoint border_space() const override
See tcontainer_::border_space.
unsigned state_num_
Usually 1 for selected and 0 for not selected, can also have higher values in tristate buttons...
tbuilder_toggle_panel(const config &cfg)
void set_value(const unsigned selected)
Inherited from tselectable_.
virtual void impl_draw_background(surface &frame_buffer, int x_offset, int y_offset) override
See twidget::impl_draw_background.
unsigned get_value() const override
Inherited from tselectable_.
void set_child_members(const std::map< std::string, string_map > &data)
Sets the members of the child controls.
unsigned num_states() const override
Inherited from tselectable_.
void set_callback_state_change(std::function< void(twidget &)> callback)
Inherited from tselectable_.
virtual twidget * find_at(const tpoint &coordinate, const bool must_be_active) override
See twidget::find_at.
Class for a toggle button.
A config object defines a single node in a WML file, with access to child nodes.
virtual void set_active(const bool active) override
See tcontrol::set_active.
virtual bool get_active() const override
See tcontrol::get_active.
virtual SDL_Rect get_client_rect() const override
See tcontainer_::get_client_rect.
void signal_handler_left_button_double_click(const event::tevent event, bool &handled)
GLsizei const GLcharARB ** string
ttoggle_panel_definition(const config &cfg)
Contains the implementation details for lexical_cast and shouldn't be used directly.
virtual const std::string & get_control_type() const override
See tcontrol::get_control_type.
tresolution(const config &cfg)
std::function< void(twidget &)> callback_mouse_left_double_click_
Mouse left double click callback.
std::function< void(twidget &)> callback_state_change_
See tselectable_::set_callback_state_change.