| 1 |
#ifndef MENUBAR_H |
| 2 |
#define MENUBAR_H |
| 3 |
|
| 4 |
#include <vector> |
| 5 |
#include <wx/event.h> |
| 6 |
#include <wx/gdicmn.h> |
| 7 |
#include <wx/menu.h> |
| 8 |
#include <wx/panel.h> |
| 9 |
|
| 10 |
struct MenuInfo { |
| 11 |
wxString label; |
| 12 |
wxMenu* menu; |
| 13 |
wxRect rect; |
| 14 |
}; |
| 15 |
|
| 16 |
extern const wxEventType wxEVT_PREVIEW_BAR_SELECTED; |
| 17 |
|
| 18 |
class MenuBar : public wxPanel |
| 19 |
{ |
| 20 |
typedef std::vector<MenuInfo> Vector_t; |
| 21 |
|
| 22 |
protected: |
| 23 |
wxMenuBar* m_mb; |
| 24 |
Vector_t m_menus; |
| 25 |
int m_controlHeight; |
| 26 |
wxString m_mbname; |
| 27 |
|
| 28 |
public: |
| 29 |
MenuBar(wxWindow* parent, wxMenuBar* mb); |
| 30 |
virtual ~MenuBar(); |
| 31 |
|
| 32 |
DECLARE_EVENT_TABLE() |
| 33 |
void OnPaint(wxPaintEvent& e); |
| 34 |
void OnEraseBG(wxEraseEvent& e); |
| 35 |
void OnLeftDown(wxMouseEvent& e); |
| 36 |
}; |
| 37 |
|
| 38 |
#endif // MENUBAR_H |