15 #define GETTEXT_DOMAIN "wesnoth-lib"
57 return can_wrap_ || characters_per_line_ != 0;
99 characters_per_line_ = characters_per_line;
174 if (link.length() == 0) {
178 DBG_GUI_E <<
"Clicked Link:\"" << link <<
"\"\n";
190 DBG_GUI_E <<
"label right click" << std::endl;
203 if (link.length() == 0) {
207 DBG_GUI_E <<
"Right Clicked Link:\"" << link <<
"\"\n";
221 DBG_GUI_P <<
"Parsing label " <<
id <<
'\n';
223 load_resolutions<tresolution>(cfg);
266 , link_aware(cfg[
"link_aware"].to_bool(false))
267 , link_color(cfg[
"link_color"].str().
size() > 0 ? cfg[
"link_color"].str() :
"#ffff00")
316 tbuilder_label::tbuilder_label(
const config& cfg)
318 , wrap(cfg[
"wrap"].to_bool())
319 , characters_per_line(cfg[
"characters_per_line"])
334 DBG_GUI_G <<
"Window builder: placed label '" <<
id <<
"' with definition '"
Define the common log macros for the gui toolkit.
std::string link_color_
What color links will be rendered in.
void set_state(const tstate state)
PangoAlignment text_alignment
virtual void set_active(const bool active) override
See tcontrol::set_active.
void signal_handler_left_button_click(const event::tevent event, bool &handled)
Left click signal handler: checks if we clicked on a hyperlink.
GLuint GLuint GLsizei GLenum type
void set_can_wrap(const bool wrap)
tresolution_definition_ptr config()
tresolution(const config &cfg)
PangoAlignment decode_text_alignment(const std::string &alignment)
Converts a text alignment string to a text alignment.
virtual unsigned get_state() const override
See tcontrol::get_state.
Base class of a resolution, contains the common keys for a resolution.
unsigned characters_per_line
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.
Desktop environment interaction functions.
static UNUSEDNOWARN std::string _(const char *str)
virtual bool can_wrap() const override
See twidget::can_wrap.
Dialog is closed with ok button.
void load_config_extra()
Inherited from tcontrol.
void show_message(CVideo &video, const std::string &title, const std::string &message, const std::string &button_caption, const bool auto_close, const bool message_use_markup)
Shows a message to the user.
bool can_wrap_
Holds the label can wrap or not.
tpoint get_mouse_position()
Returns the current mouse position.
tevent
The event send to the dispatcher.
tstate
Possible states of the widget.
Contains the state info for a resolution.
bool open_object(const std::string &path_or_url)
Opens the specified object with the default application configured for its type.
virtual void update_canvas()
Updates the canvas(ses).
unsigned characters_per_line_
The maximum number of characters per line.
virtual bool get_link_aware() const override
See tcontrol::get_link_aware.
tformula< bool > link_aware_
The link aware switch of the text.
void set_characters_per_line(const unsigned set_characters_per_line)
tstate state_
Current state of the widget.
tlabel_definition(const config &cfg)
Base class for all visible items.
unsigned characters_per_line_
The number of characters per line.
void set_link_color(const std::string &color)
bool open_object_is_supported()
Returns whether open_object() is supported/implemented for the current platform.
void copy_to_clipboard(const std::string &text, const bool)
Copies text to the clipboard.
std::vector< tstate_definition > state
void set_text_alignment(const PangoAlignment text_alignment)
tformula< std::string > link_color_
The link color of the text.
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 signal_handler_right_button_click(const event::tevent event, bool &handled)
Right click signal handler: checks if we clicked on a hyperlink, copied to clipboard.
std::string get_label_link(const gui2::tpoint &position) const
virtual const std::string & get_control_type() const override
See tcontrol::get_control_type.
void set_link_aware(bool l)
virtual bool get_active() const override
See tcontrol::get_active.
A config object defines a single node in a WML file, with access to child nodes.
virtual unsigned get_characters_per_line() const override
See tcontrol::get_characters_per_line.
GLsizei const GLcharARB ** string
Shows a yes and no button.
bool link_aware_
Whether the label is link aware, rendering links with special formatting and handling click events...
virtual std::string get_link_color() const override
See tcontrol::get_link_aware.
Contains the implementation details for lexical_cast and shouldn't be used directly.
bool disable_click_dismiss() const override
See twidget::disable_click_dismiss.