]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/stubs/toolbar.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxToolBar class
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_TOOLBAR_H_
13 #define _WX_TOOLBAR_H_
16 #pragma interface "toolbar.h"
19 #include "wx/tbarbase.h"
21 WXDLLEXPORT_DATA(extern const char*) wxToolBarNameStr
;
23 class WXDLLEXPORT wxToolBar
: public wxToolBarBase
25 DECLARE_DYNAMIC_CLASS(wxToolBar
)
33 inline wxToolBar(wxWindow
*parent
, wxWindowID id
, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
34 long style
= wxNO_BORDER
|wxTB_HORIZONTAL
,
35 const wxString
& name
= wxToolBarNameStr
)
37 Create(parent
, id
, pos
, size
, style
, name
);
41 bool Create(wxWindow
*parent
, wxWindowID id
, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
42 long style
= wxNO_BORDER
|wxTB_HORIZONTAL
,
43 const wxString
& name
= wxToolBarNameStr
);
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 // Add all the buttons
64 virtual bool CreateTools();
65 virtual void Layout() {}
67 // The post-tool-addition call. TODO: do here whatever's
68 // necessary for completing the toolbar construction.
69 bool Realize() { return CreateTools(); };