]>
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 WXDLLEXPORT_DATA(extern const wxChar
*) wxToolBarNameStr
;
20 class WXDLLEXPORT wxToolBar
: public wxToolBarBase
22 DECLARE_DYNAMIC_CLASS(wxToolBar
)
30 inline wxToolBar(wxWindow
*parent
, wxWindowID id
, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
31 long style
= wxNO_BORDER
|wxTB_HORIZONTAL
,
32 const wxString
& name
= wxToolBarNameStr
)
34 Create(parent
, id
, pos
, size
, style
, name
);
38 bool Create(wxWindow
*parent
, wxWindowID id
, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
39 long style
= wxNO_BORDER
|wxTB_HORIZONTAL
,
40 const wxString
& name
= wxToolBarNameStr
);
42 // Call default behaviour
43 void OnMouseEvent(wxMouseEvent
& event
);
45 // If pushedBitmap is NULL, a reversed version of bitmap is
46 // created and used as the pushed/toggled image.
47 // If toggle is TRUE, the button toggles between the two states.
48 wxToolBarTool
*AddTool(int toolIndex
, const wxBitmap
& bitmap
, const wxBitmap
& pushedBitmap
= wxNullBitmap
,
49 bool toggle
= FALSE
, long xPos
= -1, long yPos
= -1, wxObject
*clientData
= NULL
,
50 const wxString
& helpString1
= "", const wxString
& helpString2
= "");
52 // Set default bitmap size
53 void SetToolBitmapSize(const wxSize
& size
);
54 void EnableTool(int toolIndex
, bool enable
); // additional drawing on enabling
55 void ToggleTool(int toolIndex
, bool toggle
); // toggle is TRUE if toggled on
58 // The button size is bigger than the bitmap size
59 wxSize
GetToolSize() const;
61 wxSize
GetMaxSize() const;
63 virtual bool GetToolState(int toolIndex
) const;
65 // Add all the buttons
66 virtual bool CreateTools();
67 virtual void SetRows(int nRows
);
68 virtual void LayoutButtons() {}
70 // The post-tool-addition call
71 bool Realize() { return CreateTools(); };
74 virtual bool OS2Command(WXUINT param
, WXWORD id
);
75 virtual bool OS2OnNotify(int idCtrl
, WXLPARAM lParam
, WXLPARAM
*result
);
77 // Responds to colour changes
78 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
86 #endif // wxUSE_TOOLBAR