class::ui::TabBar

class ui::TabBar
  : public ui::Element
  : public ui::ListAttr

This class is used for UI navigation using a Tab bar.

Members

TabBar()
draw::Animation & animation()
Tab & at(

list_attr_size_t i
)

Tab & current()
virtual void draw(

const draw::DrawingAttr & attr
)

virtual Element * handle_event(

const Event & event,
const draw::DrawingAttr & attr
)

sg_size_t height() const
sg_size_t highlight() const
void set_height(

sg_size_t h
)

void set_highlight(

sg_size_t h
)

protected void draw_tab_bar(

const draw::DrawingAttr & attr,
int selected
)

Details

TabBar()

Tab Bar construction


draw::Animation & animation()

Tab & at(

list_attr_size_t i
)

This method accesses a reference to the tab at the specified offset. This method must be implemented by a class that inherits ui::TabBar.

Parameters

  • i The offset of the tab to access

Returns

A reference to the tab at the specified offset.


Tab & current()

Access a reference to the current tab (same as as(selected()))


virtual void draw(

const draw::DrawingAttr & attr
)

This method draws the object using the specified drawing attributes.

The attributes specify which bitmap to draw on, what size to draw, and where to draw. The dimensions and position are scaled to fit on the bitmap.


virtual Element * handle_event(

const Event & event,
const draw::DrawingAttr & attr
)

Handles an event sent by the event loop.

Parameters

  • event The event that should be handled

  • attr The draw::DrawingAttr to use to update the display based on the event.


sg_size_t height() const

Access the height of the tab bar as a ratio to draw::DrawingAttr::scale()


sg_size_t highlight() const

Access the currently highlighted tab


void set_height(

sg_size_t h
)

Set the height of the tab bar where draw::DrawingAttr::scale() height will set the height to fill the entire screen.

Parameters


void set_highlight(

sg_size_t h
)

Set the value of the currently highlighted tab


protected void draw_tab_bar(

const draw::DrawingAttr & attr,
int selected
)


X

Thanks for Coming!

Subscribe to news and updates