lxgui
|
A region that can contain other regions and react to events. More...
#include <gui_frame.hpp>
Public Types | |
using | base = region |
using | child_list = std::list< utils::owner_ptr< frame > > |
Type of the frame child list (internal). | |
using | child_list_view = utils::view::adaptor< child_list, utils::view::smart_ptr_dereferencer, utils::view::non_null_filter > |
using | const_child_list_view = utils::view::adaptor< const child_list, utils::view::smart_ptr_dereferencer, utils::view::non_null_filter > |
using | region_list = std::list< utils::owner_ptr< layered_region > > |
Type of the region list (internal). | |
using | region_list_view = utils::view::adaptor< region_list, utils::view::smart_ptr_dereferencer, utils::view::non_null_filter > |
using | const_region_list_view = utils::view::adaptor< const region_list, utils::view::smart_ptr_dereferencer, utils::view::non_null_filter > |
Public Member Functions | |
frame (utils::control_block &block, manager &mgr, const frame_core_attributes &attr) | |
Constructor. | |
~frame () override | |
Destructor. | |
void | render () const override |
Renders this region on the current render target. | |
void | update (float delta) final |
Updates this region's logic. | |
std::string | serialize (const std::string &tab) const override |
Prints all relevant information about this region in a string. | |
virtual bool | can_use_script (const std::string &script_name) const |
Returns 'true' if this frame can use a script. | |
void | copy_from (const region &obj) override |
Copies a region's parameters into this frame (inheritance). | |
void | create_title_region () |
Creates a new title region for this frame. | |
void | set_draw_layer_enabled (layer layer_id, bool enable) |
Enables or disables a layer. | |
void | disable_draw_layer (layer layer_id) |
Disables a layer. | |
void | enable_draw_layer (layer layer_id) |
Enables a layer. | |
void | set_mouse_enabled (bool is_mouse_enabled) |
Sets if this frame can receive mouse input (click & move). | |
void | enable_mouse () |
Marks this frame as able to receive mouse input (click & move). | |
void | disable_mouse () |
Marks this frame as unable to receive mouse input (click & move). | |
void | set_mouse_click_enabled (bool is_mouse_enabled) |
Sets if this frame can receive mouse click input. | |
void | enable_mouse_click () |
Marks this frame as able to receive mouse click input. | |
void | disable_mouse_click () |
Marks this frame as unable to receive mouse click input. | |
void | set_mouse_move_enabled (bool is_mouse_enabled) |
Sets if this frame can receive mouse move input. | |
void | enable_mouse_move () |
Marks this frame as able to receive mouse move input. | |
void | disable_mouse_move () |
Marks this frame as unable to receive mouse move input. | |
void | set_mouse_wheel_enabled (bool is_mouse_wheel_enabled) |
Sets if this frame can receive mouse wheel input. | |
void | enable_mouse_wheel () |
Marks this frame as able to receive mouse wheel input. | |
void | disable_mouse_wheel () |
Marks this frame as unable to receive mouse wheel input. | |
void | set_keyboard_enabled (bool is_keyboard_enabled) |
Sets if this frame can receive any keyboard input. | |
void | enable_keyboard () |
Marks this frame as able to receive any keyboard input. | |
void | disable_keyboard () |
Marks this frame as unable to receive any keyboard input. | |
void | set_key_capture_enabled (const std::string &key_name, bool enable) |
Marks this frame as able to receive keyboard input from a specific key. | |
void | set_key_capture_enabled (input::key key_id, bool enable) |
Marks this frame as able to receive keyboard input from a specific key. | |
void | enable_key_capture (const std::string &key_name) |
Marks this frame as able to receive keyboard input from a specific key. | |
void | enable_key_capture (input::key key_id) |
Marks this frame as able to receive keyboard input from a specific key. | |
void | disable_key_capture (const std::string &key_name) |
Marks this frame as unable to receive keyboard input from a specific key. | |
void | disable_key_capture (input::key key_id) |
Marks this frame as unable to receive keyboard input from a specific key. | |
void | disable_key_capture () |
Marks this frame as unable to receive keyboard input from any key. | |
bool | has_script (const std::string &script_name) const |
Checks if this frame has a script defined. | |
utils::observer_ptr< layered_region > | add_region (utils::owner_ptr< layered_region > reg) |
Adds a layered_region to this frame's children. | |
template<typename RegionType , typename Enable = typename std::enable_if<std::is_base_of<gui::layered_region, RegionType>::value>::type> | |
utils::observer_ptr< RegionType > | add_region (utils::owner_ptr< RegionType > reg) |
Adds a layered_region to this frame's children. | |
utils::owner_ptr< layered_region > | remove_region (const utils::observer_ptr< layered_region > ®) |
Removes a layered_region from this frame's children. | |
utils::observer_ptr< layered_region > | create_layered_region (layer layer_id, region_core_attributes attr) |
Creates a new region as child of this frame. | |
template<typename RegionType , typename Enable = typename std::enable_if<std::is_base_of<gui::layered_region, RegionType>::value>::type> | |
utils::observer_ptr< RegionType > | create_layered_region (layer layer_id, region_core_attributes attr) |
Creates a new region as child of this frame. | |
template<typename RegionType , typename Enable = typename std::enable_if<std::is_base_of<gui::layered_region, RegionType>::value>::type> | |
utils::observer_ptr< RegionType > | create_layered_region (layer layer_id, const std::string &name) |
Creates a new region as child of this frame. | |
utils::observer_ptr< frame > | create_child (frame_core_attributes attr) |
Creates a new frame as child of this frame. | |
template<typename FrameType , typename Enable = typename std::enable_if<std::is_base_of<gui::frame, FrameType>::value>::type> | |
utils::observer_ptr< FrameType > | create_child (frame_core_attributes attr) |
Creates a new frame as child of this frame. | |
template<typename FrameType , typename Enable = typename std::enable_if<std::is_base_of<gui::frame, FrameType>::value>::type> | |
utils::observer_ptr< FrameType > | create_child (const std::string &name) |
Creates a new frame as child of this frame. | |
utils::observer_ptr< frame > | add_child (utils::owner_ptr< frame > child) |
Adds a frame to this frame's children. | |
template<typename FrameType , typename Enable = typename std::enable_if<std::is_base_of<gui::frame, FrameType>::value>::type> | |
utils::observer_ptr< FrameType > | add_child (utils::owner_ptr< FrameType > child) |
Adds a frame to this frame's children. | |
utils::owner_ptr< frame > | remove_child (const utils::observer_ptr< frame > &child) |
Removes a frame from this frame's children. | |
child_list_view | get_children () |
Returns the child list. | |
const_child_list_view | get_children () const |
Returns the child list. | |
utils::observer_ptr< const frame > | get_child (const std::string &name) const |
Returns one of this frame's children. | |
utils::observer_ptr< frame > | get_child (const std::string &name) |
Returns one of this frame's children. | |
template<typename FrameType , typename Enable = typename std::enable_if<std::is_base_of<gui::frame, FrameType>::value>::type> | |
utils::observer_ptr< const FrameType > | get_child (const std::string &name) const |
Returns one of this frame's children. | |
template<typename FrameType , typename Enable = typename std::enable_if<std::is_base_of<gui::frame, FrameType>::value>::type> | |
utils::observer_ptr< FrameType > | get_child (const std::string &name) |
Returns one of this frame's children. | |
region_list_view | get_regions () |
Returns the region list. | |
const_region_list_view | get_regions () const |
Returns the region list. | |
utils::observer_ptr< const layered_region > | get_region (const std::string &name) const |
Returns one of this frame's region. | |
utils::observer_ptr< layered_region > | get_region (const std::string &name) |
Returns one of this frame's region. | |
template<typename RegionType , typename Enable = typename std::enable_if<std::is_base_of<gui::layered_region, RegionType>::value>::type> | |
utils::observer_ptr< RegionType > | get_region (const std::string &name) |
Returns one of this frame's region. | |
float | get_effective_scale () const |
Calculates effective scale. | |
int | get_level () const |
Returns this frame's level. | |
std::optional< strata > | get_strata () const |
Returns this frame's strata. | |
strata | get_effective_strata () const |
Returns this frame's effective strata. | |
utils::observer_ptr< const frame > | get_top_level_parent () const |
Returns this frame's top-level parent. | |
utils::observer_ptr< frame > | get_top_level_parent () |
Returns this frame's top-level parent. | |
const backdrop * | get_backdrop () const |
Returns this frame's backdrop. | |
backdrop * | get_backdrop () |
Returns this frame's backdrop. | |
backdrop & | get_or_create_backdrop () |
Returns this frame's backdrop, creating it if needed. | |
const bounds2f & | get_abs_hit_rect_insets () const |
Returns this frame's absolute hit rect insets. | |
const bounds2f & | get_rel_hit_rect_insets () const |
Returns this frame's relative hit rect insets. | |
vector2f | get_max_dimensions () const |
Returns this frame's max dimensions. | |
vector2f | get_min_dimensions () const |
Returns this frame's min dimensions. | |
std::size_t | get_child_count () const |
Returns the number of children of this frame. | |
std::size_t | get_child_count_upper_bound () const |
Returns the approximate number of children of this frame. | |
std::size_t | get_layered_region_count () const |
Returns the number of layered regions of this frame. | |
std::size_t | get_layered_region_count_upper_bound () const |
Returns the approximate number of regions of this frame. | |
float | get_scale () const |
Returns this frame's scale. | |
utils::observer_ptr< const region > | get_title_region () const |
Returns this frame's title region. | |
utils::observer_ptr< region > | get_title_region () |
Returns this frame's title region. | |
bool | is_clamped_to_screen () const |
Checks if this frame is clamped to screen. | |
bool | is_in_region (const vector2f &position) const override |
Checks if the provided coordinates are inside this frame. | |
virtual utils::observer_ptr< const frame > | find_topmost_frame (const std::function< bool(const frame &)> &predicate) const |
Find the topmost frame matching the provided predicate. | |
utils::observer_ptr< frame > | find_topmost_frame (const std::function< bool(const frame &)> &predicate) |
Find the topmost frame matching the provided predicate. | |
bool | is_mouse_move_enabled () const |
Checks if this frame can receive mouse movement input. | |
bool | is_mouse_click_enabled () const |
Checks if this frame can receive mouse click input. | |
bool | is_mouse_wheel_enabled () const |
Checks if this frame can receive mouse wheel input. | |
bool | is_drag_enabled (const std::string &button_name) const |
Checks if this frame is registered for drag events with the provided mouse button. | |
bool | is_key_capture_enabled (const std::string &key_name) const |
Checks if this frame can receive keyboard input from a specific key. | |
bool | is_keyboard_enabled () const |
Checks if this frame can receive any keyboard input. | |
bool | is_movable () const |
Checks if this frame can be moved. | |
bool | is_resizable () const |
Checks if this frame can be resized. | |
bool | is_top_level () const |
Checks if this frame is at top level. | |
bool | is_user_placed () const |
Checks if this frame has been moved by the user. | |
utils::connection | add_script (const std::string &script_name, std::string content, script_info info=script_info{}) |
Adds an additional handler script to this frame (executed after existing scripts). | |
utils::connection | add_script (const std::string &script_name, sol::protected_function handler, script_info info=script_info{}) |
Adds an additional handler script to this frame (executed after existing scripts). | |
utils::connection | add_script (const std::string &script_name, script_function handler, script_info info=script_info{}) |
Adds an additional handler script to this frame (executed after existing scripts). | |
template<typename DerivedType = void, typename Function > | |
utils::connection | add_script (const std::string &script_name, Function &&handler, script_info info=script_info{}) |
Adds an additional handler script to this frame (executed after existing scripts). | |
utils::connection | set_script (const std::string &script_name, std::string content, script_info info=script_info{}) |
Sets a new handler script for this frame (replacing existing scripts). | |
utils::connection | set_script (const std::string &script_name, sol::protected_function handler, script_info info=script_info{}) |
Sets a new handler script for this frame (replacing existing scripts). | |
utils::connection | set_script (const std::string &script_name, script_function handler, script_info info=script_info{}) |
Sets a new handler script for this frame (replacing existing scripts). | |
template<typename DerivedType = void, typename Function > | |
utils::connection | set_script (const std::string &script_name, Function &&handler, script_info info=script_info{}) |
Sets a new handler script for this frame (replacing existing scripts). | |
script_list_view | get_script (const std::string &script_name) const |
Return a view into this frame's handler scripts, registered for the given event. | |
void | remove_script (const std::string &script_name) |
Removes a script from this frame. | |
virtual void | fire_script (const std::string &script_name, const event_data &data=event_data{}) |
Calls a script. | |
void | set_update_rate (float rate) |
Sets a maximum update rate (in updates per seconds). | |
float | get_update_rate () const |
Gets the maximum update rate (in upates per seconds). | |
void | register_event (const std::string &event_name) |
Tells this frame to react to a certain event. | |
void | unregister_event (const std::string &event_name) |
Tells the frame not to react to a certain event. | |
void | set_drag_enabled (const std::string &button_name, bool enable) |
Tells this frame whether to react to mouse drag or not. | |
void | set_drag_enabled (input::mouse_button button_id, bool enable) |
Tells this frame whether to react to mouse drag or not. | |
void | enable_drag (const std::string &button_name) |
Tells this frame to react to mouse drag. | |
void | enable_drag (input::mouse_button button_id) |
Tells this frame to react to mouse drag. | |
void | disable_drag (const std::string &button_name) |
Tells this frame to not react to mouse drag. | |
void | disable_drag (input::mouse_button button_id) |
Tells this frame to not react to mouse drag. | |
void | disable_drag () |
Tells this frame to not react to mouse drag from any mouse button. | |
void | set_clamped_to_screen (bool is_clamped_to_screen) |
Sets if this frame is clamped to screen. | |
void | set_strata (std::optional< strata > strata_id) |
Sets this frame's strata. | |
void | set_backdrop (std::unique_ptr< backdrop > bdrop) |
Sets this frames' backdrop. | |
void | set_abs_hit_rect_insets (const bounds2f &insets) |
Sets this frame's absolute hit rect insets. | |
void | set_rel_hit_rect_insets (const bounds2f &insets) |
Sets this frame's relative hit rect insets. | |
void | set_level (int level_id) |
Sets this frame's level. | |
void | set_max_dimensions (const vector2f &max) |
Sets this frame's maximum size. | |
void | set_min_dimensions (const vector2f &min) |
Sets this frame's minimum size. | |
void | set_max_height (float max_height) |
Sets this frame's maximum height. | |
void | set_max_width (float max_width) |
Sets this frame's maximum width. | |
void | set_min_height (float min_height) |
Sets this frame's minimum height. | |
void | set_min_width (float min_width) |
Sets this frame's minimum width. | |
void | set_movable (bool is_movable) |
Sets if this frame can be moved by the user. | |
utils::owner_ptr< region > | release_from_parent () override |
Removes this region from its parent and return an owning pointer. | |
void | set_resizable (bool is_resizable) |
Sets if this frame can be resized by the user. | |
void | set_scale (float scale) |
Sets this frame's scale. | |
void | set_top_level (bool is_top_level) |
Sets if this frame is at top level. | |
void | raise () |
Increases this frame's level so it's the highest of the strata. | |
void | set_user_placed (bool is_user_placed) |
Sets if this frame has been moved by the user. | |
void | start_moving () |
Starts moving this frame with the mouse. | |
void | stop_moving () |
ends moving this frame. | |
void | start_sizing (const point &p) |
Starts resizing this frame with the mouse. | |
void | stop_sizing () |
ends resizing this frame. | |
void | enable_auto_focus (bool enable) |
Enables automatic focus when this frame is shown or raised. | |
bool | is_auto_focus_enabled () const |
Checks if automatic focus is enabled. | |
void | set_focus (bool focus) |
Asks for focus for this frame. | |
bool | has_focus () const |
Check if this frame currently has focus. | |
void | set_frame_renderer (utils::observer_ptr< frame_renderer > rdr) |
Flags this object as rendered by another object. | |
utils::observer_ptr< const frame_renderer > | get_frame_renderer () const |
Returns the renderer of this object, nullptr if none. | |
const utils::observer_ptr< frame_renderer > & | get_frame_renderer () |
Returns the renderer of this object, nullptr if none. | |
utils::observer_ptr< const frame_renderer > | get_effective_frame_renderer () const final |
Returns the renderer of this object or its parents, nullptr if none. | |
utils::observer_ptr< frame_renderer > | get_effective_frame_renderer () |
Returns the renderer of this object or its parents, nullptr if none. | |
void | notify_renderer_need_redraw () override |
Notifies the renderer of this region that it needs to be redrawn. | |
void | set_dimensions (const vector2f &dimensions) override |
Changes this region's absolute dimensions (in pixels). | |
void | set_width (float abs_width) override |
Changes this region's absolute width (in pixels). | |
void | set_height (float abs_height) override |
Changes this region's absolute height (in pixels). | |
virtual void | notify_mouse_in_frame (bool mouse_in_frame, const vector2f &mouse_pos) |
Tells this frame it is being hovered by the mouse. | |
void | notify_visible () override |
Notifies this region that it is now visible on screen. | |
void | notify_invisible () override |
Notifies this region that it is no longer visible on screen. | |
virtual void | notify_focus (bool focus) |
Notifies this frame that it has received or lost focus. | |
void | notify_loaded () override |
Notifies this region that it has been fully loaded. | |
void | notify_layers_need_update () |
Tells this frame to rebuild its layer list. | |
void | notify_scaling_factor_updated () override |
Tells this region that the global interface scaling factor has changed. | |
void | parse_layout (const layout_node &node) final |
Parses data from a layout_node. | |
virtual void | notify_borders_need_update () |
Tells this region that its borders need updating. | |
const std::string & | get_name () const |
Returns this region's name. | |
const std::string & | get_raw_name () const |
Returns this region's raw name. | |
utils::observer_ptr< const frame > | get_parent () const |
Returns this region's parent. | |
const utils::observer_ptr< frame > & | get_parent () |
Returns this region's parent. | |
void | destroy () |
Forcefully removes this region from the GUI. | |
void | set_alpha (float alpha) |
Changes this region's alpha (opacity). | |
float | get_alpha () const |
Returns this region's alpha (opacity). | |
float | get_effective_alpha () const |
Returns this region's effective alpha (opacity). | |
void | show () |
shows this region. | |
void | hide () |
hides this region. | |
void | set_shown (bool is_shown) |
shows/hides this region. | |
bool | is_shown () const |
Checks if this region is shown. | |
bool | is_visible () const |
Checks if this region can be seen on the screen. | |
bool | is_valid () const |
Checks if this region has all its borders correctly defined. | |
void | set_relative_dimensions (const vector2f &dimensions) |
Changes this region's dimensions (relative to its parent). | |
void | set_relative_width (float rel_width) |
Changes this region's width (relative to its parent). | |
void | set_relative_height (float rel_height) |
Changes this region's height (relative to its parent). | |
const vector2f & | get_dimensions () const |
Returns this region's explicitly-defined width and height (in pixels). | |
vector2f | get_apparent_dimensions () const |
Returns this region's apparent width and height (in pixels). | |
bool | is_apparent_width_defined () const |
Checks if this region's apparent width is defined. | |
bool | is_apparent_height_defined () const |
Checks if this region's apparent height is defined. | |
const std::string & | get_region_type () const |
Returns the type of this region. | |
bool | is_region_type (const std::string &type_name) const |
Checks if this region is of the provided type. | |
template<typename ObjectType > | |
bool | is_region_type () const |
Checks if this region is of the provided type. | |
bool | is_region_type (const region &obj) const |
Checks if this region is of a type equal or derived from the supplied region. | |
float | get_bottom () const |
Returns the vertical position of this region's bottom border. | |
vector2f | get_center () const |
Returns the position of this region's center. | |
float | get_left () const |
Returns the horizontal position of this region's left border. | |
float | get_right () const |
Returns the horizontal position of this region's right border. | |
float | get_top () const |
Returns the vertical position of this region's top border. | |
const bounds2f & | get_borders () const |
Returns this region's borders. | |
void | clear_all_anchors () |
Removes all anchors. | |
void | set_all_anchors (const utils::observer_ptr< region > &obj) |
Adjusts this regions anchors to fit the provided region. | |
void | set_all_anchors (const std::string &obj_name) |
Adjusts this regions anchors to fit the provided region. | |
void | set_anchor (const anchor_data &a) |
Adds/replaces an anchor. | |
template<typename... Args> | |
void | set_anchor (Args &&... args) |
Adds/replaces an anchor. | |
bool | depends_on (const region &obj) const |
Checks if this region depends on another. | |
std::size_t | get_anchor_count () const |
Returns the number of defined anchors. | |
anchor & | modify_anchor (point p) |
Returns one of this region's anchor to modify it. | |
const anchor & | get_anchor (point p) const |
Returns one of this region's anchor. | |
const std::array< std::optional< anchor >, 9 > & | get_anchors () const |
Returns all of this region's anchors. | |
float | round_to_pixel (float value, utils::rounding_method method=utils::rounding_method::nearest) const |
Round an absolute position on screen to the nearest physical pixel. | |
vector2f | round_to_pixel (const vector2f &position, utils::rounding_method method=utils::rounding_method::nearest) const |
Round an absolute position on screen to the nearest physical pixel. | |
void | add_anchored_object (region &obj) |
Notifies this region that another one is anchored to it. | |
void | remove_anchored_object (region &obj) |
Notifies this region that another one is no longer anchored to it. | |
bool | is_virtual () const |
Checks if this region is virtual. | |
void | set_manually_inherited (bool manually_inherited) |
Flags this region as manually inherited or not. | |
bool | is_manually_inherited () const |
Checks if this object is manually inherited. | |
const std::vector< utils::observer_ptr< region > > & | get_anchored_objects () const |
Returns the list of all objects that are anchored to this one. | |
bool | is_loaded () const |
Checks if this region has been fully loaded. | |
void | set_addon (const addon *a) |
Sets the addon this frame belongs to. | |
const addon * | get_addon () const |
Returns this frame's addon. | |
std::string | parse_file_name (const std::string &file_name) const |
Convert an addon-relative file path to a application-relative path. | |
manager & | get_manager () |
Returns this region's manager. | |
const manager & | get_manager () const |
Returns this region's manager. | |
registry & | get_registry () |
Returns the UI object registry, which keeps track of all objects in the UI. | |
const registry & | get_registry () const |
Returns the UI object registry, which keeps track of all objects in the UI. | |
void | remove_glue () |
Removes the Lua glue. | |
Static Public Member Functions | |
static std::string | get_adjusted_script_name (const std::string &script_name) |
Returns the "adjusted" script name: "OnEvent" becomes "on_event". | |
static void | register_on_lua (sol::state &lua) |
Registers this region class to the provided Lua state. | |
Static Public Attributes | |
static constexpr const char * | class_name = "Frame" |
Protected Member Functions | |
void | parse_attributes_ (const layout_node &node) override |
virtual void | parse_all_nodes_before_children_ (const layout_node &node) |
virtual void | parse_resize_bounds_node_ (const layout_node &node) |
virtual void | parse_title_region_node_ (const layout_node &node) |
virtual void | parse_backdrop_node_ (const layout_node &node) |
virtual void | parse_hit_rect_insets_node_ (const layout_node &node) |
virtual void | parse_layers_node_ (const layout_node &node) |
virtual void | parse_frames_node_ (const layout_node &node) |
virtual void | parse_scripts_node_ (const layout_node &node) |
const std::vector< std::string > & | get_type_list_ () const override |
utils::observer_ptr< layered_region > | parse_region_ (const layout_node &node, const std::string &layer_name, const std::string &type) |
utils::observer_ptr< frame > | parse_child_ (const layout_node &node, const std::string &type) |
virtual void | update_ (float delta) |
void | check_position_ () |
void | add_level_ (int amount) |
utils::observer_ptr< const frame_renderer > | compute_top_level_frame_renderer_ () const |
utils::observer_ptr< frame_renderer > | compute_top_level_frame_renderer_ () |
strata | compute_effective_strata_ () const |
void | notify_strata_changed_ (strata new_strata_id) |
void | notify_frame_renderer_changed_ (const utils::observer_ptr< frame_renderer > &new_renderer) |
void | update_borders_ () override |
void | set_parent_ (utils::observer_ptr< frame > parent) override |
Changes this region's parent. | |
bool | check_script_ (const std::string &script_name) const |
utils::connection | define_script_ (const std::string &script_name, const std::string &content, bool append, const script_info &info) |
utils::connection | define_script_ (const std::string &script_name, sol::protected_function handler, bool append, const script_info &info) |
utils::connection | define_script_ (const std::string &script_name, script_function handler, bool append, const script_info &info) |
void | on_event_ (std::string_view event_name, const event_data &event) |
virtual void | parse_size_node_ (const layout_node &node) |
virtual void | parse_anchor_node_ (const layout_node &node) |
color | parse_color_node_ (const layout_node &node) |
vector2< std::optional< float > > | parse_offset_node_ (const layout_node &node) |
vector2< float > | parse_offset_node_or_ (const layout_node &node, float fallback) |
std::pair< anchor_type, vector2< std::optional< float > > > | parse_dimension_node_ (const layout_node &node) |
void | read_anchors_ (float &left, float &right, float &top, float &bottom, float &x_center, float &y_center) const |
bool | make_borders_ (float &min, float &max, float center, float size) const |
sol::state & | get_lua_ () |
const sol::state & | get_lua_ () const |
template<typename T > | |
void | create_glue_ (T &self) |
void | set_lua_member_ (std::string key, sol::stack_object value) |
sol::object | get_lua_member_ (const std::string &key) const |
void | set_virtual_ () |
Makes this region virtual. | |
void | set_name_ (const std::string &name) |
Sets this region's name. | |
template<typename T > | |
void | initialize_ (T &self, const region_core_attributes &attr) |
Set up function to call in all derived class constructors. | |
Static Protected Member Functions | |
template<typename T > | |
static const std::vector< std::string > & | get_type_list_impl_ () |
Static Protected Attributes | |
static constexpr std::size_t | num_layers = magic_enum::enum_count<layer>() |
A region that can contain other regions and react to events.
This class, which is at the core of the UI design, can contain other frames as "children", and layered regions sorted by layers (text, images, ...). A frame can also react to events, and register callbacks to be executed on particular events (key presses, etc.) or on every tick.
Each frame has an optional "title region", which can be used to define and draw a title bar. This title bar can then be used to move the frame around the screen using mouse click and drag. Furthermore, frames have optional support for resizing by click and drag on corners or edges (opt in).
Frames can either move freely on the screen, or be "clamped" to the screen so they cannot be partly outside of their render area.
Rendering. Frames are grouped into different "strata", which are rendered sequentially. Frames in a high strata will always be rendered above frames in a low strata. Then, within a strata, frames are further sorted by "level"; within this particular strata, a frame with a high level will always be rendered above all frames with a lower level, but it will still remain below other frames in a higher strata. The level of a frame is automatically set to the maximum level inside the strata when the frame is clicked, which effectively brings the frame to the front.
Children and layered regions. See the region documentation for details about parent-child relationships. Note that, when reading from a layout file, layered_region are parsed before children frame. Therefore, a layered_region cannot specify an anchor to a child in the layout file. Likewise, children are parsed in order of declaration; a child may only anchor to another child if that other child was declared first. This type of anchor must be set programmatically, for example in the OnLoad
event of the parent frame. This does not affect regions created in C++ or Lua, only regions defined in layout files.
Events. Frames can react to events. For this to happen, a callback function must be registered to handle the corresponding event. There are two types of events. First: hard-coded UI events such as OnKeyPress
or OnUpdate
, which are automatically triggered by lxgui. Second: generic events, which can be triggered from various sources and all forwarded to the OnEvent
callback. Generic events are typically generated by whatever application is being driven by lxgui (i.e., your game), and they enable application-specific behavior (for example: changing the UI when the player is under attack will likely require an "UNDER_ATTACK"
event).
To use the first type of events (hard-coded events), all you have to do in general is register a callback function using frame::set_script. However, some hard-coded events require explicit enabling. In particular:
OnKeyDown
, OnKeyRepeat
, OnKeyUp
) require frame::enable_keyboard, and either focus (see frame::set_focus) or explicit key capture (frame::enable_key_capture).OnDragStart
, OnDragStop
, OnMouseUp
, OnMouseDown
) require frame::enable_mouse_click.OnEnter
, OnLeave
, OnMouseMove
) require frame::enable_mouse_move.OnMouseWheel
) require frame::enable_mouse_wheel.To use the second type of events (generic events), you have to register a callback for OnEvent
and register the frame for each generic event you wish to listen to. This is done with frame::register_event.
Some events provide arguments to the registered callback function. For example, the application can fire a "UNIT_ATTACKED"
event when a unit is under attack, and pass the ID of the attacked unit as a first argument, and the ID of the attacker as a second argument. If a callback function is registered using frame::set_script, these arguments can be handled and named like regular function parameters. In layout files "scripts" handlers, they can be accessed with the hard-coded generic names arg1
, arg2
, etc.
Hard-coded events available to all frames:
OnChar
: Triggered whenever a character is typed and the frame has focus (see frame::set_focus).OnDoubleClick
: Triggered when the frame is double-clicked.OnDragStart
: Triggered when one of the mouse button registered for dragging (see frame::enable_drag) has been pressed inside the area of the screen occupied by the frame, and a mouse movement is first recorded. This event provides four argument to the registered callback: a number identifying the mouse button that started the drag, the human-readable name of this button, and the mouse X and Y position.OnDragMove
: Triggered after OnDragStart
, each time the mouse moves, until OnDragStop
is triggered. This event provides four argument to the registered callback: the amount of mouse movement in X and Y since the last call to OnDragMove
(or since OnDragStart
if this is the first call), and the mouse X and Y position.OnDragStop
: Similar to OnDragStart
, but triggered when the mouse button is released after OnDragStart
.OnEnter
: Triggered when the mouse pointer enters into the area of the screen occupied by the frame. Note: this only takes into account the position and size of the frame and its title region, but not the space occupied by its children or layered regions. Will not trigger if the frame is hidden.OnEvent
: Triggered when a registered generic event occurs. See frame::register_event. To allow distinguishing which event has just been fired, the registered callback function is always provided with a first argument that is set to a string matching the event name. Further arguments can be passed to the callback and are handled as for other events.OnFocusGained
: Triggered when the frame gains focus, see frame::set_focus.OnFocusLost
: Triggered when the frame looses focus, see frame::set_focus.OnHide
: Triggered when region::hide is called, or when the frame is hidden indirectly (for example if its parent is itself hidden). This will only fire if the frame was previously shown.OnKeyDown
: Triggered when a keyboard key is pressed. Will only trigger if the frame is shown and either has focus (see frame::set_focus) or if the key has been registered for capture using frame::enable_key_capture. If no keyboard-enabled frame is focused, only the topmost frame with frame::enable_key_capture will receive the event. If no frame has captured the key, then the key is tested for existing key bindings (see key_binder). This event provides five arguments to the registered callback: a number identifying the main key being pressed, three boolean flags for "Shift", "Ctrl", and "Alt, and finally the human-readable
name of the key combination being pressed (e.g., "Shift+A").
- <tt>OnKeyRepeat</tt>: Similar to <tt>OnKeyDown</tt>, but triggered when a key has been
long-pressed and the operating system generated repeat events.
- <tt>OnKeyUp</tt>: Similar to <tt>OnKeyDown</tt>, but triggered when a keyboard key is
released.
- <tt>OnLeave</tt>: Triggered when the mouse pointer leaves the area of the
screen occupied by the frame. Note: this only takes into account the
position and size of the frame and its title region, but not the space
occupied by its children or layered regions. Will not trigger if the
frame is hidden, unless the frame was just hidden with the mouse
previously inside the frame. Finally, this <em>will</em> trigger whenever
the mouse enters another mouse-enabled frame with a higher level/strata,
even if the mouse is still technically within this frame's region.
- <tt>OnLoad</tt>: Triggered just after the frame is created. This is where
you would normally register for events and specific inputs, set up
initial states for extra logic, or do localization.
- <tt>OnMouseDown</tt>: Triggered when a mouse button is pressed and this frame is
the topmost mouse-click-enabled frame under the mouse pointer. Will not
trigger if the frame is hidden. This event provides four arguments to
the registered callback: a number identifying the mouse button, a string
containing the human-readable name of this button (<tt>"LeftButton"</tt>,
<tt>"RightButton"</tt>, or <tt>"MiddleButton"</tt>), and the mouse X and Y position.
- <tt>OnMouseMove</tt>: Triggered when the mouse moves over this frame, after
<tt>OnEnter</tt> and until <tt>OnLeave</tt>. This event provides four argument to
the registered callback: the amount of mouse movement in X and Y since the
last call to <tt>OnMouseMove</tt> (or since the last position before the mouse
entered this frame), and the mouse X and Y position.
- <tt>OnMouseUp</tt>: Similar to <tt>OnMouseDown</tt>, but triggered when the mouse button
is released. This event provides two extra argument compared to <tt>OnMouseDown</tt>:
a boolean flag indicating whether the mouse was released after a drag
operation (true) or not (false), and another boolean flag indicating whether
the mouse button was initially pressed on this frame (true) or not (false).
- <tt>OnMouseWheel</tt>: Triggered when the mouse wheel is moved and this frame is
the topmost mouse-wheel-enabled frame under the mouse pointer. Will not
trigger if the frame is hidden. This event provides three arguments to the
registered callback. The first is a number indicating by how many "notches"
the wheel has turned in this event. A positive value means the wheel has
been moved "away" from the user (this would normally scroll <em>up</em> in a
document). The other two arguments are the mouse X and Y position.
- <tt>OnReceiveDrag</tt>: Triggered when the mouse pointer was previously
dragged onto the frame, and when one of the mouse button registered for
dragging (see frame::enable_drag) is released. This enables
the "drop" in "drag and drop" operations.
- <tt>OnShow</tt>: Triggered when region::show is called, or when the frame
is shown indirectly (for example if its parent is itself shown). This
will only fire if the frame was previously hidden.
- <tt>OnSizeChanged</tt>: Triggered whenever the size of the frame changes, either
directly or indirectly. Be very careful not to call any function that could
change the size of the frame inside this callback, as this would generate
an infinite loop.
- <tt>OnUpdate</tt>: Triggered on every tick of the game loop, if the frame is shown.
This event provides one argument to the registered callback: a floating point
number indicating how much time has passed since the last call to <tt>OnUpdate</tt>
(in seconds). For optimal performance, prefer using other events types
whenever possible. <tt>OnUpdate</tt> callbacks will be executed over and over again,
and can quickly consume a lot of resources if user unreasonably. If you have
to use <tt>OnUpdate</tt>, you can mitigate performance problems by reducing the
update rate using @ref frame::set_update_rate().
Generic events fired natively by lxgui:
- <tt>"LUA_ERROR"</tt>: Triggered whenever a callback function or an addon script
file generates a Lua error. This event provides one argument to the
registered callback: a string containing the error message.
- <tt>"ADDON_LOADED"</tt>: Triggered when an addon is fully loaded. This event
provides one argument to the registered callback: a string containing the
name of the loaded addon.
- <tt>"ENTERING_WORLD"</tt>: Triggered once at the start of the program, at the
end of the first update tick.
<strong>Virtual frames.</strong> Virtual frames are not displayed on the screen,
and technically are not part of the interface. They are only available
as "templates" that can be reused by other (virtual or non-virtual) frames. This is useful for defining a few frame templates with a particular style, and then reuse these templates across the interface to ensure a consistent look. When inheriting from a virtual frame, the inheriting frame will copy all the registered callbacks, all the child frames, and all the layered regions of the virtual frame. Definition at line 255 of file gui_frame.hpp.
using lxgui::gui::frame::base = region |
Definition at line 257 of file gui_frame.hpp.
using lxgui::gui::frame::child_list = std::list<utils::owner_ptr<frame> > |
Type of the frame child list (internal).
Definition at line 268 of file gui_frame.hpp.
using lxgui::gui::frame::child_list_view = utils::view:: adaptor<child_list, utils::view::smart_ptr_dereferencer, utils::view::non_null_filter> |
Definition at line 269 of file gui_frame.hpp.
using lxgui::gui::frame::const_child_list_view = utils::view::adaptor< const child_list, utils::view::smart_ptr_dereferencer, utils::view::non_null_filter> |
Definition at line 271 of file gui_frame.hpp.
using lxgui::gui::frame::const_region_list_view = utils::view::adaptor< const region_list, utils::view::smart_ptr_dereferencer, utils::view::non_null_filter> |
Definition at line 288 of file gui_frame.hpp.
using lxgui::gui::frame::region_list = std::list<utils::owner_ptr<layered_region> > |
Type of the region list (internal).
Definition at line 285 of file gui_frame.hpp.
using lxgui::gui::frame::region_list_view = utils::view:: adaptor<region_list, utils::view::smart_ptr_dereferencer, utils::view::non_null_filter> |
Definition at line 286 of file gui_frame.hpp.
|
explicit |
Constructor.
Definition at line 25 of file gui_frame.cpp.
|
override |
Destructor.
Definition at line 43 of file gui_frame.cpp.
|
inherited |
Notifies this region that another one is anchored to it.
obj | The anchored region |
Definition at line 561 of file gui_region.cpp.
utils::observer_ptr< frame > lxgui::gui::frame::add_child | ( | utils::owner_ptr< frame > | child | ) |
Adds a frame to this frame's children.
child | The frame to add |
Definition at line 678 of file gui_frame.cpp.
|
inline |
Adds a frame to this frame's children.
child | The frame to add |
Definition at line 731 of file gui_frame.hpp.
|
protected |
Definition at line 1342 of file gui_frame.cpp.
utils::observer_ptr< layered_region > lxgui::gui::frame::add_region | ( | utils::owner_ptr< layered_region > | reg | ) |
Adds a layered_region to this frame's children.
reg | The layered_region to add |
Definition at line 592 of file gui_frame.cpp.
|
inline |
Adds a layered_region to this frame's children.
reg | The layered_region to add |
Definition at line 590 of file gui_frame.hpp.
|
inline |
Adds an additional handler script to this frame (executed after existing scripts).
script_name | The name of the script (e.g., "OnEvent") |
handler | The handler of the script, as a C++ function (see below for expected signature) |
info | The location where this script has been defined |
script_name
. This provides the best performance, but lacks direct access to the Lua environment. If this is required, prefer the other overload taking a Lua function instead.self
parameter of type other than frame, for example: dynamic_cast
, so that incorrect types will be reported. However this has a cost; if you are sure of the type and want to bypass this cost, just supply the self
type as the first template argument to this function: Definition at line 1197 of file gui_frame.hpp.
|
inline |
Adds an additional handler script to this frame (executed after existing scripts).
script_name | The name of the script (e.g., "OnEvent") |
handler | The handler of the script, as a C++ function of signature script_signature |
info | The location where this script has been defined |
script_name
. This provides the best performance, but lacks direct access to the Lua environment. If this is required, prefer the other overload taking a Lua function instead. Definition at line 1165 of file gui_frame.hpp.
|
inline |
Adds an additional handler script to this frame (executed after existing scripts).
script_name | The name of the script (e.g., "OnEvent") |
handler | The handler of the script, as a Lua function |
info | The location where this script has been defined |
Definition at line 1144 of file gui_frame.hpp.
|
inline |
Adds an additional handler script to this frame (executed after existing scripts).
script_name | The name of the script (e.g., "OnEvent") |
content | The content of the script, as Lua code |
info | The location where this script has been defined |
Definition at line 1125 of file gui_frame.hpp.
|
virtual |
Returns 'true' if this frame can use a script.
script_name | The name of the script |
Reimplemented in lxgui::gui::button, lxgui::gui::edit_box, lxgui::gui::scroll_frame, lxgui::gui::slider, and lxgui::gui::status_bar.
Definition at line 183 of file gui_frame.cpp.
|
protected |
Definition at line 359 of file gui_frame.cpp.
|
protected |
Definition at line 946 of file gui_frame.cpp.
|
inherited |
Removes all anchors.
Definition at line 365 of file gui_region.cpp.
|
protected |
Definition at line 739 of file gui_frame.cpp.
|
inlineprotected |
Definition at line 1759 of file gui_frame.hpp.
|
protected |
Definition at line 1414 of file gui_frame.cpp.
|
overridevirtual |
Copies a region's parameters into this frame (inheritance).
obj | The region to copy |
Reimplemented from lxgui::gui::region.
Reimplemented in lxgui::gui::scroll_frame, lxgui::gui::slider, and lxgui::gui::status_bar.
Definition at line 195 of file gui_frame.cpp.
|
inline |
Creates a new frame as child of this frame.
name | The name of the frame |
Definition at line 709 of file gui_frame.hpp.
utils::observer_ptr< frame > lxgui::gui::frame::create_child | ( | frame_core_attributes | attr | ) |
Creates a new frame as child of this frame.
attr | The core attributes of the frame (parent will be ignored) |
Definition at line 666 of file gui_frame.cpp.
|
inline |
Creates a new frame as child of this frame.
attr | The core attributes of the frame (object_type and parent will be ignored) |
Definition at line 688 of file gui_frame.hpp.
|
protectedinherited |
Definition at line 136 of file gui_region_tpl.hpp.
|
inline |
Creates a new region as child of this frame.
layer_id | The layer on which to create the region |
name | The name of the region |
Definition at line 651 of file gui_frame.hpp.
utils::observer_ptr< layered_region > lxgui::gui::frame::create_layered_region | ( | layer | layer_id, |
region_core_attributes | attr | ||
) |
Creates a new region as child of this frame.
layer_id | The layer on which to create the region |
attr | The core attributes of the region (parent will be ignored) |
Definition at line 652 of file gui_frame.cpp.
|
inline |
Creates a new region as child of this frame.
layer_id | The layer on which to create the region |
attr | The core attributes of the region (object_type and parent will be ignored) |
Definition at line 630 of file gui_frame.hpp.
void lxgui::gui::frame::create_title_region | ( | ) |
Creates a new title region for this frame.
Definition at line 275 of file gui_frame.cpp.
|
protected |
Definition at line 957 of file gui_frame.cpp.
|
protected |
Definition at line 1034 of file gui_frame.cpp.
|
protected |
Definition at line 992 of file gui_frame.cpp.
|
inherited |
Checks if this region depends on another.
obj | The region to test |
Definition at line 503 of file gui_region.cpp.
|
inherited |
Forcefully removes this region from the GUI.
Definition at line 333 of file gui_region.cpp.
void lxgui::gui::frame::disable_drag | ( | ) |
Tells this frame to not react to mouse drag from any mouse button.
Definition at line 1170 of file gui_frame.cpp.
void lxgui::gui::frame::disable_drag | ( | const std::string & | button_name | ) |
Tells this frame to not react to mouse drag.
button_name | The mouse button to not react to |
Definition at line 1162 of file gui_frame.cpp.
void lxgui::gui::frame::disable_drag | ( | input::mouse_button | button_id | ) |
Tells this frame to not react to mouse drag.
button_id | The mouse button to not react to |
Definition at line 1166 of file gui_frame.cpp.
void lxgui::gui::frame::disable_draw_layer | ( | layer | layer_id | ) |
Disables a layer.
layer_id | The id of the layer to disable |
Definition at line 421 of file gui_frame.cpp.
void lxgui::gui::frame::disable_key_capture | ( | ) |
Marks this frame as unable to receive keyboard input from any key.
Definition at line 474 of file gui_frame.cpp.
void lxgui::gui::frame::disable_key_capture | ( | const std::string & | key_name | ) |
Marks this frame as unable to receive keyboard input from a specific key.
key_name | The key for which to disable capture |
Definition at line 466 of file gui_frame.cpp.
void lxgui::gui::frame::disable_key_capture | ( | input::key | key_id | ) |
Marks this frame as unable to receive keyboard input from a specific key.
key_id | The key for which to disable capture |
Definition at line 470 of file gui_frame.cpp.
|
inline |
Marks this frame as unable to receive any keyboard input.
Definition at line 475 of file gui_frame.hpp.
|
inline |
Marks this frame as unable to receive mouse input (click & move).
Definition at line 380 of file gui_frame.hpp.
|
inline |
Marks this frame as unable to receive mouse click input.
Definition at line 402 of file gui_frame.hpp.
|
inline |
Marks this frame as unable to receive mouse move input.
Definition at line 424 of file gui_frame.hpp.
|
inline |
Marks this frame as unable to receive mouse wheel input.
Definition at line 446 of file gui_frame.hpp.
void lxgui::gui::frame::enable_auto_focus | ( | bool | enable | ) |
Enables automatic focus when this frame is shown or raised.
enable | 'true' to enable auto focus |
Definition at line 1310 of file gui_frame.cpp.
void lxgui::gui::frame::enable_drag | ( | const std::string & | button_name | ) |
Tells this frame to react to mouse drag.
button_name | The mouse button to react to |
Definition at line 1154 of file gui_frame.cpp.
void lxgui::gui::frame::enable_drag | ( | input::mouse_button | button_id | ) |
Tells this frame to react to mouse drag.
button_id | The mouse button to react to |
Definition at line 1158 of file gui_frame.cpp.
void lxgui::gui::frame::enable_draw_layer | ( | layer | layer_id | ) |
Enables a layer.
layer_id | The id of the layer to enable |
Definition at line 429 of file gui_frame.cpp.
void lxgui::gui::frame::enable_key_capture | ( | const std::string & | key_name | ) |
Marks this frame as able to receive keyboard input from a specific key.
key_name | The key to capture |
Definition at line 458 of file gui_frame.cpp.
void lxgui::gui::frame::enable_key_capture | ( | input::key | key_id | ) |
Marks this frame as able to receive keyboard input from a specific key.
key_id | The key to capture |
Definition at line 462 of file gui_frame.cpp.
|
inline |
Marks this frame as able to receive any keyboard input.
Definition at line 467 of file gui_frame.hpp.
|
inline |
Marks this frame as able to receive mouse input (click & move).
Definition at line 372 of file gui_frame.hpp.
|
inline |
Marks this frame as able to receive mouse click input.
Definition at line 394 of file gui_frame.hpp.
|
inline |
Marks this frame as able to receive mouse move input.
Definition at line 416 of file gui_frame.hpp.
|
inline |
Marks this frame as able to receive mouse wheel input.
Definition at line 438 of file gui_frame.hpp.
|
inline |
Find the topmost frame matching the provided predicate.
predicate | A function returning 'true' if the frame can be selected |
Definition at line 1034 of file gui_frame.hpp.
|
virtual |
Find the topmost frame matching the provided predicate.
predicate | A function returning 'true' if the frame can be selected |
Reimplemented in lxgui::gui::scroll_frame.
Definition at line 832 of file gui_frame.cpp.
|
virtual |
Calls a script.
script_name | The name of the script (e.g., "OnEvent") |
data | Stores scripts arguments |
Reimplemented in lxgui::gui::button, lxgui::gui::edit_box, lxgui::gui::scroll_frame, and lxgui::gui::slider.
Definition at line 1105 of file gui_frame.cpp.
const bounds2f & lxgui::gui::frame::get_abs_hit_rect_insets | ( | ) | const |
Returns this frame's absolute hit rect insets.
Definition at line 777 of file gui_frame.cpp.
|
inherited |
Returns this frame's addon.
Definition at line 843 of file gui_region.cpp.
|
static |
Returns the "adjusted" script name: "OnEvent" becomes "on_event".
script_name | The CamelCase name of the script |
Definition at line 879 of file gui_frame.cpp.
|
inherited |
Returns this region's alpha (opacity).
Definition at line 157 of file gui_region.cpp.
Returns one of this region's anchor.
p | The anchor point |
Definition at line 539 of file gui_region.cpp.
|
inherited |
Returns the number of defined anchors.
Definition at line 519 of file gui_region.cpp.
|
inherited |
Returns the list of all objects that are anchored to this one.
Definition at line 790 of file gui_region.cpp.
|
inherited |
Returns all of this region's anchors.
Definition at line 549 of file gui_region.cpp.
|
inherited |
Returns this region's apparent width and height (in pixels).
Definition at line 276 of file gui_region.cpp.
backdrop * lxgui::gui::frame::get_backdrop | ( | ) |
Returns this frame's backdrop.
Definition at line 766 of file gui_frame.cpp.
const backdrop * lxgui::gui::frame::get_backdrop | ( | ) | const |
Returns this frame's backdrop.
Definition at line 762 of file gui_frame.cpp.
|
inherited |
Returns this region's borders.
Definition at line 361 of file gui_region.cpp.
|
inherited |
Returns the vertical position of this region's bottom border.
Definition at line 357 of file gui_region.cpp.
|
inherited |
Returns the position of this region's center.
Definition at line 341 of file gui_region.cpp.
|
inline |
Returns one of this frame's children.
name | The name of the child |
Definition at line 775 of file gui_frame.hpp.
|
inline |
Returns one of this frame's children.
name | The name of the child |
Definition at line 809 of file gui_frame.hpp.
utils::observer_ptr< const frame > lxgui::gui::frame::get_child | ( | const std::string & | name | ) | const |
Returns one of this frame's children.
name | The name of the child |
Definition at line 305 of file gui_frame.cpp.
|
inline |
Returns one of this frame's children.
name | The name of the child |
Definition at line 792 of file gui_frame.hpp.
std::size_t lxgui::gui::frame::get_child_count | ( | ) | const |
Returns the number of children of this frame.
Definition at line 793 of file gui_frame.cpp.
std::size_t lxgui::gui::frame::get_child_count_upper_bound | ( | ) | const |
Returns the approximate number of children of this frame.
Definition at line 798 of file gui_frame.cpp.
frame::child_list_view lxgui::gui::frame::get_children | ( | ) |
frame::const_child_list_view lxgui::gui::frame::get_children | ( | ) | const |
|
inherited |
Returns this region's explicitly-defined width and height (in pixels).
Definition at line 272 of file gui_region.cpp.
|
inherited |
Returns this region's effective alpha (opacity).
Definition at line 161 of file gui_region.cpp.
|
inline |
Returns the renderer of this object or its parents, nullptr if none.
Definition at line 1645 of file gui_frame.hpp.
|
finalvirtual |
Returns the renderer of this object or its parents, nullptr if none.
Reimplemented from lxgui::gui::region.
Definition at line 1410 of file gui_frame.cpp.
float lxgui::gui::frame::get_effective_scale | ( | ) | const |
Calculates effective scale.
Definition at line 720 of file gui_frame.cpp.
strata lxgui::gui::frame::get_effective_strata | ( | ) | const |
Returns this frame's effective strata.
Definition at line 735 of file gui_frame.cpp.
|
inline |
Returns the renderer of this object, nullptr if none.
Definition at line 1629 of file gui_frame.hpp.
|
inline |
Returns the renderer of this object, nullptr if none.
Definition at line 1620 of file gui_frame.hpp.
std::size_t lxgui::gui::frame::get_layered_region_count | ( | ) | const |
Returns the number of layered regions of this frame.
Definition at line 802 of file gui_frame.cpp.
std::size_t lxgui::gui::frame::get_layered_region_count_upper_bound | ( | ) | const |
Returns the approximate number of regions of this frame.
Definition at line 807 of file gui_frame.cpp.
|
inherited |
Returns the horizontal position of this region's left border.
Definition at line 345 of file gui_region.cpp.
int lxgui::gui::frame::get_level | ( | ) | const |
|
protectedinherited |
Definition at line 767 of file gui_region.cpp.
|
protectedinherited |
Definition at line 771 of file gui_region.cpp.
|
protectedinherited |
|
inlineinherited |
Returns this region's manager.
Definition at line 693 of file gui_region.hpp.
|
inlineinherited |
Returns this region's manager.
Definition at line 701 of file gui_region.hpp.
vector2f lxgui::gui::frame::get_max_dimensions | ( | ) | const |
Returns this frame's max dimensions.
Definition at line 785 of file gui_frame.cpp.
vector2f lxgui::gui::frame::get_min_dimensions | ( | ) | const |
Returns this frame's min dimensions.
Definition at line 789 of file gui_frame.cpp.
|
inherited |
Returns this region's name.
Definition at line 140 of file gui_region.cpp.
backdrop & lxgui::gui::frame::get_or_create_backdrop | ( | ) |
Returns this frame's backdrop, creating it if needed.
Definition at line 770 of file gui_frame.cpp.
|
inlineinherited |
Returns this region's parent.
Definition at line 237 of file gui_region.hpp.
|
inlineinherited |
Returns this region's parent.
Definition at line 229 of file gui_region.hpp.
|
inherited |
Returns this region's raw name.
Definition at line 144 of file gui_region.cpp.
|
inline |
Returns one of this frame's region.
name | The name of the region |
Definition at line 845 of file gui_frame.hpp.
|
inline |
Returns one of this frame's region.
name | The name of the region |
Definition at line 863 of file gui_frame.hpp.
utils::observer_ptr< const layered_region > lxgui::gui::frame::get_region | ( | const std::string & | name | ) | const |
Returns one of this frame's region.
name | The name of the region |
Definition at line 329 of file gui_frame.cpp.
|
inherited |
Returns the type of this region.
Definition at line 148 of file gui_region.cpp.
frame::region_list_view lxgui::gui::frame::get_regions | ( | ) |
frame::const_region_list_view lxgui::gui::frame::get_regions | ( | ) | const |
|
inherited |
Returns the UI object registry, which keeps track of all objects in the UI.
Definition at line 850 of file gui_region.cpp.
|
inherited |
Returns the UI object registry, which keeps track of all objects in the UI.
Definition at line 855 of file gui_region.cpp.
const bounds2f & lxgui::gui::frame::get_rel_hit_rect_insets | ( | ) | const |
Returns this frame's relative hit rect insets.
Definition at line 781 of file gui_frame.cpp.
|
inherited |
Returns the horizontal position of this region's right border.
Definition at line 349 of file gui_region.cpp.
float lxgui::gui::frame::get_scale | ( | ) | const |
Returns this frame's scale.
Definition at line 811 of file gui_frame.cpp.
script_list_view lxgui::gui::frame::get_script | ( | const std::string & | script_name | ) | const |
Return a view into this frame's handler scripts, registered for the given event.
script_name | The name of the script (e.g., "OnEvent") |
Definition at line 1072 of file gui_frame.cpp.
std::optional< strata > lxgui::gui::frame::get_strata | ( | ) | const |
Returns this frame's strata.
Definition at line 731 of file gui_frame.cpp.
|
inline |
Returns this frame's title region.
Definition at line 997 of file gui_frame.hpp.
|
inline |
Returns this frame's title region.
Definition at line 992 of file gui_frame.hpp.
|
inherited |
Returns the vertical position of this region's top border.
Definition at line 353 of file gui_region.cpp.
|
inline |
Returns this frame's top-level parent.
Definition at line 902 of file gui_frame.hpp.
utils::observer_ptr< const frame > lxgui::gui::frame::get_top_level_parent | ( | ) | const |
Returns this frame's top-level parent.
Definition at line 750 of file gui_frame.cpp.
|
overrideprotectedvirtual |
Reimplemented from lxgui::gui::region.
Reimplemented in lxgui::gui::scroll_frame, lxgui::gui::slider, and lxgui::gui::status_bar.
Definition at line 1614 of file gui_frame.cpp.
|
staticprotectedinherited |
Definition at line 147 of file gui_region_tpl.hpp.
float lxgui::gui::frame::get_update_rate | ( | ) | const |
Gets the maximum update rate (in upates per seconds).
Definition at line 1150 of file gui_frame.cpp.
bool lxgui::gui::frame::has_focus | ( | ) | const |
Check if this frame currently has focus.
Definition at line 1326 of file gui_frame.cpp.
bool lxgui::gui::frame::has_script | ( | const std::string & | script_name | ) | const |
Checks if this frame has a script defined.
script_name | The name of the script to check |
Definition at line 584 of file gui_frame.cpp.
|
inherited |
hides this region.
Definition at line 186 of file gui_region.cpp.
|
protectedinherited |
Set up function to call in all derived class constructors.
self | A pointer to the derived this |
attr | The region attributes provided to the constructor |
Definition at line 141 of file gui_region_tpl.hpp.
|
inherited |
Checks if this region's apparent height is defined.
Definition at line 284 of file gui_region.cpp.
|
inherited |
Checks if this region's apparent width is defined.
Definition at line 280 of file gui_region.cpp.
bool lxgui::gui::frame::is_auto_focus_enabled | ( | ) | const |
Checks if automatic focus is enabled.
Definition at line 1314 of file gui_frame.cpp.
bool lxgui::gui::frame::is_clamped_to_screen | ( | ) | const |
Checks if this frame is clamped to screen.
Definition at line 815 of file gui_frame.cpp.
bool lxgui::gui::frame::is_drag_enabled | ( | const std::string & | button_name | ) | const |
Checks if this frame is registered for drag events with the provided mouse button.
button_name | The name of the mouse button to check |
Definition at line 851 of file gui_frame.cpp.
|
overridevirtual |
Checks if the provided coordinates are inside this frame.
position | The coordinates to test |
Reimplemented from lxgui::gui::region.
Reimplemented in lxgui::gui::slider.
Definition at line 819 of file gui_frame.cpp.
bool lxgui::gui::frame::is_key_capture_enabled | ( | const std::string & | key_name | ) | const |
Checks if this frame can receive keyboard input from a specific key.
key_name | The key to check |
Definition at line 859 of file gui_frame.cpp.
bool lxgui::gui::frame::is_keyboard_enabled | ( | ) | const |
Checks if this frame can receive any keyboard input.
Definition at line 855 of file gui_frame.cpp.
|
inherited |
Checks if this region has been fully loaded.
Definition at line 798 of file gui_region.cpp.
|
inherited |
Checks if this object is manually inherited.
Definition at line 784 of file gui_region.cpp.
bool lxgui::gui::frame::is_mouse_click_enabled | ( | ) | const |
Checks if this frame can receive mouse click input.
Definition at line 839 of file gui_frame.cpp.
bool lxgui::gui::frame::is_mouse_move_enabled | ( | ) | const |
Checks if this frame can receive mouse movement input.
Definition at line 843 of file gui_frame.cpp.
bool lxgui::gui::frame::is_mouse_wheel_enabled | ( | ) | const |
Checks if this frame can receive mouse wheel input.
Definition at line 847 of file gui_frame.cpp.
bool lxgui::gui::frame::is_movable | ( | ) | const |
Checks if this frame can be moved.
Definition at line 863 of file gui_frame.cpp.
|
inlineinherited |
Checks if this region is of the provided type.
Definition at line 423 of file gui_region.hpp.
|
inlineinherited |
Checks if this region is of a type equal or derived from the supplied region.
Definition at line 431 of file gui_region.hpp.
|
inherited |
Checks if this region is of the provided type.
type_name | The type to test |
Definition at line 152 of file gui_region.cpp.
bool lxgui::gui::frame::is_resizable | ( | ) | const |
Checks if this frame can be resized.
Definition at line 867 of file gui_frame.cpp.
|
inherited |
Checks if this region is shown.
Definition at line 203 of file gui_region.cpp.
bool lxgui::gui::frame::is_top_level | ( | ) | const |
Checks if this frame is at top level.
Definition at line 871 of file gui_frame.cpp.
bool lxgui::gui::frame::is_user_placed | ( | ) | const |
Checks if this frame has been moved by the user.
Definition at line 875 of file gui_frame.cpp.
|
inherited |
Checks if this region has all its borders correctly defined.
Definition at line 211 of file gui_region.cpp.
|
inherited |
Checks if this region is virtual.
Definition at line 553 of file gui_region.cpp.
|
inherited |
Checks if this region can be seen on the screen.
Definition at line 207 of file gui_region.cpp.
|
protectedinherited |
Definition at line 585 of file gui_region.cpp.
Returns one of this region's anchor to modify it.
p | The anchor point |
Definition at line 529 of file gui_region.cpp.
|
virtualinherited |
Tells this region that its borders need updating.
Reimplemented in lxgui::gui::slider.
Definition at line 744 of file gui_region.cpp.
|
virtual |
Notifies this frame that it has received or lost focus.
focus | 'true' if focus is received, 'false' if lost |
Reimplemented in lxgui::gui::edit_box.
Definition at line 1330 of file gui_frame.cpp.
|
protected |
Definition at line 1385 of file gui_frame.cpp.
|
overridevirtual |
Notifies this region that it is no longer visible on screen.
Reimplemented from lxgui::gui::region.
Definition at line 1457 of file gui_frame.cpp.
void lxgui::gui::frame::notify_layers_need_update | ( | ) |
Tells this frame to rebuild its layer list.
Definition at line 489 of file gui_frame.cpp.
|
overridevirtual |
Notifies this region that it has been fully loaded.
Reimplemented from lxgui::gui::region.
Definition at line 478 of file gui_frame.cpp.
|
virtual |
Tells this frame it is being hovered by the mouse.
mouse_in_frame | 'true' if the mouse is above this frame |
mouse_pos | The mouse coordinates in pixels |
Definition at line 1501 of file gui_frame.cpp.
|
overridevirtual |
Notifies the renderer of this region that it needs to be redrawn.
Reimplemented from lxgui::gui::region.
Definition at line 1481 of file gui_frame.cpp.
|
overridevirtual |
Tells this region that the global interface scaling factor has changed.
Reimplemented from lxgui::gui::region.
Reimplemented in lxgui::gui::scroll_frame.
Definition at line 1488 of file gui_frame.cpp.
|
protected |
Definition at line 567 of file gui_frame.cpp.
|
overridevirtual |
Notifies this region that it is now visible on screen.
Reimplemented from lxgui::gui::region.
Definition at line 1423 of file gui_frame.cpp.
|
protected |
Definition at line 1096 of file gui_frame.cpp.
|
protectedvirtual |
Reimplemented in lxgui::gui::button, lxgui::gui::check_button, lxgui::gui::edit_box, lxgui::gui::scroll_frame, lxgui::gui::slider, and lxgui::gui::status_bar.
Definition at line 14 of file gui_frame_parser.cpp.
|
protectedvirtualinherited |
Definition at line 89 of file gui_region_parser.cpp.
|
overrideprotectedvirtual |
Reimplemented from lxgui::gui::region.
Reimplemented in lxgui::gui::slider, and lxgui::gui::status_bar.
Definition at line 33 of file gui_frame_parser.cpp.
|
protectedvirtual |
Definition at line 133 of file gui_frame_parser.cpp.
|
protected |
Definition at line 360 of file gui_frame_parser.cpp.
|
protectedinherited |
Definition at line 10 of file gui_region_parser.cpp.
|
protectedinherited |
Definition at line 35 of file gui_region_parser.cpp.
|
inherited |
Convert an addon-relative file path to a application-relative path.
file_name | The raw file name |
Definition at line 818 of file gui_region.cpp.
|
protectedvirtual |
Definition at line 389 of file gui_frame_parser.cpp.
|
protectedvirtual |
Definition at line 271 of file gui_frame_parser.cpp.
|
protectedvirtual |
Definition at line 342 of file gui_frame_parser.cpp.
|
finalvirtual |
Parses data from a layout_node.
node | The layout node |
Reimplemented from lxgui::gui::region.
Definition at line 27 of file gui_frame_parser.cpp.
|
protectedinherited |
Definition at line 24 of file gui_region_parser.cpp.
|
protectedinherited |
Definition at line 28 of file gui_region_parser.cpp.
|
protected |
Definition at line 306 of file gui_frame_parser.cpp.
|
protectedvirtual |
Definition at line 82 of file gui_frame_parser.cpp.
|
protectedvirtual |
Definition at line 397 of file gui_frame_parser.cpp.
|
protectedvirtualinherited |
Definition at line 65 of file gui_region_parser.cpp.
|
protectedvirtual |
Definition at line 124 of file gui_frame_parser.cpp.
void lxgui::gui::frame::raise | ( | ) |
Increases this frame's level so it's the highest of the strata.
Definition at line 1286 of file gui_frame.cpp.
|
protectedinherited |
Definition at line 614 of file gui_region.cpp.
void lxgui::gui::frame::register_event | ( | const std::string & | event_name | ) |
Tells this frame to react to a certain event.
event_name | The name of the event |
Definition at line 1131 of file gui_frame.cpp.
|
static |
Registers this region class to the provided Lua state.
|
overridevirtual |
Removes this region from its parent and return an owning pointer.
Reimplemented from lxgui::gui::region.
Definition at line 1264 of file gui_frame.cpp.
|
inherited |
Notifies this region that another one is no longer anchored to it.
obj | The region no longer anchored |
Definition at line 565 of file gui_region.cpp.
utils::owner_ptr< frame > lxgui::gui::frame::remove_child | ( | const utils::observer_ptr< frame > & | child | ) |
Removes a frame from this frame's children.
child | The frame to remove |
Definition at line 690 of file gui_frame.cpp.
|
inherited |
Removes the Lua glue.
Definition at line 775 of file gui_region.cpp.
utils::owner_ptr< layered_region > lxgui::gui::frame::remove_region | ( | const utils::observer_ptr< layered_region > & | reg | ) |
Removes a layered_region from this frame's children.
reg | The layered_region to remove |
Definition at line 617 of file gui_frame.cpp.
void lxgui::gui::frame::remove_script | ( | const std::string & | script_name | ) |
Removes a script from this frame.
script_name | The name of the script (e.g., "OnEvent") |
Definition at line 1080 of file gui_frame.cpp.
|
overridevirtual |
Renders this region on the current render target.
Reimplemented from lxgui::gui::region.
Definition at line 62 of file gui_frame.cpp.
|
inherited |
Round an absolute position on screen to the nearest physical pixel.
position | The input absolute position (can be fractional) |
method | The rounding method |
Definition at line 578 of file gui_region.cpp.
|
inherited |
Round an absolute position on screen to the nearest physical pixel.
value | The input absolute position (can be fractional) |
method | The rounding method |
Definition at line 573 of file gui_region.cpp.
|
overridevirtual |
Prints all relevant information about this region in a string.
tab | The offset to give to all lines |
Reimplemented from lxgui::gui::region.
Reimplemented in lxgui::gui::slider, and lxgui::gui::status_bar.
Definition at line 84 of file gui_frame.cpp.
void lxgui::gui::frame::set_abs_hit_rect_insets | ( | const bounds2f & | insets | ) |
Sets this frame's absolute hit rect insets.
insets | Offsets |
Definition at line 1193 of file gui_frame.cpp.
|
inherited |
Sets the addon this frame belongs to.
a | The addon this frame belongs to |
Definition at line 833 of file gui_region.cpp.
|
inherited |
Adjusts this regions anchors to fit the provided region.
obj_name | The name of the object to fit to |
Definition at line 404 of file gui_region.cpp.
|
inherited |
Adjusts this regions anchors to fit the provided region.
obj | A pointer to the object you want to wrap |
Definition at line 437 of file gui_region.cpp.
|
inherited |
Changes this region's alpha (opacity).
alpha | The new alpha value |
Definition at line 169 of file gui_region.cpp.
|
inlineinherited |
Adds/replaces an anchor.
args | Argument to construct a new anchor_data |
Definition at line 503 of file gui_region.hpp.
|
inherited |
Adds/replaces an anchor.
a | The anchor to add |
Definition at line 473 of file gui_region.cpp.
void lxgui::gui::frame::set_backdrop | ( | std::unique_ptr< backdrop > | bdrop | ) |
Sets this frames' backdrop.
bdrop | The new backdrop |
Definition at line 1188 of file gui_frame.cpp.
void lxgui::gui::frame::set_clamped_to_screen | ( | bool | is_clamped_to_screen | ) |
Sets if this frame is clamped to screen.
is_clamped_to_screen | 'true' if this frame is clamped to screen |
Definition at line 1174 of file gui_frame.cpp.
|
overridevirtual |
Changes this region's absolute dimensions (in pixels).
dimensions | The new dimensions |
Reimplemented from lxgui::gui::region.
Definition at line 345 of file gui_frame.cpp.
|
inline |
Tells this frame whether to react to mouse drag or not.
button_name | The mouse button to react to |
enable | 'true' to enable, 'false' to disable |
Definition at line 1391 of file gui_frame.hpp.
|
inline |
Tells this frame whether to react to mouse drag or not.
button_id | The mouse button to react to |
enable | 'true' to enable, 'false' to disable |
Definition at line 1404 of file gui_frame.hpp.
|
inline |
Enables or disables a layer.
layer_id | The id of the layer to disable |
enable | 'true' to enable, 'false' to disable |
Definition at line 342 of file gui_frame.hpp.
void lxgui::gui::frame::set_focus | ( | bool | focus | ) |
Asks for focus for this frame.
focus | 'true' to ask for focus, 'false' to release it |
Definition at line 1318 of file gui_frame.cpp.
void lxgui::gui::frame::set_frame_renderer | ( | utils::observer_ptr< frame_renderer > | rdr | ) |
Flags this object as rendered by another object.
rdr | The object that will take care of rendering this region |
Definition at line 1398 of file gui_frame.cpp.
|
overridevirtual |
Changes this region's absolute height (in pixels).
abs_height | The new height |
Reimplemented from lxgui::gui::region.
Definition at line 355 of file gui_frame.cpp.
|
inline |
Marks this frame as able to receive keyboard input from a specific key.
key_name | The key to capture |
enable | 'true' to enable, 'false' to disable |
Definition at line 486 of file gui_frame.hpp.
|
inline |
Marks this frame as able to receive keyboard input from a specific key.
key_id | The key to capture |
enable | 'true' to enable, 'false' to disable |
Definition at line 501 of file gui_frame.hpp.
void lxgui::gui::frame::set_keyboard_enabled | ( | bool | is_keyboard_enabled | ) |
Sets if this frame can receive any keyboard input.
is_keyboard_enabled | 'true' to enable |
Definition at line 454 of file gui_frame.cpp.
void lxgui::gui::frame::set_level | ( | int | level_id | ) |
Sets this frame's level.
level_id | The new level |
Definition at line 1201 of file gui_frame.cpp.
|
protectedinherited |
|
inherited |
Flags this region as manually inherited or not.
Definition at line 780 of file gui_region.cpp.
void lxgui::gui::frame::set_max_dimensions | ( | const vector2f & | max | ) |
Sets this frame's maximum size.
max | The maximum dimensions of this frame |
Definition at line 1212 of file gui_frame.cpp.
void lxgui::gui::frame::set_max_height | ( | float | max_height | ) |
Sets this frame's maximum height.
max_height | The maximum height this frame can have |
Definition at line 1222 of file gui_frame.cpp.
void lxgui::gui::frame::set_max_width | ( | float | max_width | ) |
Sets this frame's maximum width.
max_width | The maximum width this frame can have |
Definition at line 1233 of file gui_frame.cpp.
void lxgui::gui::frame::set_min_dimensions | ( | const vector2f & | min | ) |
Sets this frame's minimum size.
min | Minimum dimensions of this frame |
Definition at line 1217 of file gui_frame.cpp.
void lxgui::gui::frame::set_min_height | ( | float | min_height | ) |
Sets this frame's minimum height.
min_height | The minimum height this frame can have |
Definition at line 1244 of file gui_frame.cpp.
void lxgui::gui::frame::set_min_width | ( | float | min_width | ) |
Sets this frame's minimum width.
min_width | The minimum width this frame can have |
Definition at line 1252 of file gui_frame.cpp.
void lxgui::gui::frame::set_mouse_click_enabled | ( | bool | is_mouse_enabled | ) |
Sets if this frame can receive mouse click input.
is_mouse_enabled | 'true' to enable |
Definition at line 442 of file gui_frame.cpp.
void lxgui::gui::frame::set_mouse_enabled | ( | bool | is_mouse_enabled | ) |
Sets if this frame can receive mouse input (click & move).
is_mouse_enabled | 'true' to enable |
Definition at line 437 of file gui_frame.cpp.
void lxgui::gui::frame::set_mouse_move_enabled | ( | bool | is_mouse_enabled | ) |
Sets if this frame can receive mouse move input.
is_mouse_enabled | 'true' to enable |
Definition at line 446 of file gui_frame.cpp.
void lxgui::gui::frame::set_mouse_wheel_enabled | ( | bool | is_mouse_wheel_enabled | ) |
Sets if this frame can receive mouse wheel input.
is_mouse_wheel_enabled | 'true' to enable |
Definition at line 450 of file gui_frame.cpp.
void lxgui::gui::frame::set_movable | ( | bool | is_movable | ) |
Sets if this frame can be moved by the user.
is_movable | 'true' to allow the user to move this frame |
Definition at line 1260 of file gui_frame.cpp.
|
protectedinherited |
Sets this region's name.
name | This region's name |
Definition at line 294 of file gui_region.cpp.
|
overrideprotectedvirtual |
Changes this region's parent.
parent | The new parent |
Reimplemented from lxgui::gui::region.
Definition at line 513 of file gui_frame.cpp.
void lxgui::gui::frame::set_rel_hit_rect_insets | ( | const bounds2f & | insets | ) |
Sets this frame's relative hit rect insets.
insets | Offsets |
Definition at line 1197 of file gui_frame.cpp.
|
inherited |
Changes this region's dimensions (relative to its parent).
dimensions | The new dimensions (relative) |
Definition at line 251 of file gui_region.cpp.
|
inherited |
Changes this region's height (relative to its parent).
rel_height | The new height |
Definition at line 265 of file gui_region.cpp.
|
inherited |
Changes this region's width (relative to its parent).
rel_width | The new width |
Definition at line 258 of file gui_region.cpp.
void lxgui::gui::frame::set_resizable | ( | bool | is_resizable | ) |
Sets if this frame can be resized by the user.
is_resizable | 'true' to allow the user to resize this frame |
Definition at line 1272 of file gui_frame.cpp.
void lxgui::gui::frame::set_scale | ( | float | scale | ) |
Sets this frame's scale.
scale | The new scale |
Definition at line 1276 of file gui_frame.cpp.
|
inline |
Sets a new handler script for this frame (replacing existing scripts).
script_name | The name of the script (e.g., "OnEvent") |
handler | The handler of the script, as a C++ function of signature script_signature |
info | The location where this script has been defined |
self
parameter of type other than frame, for example: dynamic_cast
, so that incorrect types will be reported. However this has a cost; if you are sure of the type and want to bypass this cost, just supply the self
type as the first template argument to this function: Definition at line 1305 of file gui_frame.hpp.
|
inline |
Sets a new handler script for this frame (replacing existing scripts).
script_name | The name of the script (e.g., "OnEvent") |
handler | The handler of the script, as a C++ function of signature script_signature |
info | The location where this script has been defined |
Definition at line 1273 of file gui_frame.hpp.
|
inline |
Sets a new handler script for this frame (replacing existing scripts).
script_name | The name of the script (e.g., "OnEvent") |
handler | The handler of the script, as a Lua function |
info | The location where this script has been defined |
Definition at line 1252 of file gui_frame.hpp.
|
inline |
Sets a new handler script for this frame (replacing existing scripts).
script_name | The name of the script (e.g., "OnEvent") |
content | The content of the script, as Lua code |
info | The location where this script has been defined |
Definition at line 1233 of file gui_frame.hpp.
|
inherited |
shows/hides this region.
is_shown | 'true' if you want to show this region |
Definition at line 196 of file gui_region.cpp.
void lxgui::gui::frame::set_strata | ( | std::optional< strata > | strata_id | ) |
Sets this frame's strata.
strata_id | The new strata, or nullopt to inherit strata from parent |
Definition at line 1178 of file gui_frame.cpp.
void lxgui::gui::frame::set_top_level | ( | bool | is_top_level | ) |
Sets if this frame is at top level.
is_top_level | 'true' to put the frame at top level |
Definition at line 1282 of file gui_frame.cpp.
void lxgui::gui::frame::set_update_rate | ( | float | rate | ) |
Sets a maximum update rate (in updates per seconds).
rate | The new rate, or 0 to update as often as possible |
Definition at line 1146 of file gui_frame.cpp.
void lxgui::gui::frame::set_user_placed | ( | bool | is_user_placed | ) |
Sets if this frame has been moved by the user.
is_user_placed | 'true' if this frame has been moved by the user |
Definition at line 1355 of file gui_frame.cpp.
|
protectedinherited |
|
overridevirtual |
Changes this region's absolute width (in pixels).
abs_width | The new width |
Reimplemented from lxgui::gui::region.
Definition at line 351 of file gui_frame.cpp.
|
inherited |
shows this region.
Definition at line 176 of file gui_region.cpp.
void lxgui::gui::frame::start_moving | ( | ) |
Starts moving this frame with the mouse.
Definition at line 1359 of file gui_frame.cpp.
void lxgui::gui::frame::start_sizing | ( | const point & | p | ) |
Starts resizing this frame with the mouse.
p | The corner to move |
Definition at line 1372 of file gui_frame.cpp.
void lxgui::gui::frame::stop_moving | ( | ) |
ends moving this frame.
Definition at line 1367 of file gui_frame.cpp.
void lxgui::gui::frame::stop_sizing | ( | ) |
ends resizing this frame.
Definition at line 1380 of file gui_frame.cpp.
void lxgui::gui::frame::unregister_event | ( | const std::string & | event_name | ) |
Tells the frame not to react to a certain event.
event_name | The name of the event |
Definition at line 1139 of file gui_frame.cpp.
|
finalvirtual |
Updates this region's logic.
delta | Time spent since last update |
Reimplemented from lxgui::gui::region.
Definition at line 1543 of file gui_frame.cpp.
|
protectedvirtual |
Reimplemented in lxgui::gui::edit_box, and lxgui::gui::scroll_frame.
Definition at line 1561 of file gui_frame.cpp.
|
overrideprotectedvirtual |
Reimplemented from lxgui::gui::region.
Definition at line 1519 of file gui_frame.cpp.
|
protected |
Definition at line 1833 of file gui_frame.hpp.
|
protectedinherited |
Definition at line 802 of file gui_region.hpp.
|
protectedinherited |
Definition at line 818 of file gui_region.hpp.
|
protectedinherited |
Definition at line 814 of file gui_region.hpp.
|
protectedinherited |
Definition at line 824 of file gui_region.hpp.
|
protected |
Definition at line 1822 of file gui_frame.hpp.
|
protectedinherited |
Definition at line 816 of file gui_region.hpp.
|
protected |
Definition at line 1801 of file gui_frame.hpp.
|
staticconstexpr |
Definition at line 1730 of file gui_frame.hpp.
|
protectedinherited |
Definition at line 815 of file gui_region.hpp.
|
protectedinherited |
Definition at line 822 of file gui_region.hpp.
|
protected |
Definition at line 1820 of file gui_frame.hpp.
|
protected |
Definition at line 1816 of file gui_frame.hpp.
|
protected |
Definition at line 1809 of file gui_frame.hpp.
|
protected |
Definition at line 1819 of file gui_frame.hpp.
|
protected |
Definition at line 1851 of file gui_frame.hpp.
|
protected |
Definition at line 1829 of file gui_frame.hpp.
|
protected |
Definition at line 1850 of file gui_frame.hpp.
|
protected |
Definition at line 1827 of file gui_frame.hpp.
|
protectedinherited |
Definition at line 811 of file gui_region.hpp.
|
protectedinherited |
Definition at line 809 of file gui_region.hpp.
|
protected |
Definition at line 1824 of file gui_frame.hpp.
|
protected |
Definition at line 1846 of file gui_frame.hpp.
|
protected |
Definition at line 1825 of file gui_frame.hpp.
|
protected |
Definition at line 1826 of file gui_frame.hpp.
|
protected |
Definition at line 1828 of file gui_frame.hpp.
|
protected |
Definition at line 1830 of file gui_frame.hpp.
|
protectedinherited |
Definition at line 819 of file gui_region.hpp.
|
protected |
Definition at line 1817 of file gui_frame.hpp.
|
protected |
Definition at line 1831 of file gui_frame.hpp.
|
protectedinherited |
Definition at line 812 of file gui_region.hpp.
|
protectedinherited |
Definition at line 810 of file gui_region.hpp.
|
protectedinherited |
Definition at line 820 of file gui_region.hpp.
|
protected |
Definition at line 1806 of file gui_frame.hpp.
|
protected |
Definition at line 1814 of file gui_frame.hpp.
|
protectedinherited |
Definition at line 800 of file gui_region.hpp.
|
protected |
Definition at line 1839 of file gui_frame.hpp.
|
protected |
Definition at line 1837 of file gui_frame.hpp.
|
protected |
Definition at line 1838 of file gui_frame.hpp.
|
protected |
Definition at line 1836 of file gui_frame.hpp.
|
protectedinherited |
Definition at line 804 of file gui_region.hpp.
|
staticconstexprprotected |
Definition at line 1804 of file gui_frame.hpp.
|
protectedinherited |
Definition at line 807 of file gui_region.hpp.
|
protectedinherited |
Definition at line 805 of file gui_region.hpp.
|
protected |
Definition at line 1811 of file gui_frame.hpp.
|
protected |
Definition at line 1812 of file gui_frame.hpp.
|
protected |
Definition at line 1802 of file gui_frame.hpp.
|
protected |
Definition at line 1834 of file gui_frame.hpp.
|
protected |
Definition at line 1841 of file gui_frame.hpp.
|
protected |
Definition at line 1808 of file gui_frame.hpp.
|
protected |
Definition at line 1815 of file gui_frame.hpp.
|
protected |
Definition at line 1844 of file gui_frame.hpp.
|
protected |
Definition at line 1848 of file gui_frame.hpp.
|
protected |
Definition at line 1843 of file gui_frame.hpp.