Menu bar component. More...
#include <menubar.h>
Inheritance diagram for clan::MenuBar:Public Member Functions | |
Construction | |
| MenuBar (GUIComponent *parent) | |
| Constructs a MenuBar. More... | |
| virtual | ~MenuBar () |
Operations | |
| void | clear () |
| Clear. More... | |
| int | add_menu (const std::string &name, PopupMenu popup_menu) |
| Add menu. More... | |
| void | remove_menu (int index) |
| Remove menu. More... | |
Public Member Functions inherited from clan::GUIComponent | |
| GUIComponent (GUIComponent *parent, const std::string &tag_name="component") | |
| Creates a GUI component. More... | |
| GUIComponent (GUIManager *manager, const GUITopLevelDescription &description, const std::string &tag_name="window") | |
| Constructs a GUIComponent. More... | |
| GUIComponent (GUIComponent *owner, const GUITopLevelDescription &description, const std::string &tag_name="window") | |
| Constructs a GUIComponent. More... | |
| virtual | ~GUIComponent () |
| Callback_v2< Canvas &, const Rect & > & | func_render () |
| void func_render(Canvas &canvas, const Rect &clip_rect) More... | |
| Callback_v1< std::shared_ptr < GUIMessage > & > & | func_process_message () |
| void func_process_message(std::shared_ptr<GUIMessage> &message) More... | |
| Callback_0< bool > & | func_close () |
| bool func_close() More... | |
| Callback_0< bool > & | func_activated () |
| bool func_activated() More... | |
| Callback_0< bool > & | func_deactivated () |
| bool func_deactivated() More... | |
| Callback_0< bool > & | func_focus_lost () |
| bool func_focus_lost() More... | |
| Callback_0< bool > & | func_focus_gained () |
| bool func_focus_gained() More... | |
| Callback_0< bool > & | func_pointer_enter () |
| bool func_pointer_enter() More... | |
| Callback_0< bool > & | func_pointer_exit () |
| bool func_pointer_exit() More... | |
| Callback_v1< std::shared_ptr < GUIMessage > & > & | func_filter_message () |
| Lets a component filter the messages intended for another component. Consumed messages will not reach the original target component. More... | |
| Callback_1< bool, const InputEvent & > & | func_input () |
| bool func_input(const InputEvent &input_event) More... | |
| Callback_1< bool, const InputEvent & > & | func_input_pressed () |
| bool func_input_pressed(const InputEvent &input_event) More... | |
| Callback_1< bool, const InputEvent & > & | func_input_released () |
| bool func_input_released(const InputEvent &input_event) More... | |
| Callback_1< bool, const InputEvent & > & | func_input_doubleclick () |
| bool func_input_doubleclick(const InputEvent &input_event) More... | |
| Callback_1< bool, const InputEvent & > & | func_input_pointer_moved () |
| bool func_input_pointer_moved(const InputEvent &input_event) More... | |
| Callback_v1< bool > & | func_visibility_change () |
| bool func_visibility_change() More... | |
| Signal_v0 & | sig_style_changed () |
| void sig_style_changed() More... | |
| Callback_v0 & | func_enablemode_changed () |
| void func_enablemode_changed() More... | |
| Callback_v0 & | func_resized () |
| Callback invoked when the component is resized, i.e. when set_geometry is called. More... | |
| Callback_v1< Rect & > & | func_constrain_resize () |
| void func_constrain_resize(Rect &geometry) More... | |
| virtual Callback_2 < GUIComponent *, GUIComponent *, std::string > & | func_create_custom_component () |
| Callback invoked when loading a custom component from XML. More... | |
| void | render (Canvas &canvas, const Rect &clip_rect, bool include_children=true) |
| Renders the component and its children. More... | |
| void | paint () |
| Paints the component. More... | |
| void | paint (const Rect &clip_rect) |
| Paint. More... | |
| int | exec () |
| Run component in modal mode. More... | |
| void | exit_with_code (int exit_code) |
| Break message pump. More... | |
| void | set_geometry (Rect geometry) |
| Set manual component position and size. More... | |
| void | reset_geometry () |
| Reset back to automatic layout. More... | |
| void | set_window_geometry (Rect geometry, bool client_area=false) |
| Set component window position and size. More... | |
| void | set_tag_name (const std::string &name) |
| Sets the CSS tag name. More... | |
| bool | set_class (const std::string &name, bool enable) |
| Controls the presence of a CSS class. More... | |
| void | set_id (const std::string &name) |
| Sets the CSS id. More... | |
| void | set_style (const std::string &name) |
| Sets additional CSS style properties that should be applied to this element. More... | |
| void | set_style (const CSSPropertyValue &value, bool enable) |
| Sets additional CSS style properties that should be applied to this element. More... | |
| bool | set_pseudo_class (const std::string &name, bool enable) |
| Controls the presence of a CSS pseudo class. More... | |
| void | update_layout () |
| Re-evaluates the geometry of the component. More... | |
| void | set_enabled (bool enable=true) |
| Sets the component as enabled or disabled. More... | |
| void | set_clip_children (bool clip=true, const Rect &clip_rect=Rect(0, 0, 0, 0)) |
| Sets the components children to be clipped to the parent component when drawn. More... | |
| void | set_visible (bool visible=true, bool activate_root_win=true) |
| Sets the component as visible or hidden. More... | |
| void | set_focus (bool enable=true) |
| Set this component focus. More... | |
| void | capture_mouse (bool capture) |
| Make all mouse messages be redirected to this component. More... | |
| void | capture_proximity (bool capture) |
| Make tablet proximity messages be redirected to this component. More... | |
| void | set_focus_policy (FocusPolicy policy) |
| Sets the focus policy of the component. More... | |
| void | set_double_click_enabled (bool enable) |
| Modifies whether this component will generate double click messages or not. More... | |
| void | set_component_group_name (const std::string &str) |
| Set group name. More... | |
| void | set_selected_in_component_group (bool selected) |
| Set to true if this component is the selected item in a group of components where FocusPolicy is focus_group. More... | |
| void | create_components (const DomDocument &gui_xml) |
| Create child components from a GUI definition file. More... | |
| void | create_components (const std::string &fullname) |
| Create components. More... | |
| void | create_components (IODevice &file) |
| Create components. More... | |
| void | create_components (const std::string &filename, const FileSystem &fs) |
| Create components. More... | |
| void | request_repaint () |
| void | request_repaint (Rect rect) |
| Request repaint. More... | |
| void | set_cliprect (Canvas &canvas, const Rect &rect) |
| Set a clipping rectangle. More... | |
| void | reset_cliprect (Canvas &canvas) |
| Reset the clipping rectangle. More... | |
| void | push_cliprect (Canvas &canvas, const Rect &rect) |
| Push a clipping rectangle. More... | |
| void | pop_cliprect (Canvas &canvas) |
| Pop a clipping rectangle. More... | |
| void | delete_child_components () |
| Deletes all child components. More... | |
| void | set_parent_component (GUIComponent *new_parent) |
| Makes this component a child of the given component, removing it from the previous parent. More... | |
| void | set_layout (GUILayout &layout) |
| Set a layout on the component. More... | |
| void | set_cursor (const Cursor &cursor) |
| Sets the current cursor icon. More... | |
| void | set_cursor (enum StandardCursor type) |
| Set cursor. More... | |
| void | focus_next () |
| Set focus to the next component in tab order. More... | |
| void | focus_previous () |
| Set focus to the previous component in tab order. More... | |
| void | set_default (bool value) |
| When set to true, this component will receive unhandled enter/return keypress messages. More... | |
| void | set_cancel (bool value) |
| When set to true, this component will receive unhandled escape keypress messages. More... | |
| void | set_blocks_default_action (bool block) |
| Set to true if this component, when focused, blocks the default action of the parent dialog. More... | |
| void | set_constant_repaint (bool enable) |
| Enabled whether the GUI will constantly repaint this component when there are no other messages to process. More... | |
| Rect | render_text_span (Canvas &canvas, const std::string &text, const Rect &content_rect) |
| Rect | render_text (Canvas &canvas, const std::string &text) |
| Rect | render_text (Canvas &canvas, const std::string &text, int xpos, int baseline) |
| VerticalTextPosition | get_vertical_text_align (Canvas &canvas) |
| Calculates the vertical text position for the current font using the component content box. More... | |
| VerticalTextPosition | get_vertical_text_align (Canvas &canvas, const Rect &rect) |
| Calculates the vertical text position for the current font. More... | |
| Rect | get_geometry () const |
| Returns the position and size of the drawable area of the component relative to its parent component. More... | |
| Rect | get_viewport () const |
| Returns the position and size of the viewport of the component window in screen coordinates. More... | |
| Rect | get_content_box () const |
| Returns the content box area relative to the component geometry. More... | |
| int | get_width () const |
| Returns the width of the drawable area of the component. More... | |
| int | get_height () const |
| Returns the height of the drawable area of the component. More... | |
| Size | get_size () const |
| Returns the size of the drawable area of the component. More... | |
| Rect | get_window_geometry () const |
| Returns the position and size of the component window (window frame, borders etc). More... | |
| std::string | get_tag_name () const |
| Returns the CSS tag name. More... | |
| std::string | get_id () const |
| Returns the CSS id attribute. More... | |
| bool | get_class (const std::string &name) const |
| Returns whether a CSS class is present or not. More... | |
| bool | get_pseudo_class (const std::string &name) const |
| Returns whether a CSS pseudo class is present or not. More... | |
| std::vector< std::string > | get_classes () const |
| Returns all classes currently present. More... | |
| std::vector< std::string > | get_pseudo_classes () const |
| Returns all pseudo classes currently present. More... | |
| const CSSComputedValues & | get_css_values () const |
| Returns the standard W3C CSS properties active for this component. More... | |
| bool | has_focus () const |
| Returns true if the component has the focus. More... | |
| bool | get_allow_resize () const |
| Returns true if the components size can be changed. More... | |
| bool | get_clip_children () const |
| Returns true if the components children are clipped to the parent component when drawn. More... | |
| FocusPolicy | get_focus_policy () const |
| Returns the focus policy of the component. More... | |
| std::string | get_component_group_name () const |
| Returns the name of the component group, or an empty string if no group name has been set. More... | |
| bool | is_selected_in_group () const |
| Returns true if the component is the selected item in a group of components where FocusPolicy is focus_group. More... | |
| bool | get_blocks_default_action () const |
| Returns true if this component, when focused, blocks the default action of its parent dialog. More... | |
| ResourceManager | get_resources () const |
| Returns the resource manager for the GUI resources. More... | |
| GUIManager | get_gui_manager () const |
| Returns the GUI manager owning this component. More... | |
| const GUIComponent * | get_parent_component () const |
| Returns the parent component. More... | |
| GUIComponent * | get_parent_component () |
| Get Parent component. More... | |
| const GUIComponent * | get_owner_component () const |
| Return the component owning this component. More... | |
| GUIComponent * | get_owner_component () |
| Get Owner component. More... | |
| std::vector< GUIComponent * > | get_child_components () const |
| Returns a list of the child components. More... | |
| const GUIComponent * | get_first_child () const |
| Returns the first child component. More... | |
| GUIComponent * | get_first_child () |
| Get First child. More... | |
| const GUIComponent * | get_last_child () const |
| Returns the last child component. More... | |
| GUIComponent * | get_next_component_in_tree () |
| Returns the next component in the component tree, or 'this', if none found. More... | |
| GUIComponent * | get_previous_component_in_tree () |
| Returns the previous component in the component tree, or 'this', if none found. More... | |
| GUIComponent * | get_last_child () |
| Get Last child. More... | |
| std::vector< GUIComponent * > | get_child_component_group (const std::string &group_name) const |
| Returns a list of child components belonging to the specified group. More... | |
| GUIComponent * | get_group_selected_component () |
| Returns the selected item in a component group of which this component is a member. More... | |
| GUIComponent * | get_named_item (const std::string &id) |
| Find child component with the specified component ID name. More... | |
| bool | has_child_components () const |
| Returns true if the component has any child components. More... | |
| const GUIComponent * | get_previous_sibling () const |
| Returns the previous sibling component. More... | |
| GUIComponent * | get_previous_sibling () |
| Get Previous sibling. More... | |
| const GUIComponent * | get_next_sibling () const |
| Returns the next sibling component. More... | |
| GUIComponent * | get_next_sibling () |
| Get Next sibling. More... | |
| bool | is_descendant_of (GUIComponent *component) |
| Checks if this component is a descendant of target component. More... | |
| bool | is_ancestor_of (GUIComponent *component) |
| Checks if this component is the ancestor of target component. More... | |
| const GUIComponent * | get_top_level_component () const |
| Returns the top level component this GUIComponent is a child of. More... | |
| GUITopLevelWindow * | get_top_level_window () const |
| Returns the top level window this GUIComponent belongs to. More... | |
| GUIComponent * | get_top_level_component () |
| Get Top level component. More... | |
| Canvas | get_canvas () const |
| Return the graphic context for the component. More... | |
| InputContext | get_ic () |
| Return the input context for the component. More... | |
| bool | is_enabled () const |
| Return true if the component, and all its parents are enabled. More... | |
| bool | is_visible () const |
| Return true if the component, and all its parents are visible. More... | |
| bool | is_active () const |
| Returns true if the component is active. More... | |
| GUIComponent * | get_component_at (const Point &point) |
| Return the component under 'point', in local viewport coordinates. More... | |
| virtual float | get_preferred_content_width () |
| Returns the preferred content width. More... | |
| virtual float | get_preferred_content_height (float width) |
| Returns the preferred content height for the specified content width. More... | |
| Point | window_to_component_coords (const Point &window_point) const |
| Convert the top-level window client coordinates to component coordinates. More... | |
| Rect | window_to_component_coords (const Rect &window_rect) const |
| Convert the top-level window client coordinates to component coordinates. More... | |
| Point | component_to_window_coords (const Point &component_point) const |
| Convert the component coordinates to top-level window client coordinates. More... | |
| Rect | component_to_window_coords (const Rect &component_rect) const |
| Convert the component coordinates to top-level window client coordinates. More... | |
| Point | screen_to_component_coords (const Point &screen_point) const |
| Convert the screen coordinates to component coordinates. More... | |
| Point | component_to_screen_coords (const Point &component_point) const |
| Convert the component coordinates to screen coordinates. More... | |
| GUILayout | get_layout () const |
| Returns the layout manager set for this component. Check GUILayout.is_null() if none set. More... | |
| DisplayWindow | get_display_window () const |
| Returns the display window in which this component is hosted. More... | |
| bool | is_default () |
| Returns true if this component will receive unhandled enter/return keypress messages. More... | |
| bool | is_cancel () |
| Returns true if this component will receive unhandled escape keypress messages. More... | |
| bool | is_double_click_enabled () const |
| Returns true if this component will generate double click messages. More... | |
| bool | get_constant_repaint () const |
| Enabled whether the GUI will constantly repaint this component when there are no other messages to process. More... | |
| Font | get_font () const |
| Gets the font. More... | |
| Rect | get_render_text_box (Canvas &canvas, const std::string &str) const |
| Calculates the text box using the font defined for the current state for use with render_text(). More... | |
| Size | get_render_text_size (Canvas &canvas, const std::string &str) const |
| Calculates the text size using the font defined for the current state for use with render_text(). More... | |
| Rect | get_render_text_span_box (Canvas &canvas, const std::string &str, const Rect &content_rect) const |
| Calculates the text size using the font defined for the current state for use with render_text_span(). More... | |
| Rect | get_content_shrink_box () const |
| Returns the content shrink box of the theme part. More... | |
| std::string | get_property (const std::string &property, const std::string &default_value) const |
| Returns the value of a property. More... | |
| int | get_property_int (const std::string &property, const std::string &default_value) const |
| Returns the value of a property as an integer. More... | |
Attributes | |
| virtual Size | get_css_size () const |
| Get Preferred size. More... | |
| PopupMenu | get_menu (int index) const |
| Get menu. More... | |
| static MenuBar * | get_named_item (GUIComponent *reference_component, const std::string &id) |
| Find the child MenuBar with the specified component ID name. More... | |
Implementation | |
| class | MenuModalLoop |
Menu bar component.