Hasty Badger
Small UI library (a branch of Turbo Badger)
 All Classes Namespaces Functions Variables Enumerations Enumerator Friends Groups Pages
tb_menu_window.h
1 // ================================================================================
2 // == This file is a part of Turbo Badger. (C) 2011-2014, Emil SegerÃ¥s ==
3 // == See tb_core.h for more information. ==
4 // ================================================================================
5 
6 #ifndef TB_MENU_WINDOW_H
7 #define TB_MENU_WINDOW_H
8 
9 #include "tb_select.h"
10 #include "tb_popup_window.h"
11 
12 namespace tb {
13 
22 {
23 public:
24  // For safe typecasting
25  TBOBJECT_SUBCLASS(TBMenuWindow, TBPopupWindow);
26 
27  TBMenuWindow(TBWidget *target, TBID id);
28  ~TBMenuWindow();
29 
30  bool Show(TBSelectItemSource *source, const TBPopupAlignment &alignment, int initial_value = -1);
31 
32  TBSelectList *GetList() { return &m_select_list; }
33 
34  virtual bool OnEvent(const TBWidgetEvent &ev);
35  virtual void OnDie();
36 private:
37  TBSelectList m_select_list;
38 };
39 
40 } // namespace tb
41 
42 #endif // TB_MENU_WINDOW_H
TBPopupAlignment describes the preferred alignment of a popup relative to a target widget or a given ...
Definition: tb_popup_window.h:19
virtual bool OnEvent(const TBWidgetEvent &ev)
Callback for handling events.
Definition: tb_menu_window.cpp:45
The base TBWidget class.
Definition: tb_widgets.h:418
Definition: tb_widgets.h:112
virtual void OnDie()
Called when Die() is called on this widget.
Definition: tb_menu_window.cpp:31
TBMenuWindow is a popup window that shows a list of items (TBSelectList).
Definition: tb_menu_window.h:21
TBID is a wrapper for a uint32_t to be used as ID.
Definition: tb_id.h:18
TBSelectItemSource is a item provider interface for list widgets (TBSelectList and TBSelectDropdown)...
Definition: tb_select_item.h:72
TBSelectList shows a scrollable list of items provided by a TBSelectItemSource.
Definition: tb_select.h:19
TBPopupWindow is a popup window that redirects any child widgets events through the given target...
Definition: tb_popup_window.h:61
TBMenuWindow(TBWidget *target, TBID id)
Definition: tb_menu_window.cpp:13