]> git.saurik.com Git - wxWidgets.git/blame_incremental - include/wx/msw/tbar95.h
1) APPCONF_ constants renamed to wxCONFIG_
[wxWidgets.git] / include / wx / msw / tbar95.h
... / ...
CommitLineData
1/////////////////////////////////////////////////////////////////////////////
2// Name: tbar95.h
3// Purpose: wxToolBar95 (Windows 95 toolbar) class
4// Author: Julian Smart
5// Modified by:
6// Created: 01/02/97
7// RCS-ID: $Id$
8// Copyright: (c) Julian Smart and Markus Holzem
9// Licence: wxWindows license
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef __TBAR95H__
13#define __TBAR95H__
14
15#ifdef __GNUG__
16#pragma interface "tbar95.h"
17#endif
18
19#if USE_BUTTONBAR && USE_TOOLBAR
20#include "wx/tbarbase.h"
21
22WXDLLEXPORT_DATA(extern const char*) wxToolBarNameStr;
23
24class WXDLLEXPORT wxToolBar95: public wxToolBarBase
25{
26 DECLARE_DYNAMIC_CLASS(wxToolBar95)
27 public:
28 /*
29 * Public interface
30 */
31
32 wxToolBar95(void);
33
34 inline wxToolBar95(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
35 long style = wxNO_BORDER|wxTB_HORIZONTAL,
36 const wxString& name = wxToolBarNameStr)
37 {
38 Create(parent, id, pos, size, style, name);
39 }
40 ~wxToolBar95(void);
41
42 bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
43 long style = wxNO_BORDER|wxTB_HORIZONTAL,
44 const wxString& name = wxToolBarNameStr);
45
46 // Call default behaviour
47 void OnPaint(wxPaintEvent& event) { Default() ; }
48 void OnSize(wxSizeEvent& event) { Default() ; }
49 void OnMouseEvent(wxMouseEvent& event) { Default() ; }
50 void OnKillFocus(wxFocusEvent& event) { Default() ; }
51
52 // Handle wxToolBar95 events
53
54 // If pushedBitmap is NULL, a reversed version of bitmap is
55 // created and used as the pushed/toggled image.
56 // If toggle is TRUE, the button toggles between the two states.
57 wxToolBarTool *AddTool(int toolIndex, const wxBitmap& bitmap, const wxBitmap& pushedBitmap = wxNullBitmap,
58 bool toggle = FALSE, long xPos = -1, long yPos = -1, wxObject *clientData = NULL,
59 const wxString& helpString1 = "", const wxString& helpString2 = "");
60
61 // Set default bitmap size
62 void SetToolBitmapSize(const wxSize& size);
63 void EnableTool(int toolIndex, bool enable); // additional drawing on enabling
64 void ToggleTool(int toolIndex, bool toggle); // toggle is TRUE if toggled on
65 void ClearTools(void);
66
67 // The button size is bigger than the bitmap size
68 wxSize GetToolSize(void) const;
69
70 wxSize GetMaxSize(void) const;
71 void GetSize(int *w, int *y) const;
72
73 // Add all the buttons: required for Win95.
74 virtual bool CreateTools(void);
75 virtual void SetRows(int nRows);
76 virtual void Layout(void) {}
77
78 // The post-tool-addition call
79 bool Realize() { return CreateTools(); };
80
81 // IMPLEMENTATION
82 bool MSWCommand(WXUINT param, WXWORD id);
83 bool MSWNotify(WXWPARAM wParam, WXLPARAM lParam);
84
85 // Responds to colour changes
86 void OnSysColourChanged(wxSysColourChangedEvent& event);
87
88protected:
89 WXHBITMAP m_hBitmap;
90
91DECLARE_EVENT_TABLE()
92};
93
94#endif // USE_TOOL/BUTTONBAR
95#endif
96 // __TBAR95H__