]> git.saurik.com Git - wxWidgets.git/blob - utils/wxPython/src/stattool.i
Added missing IMPLEMENT_DYNAMIC_CLASS
[wxWidgets.git] / utils / wxPython / src / stattool.i
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: stattool.i
3 // Purpose: SWIG definitions for StatusBar and ToolBar classes
4 //
5 // Author: Robin Dunn
6 //
7 // Created: 08/24/1998
8 // RCS-ID: $Id$
9 // Copyright: (c) 1998 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
12
13
14 %module stattool
15
16 %{
17 #include "helpers.h"
18 #include <wx/toolbar.h>
19 #include <wx/tbarsmpl.h>
20 %}
21
22 //----------------------------------------------------------------------
23
24 %include typemaps.i
25 %include my_typemaps.i
26
27 // Import some definitions of other classes, etc.
28 %import _defs.i
29 %import misc.i
30 %import windows.i
31 %import controls.i
32
33
34 //---------------------------------------------------------------------------
35
36 class wxStatusBar : public wxWindow {
37 public:
38 wxStatusBar(wxWindow* parent, wxWindowID id,
39 const wxPoint& pos = wxPyDefaultPosition,
40 const wxSize& size = wxPyDefaultSize,
41 long style = wxST_SIZEGRIP,
42 char* name = "statusBar");
43
44 %pragma(python) addtomethod = "__init__:wxp._StdWindowCallbacks(self)"
45
46 %addmethods {
47 %new wxRect* GetFieldRect(long item) {
48 wxRect* rect= new wxRect;
49 self->GetFieldRect(item, *rect);
50 return rect;
51 }
52 }
53 int GetFieldsCount(void);
54 wxString GetStatusText(int ir = 0);
55 void DrawField(wxDC& dc, int i);
56 void DrawFieldText(wxDC& dc, int i);
57 void InitColours(void);
58
59 // OnSysColourChanged(wxSysColourChangedEvent& event);
60
61 void SetFieldsCount(int number = 1);
62 void SetStatusText(const wxString& text, int i = 0);
63 void SetStatusWidths(int LCOUNT, int* LIST);
64 };
65
66
67 //---------------------------------------------------------------------------
68
69 class wxToolBarTool {
70 public:
71 wxToolBarTool();
72 ~wxToolBarTool();
73 void SetSize( long w, long h ) { m_width = w; m_height = h; }
74 long GetWidth () const { return m_width; }
75 long GetHeight () const { return m_height; }
76
77 public:
78 int m_toolStyle;
79 wxObject * m_clientData;
80 int m_index;
81 long m_x;
82 long m_y;
83 long m_width;
84 long m_height;
85 bool m_toggleState;
86 bool m_isToggle;
87 bool m_deleteSecondBitmap;
88 bool m_enabled;
89 wxBitmap m_bitmap1;
90 wxBitmap m_bitmap2;
91 bool m_isMenuCommand;
92 wxString m_shortHelpString;
93 wxString m_longHelpString;
94 };
95
96
97
98 class wxToolBarBase : public wxControl {
99 public:
100
101
102 void AddSeparator(void);
103
104 // Ignoge the clientData for now...
105 %addmethods {
106 wxToolBarTool* AddTool(int toolIndex,
107 const wxBitmap& bitmap1,
108 const wxBitmap& bitmap2 = wxNullBitmap,
109 int isToggle = FALSE,
110 long xPos = -1,
111 long yPos = -1,
112 //wxObject* clientData = NULL,
113 const wxString& shortHelpString = wxPyEmptyStr,
114 const wxString& longHelpString = wxPyEmptyStr) {
115 return self->AddTool(toolIndex, bitmap1, bitmap2,
116 isToggle, xPos, yPos, NULL,
117 shortHelpString, longHelpString);
118 }
119 }
120
121 // void DrawTool(wxMemoryDC& memDC, wxToolBarTool* tool);
122 void EnableTool(int toolIndex, const bool enable);
123 wxToolBarTool* FindToolForPosition(const float x, const float y);
124 wxSize GetToolSize();
125 wxSize GetToolBitmapSize();
126 // wxSize GetMargins();
127 wxSize GetMaxSize();
128 // wxObject* GetToolClientData(int toolIndex);
129 bool GetToolEnabled(int toolIndex);
130 wxString GetToolLongHelp(int toolIndex);
131 int GetToolPacking();
132 int GetToolSeparation();
133 wxString GetToolShortHelp(int toolIndex);
134 bool GetToolState(int toolIndex);
135
136 // TODO: figure out how to handle these
137 //bool OnLeftClick(int toolIndex, bool toggleDown);
138 //void OnMouseEnter(int toolIndex);
139 //void OnRightClick(int toolIndex, float x, float y);
140
141 bool Realize();
142 void SetToolBitmapSize(const wxSize& size);
143 void SetMargins(const wxSize& size);
144 void SetToolLongHelp(int toolIndex, const wxString& helpString);
145 void SetToolPacking(int packing);
146 void SetToolShortHelp(int toolIndex, const wxString& helpString);
147 void SetToolSeparation(int separation);
148 void ToggleTool(int toolIndex, const bool toggle);
149 };
150
151
152
153 // The Native Toolbar
154 class wxToolBar : public wxToolBarBase {
155 public:
156 wxToolBar(wxWindow* parent, wxWindowID id,
157 const wxPoint& pos = wxPyDefaultPosition,
158 const wxSize& size = wxPyDefaultSize,
159 long style = wxTB_HORIZONTAL | wxNO_BORDER,
160 char* name = "toolBar");
161
162 %pragma(python) addtomethod = "__init__:wxp._StdWindowCallbacks(self)"
163
164 };
165
166
167 // A generic toolbar
168 class wxToolBarSimple : public wxToolBarBase {
169 public:
170 wxToolBarSimple(wxWindow* parent, wxWindowID id,
171 const wxPoint& pos = wxPyDefaultPosition,
172 const wxSize& size = wxPyDefaultSize,
173 long style = wxTB_HORIZONTAL | wxNO_BORDER,
174 char* name = "toolBar");
175
176 %pragma(python) addtomethod = "__init__:wxp._StdWindowCallbacks(self)"
177
178 };
179
180
181 //---------------------------------------------------------------------------
182
183 /////////////////////////////////////////////////////////////////////////////
184 //
185 // $Log$
186 // Revision 1.1 1998/10/02 06:40:42 RD
187 // Version 0.4 of wxPython for MSW.
188 //
189 //
190
191
192
193
194
195
196