15 #define GETTEXT_DOMAIN "wesnoth-lib"
31 #define LOG_SCOPE_HEADER get_control_type() + " [" + id() + "] " + __func__
32 #define LOG_HEADER LOG_SCOPE_HEADER + ':'
49 values_.push_back(this->label());
51 connect_signal<event::MOUSE_ENTER>(
53 connect_signal<event::MOUSE_LEAVE>(
56 connect_signal<event::LEFT_BUTTON_DOWN>(std::bind(
58 connect_signal<event::LEFT_BUTTON_UP>(
60 connect_signal<event::LEFT_BUTTON_CLICK>(std::bind(
167 assert(static_cast<size_t>(selected) < values.size());
179 assert(static_cast<size_t>(selected) <
values_.size());
193 DBG_GUI_P <<
"Parsing combobox " <<
id <<
'\n';
195 load_resolutions<tresolution>(cfg);
278 tbuilder_combobox::tbuilder_combobox(
const config& cfg)
280 , retval_id_(cfg[
"return_value_id"])
281 , retval_(cfg[
"return_value"])
299 DBG_GUI_G <<
"Window builder: placed combobox '" <<
id
300 <<
"' with definition '" <<
definition <<
"'.\n";
Define the common log macros for the gui toolkit.
void signal_handler_mouse_leave(const event::tevent event, bool &handled)
child_itors child_range(const std::string &key)
virtual unsigned get_state() const override
See tcontrol::get_state.
void signal_handler_left_button_up(const event::tevent event, bool &handled)
GLuint GLuint GLsizei GLenum type
bool show(CVideo &video, const unsigned auto_close_time=0)
Shows the window.
std::string sound_button_click
virtual void set_label(const t_string &label)
Used by the combobox widget.
int get_retval(const std::string &retval_id, const int retval, const std::string &id)
Returns the return value for a widget.
void set_state(const tstate state)
Base class of a resolution, contains the common keys for a resolution.
GLboolean GLenum GLenum GLvoid * values
base class of top level items, the only item which needs to store the final canvases to draw on ...
A class inherited from ttext_box that displays its input as stars.
void init_control(tcontrol *control) const
std::string definition
Parameters for the control.
std::function< void(twidget &)> selected_callback_
int retval_
The return value of the button.
tresolution(const config &cfg)
virtual void set_active(const bool active) override
See tcontrol::set_active.
void set_retval(const int retval, const bool close_window=true)
Sets there return value of the window.
void signal_handler_mouse_enter(const event::tevent event, bool &handled)
tevent
The event send to the dispatcher.
bool get_use_markup() const
void signal_handler_left_button_down(const event::tevent event, bool &handled)
Contains the state info for a resolution.
Small abstract helper class.
virtual const std::string & get_control_type() const override
See tcontrol::get_control_type.
void signal_handler_left_button_click(const event::tevent event, bool &handled)
std::vector< std::string > options_
void set_values(const std::vector< std::string > &values, int selected=0)
tstate
Possible states of the widget.
void set_retval(const int retval)
tcombobox_definition(const config &cfg)
std::vector< std::string > values_
Base class for all visible items.
tstate state_
Current state of the widget.
std::vector< tstate_definition > state
config & child(const std::string &key, int n=0)
Returns the nth child with the given key, or a reference to an invalid config if there is none...
void play_UI_sound(const std::string &files)
void mouse_capture(const bool capture=true)
void set_selected(int selected)
int selected_item() const
A config object defines a single node in a WML file, with access to child nodes.
GLsizei const GLcharARB ** string
Contains the implementation details for lexical_cast and shouldn't be used directly.
virtual bool get_active() const override
See tcontrol::get_active.