1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxToolBarSimple class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart and Markus Holzem
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_TBARSMPLH__
13 #define _WX_TBARSMPLH__
16 #pragma interface "tbarsmpl.h"
23 #include "wx/bitmap.h"
25 #include "wx/tbarbase.h"
27 class WXDLLEXPORT wxMemoryDC
;
29 WXDLLEXPORT_DATA(extern const wxChar
*) wxToolBarNameStr
;
30 WXDLLEXPORT_DATA(extern const wxSize
) wxDefaultSize
;
31 WXDLLEXPORT_DATA(extern const wxPoint
) wxDefaultPosition
;
33 // XView can't cope properly with panels that behave like canvases
34 // (e.g. no scrollbars in panels)
35 class WXDLLEXPORT wxToolBarSimple
: public wxToolBarBase
37 DECLARE_DYNAMIC_CLASS(wxToolBarSimple
)
41 wxToolBarSimple(void);
42 inline wxToolBarSimple(wxWindow
*parent
, wxWindowID id
, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
43 long style
= wxNO_BORDER
|wxTB_HORIZONTAL
,
44 const wxString
& name
= wxToolBarNameStr
)
46 Create(parent
, id
, pos
, size
, style
, name
);
48 ~wxToolBarSimple(void);
50 bool Create(wxWindow
*parent
, wxWindowID id
, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
51 long style
= wxNO_BORDER
|wxTB_HORIZONTAL
, const wxString
& name
= wxToolBarNameStr
);
53 void OnPaint(wxPaintEvent
& event
);
54 void OnSize(wxSizeEvent
& event
);
55 void OnMouseEvent(wxMouseEvent
& event
);
56 void OnKillFocus(wxFocusEvent
& event
);
58 // Handle wxToolBar events
60 virtual void DrawTool(wxDC
& dc
, wxMemoryDC
& memDC
, wxToolBarTool
*tool
);
61 virtual void ToggleTool(int toolIndex
, bool toggle
); // toggle is TRUE if toggled on
63 virtual void SpringUpButton(int index
);
67 // The post-tool-addition call
68 bool Realize() { Layout(); return TRUE
; };
71 int m_currentRowsOrColumns
;
72 long m_lastX
, m_lastY
;
78 #endif // wxUSE_TOOLBAR