]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/tbar95.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/tbar95.h
3 // Purpose: wxToolBar95 (Windows 95 toolbar) class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "tbar95.h"
21 #include "wx/dynarray.h"
23 #include "wx/tbarbase.h"
25 class WXDLLEXPORT wxToolBar95
: public wxToolBarBase
28 wxToolBar95() { Init(); }
30 wxToolBar95(wxWindow
*parent
,
32 const wxPoint
& pos
= wxDefaultPosition
,
33 const wxSize
& size
= wxDefaultSize
,
34 long style
= wxNO_BORDER
| wxTB_HORIZONTAL
,
35 const wxString
& name
= wxToolBarNameStr
)
39 Create(parent
, id
, pos
, size
, style
, name
);
44 bool Create(wxWindow
*parent
,
46 const wxPoint
& pos
= wxDefaultPosition
,
47 const wxSize
& size
= wxDefaultSize
,
48 long style
= wxNO_BORDER
| wxTB_HORIZONTAL
,
49 const wxString
& name
= wxToolBarNameStr
);
51 // override base class virtuals
53 virtual wxToolBarTool
*AddTool(int toolIndex
,
54 const wxBitmap
& bitmap
,
55 const wxBitmap
& pushedBitmap
= wxNullBitmap
,
57 long xPos
= -1, long yPos
= -1,
58 wxObject
*clientData
= NULL
,
59 const wxString
& helpString1
= wxEmptyString
,
60 const wxString
& helpString2
= wxEmptyString
);
61 virtual bool AddControl(wxControl
*control
);
63 virtual bool DeleteTool(int toolIndex
);
64 virtual void ClearTools();
66 virtual bool Realize() { return CreateTools(); };
68 virtual void EnableTool(int toolIndex
, bool enable
);
69 virtual void ToggleTool(int toolIndex
, bool toggle
);
71 virtual void SetToolBitmapSize(const wxSize
& size
);
72 virtual wxSize
GetToolSize() const;
73 virtual wxSize
GetMaxSize() const;
75 virtual bool GetToolState(int toolIndex
) const;
77 virtual bool CreateTools();
78 virtual void SetRows(int nRows
);
81 virtual bool MSWCommand(WXUINT param
, WXWORD id
);
82 virtual bool MSWOnNotify(int idCtrl
, WXLPARAM lParam
, WXLPARAM
*result
);
84 void OnMouseEvent(wxMouseEvent
& event
);
85 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
88 // common part of all ctors
91 // the array storing the id for each index
94 // get index from id (returns wxNOT_FOUND if no such button)
95 int GetIndexFromId(int id
) const;
97 // the big bitmap containing all bitmaps of the toolbar buttons
100 DECLARE_EVENT_TABLE()
103 class WXDLLEXPORT wxToolBar
: public wxToolBar95
108 wxToolBar(wxWindow
*parent
,
110 const wxPoint
& pos
= wxDefaultPosition
,
111 const wxSize
& size
= wxDefaultSize
,
112 long style
= wxNO_BORDER
| wxTB_HORIZONTAL
,
113 const wxString
& name
= wxToolBarNameStr
)
114 : wxToolBar95(parent
, id
, pos
, size
, style
, name
)
119 DECLARE_DYNAMIC_CLASS(wxToolBar
)
122 #endif // wxUSE_TOOLBAR