]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/tbar95.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxToolBar95 (Windows 95 toolbar) class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart and Markus Holzem
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "tbar95.h"
19 #if USE_BUTTONBAR && USE_TOOLBAR
20 #include "wx/tbarbase.h"
22 WXDLLEXPORT_DATA(extern const char*) wxToolBarNameStr
;
24 #define DEFAULTBITMAPX 16
25 #define DEFAULTBITMAPY 15
26 #define DEFAULTBUTTONX 24
27 #define DEFAULTBUTTONY 24
28 #define DEFAULTBARHEIGHT 27
30 class WXDLLEXPORT wxToolBar95
: public wxToolBarBase
32 DECLARE_DYNAMIC_CLASS(wxToolBar95
)
40 #if WXWIN_COMPATIBILITY > 0
41 inline wxToolBar95(wxWindow
*parent
, int x
, int y
, int w
, int h
,
42 long style
= wxNO_BORDER
, int orientation
= wxVERTICAL
, int RowsOrColumns
= 2,
43 const char *name
= wxToolBarNameStr
)
45 Create(parent
, -1, wxPoint(x
, y
), wxSize(w
, h
), style
, orientation
, RowsOrColumns
, name
);
48 inline wxToolBar95(wxWindow
*parent
, const wxWindowID id
, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
49 const long style
= wxNO_BORDER
, const int orientation
= wxVERTICAL
,
50 const int RowsOrColumns
= 1, const wxString
& name
= wxToolBarNameStr
)
52 Create(parent
, id
, pos
, size
, style
, orientation
, RowsOrColumns
, name
);
56 bool Create(wxWindow
*parent
, const wxWindowID id
, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
57 const long style
= wxNO_BORDER
, const int orientation
= wxVERTICAL
,
58 const int RowsOrColumns
= 1, const wxString
& name
= wxToolBarNameStr
);
60 // Call default behaviour
61 void OnPaint(wxPaintEvent
& event
) { Default() ; }
62 void OnSize(wxSizeEvent
& event
) { Default() ; }
63 void OnMouseEvent(wxMouseEvent
& event
) { Default() ; }
64 void OnKillFocus(wxFocusEvent
& event
) { Default() ; }
66 // Handle wxToolBar95 events
68 // If pushedBitmap is NULL, a reversed version of bitmap is
69 // created and used as the pushed/toggled image.
70 // If toggle is TRUE, the button toggles between the two states.
71 wxToolBarTool
*AddTool(const int toolIndex
, const wxBitmap
& bitmap
, const wxBitmap
& pushedBitmap
= wxNullBitmap
,
72 const bool toggle
= FALSE
, const long xPos
= -1, const long yPos
= -1, wxObject
*clientData
= NULL
,
73 const wxString
& helpString1
= "", const wxString
& helpString2
= "");
76 // Set default bitmap size
77 void SetDefaultSize(const wxSize
& size
);
78 void EnableTool(const int toolIndex
, const bool enable
); // additional drawing on enabling
79 void ToggleTool(const int toolIndex
, const bool toggle
); // toggle is TRUE if toggled on
80 void ClearTools(void);
82 // The button size is bigger than the bitmap size
83 wxSize
GetDefaultButtonSize(void) const;
85 wxSize
GetMaxSize(void) const;
86 void GetSize(int *w
, int *y
) const;
88 // Add all the buttons: required for Win95.
89 virtual bool CreateTools(void);
90 virtual void SetRows(const int nRows
);
91 virtual void Layout(void) {}
94 bool MSWCommand(const WXUINT param
, const WXWORD id
);
95 bool MSWNotify(const WXWPARAM wParam
, const WXLPARAM lParam
);
97 // Responds to colour changes
98 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
103 DECLARE_EVENT_TABLE()
106 #endif // USE_TOOL/BUTTONBAR