]> git.saurik.com Git - wxWidgets.git/blob - utils/wxPython/src/stattool.i
Added rotated text support
[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 %pragma(python) code = "import wx"
34
35 //---------------------------------------------------------------------------
36
37 class wxStatusBar : public wxWindow {
38 public:
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");
44
45 %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
46
47 %addmethods {
48 %new wxRect* GetFieldRect(long item) {
49 wxRect* rect= new wxRect;
50 self->GetFieldRect(item, *rect);
51 return rect;
52 }
53 }
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);
59
60 void SetFieldsCount(int number = 1);
61 void SetStatusText(const wxString& text, int i = 0);
62 void SetStatusWidths(int LCOUNT, int* LIST);
63 };
64
65
66 //---------------------------------------------------------------------------
67
68 class wxToolBarTool {
69 public:
70 wxToolBarTool();
71 ~wxToolBarTool();
72 void SetSize( long w, long h ) { m_width = w; m_height = h; }
73 long GetWidth () const { return m_width; }
74 long GetHeight () const { return m_height; }
75 wxControl *GetControl();
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 class wxToolBar : public wxControl {
102 public:
103 wxToolBar(wxWindow* parent, wxWindowID id,
104 const wxPoint& pos = wxPyDefaultPosition,
105 const wxSize& size = wxPyDefaultSize,
106 long style = wxTB_HORIZONTAL | wxNO_BORDER,
107 char* name = "toolBar");
108
109 %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
110
111
112 bool AddControl(wxControl * control);
113 void AddSeparator();
114 void ClearTools();
115
116 // Ignoge the clientData for now...
117 %addmethods {
118 wxToolBarTool* AddTool(int toolIndex,
119 const wxBitmap& bitmap1,
120 const wxBitmap& bitmap2 = wxNullBitmap,
121 int isToggle = FALSE,
122 long xPos = -1,
123 long yPos = -1,
124 //wxObject* clientData = NULL,
125 const wxString& shortHelpString = wxPyEmptyStr,
126 const wxString& longHelpString = wxPyEmptyStr) {
127 return self->AddTool(toolIndex, bitmap1, bitmap2,
128 isToggle, xPos, yPos, NULL,
129 shortHelpString, longHelpString);
130 }
131
132 wxToolBarTool* AddSimpleTool(int toolIndex,
133 const wxBitmap& bitmap,
134 const wxString& shortHelpString = wxPyEmptyStr,
135 const wxString& longHelpString = wxPyEmptyStr) {
136 return self->AddTool(toolIndex, bitmap, wxNullBitmap,
137 FALSE, -1, -1, NULL,
138 shortHelpString, longHelpString);
139 }
140 }
141
142
143 void EnableTool(int toolIndex, bool enable);
144 wxToolBarTool* FindToolForPosition(long x, long y);
145 wxSize GetToolSize();
146 wxSize GetToolBitmapSize();
147 void SetToolBitmapSize(const wxSize& size);
148 wxSize GetToolMargins();
149 wxSize GetMaxSize();
150 // wxObject* GetToolClientData(int toolIndex);
151 bool GetToolEnabled(int toolIndex);
152 wxString GetToolLongHelp(int toolIndex);
153 int GetToolPacking();
154 int GetToolSeparation();
155 wxString GetToolShortHelp(int toolIndex);
156 bool GetToolState(int toolIndex);
157
158
159 bool Realize();
160
161 void SetToolLongHelp(int toolIndex, const wxString& helpString);
162 void SetToolShortHelp(int toolIndex, const wxString& helpString);
163 void SetMargins(const wxSize& size);
164 void SetToolPacking(int packing);
165 void SetToolSeparation(int separation);
166 void ToggleTool(int toolIndex, const bool toggle);
167 void SetToggle(int toolIndex, bool toggle);
168
169 void SetMaxRowsCols(int rows, int cols);
170 int GetMaxRows();
171 int GetMaxCols();
172
173 };
174
175
176
177
178 //---------------------------------------------------------------------------
179