libwtk-sdl2  0.0.1
Public Member Functions | List of all members
selectable Struct Reference
Inheritance diagram for selectable:
Inheritance graph
[legend]
Collaboration diagram for selectable:
Collaboration graph
[legend]

Public Member Functions

widgetfind_selectable (navigation_type nt, point center) override
 
widgetnavigate_selectable (navigation_type nt, point center) override
 
void on_select () override
 
void on_unselect () override
 
- Public Member Functions inherited from widget
 widget (widget const &)=delete
 
widgetoperator= (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 std::vector< widget * > get_children ()
 
virtual std::vector< widget const * > get_children () const
 
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_draw (draw_context &dc, selection_context const &sc) const =0
 
virtual void on_mouse_up_event (mouse_up_event const &e)
 
virtual void on_mouse_down_event (mouse_down_event const &e)
 
virtual void on_mouse_move_event (mouse_move_event const &e)
 
virtual void on_key_event (key_event const &e)
 
virtual void on_activate ()
 
void apply_layout (SDL_Rect box)
 
virtual void on_box_allocated ()
 
virtual size_hint get_size_hint (int width=-1, int height=-1) const =0
 
virtual bool can_use_intermediate_size () const
 
virtual widgetnavigate_selectable_from_children (navigation_type nt, widget *w, point center)
 

Additional Inherited Members

- Protected Member Functions inherited from widget
std::optional< swipe_infoget_swipe_info_with_context_info (mouse_up_event const &e)
 
widgetnavigate_selectable_parent (navigation_type nt, point center)
 
- Protected Attributes inherited from widget
widget_parent
 

Member Function Documentation

◆ find_selectable()

widget* selectable::find_selectable ( navigation_type  nt,
point  center 
)
overridevirtual

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.

Reimplemented from widget.

◆ navigate_selectable()

widget* selectable::navigate_selectable ( navigation_type  nt,
point  center 
)
overridevirtual

Perform a navigation request from this widget as source.

A widget that is not selectable doesn't have to implement this. Containers on the other hand should implement this to enable navigation of their children.

The point may serve as a hint to provide a more accurate selection.

Reimplemented from widget.


The documentation for this struct was generated from the following file: