1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG definitions for StatusBar and ToolBar classes
9 // Copyright: (c) 1998 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
18 #include <wx/toolbar.h>
19 #include <wx/tbarsmpl.h>
22 //----------------------------------------------------------------------
25 %include my_typemaps.i
27 // Import some definitions of other classes, etc.
33 %pragma(python) code = "import wx"
35 //---------------------------------------------------------------------------
37 class wxStatusBar : public wxWindow {
39 wxStatusBar(wxWindow* parent, wxWindowID id,
40 const wxPoint& pos = wxPyDefaultPosition,
41 const wxSize& size = wxPyDefaultSize,
42 long style = wxST_SIZEGRIP,
43 char* name = "statusBar");
45 %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
48 %new wxRect* GetFieldRect(long item) {
49 wxRect* rect= new wxRect;
50 self->GetFieldRect(item, *rect);
54 int GetFieldsCount(void);
55 wxString GetStatusText(int ir = 0);
56 void DrawField(wxDC& dc, int i);
57 void DrawFieldText(wxDC& dc, int i);
58 void InitColours(void);
60 // OnSysColourChanged(wxSysColourChangedEvent& event);
62 void SetFieldsCount(int number = 1);
63 void SetStatusText(const wxString& text, int i = 0);
64 void SetStatusWidths(int LCOUNT, int* LIST);
68 //---------------------------------------------------------------------------
75 void SetSize( long w, long h ) { m_width = w; m_height = h; }
76 long GetWidth () const { return m_width; }
77 long GetHeight () const { return m_height; }
82 wxObject * m_clientData;
92 bool m_deleteSecondBitmap;
97 wxString m_shortHelpString;
98 wxString m_longHelpString;
103 // class wxToolBarBase : public wxControl {
106 class wxToolBar : public wxControl {
108 wxToolBar(wxWindow* parent, wxWindowID id,
109 const wxPoint& pos = wxPyDefaultPosition,
110 const wxSize& size = wxPyDefaultSize,
111 long style = wxTB_HORIZONTAL | wxNO_BORDER,
112 char* name = "toolBar");
114 %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
117 void AddSeparator(void);
119 // Ignoge the clientData for now...
121 wxToolBarTool* AddTool(int toolIndex,
122 const wxBitmap& bitmap1,
123 const wxBitmap& bitmap2 = wxNullBitmap,
124 int isToggle = FALSE,
127 //wxObject* clientData = NULL,
128 const wxString& shortHelpString = wxPyEmptyStr,
129 const wxString& longHelpString = wxPyEmptyStr) {
130 return self->AddTool(toolIndex, bitmap1, bitmap2,
131 isToggle, xPos, yPos, NULL,
132 shortHelpString, longHelpString);
136 // void DrawTool(wxMemoryDC& memDC, wxToolBarTool* tool);
137 void EnableTool(int toolIndex, const bool enable);
139 wxToolBarTool* FindToolForPosition(const float x, const float y);
140 wxSize GetToolSize();
141 wxSize GetToolBitmapSize();
142 // wxSize GetMargins();
144 // wxObject* GetToolClientData(int toolIndex);
146 bool GetToolEnabled(int toolIndex);
148 wxString GetToolLongHelp(int toolIndex);
149 int GetToolPacking();
150 int GetToolSeparation();
151 wxString GetToolShortHelp(int toolIndex);
153 bool GetToolState(int toolIndex);
155 // TODO: figure out how to handle these
156 //bool OnLeftClick(int toolIndex, bool toggleDown);
157 //void OnMouseEnter(int toolIndex);
158 //void OnRightClick(int toolIndex, float x, float y);
167 void SetToolBitmapSize(const wxSize& size);
168 void SetToolLongHelp(int toolIndex, const wxString& helpString);
169 void SetToolShortHelp(int toolIndex, const wxString& helpString);
171 void SetMargins(const wxSize& size);
172 void SetToolPacking(int packing);
173 void SetToolSeparation(int separation);
174 void ToggleTool(int toolIndex, const bool toggle);
179 // // The Native Toolbar
180 // class wxToolBar : public wxToolBarBase {
182 // wxToolBar(wxWindow* parent, wxWindowID id,
183 // const wxPoint& pos = wxPyDefaultPosition,
184 // const wxSize& size = wxPyDefaultSize,
185 // long style = wxTB_HORIZONTAL | wxNO_BORDER,
186 // char* name = "toolBar");
188 // %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
193 // // A generic toolbar
194 // class wxToolBarSimple : public wxToolBarBase {
196 // wxToolBarSimple(wxWindow* parent, wxWindowID id,
197 // const wxPoint& pos = wxPyDefaultPosition,
198 // const wxSize& size = wxPyDefaultSize,
199 // long style = wxTB_HORIZONTAL | wxNO_BORDER,
200 // char* name = "toolBar");
202 // %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
207 //---------------------------------------------------------------------------
209 /////////////////////////////////////////////////////////////////////////////
212 // Revision 1.3 1998/12/15 20:41:23 RD
213 // Changed the import semantics from "from wxPython import *" to "from
214 // wxPython.wx import *" This is for people who are worried about
215 // namespace pollution, they can use "from wxPython import wx" and then
216 // prefix all the wxPython identifiers with "wx."
218 // Added wxTaskbarIcon for wxMSW.
220 // Made the events work for wxGrid.
224 // Added wxMiniFrame for wxGTK, (untested.)
226 // Changed many of the args and return values that were pointers to gdi
227 // objects to references to reflect changes in the wxWindows API.
229 // Other assorted fixes and additions.
231 // Revision 1.2 1998/10/07 07:34:34 RD
232 // Version 0.4.1 for wxGTK
234 // Revision 1.1 1998/10/02 06:40:42 RD
236 // Version 0.4 of wxPython for MSW.