]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/toolbar.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxToolBar class
4 // Author: David Webster
8 // Copyright: (c) David Webster
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_TOOLBAR_H_
13 #define _WX_TOOLBAR_H_
16 #include "wx/tbarbase.h"
18 class WXDLLEXPORT wxToolBar
: public wxToolBarBase
25 wxToolBar() { Init(); }
27 inline wxToolBar( wxWindow
* pParent
29 ,const wxPoint
& rPos
= wxDefaultPosition
30 ,const wxSize
& rSize
= wxDefaultSize
31 ,long lStyle
= wxNO_BORDER
| wxTB_HORIZONTAL
32 ,const wxString
& rName
= wxToolBarNameStr
46 bool Create( wxWindow
* pParent
48 ,const wxPoint
& rPos
= wxDefaultPosition
49 ,const wxSize
& rSize
= wxDefaultSize
50 ,long lStyle
= wxNO_BORDER
| wxTB_HORIZONTAL
51 ,const wxString
& rName
= wxToolBarNameStr
56 // Override/implement base class virtuals
58 virtual wxToolBarToolBase
* FindToolForPosition( wxCoord vX
61 virtual bool Realize(void);
62 virtual void SetRows(int nRows
);
67 void OnPaint(wxPaintEvent
& event
);
68 void OnSize(wxSizeEvent
& event
);
69 void OnMouseEvent(wxMouseEvent
& event
);
70 void OnKillFocus(wxFocusEvent
& event
);
74 // Common part of all ctors
79 // Implement base class pure virtuals
81 virtual wxToolBarToolBase
* DoAddTool( int id
82 ,const wxString
& label
83 ,const wxBitmap
& bitmap
84 ,const wxBitmap
& bmpDisabled
86 ,const wxString
& shortHelp
= wxEmptyString
87 ,const wxString
& longHelp
= wxEmptyString
88 ,wxObject
*clientData
= NULL
93 virtual bool DoInsertTool( size_t nPos
94 ,wxToolBarToolBase
* pTool
96 virtual bool DoDeleteTool( size_t nPos
97 , wxToolBarToolBase
* pTool
100 virtual void DoEnableTool( wxToolBarToolBase
* pTool
103 virtual void DoToggleTool( wxToolBarToolBase
* pTool
106 virtual void DoSetToggle( wxToolBarToolBase
* pTool
110 virtual wxToolBarToolBase
* CreateTool( int vId
111 ,const wxString
& rsLabel
112 ,const wxBitmap
& rBmpNormal
113 ,const wxBitmap
& rBmpDisabled
115 ,wxObject
* pClientData
116 ,const wxString
& rsShortHelp
117 ,const wxString
& rsLongHelp
119 virtual wxToolBarToolBase
* CreateTool(wxControl
* pControl
);
124 void DrawTool(wxToolBarToolBase
*tool
);
125 virtual void DrawTool( wxDC
& rDC
126 ,wxToolBarToolBase
* pTool
128 virtual void SpringUpButton(int nIndex
);
130 int m_nCurrentRowsOrColumns
;
136 wxCoord m_vMaxHeight
;
143 void LowerTool( wxToolBarToolBase
* pTool
146 void RaiseTool( wxToolBarToolBase
* pTool
150 static bool m_bInitialized
;
152 DECLARE_EVENT_TABLE()
153 DECLARE_DYNAMIC_CLASS(wxToolBar
)
156 #endif // wxUSE_TOOLBAR