-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathtb_menu_window.h
41 lines (28 loc) · 1.2 KB
/
tb_menu_window.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// ================================================================================
// == This file is a part of Turbo Badger. (C) 2011-2014, Emil Segerås ==
// == See tb_core.h for more information. ==
// ================================================================================
#ifndef TB_MENU_WINDOW_H
#define TB_MENU_WINDOW_H
#include "tb_select.h"
#include "tb_popup_window.h"
namespace tb {
/** TBMenuWindow is a popup window that shows a list of items (TBSelectList).
When selected it will invoke a click with the id given to the menu,
and the id of the clicked item as ref_id, and then close itself.
It may open sub items as new windows at the same time as this window is open.*/
class TBMenuWindow : public TBPopupWindow
{
public:
// For safe typecasting
TBOBJECT_SUBCLASS(TBMenuWindow, TBPopupWindow);
TBMenuWindow(TBWidget *target, TBID id);
~TBMenuWindow();
bool Show(TBSelectItemSource *source, const TBPopupAlignment &alignment, int initial_value = -1);
TBSelectList *GetList() { return &m_select_list; }
virtual bool OnEvent(const TBWidgetEvent &ev);
private:
TBSelectList m_select_list;
};
} // namespace tb
#endif // TB_MENU_WINDOW_H