|
libwtk-sdl2
0.0.1
|
#include <box.hpp>


Classes | |
| struct | child |
Public Types | |
| enum | orientation { VERTICAL, HORIZONTAL } |
| typedef std::vector< child > | children_type |
Public Member Functions | |
| box (orientation o, children_type children) | |
| box (orientation o, children_type children, int children_spacing) | |
| box (orientation o, children_type children, bool children_homogeneous) | |
| box (orientation o, children_type children, int children_spacing, bool children_homogeneous) | |
| void | on_box_allocated () override |
| widget * | find_selectable (navigation_type nt, point center) override |
| widget * | navigate_selectable_from_children (navigation_type nt, widget *w, point center) override |
| size_hint | get_size_hint (int width, int height) const override |
| std::vector< widget * > | get_children () override |
| std::vector< widget const * > | get_children () const override |
Public Member Functions inherited from container | |
| void | on_draw (draw_context &dc, selection_context const &sc) const override |
| void | on_mouse_up_event (mouse_up_event const &me) override |
| void | on_mouse_down_event (mouse_down_event const &me) override |
| void | on_mouse_move_event (mouse_move_event const &e) override |
Public Member Functions inherited from widget | |
| widget (widget const &)=delete | |
| widget & | operator= (widget const &)=delete |
| SDL_Rect const & | get_box () const |
| context_info const & | get_context_info () const |
| void | set_context_info (context_info const &ci) |
| void | set_parent (widget *parent) |
| virtual void | on_child_dirty (widget *child) |
| virtual std::vector< widget * > | get_visible_children () |
| virtual std::vector< widget const * > | get_visible_children () const |
| void | clear_dirty () |
| void | mark_dirty () |
| void | mark_child_dirty (widget *child) |
| void | draw (draw_context &dc, selection_context const &sc) const |
| void | draw_dirty (draw_context &dc, selection_context const &sc) const |
| virtual void | on_key_event (key_event const &e) |
| virtual void | on_activate () |
| void | apply_layout (SDL_Rect box) |
| virtual bool | can_use_intermediate_size () const |
| virtual widget * | navigate_selectable (navigation_type nt, point center) |
| virtual void | on_select () |
| virtual void | on_unselect () |
Static Public Member Functions | |
| static bool | is_orthogonal (navigation_type nt, orientation o) |
| static bool | is_forward (navigation_type nt) |
Additional Inherited Members | |
Protected Member Functions inherited from container | |
| void | init_children () |
Protected Member Functions inherited from widget | |
| std::optional< swipe_info > | get_swipe_info_with_context_info (mouse_up_event const &e) |
| widget * | navigate_selectable_parent (navigation_type nt, point center) |
Protected Attributes inherited from widget | |
| widget * | _parent |
Container to arrange widgets in a horizontal or vertical layout.
Should return the first selectable widget according to the navigation type. If a widget is selectable it should return itself. Containers should return the first selectable child widget. Otherwise nullptr is returned.
The point may serve as a hint to provide a more accurate selection.
Implements container.
|
overridevirtual |
Return child widgets in Z-order. Should be implemented by containers.
Implements container.
|
overridevirtual |
Computes the widgets preferred minimal and natural size. When given a specific width or height the widget might use that to give a more accurate size.
Implements widget.
|
overridevirtual |
When a child widget has exhausted its selectable widgets it may ask its parent for the next widget according to the navigation. The coordinates of the widget are provided to get a more accurate result for some navigation types (i.e. 2-dimensional). The widget passed has to be the direct child, otherwise the parent is not able to find it.
Only containers should implement this.
Reimplemented from widget.
|
overridevirtual |
Refresh layout with existing box. This should not be called if the widget does not have a box already. Otherwise no space is allocated.
Implements container.
1.8.14