|
| Switch (const std::string &text={}, const Rect &rect={}) noexcept |
|
| Switch (Serializer::Properties &props) noexcept |
|
void | draw (Painter &painter, const Rect &rect) override |
| Draw the widget.
|
|
void | handle (Event &event) override |
| Handle an event.
|
|
EGT_NODISCARD Size | min_size_hint () const override |
| Get a minimum size hint for the Widget.
|
|
EGT_NODISCARD Size | min_size_hint () const override |
| Get a minimum size hint for the Widget.
|
|
void | reset_switch_image (bool checked) |
| Remove the image, if any, used to draw the widget's switch, based on the value of its 'checked' flag.
|
|
EGT_NODISCARD bool | show_label () const |
| Get the show label state.
|
|
void | show_label (bool value) |
| Enable/disable showing the label text.
|
|
EGT_NODISCARD AlignFlags | switch_align () const |
| Get the switch alignment.
|
|
void | switch_align (const AlignFlags &align) |
| Set the alignement of the switch relative to the text.
|
|
EGT_NODISCARD Image * | switch_image (bool checked) const |
| Get the image, if any, used to draw the widget's switch, based on the value of its 'checked' flag.
|
|
void | switch_image (const Image &image, bool checked) |
| Add an image to draw the widget's switch, based on the value of its 'checked' flag.
|
|
virtual EGT_NODISCARD const std::string & | text () const |
| Get the text of the Label.
|
|
virtual void | text (const std::string &str) |
| Set the text.
|
|
void | text (const std::string &text) override |
| Set the text.
|
|
void | text (const std::string &text) override |
| Set the text.
|
|
| Button (Button &&) noexcept=default |
|
| Button (const Button &)=delete |
|
| Button (const std::string &text, const Rect &rect, const AlignFlags &text_align=default_text_align()) noexcept |
|
| Button (const std::string &text={}, const AlignFlags &text_align=default_text_align()) noexcept |
|
| Button (Frame &parent, const std::string &text, const Rect &rect, const AlignFlags &text_align=default_text_align()) noexcept |
|
| Button (Frame &parent, const std::string &text={}, const AlignFlags &text_align=default_text_align()) noexcept |
|
| Button (Serializer::Properties &props) noexcept |
|
| ~Button () noexcept override |
|
EGT_NODISCARD bool | checked () const |
| Get the boolean checked state of the a widget.
|
|
virtual void | checked (bool value) |
| Set the checked state of the widget.
|
|
void | checked (bool value) override |
| Set the checked state of the widget.
|
|
RegisterHandle | on_click (const EventCallback &handler) |
| Add an event handler to be called when the widget receives an EventId::pointer_click event.
|
|
Button & | operator= (Button &&) noexcept=default |
|
Button & | operator= (const Button &)=delete |
|
| TextWidget (Serializer::Properties &props) noexcept |
|
| TextWidget (std::string text={}, const Rect &rect={}, const AlignFlags &text_align=AlignFlag::center) noexcept |
|
virtual void | clear () |
| Clear the text value.
|
|
virtual EGT_NODISCARD size_t | len () const |
| Get the length of the text.
|
|
void | serialize (Serializer &serializer) const override |
| Serialize the widget to the specified serializer.
|
|
EGT_NODISCARD AlignFlags | text_align () const |
| Get the text alignment within the Label.
|
|
void | text_align (const AlignFlags &align) |
| Set the text alignment within the Label.
|
|
| Widget (const Rect &rect={}, const Widget::Flags &flags={}) noexcept |
|
| Widget (const Widget &)=delete |
|
| Widget (Frame &parent, const Rect &rect={}, const Widget::Flags &flags={}) noexcept |
|
| Widget (Serializer::Properties &props) noexcept |
|
| Widget (Widget &&) noexcept=default |
|
| ~Widget () noexcept override |
|
EGT_NODISCARD bool | active () const |
| Get the active state.
|
|
void | active (bool value) |
| Set the active state.
|
|
AlignFlags & | align () |
| Get the alignment.
|
|
EGT_NODISCARD const AlignFlags & | align () const |
| Get the alignment.
|
|
void | align (const AlignFlags &a) |
| Align the widget.
|
|
EGT_NODISCARD float | alpha () const |
| Get the alpha property.
|
|
void | alpha (float alpha) |
| Set the alpha property.
|
|
EGT_NODISCARD bool | autoresize () const |
| Return the autoresize state of the widget.
|
|
void | autoresize (bool value) |
| Set the autoresize state.
|
|
EGT_NODISCARD Image * | background (bool allow_fallback=false) const |
| Get the background image, if any, for the current group.
|
|
void | background (const Image &image, Palette::GroupId group=Palette::GroupId::normal) |
| Add an image background to the widget's box.
|
|
EGT_NODISCARD Image * | background (Palette::GroupId group, bool allow_fallback=false) const |
| Get the background image, if any, for the given group.
|
|
EGT_NODISCARD DefaultDim | border () const |
| Get the border width.
|
|
void | border (DefaultDim border) |
| Set the border width.
|
|
EGT_NODISCARD Theme::BorderFlags | border_flags () const |
| Get the border flags.
|
|
void | border_flags (const Theme::BorderFlags &flags) |
| Set the border flags.
|
|
EGT_NODISCARD float | border_radius () const |
| Get the border radius.
|
|
void | border_radius (float radius) |
| Set the border radius.
|
|
EGT_NODISCARD const Rect & | box () const |
| Bounding box for the Widget.
|
|
void | box (const Rect &rect) |
| Change the bounding box of the widget.
|
|
bool | can_handle_event () const |
| Returns true if the widget is capable of handling an event.
|
|
EGT_NODISCARD Point | center () const |
| Get the center point of the widget's box().
|
|
EGT_NODISCARD bool | checked () const |
| Get the boolean checked state of the a widget.
|
|
EGT_NODISCARD bool | clip () const |
| Return the clip state of the widget.
|
|
EGT_NODISCARD const Pattern & | color (Palette::ColorId id) const |
| Get a Widget color.
|
|
void | color (Palette::ColorId id, const Pattern &color, Palette::GroupId group=Palette::GroupId::normal) |
| Add a color to the widget's instance palette.
|
|
EGT_NODISCARD const Pattern & | color (Palette::ColorId id, Palette::GroupId group) const |
| Get a Widget color.
|
|
virtual EGT_NODISCARD Rect | content_area () const |
| Return the area that content is allowed to be positioned into.
|
|
void | continue_drag (Event &event) |
| Handle 'pointer_drag' and 'pointer_drag_stop' events.
|
|
virtual void | damage () |
| Damage the box() of the widget and cause a redraw.
|
|
virtual void | damage (const Rect &rect) |
| Mark the specified rect as a damaged area of the widget.
|
|
virtual void | deserialize_children (const Deserializer &deserializer) |
| Deserialize the children of this widget.
|
|
void | detach () |
| Detach this widget from its parent.
|
|
void | disable () |
| Set the disabled state to true.
|
|
void | disable_toggle () |
| Toggle the disabled state.
|
|
EGT_NODISCARD bool | disabled () const |
| Return the disabled state of the widget.
|
|
void | disabled (bool value) |
| Set the disabled state.
|
|
DisplayPoint | display_origin () |
| Get the display origin of the Widget.
|
|
virtual Point | display_to_local (const DisplayPoint &p) const |
| Convert a display point to a local point.
|
|
void | draw_box (Painter &painter, Palette::ColorId bg, Palette::ColorId border) const |
| Helper function to draw this widget's box using the appropriate theme.
|
|
void | draw_circle (Painter &painter, Palette::ColorId bg, Palette::ColorId border) const |
| Helper function to draw this widget's circle using the appropriate theme.
|
|
void | enable () |
| Set the disabled state to false.
|
|
Theme::FillFlags & | fill_flags () |
| Get a modifiable fill flags reference.
|
|
EGT_NODISCARD const Theme::FillFlags & | fill_flags () const |
| Get the fill flags.
|
|
void | fill_flags (const Theme::FillFlags &flags) |
| Set the fill flags.
|
|
EGT_NODISCARD bool | focus () const |
| Get the current focus state.
|
|
void | focus (bool value) |
| Set the focus state.
|
|
EGT_NODISCARD const Font & | font () const |
| Get the widget Font.
|
|
void | font (const Font &font) |
| Set the widget Font.
|
|
EGT_NODISCARD bool | frame () const |
| Return the frame state of the widget.
|
|
EGT_NODISCARD bool | grab_mouse () const |
| Return the grab_mouse state of the widget.
|
|
void | grab_mouse (bool value) |
| Set the grab_mouse state.
|
|
EGT_NODISCARD Palette::GroupId | group () const |
| Get the current Palette::GroupId depending on the widget's state.
|
|
bool | has_font () const |
| Check whether the widget has a custom Font.
|
|
EGT_NODISCARD bool | has_palette () const |
| Check whether the widget has a custom palette.
|
|
virtual EGT_NODISCARD bool | has_screen () const |
| Does this Widget have a screen?
|
|
EGT_NODISCARD DefaultDim | height () const |
| Height of the widget's box().
|
|
void | height (DefaultDim h) |
| Change the height.
|
|
virtual void | hide () |
| Hide the Widget.
|
|
EGT_NODISCARD bool | hit (const DisplayPoint &point) const |
| Returns true if the DisplayPoint is within the widget box.
|
|
EGT_NODISCARD DefaultDim | horizontal_ratio () const |
| Get the horizontal ratio relative to parent.
|
|
void | horizontal_ratio (DefaultDim horizontal) |
| Set the horizontal ratio relative to parent.
|
|
EGT_NODISCARD bool | in_layout () const |
| Indicate if the Widget is computing the layout or not.
|
|
virtual void | layout () |
| Perform layout of the Widget.
|
|
DisplayPoint | local_to_display (const Point &p) const |
| Convert a local point to a display point.
|
|
EGT_NODISCARD DefaultDim | margin () const |
| Get the margin width.
|
|
void | margin (DefaultDim margin) |
| Set the margin width.
|
|
void | min_size_hint (const Size &size) |
| Set the minimum size hint for the Widget.
|
|
EGT_NODISCARD size_t | moat () const |
| Get the sum of the margin(), padding(), and border() around the content of the widget.
|
|
virtual void | move (const Point &point) |
| Move the Widget to a new position.
|
|
void | move_to_center () |
| Move the widget to the center of its parent.
|
|
void | move_to_center (const Point &point) |
| Move the widget to the specified center point.
|
|
EGT_NODISCARD bool | no_layout () const |
| Return the no_layout state of the widget.
|
|
void | no_layout (bool value) |
| Set the no_layout state.
|
|
virtual void | on_screen_resized () |
| Called from ComposerScreen::resize().
|
|
Widget & | operator= (const Widget &)=delete |
|
Widget & | operator= (Widget &&) noexcept=default |
|
EGT_NODISCARD DefaultDim | padding () const |
| Return the padding width.
|
|
void | padding (DefaultDim padding) |
| Set the padding width.
|
|
virtual void | paint (Painter &painter) |
| Paint the Widget using a Painter.
|
|
virtual void | paint_to_file (const std::string &filename={}) |
| Draw the widget to a file.
|
|
EGT_NODISCARD const Palette & | palette () const |
| Get the widget palette.
|
|
void | palette (const Palette &palette) |
| Set the widget instance Palette.
|
|
Widget * | parent () |
| Get a pointer to the parent Widget, or nullptr if none exists.
|
|
EGT_NODISCARD const Widget * | parent () const |
| Get a pointer to the parent Widget, or nullptr if none exists.
|
|
EGT_NODISCARD bool | plane_window () const |
| Return the plane_window state of the widget.
|
|
EGT_NODISCARD const Point & | point () const |
| Get the origin of the widget's box().
|
|
virtual void | post_deserialize (Serializer::Properties &props) |
| Resume deserializing of the widget after its children have been deserialized.
|
|
void | ratio (DefaultDim horizontal, DefaultDim vertical) |
| Set the size ratio relative to parent.
|
|
void | ratio (DefaultDim ratio) |
| Set the size ratio relative to parent.
|
|
EGT_NODISCARD bool | readonly () const |
| Get the readonly state of the widget.
|
|
void | readonly (bool value) |
| Set the readonly state of the widget.
|
|
void | readonly_toggle () |
| Toggle the readonly state.
|
|
void | reset_background (Palette::GroupId group=Palette::GroupId::normal) |
| Remove an image background from the widget's box.
|
|
void | reset_font () |
| Reset the widget's Font.
|
|
void | reset_palette () |
| Clear the widget instance palette.
|
|
virtual void | resize (const Size &size) |
| Resize the widget.
|
|
void | resize_by_ratio (DefaultDim hratio, DefaultDim vratio) |
| Scale the current size of the Widget given the ratio.
|
|
void | resize_by_ratio (DefaultDim ratio) |
| Scale the current size of the Widget given the ratio.
|
|
virtual void | scale (float hscale, float vscale) |
| Set the scale of the widget.
|
|
void | scale (float scale) |
| Set the scale of the widget.
|
|
virtual EGT_NODISCARD Screen * | screen () const |
| Get a pointer to the Screen instance, using using a parent as necessary.
|
|
virtual void | serialize_children (Serializer &serializer) const |
| Serialize the widget's children to the specified serializer.
|
|
virtual void | show () |
| Show the Widget.
|
|
EGT_NODISCARD const Size & | size () const |
| Get the size of the widget's box().
|
|
EGT_NODISCARD const Theme & | theme () const |
| Get the Widget Theme.
|
|
EGT_NODISCARD Point | to_parent (const Point &r) const |
| Convert a point with a local origin to a parent origin.
|
|
EGT_NODISCARD Rect | to_parent (const Rect &r) const |
| Convert a point in a rect a local origin to a parent origin.
|
|
virtual EGT_NODISCARD std::string | type () const |
| Returns a string representation of the type of this widget.
|
|
EGT_NODISCARD bool | user_drag () const |
|
void | user_drag (bool value) |
|
EGT_NODISCARD const Rect & | user_requested_box () const |
| Get the box corresponding to the user requested one, not the actual one.
|
|
EGT_NODISCARD bool | user_track_drag () const |
|
void | user_track_drag (bool value) |
|
EGT_NODISCARD DefaultDim | vertical_ratio () const |
| Get the vertical ratio relative to parent.
|
|
void | vertical_ratio (DefaultDim vertical) |
| Set the vertical ratio relative to parent.
|
|
EGT_NODISCARD bool | visible () const |
| Get the visible state of the widget.
|
|
void | visible (bool value) |
| Set the visible state.
|
|
void | visible_toggle () |
| Toggle the visibility state.
|
|
virtual void | walk (const WalkCallback &callback, int level=0) |
| Walk the Widget tree and call callback with each Widget.
|
|
EGT_NODISCARD WidgetId | widgetid () const |
| Get the unique id of the widget.
|
|
EGT_NODISCARD DefaultDim | width () const |
| Width of the widget's box().
|
|
void | width (DefaultDim w) |
| Change the width.
|
|
EGT_NODISCARD DefaultDim | x () const |
| X coordinate of the widget's box().
|
|
void | x (DefaultDim x) |
| Set the X coordinate of the box.
|
|
EGT_NODISCARD DefaultDim | xratio () const |
| Get the X position ratio relative to parent.
|
|
void | xratio (DefaultDim xratio) |
| Set the X position ratio relative to parent.
|
|
EGT_NODISCARD DefaultDim | y () const |
| Y coordinate of the widget's box().
|
|
void | y (DefaultDim y) |
| Set the Y coordinate of the box.
|
|
EGT_NODISCARD DefaultDim | yratio () const |
| Get the Y position ratio relative to parent.
|
|
void | yratio (DefaultDim yratio) |
| Set the Y position ratio relative to parent.
|
|
virtual EGT_NODISCARD size_t | zorder () const |
| Get the zorder of the widget.
|
|
virtual void | zorder (size_t rank) |
| Set the zorder of the widget.
|
|
virtual void | zorder_bottom () |
| Move the widget to the bottom.
|
|
virtual void | zorder_down () |
| Move this widgets zorder down relative to other widgets with the same parent.
|
|
virtual void | zorder_top () |
| Move the widget to the top.
|
|
virtual void | zorder_up () |
| Move this widgets zorder up relative to other widgets with the same parent.
|
|
| Object () noexcept=default |
|
| Object (const Object &)=delete |
|
| Object (Object &&)=default |
|
virtual | ~Object () noexcept=default |
|
void | clear_handlers () |
| Clear all registered event handlers.
|
|
void | invoke_handlers (Event &event) |
| Invoke all handlers with the specified event.
|
|
void | invoke_handlers (EventId event) |
| Invoke all handlers with the specified EventId.
|
|
EGT_NODISCARD const std::string & | name () const |
| Get the name of the Object.
|
|
void | name (const std::string &name) |
| Set the name of the Object.
|
|
RegisterHandle | on_event (const EventCallback &handler, const FilterFlags &mask={}) |
| Add an event handler to be called when the widget generates an event.
|
|
Object & | operator= (const Object &)=delete |
|
Object & | operator= (Object &&)=default |
|
void | remove_handler (RegisterHandle handle) |
| Remove an event handler.
|
|
|
| Switch (Serializer::Properties &props, bool is_derived) noexcept |
|
virtual void | draw_switch (Painter &painter, const Rect &handle) const |
|
void | serialize (Serializer &serializer) const override |
| Serialize the widget to the specified serializer.
|
|
| Button (Serializer::Properties &props, bool is_derived) noexcept |
|
void | set_parent (Widget *parent) override |
| Set this widget's parent.
|
|
| TextWidget (Serializer::Properties &props, bool is_derived) noexcept |
|
EGT_NODISCARD Size | text_size (const std::string &text) const |
| Get the size of the text.
|
|
| Widget (Serializer::Properties &props, bool is_derived) noexcept |
|
bool | accept_drag () const |
| Tell the start_drag() method whether the widget accepts 'pointer_drag*' events.
|
|
void | add_component (Widget &widget) |
| Add a component.
|
|
void | add_damage (const Rect &rect) |
| Add damage to the damage array.
|
|
virtual void | begin_draw () |
| Cause the widget to draw itself and all of its children.
|
|
void | begin_draw (Widget *parent) |
| Call the begin_draw() method of the parent.
|
|
EGT_NODISCARD detail::Range< SubordinatesArray > & | children () |
| Return the array of child widgets.
|
|
EGT_NODISCARD const detail::Range< SubordinatesArray > & | children () const |
| Return the array of child widgets.
|
|
EGT_NODISCARD bool | component () const |
| Get the component status.
|
|
void | component (bool value) |
| Set the component flag.
|
|
EGT_NODISCARD detail::Range< SubordinatesArray > & | components () |
| Return the array of components widgets.
|
|
EGT_NODISCARD const detail::Range< SubordinatesArray > & | components () const |
| Return the array of components widgets.
|
|
virtual void | damage_from_subordinate (const Rect &rect) |
| Special variation of damage() that is to be called explicitly by subordinate widgets.
|
|
void | deserialize_leaf (Serializer::Properties &props) |
| Deserialize widget properties that require to call overridden methods.
|
|
Widget * | find_screen () |
| Starting from this Widget, find the Widget that has a Screen.
|
|
EGT_NODISCARD const Widget * | find_screen () const |
| Starting from this Widget, find the Widget that has a Screen.
|
|
Widget::Flags & | flags () |
| Get a modifiable ref of the flags.
|
|
EGT_NODISCARD const Widget::Flags & | flags () const |
| Get a const ref of the flags.
|
|
virtual bool | internal_drag () const |
|
virtual bool | internal_track_drag () const |
|
EGT_NODISCARD Rect | local_box () const |
| Get the local box which is the same size as box(), but with the origin zeroed.
|
|
EGT_NODISCARD bool | parent_in_layout () |
| Indicate if our parent is computing the layout.
|
|
void | parent_layout () |
| Call our parent to do a layout.
|
|
virtual Point | point_from_subordinate (const Widget &subordinate) const |
|
EGT_NODISCARD detail::Range< SubordinatesArray > & | range_from_widget (const Widget &widget) |
| Return either components() or children() depending on widget.component()
|
|
EGT_NODISCARD const detail::Range< SubordinatesArray > & | range_from_widget (const Widget &widget) const |
| Return either components() or children() depending on widget.component()
|
|
void | remove_component (Widget *widget) |
| Remove a component.
|
|
void | special_child_draw (Painter &painter, Widget *widget) |
| Special draw function that can be invoked when drawing each child.
|
|
EGT_NODISCARD ChildDrawCallback | special_child_draw_callback () const |
| Get the special child draw callback.
|
|
void | special_child_draw_callback (ChildDrawCallback func) |
| Set the special child draw callback.
|
|
EGT_NODISCARD ChildDrawCallback | special_child_draw_callback (Widget *parent) const |
| Get the child draw callback of the parent.
|
|
void | start_drag (Event &event) |
| Handle 'pointer_drag_start' events and decide whether they are caught by this widget.
|
|
virtual Point | to_panel (const Point &p) |
| Convert a local point to the coordinate system of the current panel.
|
|
virtual EGT_NODISCARD Point | to_subordinate (const Point &p) const |
| Convert a point with an origin of the current widget to subordinate origin.
|
|
EGT_NODISCARD Rect | to_subordinate (Rect rect) const |
|
virtual EGT_NODISCARD bool | top_level () const |
| Is this widget a top level widget?
|
|
bool | track_drag () const |
| Tell the continue_drag() method whether the widget tracks 'pointer_drag*' events once they have crossed out the widget boundaries.
|
|
void | update_subordinates_ranges () |
| Update the 'm_children' and 'm_components' members.
|
|
size_t | zorder (const Widget *widget) const |
| Get the zorder of the widget.
|
|
void | zorder (const Widget *widget, size_t rank) |
| Set the zorder of the widget.
|
|
void | zorder_bottom (const Widget *widget) |
| Move the specified widget zorder to the bottom of the current list of widgets with the same parent.
|
|
void | zorder_down (const Widget *widget) |
| Move the specified widget zorder down relative to other widgets with the same parent.
|
|
void | zorder_top (const Widget *widget) |
| Move the specified widget zorder to the top of the current list of widgets with the same parent.
|
|
void | zorder_up (const Widget *widget) |
| Move the specified widget zorder up relative to other widgets with the same parent.
|
|