|
| ItemHorizontalMenu (int id, float height, float min_item_width=-1.f) |
|
Item & | get_selected_item () |
|
void | add_item (const std::string &text, const std::string &description, const std::string &icon_file, int id=-1) |
|
void | draw (DrawingContext &context, const Vector &pos, int menu_width, bool active) override |
| Draws the menu item. More...
|
|
void | draw_item (DrawingContext &context, const Item &item, bool active, const Vector &pos, const float &item_width) |
|
void | process_action (const MenuAction &action) override |
| Processes the menu action. More...
|
|
void | event (const SDL_Event &ev) override |
| Processes the given event. More...
|
|
void | on_window_resize () override |
|
bool | changes_width () const override |
| Returns true when the width must be recalculated when an action is processed.
|
|
bool | select_blink () const override |
| Returns true when the item should have a blink effect, provided by the menu, when active. More...
|
|
float | get_distance () const override |
| Returns the distance between the items above and below the current menu item. More...
|
|
int | get_width () const override |
| Returns the minimum width of the menu item. More...
|
|
int | get_height () const override |
| Returns height of menu item. More...
|
|
|
void | calculate_width (int begin=0) |
|
void | calculate_rect (const Vector &pos) |
|
void | go_left () |
|
void | go_right () |
|
|
std::vector< Item > | m_items |
|
int | m_selected_item |
|
int | m_item_range_begin |
|
int | m_item_range_end |
|
float | m_width |
|
const float | m_height |
|
const float | m_min_item_width |
|
Rectf | m_rect |
|
|
static float | s_max_width = 0.f |
|
static const float | s_width_offset = 80.f |
|
static const float | s_menu_width_offset = 30.f |
|
static const float | s_item_spacing = 30.f |
|
static const float | s_icon_y = 3.f |
|
◆ draw()
void ItemHorizontalMenu::draw |
( |
DrawingContext & |
context, |
|
|
const Vector & |
pos, |
|
|
int |
menu_width, |
|
|
bool |
active |
|
) |
| |
|
overridevirtual |
Draws the menu item.
Reimplemented from MenuItem.
◆ event()
void ItemHorizontalMenu::event |
( |
const SDL_Event & |
ev | ) |
|
|
overridevirtual |
Processes the given event.
Reimplemented from MenuItem.
◆ get_distance()
float ItemHorizontalMenu::get_distance |
( |
| ) |
const |
|
inlineoverridevirtual |
Returns the distance between the items above and below the current menu item.
Reimplemented from MenuItem.
◆ get_height()
int ItemHorizontalMenu::get_height |
( |
| ) |
const |
|
inlineoverridevirtual |
Returns height of menu item.
Reimplemented from MenuItem.
◆ get_width()
int ItemHorizontalMenu::get_width |
( |
| ) |
const |
|
inlineoverridevirtual |
Returns the minimum width of the menu item.
Reimplemented from MenuItem.
◆ process_action()
void ItemHorizontalMenu::process_action |
( |
const MenuAction & |
action | ) |
|
|
overridevirtual |
Processes the menu action.
Reimplemented from MenuItem.
◆ select_blink()
bool ItemHorizontalMenu::select_blink |
( |
| ) |
const |
|
inlineoverridevirtual |
Returns true when the item should have a blink effect, provided by the menu, when active.
Reimplemented from MenuItem.
The documentation for this class was generated from the following files: