Base class for all visible items. More...
#include <control.hpp>


Public Member Functions | |
| tcontrol (const unsigned canvas_count) | |
| tcontrol (const implementation::tbuilder_control &builder, const unsigned canvas_count, const std::string &control_type) | |
| Constructor. | |
| virtual void | set_members (const string_map &data) |
| Sets the members of the control. | |
| virtual void | set_active (const bool active)=0 |
| Sets the control's state. | |
| virtual bool | get_active () const =0 |
| Gets the active state of the control. | |
| bool | disable_click_dismiss () const |
| Inherited from twidget. | |
| virtual iterator::twalker_ * | create_walker () |
| Inherited from twidget. | |
| tpoint | get_config_minimum_size () const |
| Gets the minimum size as defined in the config. | |
| tpoint | get_config_default_size () const |
| Gets the default size as defined in the config. | |
| tpoint | get_config_maximum_size () const |
| Gets the best size as defined in the config. | |
| virtual unsigned | get_characters_per_line () const |
| Returns the number of characters per line. | |
| void | layout_init (const bool full_initialization) |
| Inherited from twidget. | |
| void | request_reduce_width (const unsigned maximum_width) |
| Inherited from twidget. | |
| void | place (const tpoint &origin, const tpoint &size) |
| Inherited from twidget. | |
| twidget * | find_at (const tpoint &coordinate, const bool must_be_active) |
| Inherited from twidget. | |
| const twidget * | find_at (const tpoint &coordinate, const bool must_be_active) const |
| Inherited from twidget. | |
| twidget * | find (const std::string &id, const bool must_be_active) |
| Inherited from twidget. | |
| const twidget * | find (const std::string &id, const bool must_be_active) const |
| Inherited from twidget. | |
| void | set_definition (const std::string &definition) |
| Sets the definition. | |
| bool | get_use_tooltip_on_label_overflow () const |
| void | set_use_tooltip_on_label_overflow (const bool use_tooltip=true) |
| const t_string & | label () const |
| virtual void | set_label (const t_string &label) |
| virtual void | set_use_markup (bool use_markup) |
| bool | get_use_markup () const |
| const t_string & | tooltip () const |
| void | set_tooltip (const t_string &tooltip) |
| const t_string & | help_message () const |
| void | set_help_message (const t_string &help_message) |
| std::vector< tcanvas > & | canvas () |
| tcanvas & | canvas (const unsigned index) |
| void | set_text_alignment (const PangoAlignment text_alignment) |
| PangoAlignment | get_text_alignment () const |
| virtual const std::string & | get_control_type () const =0 |
| Returns the control_type of the control. | |
Protected Member Functions | |
| virtual unsigned | get_state () const =0 |
| Returns the id of the state. | |
| tpoint | calculate_best_size () const |
| Inherited from twidget. | |
| tresolution_definition_ptr | config () |
| tresolution_definition_const_ptr | config () const |
| void | set_config (tresolution_definition_ptr config) |
| virtual void | update_canvas () |
| Updates the canvas(ses). | |
| int | get_text_maximum_width () const |
| Returns the maximum width available for the text. | |
| int | get_text_maximum_height () const |
| Returns the maximum height available for the text. | |
| void | impl_draw_background (surface &frame_buffer) |
| Inherited from twidget. | |
| void | impl_draw_background (surface &frame_buffer, int x_offset, int y_offset) |
| void | impl_draw_foreground (surface &) |
| Inherited from twidget. | |
| void | impl_draw_foreground (surface &, int, int) |
Private Member Functions | |
| void | load_config () |
| Loads the configuration of the widget. | |
| virtual void | load_config_extra () |
| Load class dependant config settings. | |
| void | definition_load_configuration (const std::string &control_type) |
| Loads the configuration of the widget. | |
| tpoint | get_best_text_size (const tpoint &minimum_size, const tpoint &maximum_size=tpoint(0, 0)) const |
| Gets the best size for a text. | |
| void | signal_handler_show_tooltip (const event::tevent event, bool &handled, const tpoint &location) |
| void | signal_handler_show_helptip (const event::tevent event, bool &handled, const tpoint &location) |
| void | signal_handler_notify_remove_tooltip (const event::tevent event, bool &handled) |
Private Attributes | |
| std::string | definition_ |
| The definition is the id of that widget class. | |
| t_string | label_ |
| Contain the non-editable text associated with control. | |
| bool | use_markup_ |
| Use markup for the label? | |
| bool | use_tooltip_on_label_overflow_ |
| If the text doesn't fit on the label should the text be used as tooltip? | |
| t_string | tooltip_ |
| Tooltip text. | |
| t_string | help_message_ |
| Tooltip text. | |
| std::vector< tcanvas > | canvas_ |
| Holds all canvas objects for a control. | |
| tresolution_definition_ptr | config_ |
| Contains the pointer to the configuration. | |
| font::ttext | renderer_ |
| Contains a helper cache for the rendering. | |
| int | text_maximum_width_ |
| The maximum width for the text in a control. | |
| PangoAlignment | text_alignment_ |
| The alignment of the text in a control. | |
| bool | shrunken_ |
| Is the widget smaller as it's best size? | |
Friends | |
| class | tdebug_layout_graph |
| class | twindow |
| Uses the load function. | |
Base class for all visible items.
Definition at line 30 of file control.hpp.
| gui2::tcontrol::tcontrol | ( | const unsigned | canvas_count | ) | [explicit] |
Definition at line 42 of file control.cpp.
References signal_handler_notify_remove_tooltip(), signal_handler_show_helptip(), and signal_handler_show_tooltip().

| gui2::tcontrol::tcontrol | ( | const implementation::tbuilder_control & | builder, | |
| const unsigned | canvas_count, | |||
| const std::string & | control_type | |||
| ) |
Constructor.
| builder | The builder object with the settings for the object. | |
| canvas_count | The number of canvasses in the control. |
Definition at line 77 of file control.cpp.
References definition_load_configuration(), signal_handler_notify_remove_tooltip(), signal_handler_show_helptip(), and signal_handler_show_tooltip().

| tpoint gui2::tcontrol::calculate_best_size | ( | ) | const [protected, virtual] |
Inherited from twidget.
Implements gui2::twidget.
Reimplemented in gui2::tcontainer_, gui2::tdrawing, gui2::tscrollbar_container, and gui2::tspacer.
Definition at line 236 of file control.cpp.
References config_, DBG_GUI_L, gui2::debug_truncate(), t_string::empty(), get_best_text_size(), get_config_default_size(), get_config_maximum_size(), label_, and LOG_HEADER.

| tcanvas& gui2::tcontrol::canvas | ( | const unsigned | index | ) | [inline] |
Definition at line 247 of file control.hpp.
References canvas_.
| std::vector<tcanvas>& gui2::tcontrol::canvas | ( | ) | [inline] |
Definition at line 246 of file control.hpp.
References canvas_.
Referenced by definition_load_configuration(), impl_draw_background(), gui2::tpanel::impl_draw_background(), gui2::tpanel::impl_draw_foreground(), intf_set_dialog_canvas(), gui2::tscrollbar_::load_config_extra(), place(), gui2::twml_message_::pre_show(), gui2::ttitle_screen::pre_show(), gui2::tdebug_clock::ttime::ttime(), gui2::tscrollbar_::update_canvas(), update_canvas(), gui2::ttoggle_button::update_canvas(), gui2::ttext_box::update_canvas(), gui2::tslider::update_canvas(), and gui2::ttext_box::update_offsets().

| tresolution_definition_ptr gui2::tcontrol::config | ( | ) | [inline, protected] |
Definition at line 257 of file control.hpp.
References config_.
Referenced by gui2::ttoggle_panel::border_space(), gui2::tpanel::border_space(), gui2::tslider::calculate_best_size(), definition_load_configuration(), gui2::ttoggle_panel::get_client_rect(), gui2::twindow::layout(), load_config(), gui2::ttext_box::load_config_extra(), gui2::tvertical_scrollbar::maximum_positioner_length(), gui2::tslider::maximum_positioner_length(), gui2::thorizontal_scrollbar::maximum_positioner_length(), gui2::tslider::minimum_positioner_length(), gui2::tvertical_scrollbar::offset_after(), gui2::tslider::offset_after(), gui2::thorizontal_scrollbar::offset_after(), gui2::tvertical_scrollbar::offset_before(), gui2::tslider::offset_before(), gui2::thorizontal_scrollbar::offset_before(), set_definition(), gui2::ttoggle_panel::set_state(), and gui2::ttext_box::update_offsets().

| tresolution_definition_const_ptr gui2::tcontrol::config | ( | ) | const [inline, protected] |
Definition at line 258 of file control.hpp.
References config_.
| iterator::twalker_ * gui2::tcontrol::create_walker | ( | ) | [virtual] |
Inherited from twidget.
Implements gui2::twidget.
Reimplemented in gui2::tcontainer_.
Definition at line 158 of file control.cpp.
References gui2::twidget::twidget().

| void gui2::tcontrol::definition_load_configuration | ( | const std::string & | control_type | ) | [private] |
Loads the configuration of the widget.
Controls have their definition stored in a definition object. In order to determine sizes and drawing the widget this definition needs to be loaded. The member definition_ contains the name of the definition and function load the proper configuration.
Definition at line 400 of file control.cpp.
References canvas(), config(), definition_, gui2::get_control(), set_config(), and update_canvas().
Referenced by load_config(), and tcontrol().


| bool gui2::tcontrol::disable_click_dismiss | ( | ) | const [virtual] |
Inherited from twidget.
The default behavious is that a widget blocks easy close, if not it hould override this function.
Implements gui2::twidget.
Reimplemented in gui2::tcontainer_, gui2::tdrawing, gui2::tlabel, gui2::tminimap, gui2::tprogress_bar, gui2::tscrollbar_container, and gui2::tspacer.
Definition at line 153 of file control.cpp.
References get_active(), gui2::twidget::get_visible(), and gui2::twidget::VISIBLE.

| twidget* gui2::tcontrol::find | ( | const std::string & | id, | |
| const bool | must_be_active | |||
| ) | [inline, virtual] |
Inherited from twidget.
Reimplemented from gui2::twidget.
Reimplemented in gui2::tcontainer_, and gui2::tscrollbar_container.
Definition at line 200 of file control.hpp.
References gui2::twidget::find(), and get_active().

| const twidget* gui2::tcontrol::find | ( | const std::string & | id, | |
| const bool | must_be_active | |||
| ) | const [inline, virtual] |
Inherited from twidget.
Reimplemented from gui2::twidget.
Reimplemented in gui2::tcontainer_, and gui2::tscrollbar_container.
Definition at line 207 of file control.hpp.
References gui2::twidget::find(), and get_active().

| twidget* gui2::tcontrol::find_at | ( | const tpoint & | coordinate, | |
| const bool | must_be_active | |||
| ) | [inline, virtual] |
Inherited from twidget.
Reimplemented from gui2::twidget.
Reimplemented in gui2::tcontainer_, and gui2::tscrollbar_container.
Definition at line 185 of file control.hpp.
References gui2::twidget::find_at(), and get_active().

| const twidget* gui2::tcontrol::find_at | ( | const tpoint & | coordinate, | |
| const bool | must_be_active | |||
| ) | const [inline, virtual] |
Inherited from twidget.
Reimplemented from gui2::twidget.
Reimplemented in gui2::tcontainer_, and gui2::tscrollbar_container.
Definition at line 192 of file control.hpp.
References gui2::twidget::find_at(), and get_active().

| virtual bool gui2::tcontrol::get_active | ( | ) | const [pure virtual] |
Gets the active state of the control.
Implemented in gui2::tdrawing, gui2::tlabel, gui2::tminimap, gui2::tmulti_page, gui2::tpanel, gui2::tprogress_bar, gui2::tscroll_label, gui2::tscrollbar_, gui2::tscrollbar_container, gui2::tscrollbar_panel, gui2::tspacer, gui2::tstacked_widget, and gui2::ttext_.
Referenced by disable_click_dismiss(), find(), find_at(), gui2::tcontainer_::set_active(), and gui2::tfield_::widget_set_enabled().

| tpoint gui2::tcontrol::get_best_text_size | ( | const tpoint & | minimum_size, | |
| const tpoint & | maximum_size = tpoint(0,0) | |||
| ) | const [private] |
Gets the best size for a text.
| minimum_size | The minimum size of the text. | |
| maximum_size | The wanted maximum size of the text, if not possible it's ignored. A value of 0 means that it's ignored as well. |
Definition at line 414 of file control.cpp.
References gui2::twidget::can_wrap(), config_, DBG_GUI_L, gui2::debug_truncate(), t_string::empty(), get_characters_per_line(), label_, gui2::log_gui_layout, LOG_HEADER, log_scope2, LOG_SCOPE_HEADER, renderer_, text_alignment_, text_maximum_width_, use_markup_, WRN_GUI_L, gui2::tpoint::x, and gui2::tpoint::y.
Referenced by calculate_best_size(), and request_reduce_width().


| unsigned gui2::tcontrol::get_characters_per_line | ( | ) | const [virtual] |
Returns the number of characters per line.
This value is used to call ttext::set_characters_per_line (indirectly).
Reimplemented in gui2::tlabel.
Definition at line 193 of file control.cpp.
Referenced by get_best_text_size(), and update_canvas().

| tpoint gui2::tcontrol::get_config_default_size | ( | ) | const |
Gets the default size as defined in the config.
Definition at line 173 of file control.cpp.
References config_, DBG_GUI_L, and LOG_HEADER.
Referenced by calculate_best_size().

| tpoint gui2::tcontrol::get_config_maximum_size | ( | ) | const |
Gets the best size as defined in the config.
Definition at line 183 of file control.cpp.
References config_, DBG_GUI_L, and LOG_HEADER.
Referenced by calculate_best_size(), and gui2::tgrid::tchild::place().

| tpoint gui2::tcontrol::get_config_minimum_size | ( | ) | const |
Gets the minimum size as defined in the config.
Definition at line 163 of file control.cpp.
References config_, DBG_GUI_L, and LOG_HEADER.
| virtual const std::string& gui2::tcontrol::get_control_type | ( | ) | const [pure virtual] |
Returns the control_type of the control.
The control_type parameter for tgui_definition::get_control() To keep the code more generic this type is required so the controls need to return the proper string here. Might be used at other parts as well the get the type of control involved.
Implemented in gui2::tdrawing, gui2::thorizontal_scrollbar, gui2::tlabel, gui2::tlistbox, gui2::tminimap, gui2::tmulti_page, gui2::tpanel, gui2::tpassword_box, gui2::tprogress_bar, gui2::tscroll_label, gui2::tscrollbar_container, gui2::tscrollbar_panel, gui2::tspacer, gui2::tstacked_widget, gui2::ttext_box, gui2::ttree_view, and gui2::tvertical_scrollbar.
Referenced by load_config().

| virtual unsigned gui2::tcontrol::get_state | ( | ) | const [protected, pure virtual] |
Returns the id of the state.
The current state is also the index canvas_.
Implemented in gui2::tdrawing, gui2::tlabel, gui2::tminimap, gui2::tmulti_page, gui2::tpanel, gui2::tprogress_bar, gui2::tscroll_label, gui2::tscrollbar_, gui2::tscrollbar_container, gui2::tscrollbar_panel, gui2::tspacer, gui2::tstacked_widget, and gui2::ttext_.
Referenced by impl_draw_background().

| PangoAlignment gui2::tcontrol::get_text_alignment | ( | ) | const [inline] |
Definition at line 251 of file control.hpp.
References text_alignment_.
| int gui2::tcontrol::get_text_maximum_height | ( | ) | const [protected] |
Returns the maximum height available for the text.
This value makes sense after the widget has been given a size, since the maximum height is based on the height of the widget.
Definition at line 368 of file control.cpp.
References config_, and gui2::twidget::get_height().
Referenced by gui2::ttext_box::place(), update_canvas(), and gui2::ttext_box::update_canvas().


| int gui2::tcontrol::get_text_maximum_width | ( | ) | const [protected] |
Returns the maximum width available for the text.
This value makes sense after the widget has been given a size, since the maximum width is based on the width of the widget.
Definition at line 359 of file control.cpp.
References config_, gui2::twidget::get_width(), and text_maximum_width_.
Referenced by gui2::ttext_box::place(), update_canvas(), and gui2::ttext_box::update_canvas().


| bool gui2::tcontrol::get_use_markup | ( | ) | const [inline] |
Definition at line 234 of file control.hpp.
References use_markup_.
| bool gui2::tcontrol::get_use_tooltip_on_label_overflow | ( | ) | const [inline] |
Definition at line 226 of file control.hpp.
References use_tooltip_on_label_overflow_.
| const t_string& gui2::tcontrol::help_message | ( | ) | const [inline] |
Definition at line 241 of file control.hpp.
References help_message_.
| void gui2::tcontrol::impl_draw_background | ( | surface & | frame_buffer | ) | [protected, virtual] |
Inherited from twidget.
Reimplemented from gui2::twidget.
Reimplemented in gui2::tminimap, gui2::tmulti_page, gui2::tpanel, and gui2::tspacer.
Definition at line 375 of file control.cpp.
References canvas(), DBG_GUI_D, gui2::debug_truncate(), gui2::twidget::get_rect(), get_state(), label_, and LOG_HEADER.

| void gui2::tcontrol::impl_draw_background | ( | surface & | frame_buffer, | |
| int | x_offset, | |||
| int | y_offset | |||
| ) | [protected, virtual] |
Reimplemented from gui2::twidget.
Reimplemented in gui2::tminimap, gui2::tmulti_page, gui2::tpanel, and gui2::tspacer.
Definition at line 385 of file control.cpp.
References gui2::twidget::calculate_blitting_rectangle(), canvas(), DBG_GUI_D, gui2::debug_truncate(), gui2::twidget::get_rect(), get_state(), label_, and LOG_HEADER.

| void gui2::tcontrol::impl_draw_foreground | ( | surface & | ) | [inline, protected, virtual] |
Inherited from twidget.
Reimplemented from gui2::twidget.
Reimplemented in gui2::tpanel.
Definition at line 387 of file control.hpp.
| void gui2::tcontrol::impl_draw_foreground | ( | surface & | , | |
| int | , | |||
| int | ||||
| ) | [inline, protected, virtual] |
Reimplemented from gui2::twidget.
Reimplemented in gui2::tpanel.
Definition at line 388 of file control.hpp.
| const t_string& gui2::tcontrol::label | ( | ) | const [inline] |
Definition at line 230 of file control.hpp.
References label_.
Referenced by gui2::tlobby_main::active_window_changed(), gui2::tlobby_main::append_to_chatbox(), gui2::tsub_player_list::auto_hide(), gui2::tscroll_label::finalize_subclass(), and gui2::tfield< T, W, CT >::save().

| void gui2::tcontrol::layout_init | ( | const bool | full_initialization | ) | [virtual] |
Inherited from twidget.
Reimplemented from gui2::twidget.
Reimplemented in gui2::tcontainer_, and gui2::tscrollbar_container.
Definition at line 198 of file control.cpp.
References shrunken_.
| void gui2::tcontrol::load_config | ( | ) | [private] |
Loads the configuration of the widget.
Controls have their definition stored in a definition object. In order to determine sizes and drawing the widget this definition needs to be loaded. The member definition_ contains the name of the definition and function load the proper configuration.
definition_load_configuration() is the replacement.
Definition at line 282 of file control.cpp.
References config(), definition_load_configuration(), get_control_type(), and load_config_extra().
Referenced by set_definition(), and gui2::twindow::twindow().


| virtual void gui2::tcontrol::load_config_extra | ( | ) | [inline, private, virtual] |
Load class dependant config settings.
load_config will call this method after loading the config, by default it does nothing but classes can override it to implement custom behaviour.
Reimplemented in gui2::tscrollbar_, and gui2::ttext_box.
Definition at line 354 of file control.hpp.
Referenced by load_config().

Inherited from twidget.
Reimplemented from gui2::twidget.
Reimplemented in gui2::tcontainer_, gui2::tlistbox, gui2::tscrollbar_, gui2::tscrollbar_container, and gui2::ttext_box.
Definition at line 259 of file control.cpp.
References canvas(), canvas_, t_string::empty(), label_, renderer_, gui2::tcanvas::set_height(), set_tooltip(), gui2::tcanvas::set_width(), tooltip_, update_canvas(), use_tooltip_on_label_overflow_, gui2::tpoint::x, and gui2::tpoint::y.

| void gui2::tcontrol::request_reduce_width | ( | const unsigned | maximum_width | ) | [virtual] |
Inherited from twidget.
Implements gui2::twidget.
Reimplemented in gui2::tcontainer_, and gui2::tscrollbar_container.
Definition at line 208 of file control.cpp.
References gui2::twidget::can_wrap(), config_, DBG_GUI_L, gui2::debug_truncate(), t_string::empty(), get_best_text_size(), label_, LOG_HEADER, gui2::twidget::set_layout_size(), gui2::tpoint::x, and gui2::tpoint::y.

| virtual void gui2::tcontrol::set_active | ( | const bool | active | ) | [pure virtual] |
Sets the control's state.
Sets the control in the active state, when inactive a control can't be used and doesn't react to events. (Note read-only for a ttext_ is a different state.)
Implemented in gui2::tcontainer_, gui2::tdrawing, gui2::tlabel, gui2::tminimap, gui2::tprogress_bar, gui2::tscrollbar_, gui2::tspacer, and gui2::ttext_.
Referenced by intf_set_dialog_active(), gui2::tgrid::set_active(), gui2::tscrollbar_container::set_scrollbar_button_status(), gui2::teditor_settings::update_selected_tod_info(), and gui2::tfield_::widget_set_enabled().

| void gui2::tcontrol::set_config | ( | tresolution_definition_ptr | config | ) | [inline, protected] |
Definition at line 260 of file control.hpp.
References config_.
Referenced by definition_load_configuration().

| void gui2::tcontrol::set_definition | ( | const std::string & | definition | ) |
Sets the definition.
This function sets the definition of a control and should be called soon after creating the object since a lot of internal functions depend on the definition.
This function should be called one time only!!!
Definition at line 292 of file control.cpp.
References config(), definition_, gui2::init(), and load_config().
Referenced by gui2::tscrollbar_container::finalize_setup(), gui2::implementation::tbuilder_control::init_control(), and gui2::twindow::twindow().


| void gui2::tcontrol::set_help_message | ( | const t_string & | help_message | ) | [inline] |
Definition at line 243 of file control.hpp.
References help_message_.
Referenced by gui2::implementation::tbuilder_control::init_control(), and set_members().

| void gui2::tcontrol::set_label | ( | const t_string & | label | ) | [virtual] |
Reimplemented in gui2::tscroll_label.
Definition at line 304 of file control.cpp.
References label_, gui2::twidget::set_dirty(), gui2::twidget::set_layout_size(), and update_canvas().
Referenced by gui2::tsub_player_list::auto_hide(), gui2::tchat_log::model::clear_chat_msg_list(), gui2::tscroll_label::finalize_subclass(), gui2::tmessage_implementation::init_button(), gui2::implementation::tbuilder_control::init_control(), intf_set_dialog_value(), gui2::tchat_log::model::populate_chat_message_list(), gui2::twml_message_::pre_show(), gui2::tsimple_item_selector::pre_show(), gui2::tnetwork_transmission::pre_show(), gui2::tmessage::pre_show(), gui2::tformula_debugger::pre_show(), gui2::tfield< T, W, CT >::restore(), gui2::tgamestate_inspector::model::set_inspect_window_text(), gui2::tscroll_label::set_label(), set_members(), gui2::tgamestate_inspector::controller::show_title(), gui2::teditor_generate_map::update_current_generator_label(), gui2::tlobby_player_info::update_relation(), and gui2::teditor_settings::update_selected_tod_info().


| void gui2::tcontrol::set_members | ( | const string_map & | data | ) | [virtual] |
Sets the members of the control.
The map contains named members it can set, controls inheriting from us can add additional members to set by this function. The following members can by the following key: * label_ label * tooltip_ tooltip * help_message_ help
| data | Map with the key value pairs to set the members. |
Definition at line 118 of file control.cpp.
References set_help_message(), gui2::twidget::set_id(), set_label(), gui2::twidget::set_linked_group(), set_tooltip(), set_use_markup(), and utils::string_bool().
Referenced by gui2::tpane::create_item(), gui2::ttree_view_node::init_grid(), and gui2::ttoggle_panel::set_child_members().


| void gui2::tcontrol::set_text_alignment | ( | const PangoAlignment | text_alignment | ) |
Definition at line 327 of file control.cpp.
References gui2::twidget::set_dirty(), text_alignment_, and update_canvas().

| void gui2::tcontrol::set_tooltip | ( | const t_string & | tooltip | ) | [inline] |
Definition at line 238 of file control.hpp.
References t_string::empty(), gui2::tevent_executor::set_wants_mouse_hover(), and tooltip_.
Referenced by gui2::implementation::tbuilder_control::init_control(), place(), and set_members().


| void gui2::tcontrol::set_use_markup | ( | bool | use_markup | ) | [virtual] |
Reimplemented in gui2::tscroll_label.
Definition at line 316 of file control.cpp.
References gui2::twidget::set_dirty(), update_canvas(), and use_markup_.
Referenced by gui2::twml_message_::pre_show(), gui2::tnetwork_transmission::pre_show(), gui2::tformula_debugger::pre_show(), set_members(), gui2::tscroll_label::set_use_markup(), and gui2::tchat_log::controller::update_view_from_model().


| void gui2::tcontrol::set_use_tooltip_on_label_overflow | ( | const bool | use_tooltip = true |
) | [inline] |
Definition at line 227 of file control.hpp.
References use_tooltip_on_label_overflow_.
Referenced by gui2::implementation::tbuilder_control::init_control().

| void gui2::tcontrol::signal_handler_notify_remove_tooltip | ( | const event::tevent | event, | |
| bool & | handled | |||
| ) | [private] |
Definition at line 525 of file control.cpp.
References DBG_GUI_E, LOG_HEADER, and schema_validation::remove.
Referenced by tcontrol().

| void gui2::tcontrol::signal_handler_show_helptip | ( | const event::tevent | event, | |
| bool & | handled, | |||
| const tpoint & | location | |||
| ) | [private] |
Definition at line 512 of file control.cpp.
References DBG_GUI_E, t_string::empty(), gui2::event::tdispatcher::fire(), help_message_, LOG_HEADER, and gui2::event::MESSAGE_SHOW_HELPTIP.
Referenced by tcontrol().


| void gui2::tcontrol::signal_handler_show_tooltip | ( | const event::tevent | event, | |
| bool & | handled, | |||
| const tpoint & | location | |||
| ) | [private] |
Definition at line 488 of file control.cpp.
References DBG_GUI_E, t_string::empty(), gui2::event::tdispatcher::fire(), hotkey::get_hotkey(), hotkey::GLOBAL__HELPTIP, gui2::settings::has_helptip_message, help_message_, utils::interpolate_variables_into_string(), LOG_HEADER, gui2::event::MESSAGE_SHOW_TOOLTIP, gui2::tip::tip(), and tooltip_.
Referenced by tcontrol().


| const t_string& gui2::tcontrol::tooltip | ( | ) | const [inline] |
Definition at line 236 of file control.hpp.
References tooltip_.
| void gui2::tcontrol::update_canvas | ( | ) | [protected, virtual] |
Updates the canvas(ses).
This function should be called if either the size of the widget changes or the text on the widget changes.
Reimplemented in gui2::tscrollbar_, and gui2::ttext_box.
Definition at line 338 of file control.cpp.
References gui2::twidget::can_wrap(), canvas(), canvas_, gui2::encode_text_alignment(), get_characters_per_line(), get_text_maximum_height(), get_text_maximum_width(), label_, gui2::tcanvas::set_variable(), text_alignment_, and use_markup_.
Referenced by definition_load_configuration(), gui2::ttext_::insert_char(), gui2::ttext_::paste_selection(), place(), gui2::ttext_::set_cursor(), set_label(), gui2::ttext_::set_maximum_length(), set_text_alignment(), set_use_markup(), and gui2::ttext_::set_value().


friend class tdebug_layout_graph [friend] |
Reimplemented from gui2::twidget.
Reimplemented in gui2::tcontainer_, gui2::tlistbox, gui2::tmulti_page, gui2::tscrollbar_container, and gui2::tstacked_widget.
Definition at line 32 of file control.hpp.
friend class twindow [friend] |
Uses the load function.
Reimplemented from gui2::twidget.
Definition at line 181 of file control.hpp.
std::vector<tcanvas> gui2::tcontrol::canvas_ [private] |
Holds all canvas objects for a control.
A control can have multiple states, which are defined in the classes inheriting from us. For every state there is a separate canvas, which is stored here. When drawing the state is determined and that canvas is drawn.
Definition at line 335 of file control.hpp.
Referenced by canvas(), place(), and update_canvas().
Contains the pointer to the configuration.
Every control has a definition of how it should look, this contains a pointer to the definition. The definition is resolution dependant, where the resolution is the size of the Wesnoth application window. Depending on the resolution widgets can look different, use different fonts. Windows can use extra scrollbars use abbreviations as text etc.
Definition at line 346 of file control.hpp.
Referenced by calculate_best_size(), config(), get_best_text_size(), get_config_default_size(), get_config_maximum_size(), get_config_minimum_size(), get_text_maximum_height(), get_text_maximum_width(), request_reduce_width(), and set_config().
std::string gui2::tcontrol::definition_ [private] |
The definition is the id of that widget class.
Eg for a button it [button_definition]id. A button can have multiple definitions which all look different but for the engine still is a button.
Definition at line 296 of file control.hpp.
Referenced by definition_load_configuration(), and set_definition().
t_string gui2::tcontrol::help_message_ [private] |
Tooltip text.
The help event can cause a tooltip to be shown, this is the text to be shown. At the moment the tooltip is a single line of text.
Definition at line 325 of file control.hpp.
Referenced by help_message(), set_help_message(), signal_handler_show_helptip(), and signal_handler_show_tooltip().
t_string gui2::tcontrol::label_ [private] |
Contain the non-editable text associated with control.
Definition at line 299 of file control.hpp.
Referenced by calculate_best_size(), get_best_text_size(), impl_draw_background(), label(), place(), request_reduce_width(), set_label(), and update_canvas().
font::ttext gui2::tcontrol::renderer_ [mutable, private] |
Contains a helper cache for the rendering.
Creating a ttext object is quite expensive and is done on various occasions so it's cached here.
Definition at line 431 of file control.hpp.
Referenced by get_best_text_size(), and place().
bool gui2::tcontrol::shrunken_ [private] |
Is the widget smaller as it's best size?
Definition at line 440 of file control.hpp.
Referenced by layout_init().
PangoAlignment gui2::tcontrol::text_alignment_ [private] |
The alignment of the text in a control.
Definition at line 437 of file control.hpp.
Referenced by get_best_text_size(), get_text_alignment(), set_text_alignment(), and update_canvas().
int gui2::tcontrol::text_maximum_width_ [private] |
The maximum width for the text in a control.
Definition at line 434 of file control.hpp.
Referenced by get_best_text_size(), and get_text_maximum_width().
t_string gui2::tcontrol::tooltip_ [private] |
Tooltip text.
The hovering event can cause a small tooltip to be shown, this is the text to be shown. At the moment the tooltip is a single line of text.
Definition at line 317 of file control.hpp.
Referenced by place(), set_tooltip(), signal_handler_show_tooltip(), and tooltip().
bool gui2::tcontrol::use_markup_ [private] |
Use markup for the label?
Definition at line 302 of file control.hpp.
Referenced by get_best_text_size(), get_use_markup(), set_use_markup(), and update_canvas().
bool gui2::tcontrol::use_tooltip_on_label_overflow_ [private] |
If the text doesn't fit on the label should the text be used as tooltip?
This only happens if the tooltip is empty.
Definition at line 309 of file control.hpp.
Referenced by get_use_tooltip_on_label_overflow(), place(), and set_use_tooltip_on_label_overflow().
| Generated by doxygen 1.7.1 on Thu May 24 2012 01:22:47 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |