]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/controls.i
Various changes needed to get up to date with current CVS
[wxWidgets.git] / wxPython / src / controls.i
CommitLineData
7bf85405
RD
1/////////////////////////////////////////////////////////////////////////////
2// Name: controls.i
3// Purpose: Control (widget) classes for wxPython
4//
5// Author: Robin Dunn
6//
7// Created: 6/10/98
8// RCS-ID: $Id$
9// Copyright: (c) 1998 by Total Control Software
10// Licence: wxWindows license
11/////////////////////////////////////////////////////////////////////////////
12
03e9bead 13%module controls
7bf85405 14
03e9bead 15%{
7bf85405
RD
16#include "helpers.h"
17#include <wx/slider.h>
62bd0874 18#include <wx/spinbutt.h>
f6bcfd97 19#include <wx/spinctrl.h>
cf694132 20#include <wx/dynarray.h>
8bf5d46e 21#include <wx/statline.h>
d1679124 22#include <wx/tglbtn.h>
fb5e0af0
RD
23
24#ifdef __WXMSW__
9c039d08
RD
25#if wxUSE_OWNER_DRAWN
26#include <wx/checklst.h>
27#endif
fb5e0af0 28#endif
c95e68d8
RD
29
30#ifdef __WXGTK__
31#include <wx/checklst.h>
32#endif
7bf85405
RD
33%}
34
35//----------------------------------------------------------------------
36
37%include typemaps.i
38%include my_typemaps.i
39
40// Import some definitions of other classes, etc.
41%import _defs.i
42%import misc.i
43%import windows.i
44%import gdi.i
45%import events.i
46
b8b8dda7 47%pragma(python) code = "import wx"
9c039d08 48
7bf85405
RD
49//----------------------------------------------------------------------
50
2f90df85 51%readonly
dd116e73 52// See also wxPy_ReinitStockObjects in helpers.cpp
2f90df85
RD
53wxValidator wxDefaultValidator;
54%readwrite
55
7bf85405
RD
56//----------------------------------------------------------------------
57
137b5242
RD
58%{
59//#define DECLARE_DEF_STRING(name) static wxString* wxPy##name
60
61 // Put some wx default wxChar* values into wxStrings.
62 DECLARE_DEF_STRING(ControlNameStr);
63 DECLARE_DEF_STRING(ButtonNameStr);
64 DECLARE_DEF_STRING(CheckBoxNameStr);
65 DECLARE_DEF_STRING(ChoiceNameStr);
66 DECLARE_DEF_STRING(ComboBoxNameStr);
67 DECLARE_DEF_STRING(GaugeNameStr);
68 DECLARE_DEF_STRING(StaticBoxNameStr);
69 DECLARE_DEF_STRING(StaticTextNameStr);
70 DECLARE_DEF_STRING(ListBoxNameStr);
71 DECLARE_DEF_STRING(TextCtrlNameStr);
72 DECLARE_DEF_STRING(ScrollBarNameStr);
73 DECLARE_DEF_STRING(SPIN_BUTTON_NAME);
74 DECLARE_DEF_STRING(StaticBitmapNameStr);
75 DECLARE_DEF_STRING(RadioBoxNameStr);
76 DECLARE_DEF_STRING(RadioButtonNameStr);
77 DECLARE_DEF_STRING(SliderNameStr);
78
79 wxChar* wxSpinCtrlNameStr = _T("wxSpinCtrl");
80 DECLARE_DEF_STRING(SpinCtrlNameStr);
81
82 static const wxString wxPyEmptyString(wxT(""));
83%}
84
85//----------------------------------------------------------------------
4268f798
RD
86
87// This is the base class for a control or 'widget'.
88//
89// A control is generally a small window which processes user input and/or
90// displays one or more item of data.
7bf85405
RD
91class wxControl : public wxWindow {
92public:
4268f798
RD
93
94 //
9b3d3bc4 95 wxControl(wxWindow *parent,
b0e5c039
RD
96 wxWindowID id,
97 const wxPoint& pos=wxDefaultPosition,
98 const wxSize& size=wxDefaultSize,
99 long style=0,
100 const wxValidator& validator=wxDefaultValidator,
101 const wxString& name=wxPyControlNameStr);
4268f798
RD
102
103 //
09f3d4e6
RD
104 %name(wxPreControl)wxControl();
105
4268f798 106 //
09f3d4e6
RD
107 bool Create(wxWindow *parent,
108 wxWindowID id,
109 const wxPoint& pos=wxDefaultPosition,
110 const wxSize& size=wxDefaultSize,
111 long style=0,
112 const wxValidator& validator=wxDefaultValidator,
137b5242 113 const wxString& name=wxPyControlNameStr);
9b3d3bc4 114
0122b7e3 115 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
17c0e08c 116 %pragma(python) addtomethod = "wxPreControl:val._setOORInfo(val)"
6999b0d8 117
4268f798
RD
118 // Simulates the effect of the user issuing a command to the item. See
119 // wxCommandEvent.
7bf85405 120 void Command(wxCommandEvent& event);
4268f798
RD
121
122 // Return a control's text.
fb5e0af0 123 wxString GetLabel();
4268f798
RD
124
125 // Sets the item's text.
7bf85405
RD
126 void SetLabel(const wxString& label);
127};
128
6999b0d8 129
7bf85405
RD
130//----------------------------------------------------------------------
131
900d9886
RD
132
133class wxControlWithItems : public wxControl {
134public:
135
136 // void Clear(); ambiguous, redefine below...
4268f798
RD
137
138 // Deletes an item from the control
900d9886
RD
139 void Delete(int n);
140
4268f798 141 // Returns the number of items in the control.
900d9886
RD
142 int GetCount();
143 %pragma(python) addtoclass = "Number = GetCount"
4268f798
RD
144
145 // Returns the string at the given position.
900d9886 146 wxString GetString(int n);
4268f798
RD
147
148 // Sets the string value of an item.
900d9886 149 void SetString(int n, const wxString& s);
4268f798
RD
150
151 // Finds an item matching the given string. Returns the zero-based
152 // position of the item, or -1 if the string was not found.
900d9886
RD
153 int FindString(const wxString& s);
154
4268f798 155 // Select the item at postion n.
900d9886 156 void Select(int n);
4268f798
RD
157
158 // Gets the position of the selected item.
900d9886
RD
159 int GetSelection();
160
4268f798 161 // Gets the current selection as a string.
900d9886
RD
162 wxString GetStringSelection() const;
163
164 // void Append(const wxString& item);
165 // void Append(const wxString& item, char* clientData);
166 // char* GetClientData(const int n);
167 // void SetClientData(const int n, char* data);
4268f798
RD
168
169
900d9886 170 %addmethods {
4268f798
RD
171 // Adds the item to the control, associating the given data with the
172 // item if not None.
900d9886
RD
173 void Append(const wxString& item, PyObject* clientData=NULL) {
174 if (clientData) {
175 wxPyClientData* data = new wxPyClientData(clientData);
176 self->Append(item, data);
177 } else
178 self->Append(item);
179 }
180
4268f798 181 // Returns the client data associated with the given item, (if any.)
900d9886
RD
182 PyObject* GetClientData(int n) {
183 wxPyClientData* data = (wxPyClientData*)self->GetClientObject(n);
184 if (data) {
185 Py_INCREF(data->m_obj);
186 return data->m_obj;
187 } else {
188 Py_INCREF(Py_None);
189 return Py_None;
190 }
191 }
192
4268f798 193 // Associate the given client data with the item at position n.
900d9886
RD
194 void SetClientData(int n, PyObject* clientData) {
195 wxPyClientData* data = new wxPyClientData(clientData);
196 self->SetClientObject(n, data);
197 }
198 }
199
ce914f73
RD
200 // append several items at once to the control
201 %name(AppendItems)void Append(const wxArrayString& strings);
202
900d9886 203};
4268f798 204
900d9886
RD
205//----------------------------------------------------------------------
206
4268f798
RD
207// A button is a control that contains a text string, and is one of the most
208// common elements of a GUI. It may be placed on a dialog box or panel, or
209// indeed almost any other window.
210//
211// Styles
212// wxBU_LEFT: Left-justifies the label. WIN32 only.
213// wxBU_TOP: Aligns the label to the top of the button. WIN32 only.
214// wxBU_RIGHT: Right-justifies the bitmap label. WIN32 only.
215// wxBU_BOTTOM: Aligns the label to the bottom of the button. WIN32 only.
216// wxBU_EXACTFIT: Creates the button as small as possible instead of making
217// it of the standard size (which is the default behaviour.)
218//
219// Events
220// EVT_BUTTON(win,id,func):
221// Sent when the button is clicked.
222//
7bf85405
RD
223class wxButton : public wxControl {
224public:
4268f798
RD
225 // Constructor, creating and showing a button.
226 //
227 // parent: Parent window. Must not be None.
228 // id: Button identifier. A value of -1 indicates a default value.
229 // label: The text to be displayed on the button.
230 // pos: The button position on it's parent.
231 // size: Button size. If the default size (-1, -1) is specified then the
232 // button is sized appropriately for the text.
233 // style: Window style. See wxButton.
234 // validator: Window validator.
235 // name: Window name.
7bf85405 236 wxButton(wxWindow* parent, wxWindowID id, const wxString& label,
b68dc582
RD
237 const wxPoint& pos = wxDefaultPosition,
238 const wxSize& size = wxDefaultSize,
7bf85405 239 long style = 0,
b68dc582 240 const wxValidator& validator = wxDefaultValidator,
137b5242 241 const wxString& name = wxPyButtonNameStr);
4268f798
RD
242
243 // Default constructor
09f3d4e6
RD
244 %name(wxPreButton)wxButton();
245
4268f798 246 // Button creation function for two-step creation.
09f3d4e6
RD
247 bool Create(wxWindow* parent, wxWindowID id, const wxString& label,
248 const wxPoint& pos = wxDefaultPosition,
249 const wxSize& size = wxDefaultSize,
250 long style = 0,
251 const wxValidator& validator = wxDefaultValidator,
137b5242 252 const wxString& name = wxPyButtonNameStr);
9c039d08 253
0122b7e3 254 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
17c0e08c 255 %pragma(python) addtomethod = "wxPreButton:val._setOORInfo(val)"
9c039d08 256
4268f798
RD
257 // This sets the button to be the default item for the panel or dialog box.
258 //
259 // Under Windows, only dialog box buttons respond to this function. As
260 // normal under Windows and Motif, pressing return causes the default
261 // button to be depressed when the return key is pressed. See also
262 // wxWindow.SetFocus which sets the keyboard focus for windows and text
263 // panel items, and wxPanel.SetDefaultItem.
7bf85405 264 void SetDefault();
4268f798
RD
265
266 //
9b3d3bc4 267 void SetBackgroundColour(const wxColour& colour);
4268f798 268 //
9b3d3bc4 269 void SetForegroundColour(const wxColour& colour);
4268f798 270
059a841c 271#ifdef __WXMSW__
4268f798 272 // show the image in the button in addition to the label
09f3d4e6 273 void SetImageLabel(const wxBitmap& bitmap);
4268f798
RD
274
275 // set the margins around the image
09f3d4e6 276 void SetImageMargins(wxCoord x, wxCoord y);
059a841c 277#endif
4268f798
RD
278
279 // returns the default button size for this platform
09f3d4e6
RD
280 static wxSize GetDefaultSize();
281};
6999b0d8 282
7bf85405
RD
283//----------------------------------------------------------------------
284
285class wxBitmapButton : public wxButton {
286public:
287 wxBitmapButton(wxWindow* parent, wxWindowID id, const wxBitmap& bitmap,
b68dc582
RD
288 const wxPoint& pos = wxDefaultPosition,
289 const wxSize& size = wxDefaultSize,
7bf85405 290 long style = wxBU_AUTODRAW,
b68dc582 291 const wxValidator& validator = wxDefaultValidator,
137b5242 292 const wxString& name = wxPyButtonNameStr);
09f3d4e6
RD
293 %name(wxPreBitmapButton)wxBitmapButton();
294
295 bool Create(wxWindow* parent, wxWindowID id, const wxBitmap& bitmap,
296 const wxPoint& pos = wxDefaultPosition,
297 const wxSize& size = wxDefaultSize,
298 long style = wxBU_AUTODRAW,
299 const wxValidator& validator = wxDefaultValidator,
137b5242 300 const wxString& name = wxPyButtonNameStr);
7bf85405 301
0122b7e3 302 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
17c0e08c 303 %pragma(python) addtomethod = "wxPreBitmapButton:val._setOORInfo(val)"
9c039d08 304
c5943253
RD
305 wxBitmap GetBitmapLabel();
306 wxBitmap GetBitmapDisabled();
307 wxBitmap GetBitmapFocus();
308 wxBitmap GetBitmapSelected();
7bf85405
RD
309 void SetBitmapDisabled(const wxBitmap& bitmap);
310 void SetBitmapFocus(const wxBitmap& bitmap);
7bf85405 311 void SetBitmapSelected(const wxBitmap& bitmap);
fb5e0af0 312 void SetBitmapLabel(const wxBitmap& bitmap);
7bf85405 313
f6bcfd97
BP
314 void SetMargins(int x, int y) { m_marginX = x; m_marginY = y; }
315 int GetMarginX() const { return m_marginX; }
316 int GetMarginY() const { return m_marginY; }
7bf85405
RD
317};
318
319//----------------------------------------------------------------------
320
7ea515ab
RD
321enum {
322 wxCHK_2STATE,
323 wxCHK_3STATE,
324 wxCHK_ALLOW_3RD_STATE_FOR_USER,
325};
326
327enum wxCheckBoxState
328{
329 wxCHK_UNCHECKED,
330 wxCHK_CHECKED,
331 wxCHK_UNDETERMINED /* 3-state checkbox only */
332};
333
334
7bf85405
RD
335class wxCheckBox : public wxControl {
336public:
337 wxCheckBox(wxWindow* parent, wxWindowID id, const wxString& label,
b68dc582
RD
338 const wxPoint& pos = wxDefaultPosition,
339 const wxSize& size = wxDefaultSize,
7bf85405 340 long style = 0,
1fded56b 341 const wxValidator& validator = wxDefaultValidator,
137b5242 342 const wxString& name = wxPyCheckBoxNameStr);
09f3d4e6
RD
343 %name(wxPreCheckBox)wxCheckBox();
344
345 bool Create(wxWindow* parent, wxWindowID id, const wxString& label,
346 const wxPoint& pos = wxDefaultPosition,
347 const wxSize& size = wxDefaultSize,
348 long style = 0,
1fded56b 349 const wxValidator& validator = wxDefaultValidator,
137b5242 350 const wxString& name = wxPyCheckBoxNameStr);
7bf85405 351
0122b7e3 352 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
17c0e08c 353 %pragma(python) addtomethod = "wxPreCheckBox:val._setOORInfo(val)"
9c039d08 354
7bf85405 355 bool GetValue();
1e4a197e 356 bool IsChecked();
7bf85405 357 void SetValue(const bool state);
7ea515ab
RD
358 wxCheckBoxState Get3StateValue() const;
359 void Set3StateValue(wxCheckBoxState state);
360 bool Is3State() const;
361 bool Is3rdStateAllowedForUser() const;
7bf85405
RD
362};
363
364//----------------------------------------------------------------------
365
900d9886 366class wxChoice : public wxControlWithItems {
7bf85405
RD
367public:
368 wxChoice(wxWindow *parent, wxWindowID id,
b68dc582
RD
369 const wxPoint& pos = wxDefaultPosition,
370 const wxSize& size = wxDefaultSize,
eec92d76 371 int LCOUNT=0, wxString* choices=NULL,
7bf85405 372 long style = 0,
b68dc582 373 const wxValidator& validator = wxDefaultValidator,
137b5242 374 const wxString& name = wxPyChoiceNameStr);
09f3d4e6
RD
375 %name(wxPreChoice)wxChoice();
376
377 bool Create(wxWindow *parent, wxWindowID id,
378 const wxPoint& pos = wxDefaultPosition,
379 const wxSize& size = wxDefaultSize,
380 int LCOUNT=0, wxString* choices=NULL,
381 long style = 0,
382 const wxValidator& validator = wxDefaultValidator,
137b5242 383 const wxString& name = wxPyChoiceNameStr);
7bf85405 384
0122b7e3 385 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
17c0e08c 386 %pragma(python) addtomethod = "wxPreChoice:val._setOORInfo(val)"
0122b7e3 387
7bf85405 388 void Clear();
900d9886 389
7bf85405 390 int GetColumns();
7bf85405
RD
391 void SetColumns(const int n = 1);
392 void SetSelection(const int n);
393 void SetStringSelection(const wxString& string);
0adbc166
RD
394 void SetString(int n, const wxString& s);
395
396 %pragma(python) addtoclass = "
0adbc166
RD
397 Select = SetSelection
398 "
7bf85405
RD
399};
400
401//----------------------------------------------------------------------
402
1fded56b
RD
403// wxGTK's wxComboBox doesn't derive from wxChoice like wxMSW, or even
404// wxControlWithItems, so we have to duplicate the methods here... <blech!>
405// wxMac's inheritace is weird too so we'll fake it with this one too.
c70fd24f 406
1fded56b 407#ifndef __WXMSW__
c70fd24f
RD
408class wxComboBox : public wxControl
409{
410public:
137b5242
RD
411 wxComboBox(wxWindow* parent, wxWindowID id,
412 const wxString& value = wxPyEmptyString,
c70fd24f
RD
413 const wxPoint& pos = wxDefaultPosition,
414 const wxSize& size = wxDefaultSize,
415 int LCOUNT=0, wxString* choices=NULL,
416 long style = 0,
417 const wxValidator& validator = wxDefaultValidator,
137b5242 418 const wxString& name = wxPyComboBoxNameStr);
c70fd24f
RD
419 %name(wxPreComboBox)wxComboBox();
420
137b5242
RD
421 bool Create(wxWindow* parent, wxWindowID id,
422 const wxString& value = wxPyEmptyString,
423 const wxPoint& pos = wxDefaultPosition,
424 const wxSize& size = wxDefaultSize,
425 int LCOUNT=0, wxString* choices=NULL,
426 long style = 0,
427 const wxValidator& validator = wxDefaultValidator,
428 const wxString& name = wxPyComboBoxNameStr);
c70fd24f
RD
429
430 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
431 %pragma(python) addtomethod = "wxPreComboBox:val._setOORInfo(val)"
432
433 void Copy();
434 void Cut();
435 long GetInsertionPoint();
436 long GetLastPosition();
437 wxString GetValue();
438 void Paste();
439 void Replace(long from, long to, const wxString& text);
440 void Remove(long from, long to);
441 void SetInsertionPoint(long pos);
442 void SetInsertionPointEnd();
443 void SetSelection(int n);
444 %name(SetMark)void SetSelection(long from, long to);
445 void SetValue(const wxString& text);
446 void SetEditable(bool editable);
447
448
449 void Clear();
450 void Delete(int n);
451
452 int GetCount();
453 %pragma(python) addtoclass = "Number = GetCount"
454 wxString GetString(int n);
455 int FindString(const wxString& s);
456
457 //void SetString(int n, const wxString& s); *** No equivalent for wxGTK!!!
458
459 // void Select(int n);
460 %pragma(python) addtoclass = "Select = SetSelection"
461
462 int GetSelection();
463 wxString GetStringSelection() const;
464
465 // void Append(const wxString& item);
466 // void Append(const wxString& item, char* clientData);
467 // char* GetClientData(const int n);
468 // void SetClientData(const int n, char* data);
469 %addmethods {
470 void Append(const wxString& item, PyObject* clientData=NULL) {
471 if (clientData) {
472 wxPyClientData* data = new wxPyClientData(clientData);
473 self->Append(item, data);
474 } else
475 self->Append(item);
476 }
477
478 PyObject* GetClientData(int n) {
d84a9306
RD
479#ifdef __WXMAC__
480 wxPyClientData* data = (wxPyClientData*)self->wxItemContainer::GetClientObject(n);
481#else
c70fd24f 482 wxPyClientData* data = (wxPyClientData*)self->GetClientObject(n);
d84a9306 483#endif
c70fd24f
RD
484 if (data) {
485 Py_INCREF(data->m_obj);
486 return data->m_obj;
487 } else {
488 Py_INCREF(Py_None);
489 return Py_None;
490 }
491 }
492
493 void SetClientData(int n, PyObject* clientData) {
494 wxPyClientData* data = new wxPyClientData(clientData);
d84a9306
RD
495#ifdef __WXMAC__
496 self->wxItemContainer::SetClientObject(n, data);
497#else
c70fd24f 498 self->SetClientObject(n, data);
d84a9306 499#endif
c70fd24f
RD
500 }
501 }
502
503};
504
505
506
1fded56b
RD
507#else
508// MSW's version derives from wxChoice
c70fd24f 509
bb0054cd 510class wxComboBox : public wxChoice {
7bf85405 511public:
137b5242
RD
512 wxComboBox(wxWindow* parent, wxWindowID id,
513 const wxString& value = wxPyEmptyString,
b68dc582
RD
514 const wxPoint& pos = wxDefaultPosition,
515 const wxSize& size = wxDefaultSize,
eec92d76 516 int LCOUNT=0, wxString* choices=NULL,
7bf85405 517 long style = 0,
b68dc582 518 const wxValidator& validator = wxDefaultValidator,
137b5242 519 const wxString& name = wxPyComboBoxNameStr);
09f3d4e6
RD
520 %name(wxPreComboBox)wxComboBox();
521
137b5242
RD
522 bool Create(wxWindow* parent, wxWindowID id,
523 const wxString& value = wxPyEmptyString,
09f3d4e6
RD
524 const wxPoint& pos = wxDefaultPosition,
525 const wxSize& size = wxDefaultSize,
526 int LCOUNT=0, wxString* choices=NULL,
527 long style = 0,
528 const wxValidator& validator = wxDefaultValidator,
137b5242 529 const wxString& name = wxPyComboBoxNameStr);
7bf85405 530
0122b7e3 531 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
17c0e08c 532 %pragma(python) addtomethod = "wxPreComboBox:val._setOORInfo(val)"
9c039d08 533
7bf85405
RD
534 void Copy();
535 void Cut();
7bf85405
RD
536 long GetInsertionPoint();
537 long GetLastPosition();
7bf85405 538 wxString GetValue();
7bf85405
RD
539 void Paste();
540 void Replace(long from, long to, const wxString& text);
541 void Remove(long from, long to);
7bf85405
RD
542 void SetInsertionPoint(long pos);
543 void SetInsertionPointEnd();
1d99702e 544 void SetSelection(int n);
7bf85405
RD
545 %name(SetMark)void SetSelection(long from, long to);
546 void SetValue(const wxString& text);
0adbc166 547 void SetEditable(bool editable);
7bf85405 548};
c70fd24f
RD
549#endif
550
7bf85405
RD
551
552//----------------------------------------------------------------------
553
554class wxGauge : public wxControl {
555public:
556 wxGauge(wxWindow* parent, wxWindowID id, int range,
b68dc582
RD
557 const wxPoint& pos = wxDefaultPosition,
558 const wxSize& size = wxDefaultSize,
7bf85405 559 long style = wxGA_HORIZONTAL,
b68dc582 560 const wxValidator& validator = wxDefaultValidator,
137b5242 561 const wxString& name = wxPyGaugeNameStr);
09f3d4e6
RD
562 %name(wxPreGauge)wxGauge();
563
564 bool Create(wxWindow* parent, wxWindowID id, int range,
565 const wxPoint& pos = wxDefaultPosition,
566 const wxSize& size = wxDefaultSize,
567 long style = wxGA_HORIZONTAL,
568 const wxValidator& validator = wxDefaultValidator,
137b5242 569 const wxString& name = wxPyGaugeNameStr);
7bf85405 570
0122b7e3 571 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
17c0e08c 572 %pragma(python) addtomethod = "wxPreGauge:val._setOORInfo(val)"
9c039d08 573
7bf85405
RD
574 int GetBezelFace();
575 int GetRange();
576 int GetShadowWidth();
577 int GetValue();
1a10a058 578 bool IsVertical() const;
7bf85405
RD
579 void SetBezelFace(int width);
580 void SetRange(int range);
581 void SetShadowWidth(int width);
582 void SetValue(int pos);
583};
584
585//----------------------------------------------------------------------
586
587class wxStaticBox : public wxControl {
588public:
589 wxStaticBox(wxWindow* parent, wxWindowID id, const wxString& label,
b68dc582
RD
590 const wxPoint& pos = wxDefaultPosition,
591 const wxSize& size = wxDefaultSize,
7bf85405 592 long style = 0,
137b5242 593 const wxString& name = wxPyStaticBoxNameStr);
09f3d4e6
RD
594 %name(wxPreStaticBox)wxStaticBox();
595
596 bool Create(wxWindow* parent, wxWindowID id, const wxString& label,
597 const wxPoint& pos = wxDefaultPosition,
598 const wxSize& size = wxDefaultSize,
599 long style = 0,
137b5242 600 const wxString& name = wxPyStaticBoxNameStr);
0122b7e3
RD
601
602 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
17c0e08c 603 %pragma(python) addtomethod = "wxPreStaticBox:val._setOORInfo(val)"
7bf85405
RD
604};
605
606
bb0054cd
RD
607//----------------------------------------------------------------------
608
8bf5d46e 609
bb0054cd
RD
610class wxStaticLine : public wxControl {
611public:
612 wxStaticLine( wxWindow *parent, wxWindowID id,
b68dc582
RD
613 const wxPoint &pos = wxDefaultPosition,
614 const wxSize &size = wxDefaultSize,
bb0054cd 615 long style = wxLI_HORIZONTAL,
137b5242 616 const wxString& name = wxPyStaticTextNameStr);
09f3d4e6
RD
617 %name(wxPreStaticLine)wxStaticLine();
618
619 bool Create( wxWindow *parent, wxWindowID id,
620 const wxPoint &pos = wxDefaultPosition,
621 const wxSize &size = wxDefaultSize,
622 long style = wxLI_HORIZONTAL,
137b5242 623 const wxString& name = wxPyStaticTextNameStr);
0122b7e3
RD
624
625 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
17c0e08c 626 %pragma(python) addtomethod = "wxPreStaticLine:val._setOORInfo(val)"
bb0054cd 627};
8bf5d46e 628
bb0054cd 629
7bf85405
RD
630//----------------------------------------------------------------------
631
632class wxStaticText : public wxControl {
633public:
634 wxStaticText(wxWindow* parent, wxWindowID id, const wxString& label,
b68dc582
RD
635 const wxPoint& pos = wxDefaultPosition,
636 const wxSize& size = wxDefaultSize,
7bf85405 637 long style = 0,
137b5242 638 const wxString& name = wxPyStaticTextNameStr);
09f3d4e6
RD
639 %name(wxPreStaticText)wxStaticText();
640
641 bool Create(wxWindow* parent, wxWindowID id, const wxString& label,
642 const wxPoint& pos = wxDefaultPosition,
643 const wxSize& size = wxDefaultSize,
644 long style = 0,
137b5242 645 const wxString& name = wxPyStaticTextNameStr);
7bf85405 646
0122b7e3 647 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
17c0e08c 648 %pragma(python) addtomethod = "wxPreStaticText:val._setOORInfo(val)"
9c039d08 649
7bf85405
RD
650 wxString GetLabel();
651 void SetLabel(const wxString& label);
652};
653
654//----------------------------------------------------------------------
655
900d9886 656class wxListBox : public wxControlWithItems {
7bf85405
RD
657public:
658 wxListBox(wxWindow* parent, wxWindowID id,
b68dc582
RD
659 const wxPoint& pos = wxDefaultPosition,
660 const wxSize& size = wxDefaultSize,
eec92d76 661 int LCOUNT, wxString* choices = NULL,
7bf85405 662 long style = 0,
b68dc582 663 const wxValidator& validator = wxDefaultValidator,
137b5242 664 const wxString& name = wxPyListBoxNameStr);
09f3d4e6
RD
665 %name(wxPreListBox)wxListBox();
666
667 bool Create(wxWindow* parent, wxWindowID id,
668 const wxPoint& pos = wxDefaultPosition,
669 const wxSize& size = wxDefaultSize,
670 int LCOUNT, wxString* choices = NULL,
671 long style = 0,
672 const wxValidator& validator = wxDefaultValidator,
137b5242 673 const wxString& name = wxPyListBoxNameStr);
7bf85405 674
0122b7e3 675 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
17c0e08c 676 %pragma(python) addtomethod = "wxPreListBox:val._setOORInfo(val)"
0122b7e3 677
7bf85405 678 void Clear();
7bf85405 679 void Deselect(int n);
cf694132
RD
680
681 // int GetSelections(int **selections);
682 %addmethods {
683 PyObject* GetSelections() {
684 wxArrayInt lst;
685 self->GetSelections(lst);
686 PyObject *tup = PyTuple_New(lst.GetCount());
f6bcfd97 687 for(size_t i=0; i<lst.GetCount(); i++) {
cf694132
RD
688 PyTuple_SetItem(tup, i, PyInt_FromLong(lst[i]));
689 }
690 return tup;
691 }
692 }
693
900d9886 694
eec92d76 695 void InsertItems(int LCOUNT, wxString* choices, int pos);
2f90df85 696
0adbc166 697 bool IsSelected(const int n);
7bf85405 698 bool Selected(const int n);
eec92d76 699 void Set(int LCOUNT, wxString* choices);
7bf85405
RD
700 void SetFirstItem(int n);
701 %name(SetFirstItemStr)void SetFirstItem(const wxString& string);
702 void SetSelection(int n, bool select = TRUE);
703 void SetString(int n, const wxString& string);
704 void SetStringSelection(const wxString& string, bool select = TRUE);
705};
706
707
9c039d08
RD
708//----------------------------------------------------------------------
709
9c039d08
RD
710class wxCheckListBox : public wxListBox {
711public:
712 wxCheckListBox(wxWindow *parent, wxWindowID id,
b68dc582
RD
713 const wxPoint& pos = wxDefaultPosition,
714 const wxSize& size = wxDefaultSize,
9c039d08 715 int LCOUNT = 0,
eec92d76 716 wxString* choices = NULL,
9c039d08 717 long style = 0,
b68dc582 718 const wxValidator& validator = wxDefaultValidator,
137b5242 719 const wxString& name = wxPyListBoxNameStr);
09f3d4e6
RD
720 %name(wxPreCheckListBox)wxCheckListBox();
721
722 bool Create(wxWindow *parent, wxWindowID id,
723 const wxPoint& pos = wxDefaultPosition,
724 const wxSize& size = wxDefaultSize,
725 int LCOUNT = 0,
726 wxString* choices = NULL,
727 long style = 0,
728 const wxValidator& validator = wxDefaultValidator,
137b5242 729 const wxString& name = wxPyListBoxNameStr);
9c039d08 730
0122b7e3 731 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
17c0e08c 732 %pragma(python) addtomethod = "wxPreCheckListBox:val._setOORInfo(val)"
9c039d08
RD
733
734 bool IsChecked(int uiIndex);
694759cf 735 void Check(int uiIndex, int bCheck = TRUE);
eec92d76 736 void InsertItems(int LCOUNT, wxString* choices, int pos);
9c039d08 737
e6056257 738#ifndef __WXMAC__
9c039d08 739 int GetItemHeight();
e6056257 740#endif
3b3ab7f6
RD
741
742 // return the index of the item at this position or wxNOT_FOUND
743 int HitTest(const wxPoint& pt) const;
744 %name(HitTestXY)int HitTest(wxCoord x, wxCoord y) const;
745
9c039d08 746};
9c039d08 747
7bf85405
RD
748//----------------------------------------------------------------------
749
3ef86e32
RD
750enum {
751 // Styles
752 wxTE_NO_VSCROLL,
753 wxTE_AUTO_SCROLL,
754 wxTE_READONLY,
755 wxTE_MULTILINE,
756 wxTE_PROCESS_TAB,
757 wxTE_LEFT,
758 wxTE_CENTER,
759 wxTE_RIGHT,
760 wxTE_CENTRE,
761 wxTE_RICH,
762 wxTE_PROCESS_ENTER,
763 wxTE_PASSWORD,
764 wxTE_AUTO_URL,
765 wxTE_NOHIDESEL,
766 wxTE_DONTWRAP,
767 wxTE_LINEWRAP,
768 wxTE_WORDWRAP,
769 wxTE_RICH2,
770
771 // Flags to indicate which attributes are being applied
772 wxTEXT_ATTR_TEXT_COLOUR,
773 wxTEXT_ATTR_BACKGROUND_COLOUR,
774 wxTEXT_ATTR_FONT_FACE,
775 wxTEXT_ATTR_FONT_SIZE,
776 wxTEXT_ATTR_FONT_WEIGHT,
777 wxTEXT_ATTR_FONT_ITALIC,
778 wxTEXT_ATTR_FONT_UNDERLINE,
779 wxTEXT_ATTR_FONT,
780 wxTEXT_ATTR_ALIGNMENT,
781 wxTEXT_ATTR_LEFT_INDENT,
782 wxTEXT_ATTR_RIGHT_INDENT,
783 wxTEXT_ATTR_TABS,
784
785};
786
787
788enum wxTextAttrAlignment
789{
790 wxTEXT_ALIGNMENT_DEFAULT,
791 wxTEXT_ALIGNMENT_LEFT,
792 wxTEXT_ALIGNMENT_CENTRE,
793 wxTEXT_ALIGNMENT_CENTER,
794 wxTEXT_ALIGNMENT_RIGHT,
795 wxTEXT_ALIGNMENT_JUSTIFIED
796};
797
798
799
d56cebe7
RD
800
801class wxTextAttr
802{
803public:
804 // ctors
805 wxTextAttr(const wxColour& colText = wxNullColour,
806 const wxColour& colBack = wxNullColour,
3ef86e32
RD
807 const wxFont& font = wxNullFont,
808 wxTextAttrAlignment alignment = wxTEXT_ALIGNMENT_DEFAULT);
d56cebe7
RD
809 ~wxTextAttr();
810
3ef86e32
RD
811 void Init();
812
d56cebe7
RD
813 // setters
814 void SetTextColour(const wxColour& colText);
815 void SetBackgroundColour(const wxColour& colBack);
816 void SetFont(const wxFont& font);
3ef86e32
RD
817 void SetAlignment(wxTextAttrAlignment alignment);
818 void SetTabs(const wxArrayInt& tabs);
819 void SetLeftIndent(int indent);
820 void SetRightIndent(int indent);
821 void SetFlags(long flags);
d56cebe7
RD
822
823 // accessors
824 bool HasTextColour() const;
825 bool HasBackgroundColour() const;
826 bool HasFont() const;
3ef86e32
RD
827 bool HasAlignment() const;
828 bool HasTabs() const;
829 bool HasLeftIndent() const;
830 bool HasRightIndent() const;
831 bool HasFlag(long flag) const;
d56cebe7 832
c5943253
RD
833 wxColour GetTextColour() const;
834 wxColour GetBackgroundColour() const;
835 wxFont GetFont() const;
3ef86e32
RD
836 wxTextAttrAlignment GetAlignment();
837 const wxArrayInt& GetTabs() const;
838 long GetLeftIndent() const;
839 long GetRightIndent() const;
840 long GetFlags() const;
841
98624b49
RD
842
843 // returns false if we have any attributes set, true otherwise
844 bool IsDefault();
2f4e9287
RD
845
846 // return the attribute having the valid font and colours: it uses the
847 // attributes set in attr and falls back first to attrDefault and then to
848 // the text control font/colours for those attributes which are not set
849 static wxTextAttr Combine(const wxTextAttr& attr,
850 const wxTextAttr& attrDef,
851 const wxTextCtrl *text);
d56cebe7
RD
852};
853
854
855
7bf85405
RD
856class wxTextCtrl : public wxControl {
857public:
137b5242
RD
858 wxTextCtrl(wxWindow* parent, wxWindowID id,
859 const wxString& value = wxPyEmptyString,
b68dc582
RD
860 const wxPoint& pos = wxDefaultPosition,
861 const wxSize& size = wxDefaultSize,
7bf85405 862 long style = 0,
b68dc582 863 const wxValidator& validator = wxDefaultValidator,
137b5242 864 const wxString& name = wxPyTextCtrlNameStr);
09f3d4e6
RD
865 %name(wxPreTextCtrl)wxTextCtrl();
866
137b5242
RD
867 bool Create(wxWindow* parent, wxWindowID id,
868 const wxString& value = wxPyEmptyString,
09f3d4e6
RD
869 const wxPoint& pos = wxDefaultPosition,
870 const wxSize& size = wxDefaultSize,
871 long style = 0,
872 const wxValidator& validator = wxDefaultValidator,
137b5242 873 const wxString& name = wxPyTextCtrlNameStr);
7bf85405 874
0122b7e3 875 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
17c0e08c 876 %pragma(python) addtomethod = "wxPreTextCtrl:val._setOORInfo(val)"
9c039d08 877
98624b49
RD
878
879 wxString GetValue() const;
880 void SetValue(const wxString& value);
881
68320e40
RD
882 wxString GetRange(long from, long to);
883
98624b49
RD
884 int GetLineLength(long lineNo) const;
885 wxString GetLineText(long lineNo) const;
886 int GetNumberOfLines() const;
887
888 bool IsModified() const;
889 bool IsEditable() const;
890
891 // If the return values from and to are the same, there is no selection.
892 void GetSelection(long* OUTPUT, long* OUTPUT) const;
b78b83ec 893 wxString GetStringSelection();
98624b49 894
7bf85405 895 void Clear();
7bf85405 896 void Replace(long from, long to, const wxString& value);
98624b49
RD
897 void Remove(long from, long to);
898
899 // load/save the controls contents from/to the file
900 bool LoadFile(const wxString& file);
137b5242 901 bool SaveFile(const wxString& file = wxPyEmptyString);
98624b49 902
1a10a058
RD
903 // sets the dirty flag
904 virtual void MarkDirty() = 0;
905
98624b49
RD
906 // clears the dirty flag
907 void DiscardEdits();
908
909 // set the max number of characters which may be entered in a single line
910 // text control
911 void SetMaxLength(unsigned long len);
912
913 // writing text inserts it at the current position, appending always
914 // inserts it at the end
7bf85405 915 void WriteText(const wxString& text);
cf694132 916 void AppendText(const wxString& text);
b1462dfa 917
db0ff83e
RD
918 // insert the character which would have resulted from this key event,
919 // return TRUE if anything has been inserted
920 bool EmulateKeyPress(const wxKeyEvent& event);
921
98624b49
RD
922 // text control under some platforms supports the text styles: these
923 // methods allow to apply the given text style to the given selection or to
924 // set/get the style which will be used for all appended text
d56cebe7
RD
925 bool SetStyle(long start, long end, const wxTextAttr& style);
926 bool SetDefaultStyle(const wxTextAttr& style);
927 const wxTextAttr& GetDefaultStyle() const;
3ef86e32 928 bool GetStyle(long position, wxTextAttr& style);
d56cebe7 929
98624b49
RD
930 // translate between the position (which is just an index in the text ctrl
931 // considering all its contents as a single strings) and (x, y) coordinates
932 // which represent column and line.
933 long XYToPosition(long x, long y) const;
68320e40
RD
934 void PositionToXY(long pos, long *OUTPUT, long *OUTPUT) const;
935
936 //bool PositionToXY(long pos, long *OUTPUT, long *OUTPUT) const;
937 // TODO: check return value, raise exception.
98624b49
RD
938
939 void ShowPosition(long pos);
940
941 // Clipboard operations
942 void Copy();
943 void Cut();
944 void Paste();
945
946 bool CanCopy() const;
947 bool CanCut() const;
948 bool CanPaste() const;
949
950 // Undo/redo
951 void Undo();
952 void Redo();
953
954 bool CanUndo() const;
955 bool CanRedo() const;
956
957 // Insertion point
958 void SetInsertionPoint(long pos);
959 void SetInsertionPointEnd();
960 long GetInsertionPoint() const;
961 long GetLastPosition() const;
962
963 void SetSelection(long from, long to);
964 void SelectAll();
965 void SetEditable(bool editable);
00b6c4e3 966
64c06a50
RD
967 bool IsSingleLine();
968 bool IsMultiLine();
969
970
b1462dfa
RD
971 %addmethods {
972 void write(const wxString& text) {
d56cebe7 973 self->AppendText(text);
b1462dfa
RD
974 }
975 }
2f4e9287
RD
976
977 // TODO: replace this when the method is really added to wxTextCtrl
978 %addmethods {
979 wxString GetString(long from, long to) {
64c06a50 980 return self->GetValue().Mid(from, to - from);
2f4e9287
RD
981 }
982 }
7bf85405
RD
983};
984
985//----------------------------------------------------------------------
986
987class wxScrollBar : public wxControl {
988public:
989 wxScrollBar(wxWindow* parent, wxWindowID id = -1,
b68dc582
RD
990 const wxPoint& pos = wxDefaultPosition,
991 const wxSize& size = wxDefaultSize,
7bf85405 992 long style = wxSB_HORIZONTAL,
b68dc582 993 const wxValidator& validator = wxDefaultValidator,
137b5242 994 const wxString& name = wxPyScrollBarNameStr);
09f3d4e6
RD
995 %name(wxPreScrollBar)wxScrollBar();
996
997 bool Create(wxWindow* parent, wxWindowID id = -1,
998 const wxPoint& pos = wxDefaultPosition,
999 const wxSize& size = wxDefaultSize,
1000 long style = wxSB_HORIZONTAL,
1001 const wxValidator& validator = wxDefaultValidator,
137b5242 1002 const wxString& name = wxPyScrollBarNameStr);
7bf85405 1003
0122b7e3 1004 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
17c0e08c 1005 %pragma(python) addtomethod = "wxPreScrollBar:val._setOORInfo(val)"
9c039d08 1006
7bf85405
RD
1007 int GetRange();
1008 int GetPageSize();
b8b8dda7 1009 int GetThumbPosition();
7bf85405 1010 int GetThumbSize();
26b9cf27 1011 %name(GetThumbLength) int GetThumbSize(); // to match the docs
ebf4302c
RD
1012
1013 bool IsVertical();
1014
b8b8dda7 1015 void SetThumbPosition(int viewStart);
7bf85405
RD
1016 void SetScrollbar(int position, int thumbSize,
1017 int range, int pageSize,
1018 bool refresh = TRUE);
1019};
1020
1021//----------------------------------------------------------------------
1022
1023class wxSpinButton : public wxControl {
1024public:
1025 wxSpinButton(wxWindow* parent, wxWindowID id = -1,
b68dc582
RD
1026 const wxPoint& pos = wxDefaultPosition,
1027 const wxSize& size = wxDefaultSize,
7bf85405 1028 long style = wxSP_HORIZONTAL,
137b5242 1029 const wxString& name = wxPySPIN_BUTTON_NAME);
09f3d4e6
RD
1030 %name(wxPreSpinButton)wxSpinButton();
1031
1032 bool Create(wxWindow* parent, wxWindowID id = -1,
1033 const wxPoint& pos = wxDefaultPosition,
1034 const wxSize& size = wxDefaultSize,
1035 long style = wxSP_HORIZONTAL,
137b5242 1036 const wxString& name = wxPySPIN_BUTTON_NAME);
7bf85405 1037
0122b7e3 1038 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
17c0e08c 1039 %pragma(python) addtomethod = "wxPreSpinButton:val._setOORInfo(val)"
0122b7e3 1040
7bf85405
RD
1041 int GetMax();
1042 int GetMin();
1043 int GetValue();
1044 void SetRange(int min, int max);
1045 void SetValue(int value);
1046};
1047
1048//----------------------------------------------------------------------
1049
1050class wxStaticBitmap : public wxControl {
1051public:
1052 wxStaticBitmap(wxWindow* parent, wxWindowID id,
1053 const wxBitmap& bitmap,
b68dc582
RD
1054 const wxPoint& pos = wxDefaultPosition,
1055 const wxSize& size = wxDefaultSize,
7bf85405 1056 long style = 0,
137b5242 1057 const wxString& name = wxPyStaticBitmapNameStr);
09f3d4e6
RD
1058 %name(wxPreStaticBitmap)wxStaticBitmap();
1059
1060 bool Create(wxWindow* parent, wxWindowID id,
1061 const wxBitmap& bitmap,
1062 const wxPoint& pos = wxDefaultPosition,
1063 const wxSize& size = wxDefaultSize,
1064 long style = 0,
137b5242 1065 const wxString& name = wxPyStaticBitmapNameStr);
7bf85405 1066
0122b7e3 1067 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
17c0e08c 1068 %pragma(python) addtomethod = "wxPreStaticBitmap:val._setOORInfo(val)"
9c039d08 1069
c5943253 1070 wxBitmap GetBitmap();
7bf85405 1071 void SetBitmap(const wxBitmap& bitmap);
8bf5d46e 1072 void SetIcon(const wxIcon& icon);
7bf85405
RD
1073};
1074
1075//----------------------------------------------------------------------
1076
1077class wxRadioBox : public wxControl {
1078public:
1079 wxRadioBox(wxWindow* parent, wxWindowID id,
1080 const wxString& label,
b68dc582
RD
1081 const wxPoint& point = wxDefaultPosition,
1082 const wxSize& size = wxDefaultSize,
eec92d76 1083 int LCOUNT = 0, wxString* choices = NULL,
7bf85405
RD
1084 int majorDimension = 0,
1085 long style = wxRA_HORIZONTAL,
b68dc582 1086 const wxValidator& validator = wxDefaultValidator,
137b5242 1087 const wxString& name = wxPyRadioBoxNameStr);
09f3d4e6
RD
1088 %name(wxPreRadioBox)wxRadioBox();
1089
1090 bool Create(wxWindow* parent, wxWindowID id,
1091 const wxString& label,
1092 const wxPoint& point = wxDefaultPosition,
1093 const wxSize& size = wxDefaultSize,
1094 int LCOUNT = 0, wxString* choices = NULL,
1095 int majorDimension = 0,
1096 long style = wxRA_HORIZONTAL,
1097 const wxValidator& validator = wxDefaultValidator,
137b5242 1098 const wxString& name = wxPyRadioBoxNameStr);
7bf85405 1099
0122b7e3 1100 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
17c0e08c 1101 %pragma(python) addtomethod = "wxPreRadioBox:val._setOORInfo(val)"
9c039d08 1102
0699c864
RD
1103 void Enable(bool enable);
1104 %name(EnableItem)void Enable(int n, bool enable);
7bf85405 1105 int FindString(const wxString& string);
bb0054cd 1106
7bf85405 1107 wxString GetString(int n);
0adbc166
RD
1108 void SetString(int n, const wxString& label);
1109 %pragma(python) addtoclass = "
1110 GetItemLabel = GetString
1111 SetItemLabel = SetString
1112 "
1e4a197e 1113#ifndef __WXGTK__
2c8a649d
RD
1114 int GetColumnCount();
1115 int GetRowCount();
1e4a197e 1116 int GetNextItem(int item, wxDirection dir, long style);
2c8a649d
RD
1117#endif
1118
0adbc166 1119 int GetSelection();
7bf85405 1120 wxString GetStringSelection();
0adbc166
RD
1121 int GetCount();
1122 %pragma(python) addtoclass = "Number = GetCount"
1123
7bf85405
RD
1124 void SetSelection(int n);
1125 void SetStringSelection(const wxString& string);
1126 void Show(bool show);
1127 %name(ShowItem)void Show(int item, bool show);
1128};
1129
1130//----------------------------------------------------------------------
1131
1132class wxRadioButton : public wxControl {
1133public:
1134 wxRadioButton(wxWindow* parent, wxWindowID id,
1135 const wxString& label,
b68dc582
RD
1136 const wxPoint& pos = wxDefaultPosition,
1137 const wxSize& size = wxDefaultSize,
7bf85405 1138 long style = 0,
b68dc582 1139 const wxValidator& validator = wxDefaultValidator,
137b5242 1140 const wxString& name = wxPyRadioButtonNameStr);
09f3d4e6
RD
1141 %name(wxPreRadioButton)wxRadioButton();
1142
1143 bool Create(wxWindow* parent, wxWindowID id,
1144 const wxString& label,
1145 const wxPoint& pos = wxDefaultPosition,
1146 const wxSize& size = wxDefaultSize,
1147 long style = 0,
1148 const wxValidator& validator = wxDefaultValidator,
137b5242 1149 const wxString& name = wxPyRadioButtonNameStr);
7bf85405 1150
0122b7e3 1151 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
17c0e08c 1152 %pragma(python) addtomethod = "wxPreRadioButton:val._setOORInfo(val)"
9c039d08 1153
7bf85405
RD
1154 bool GetValue();
1155 void SetValue(bool value);
1156};
1157
1158//----------------------------------------------------------------------
1159
1160class wxSlider : public wxControl {
1161public:
1162 wxSlider(wxWindow* parent, wxWindowID id,
1163 int value, int minValue, int maxValue,
b68dc582
RD
1164 const wxPoint& point = wxDefaultPosition,
1165 const wxSize& size = wxDefaultSize,
7bf85405 1166 long style = wxSL_HORIZONTAL,
b68dc582 1167 const wxValidator& validator = wxDefaultValidator,
137b5242 1168 const wxString& name = wxPySliderNameStr);
09f3d4e6
RD
1169 %name(wxPreSlider)wxSlider();
1170
1171 bool Create(wxWindow* parent, wxWindowID id,
1172 int value, int minValue, int maxValue,
1173 const wxPoint& point = wxDefaultPosition,
1174 const wxSize& size = wxDefaultSize,
1175 long style = wxSL_HORIZONTAL,
1176 const wxValidator& validator = wxDefaultValidator,
137b5242 1177 const wxString& name = wxPySliderNameStr);
7bf85405 1178
0122b7e3 1179 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
17c0e08c 1180 %pragma(python) addtomethod = "wxPreSlider:val._setOORInfo(val)"
9c039d08 1181
7bf85405
RD
1182 void ClearSel();
1183 void ClearTicks();
1184 int GetLineSize();
1185 int GetMax();
1186 int GetMin();
1187 int GetPageSize();
1188 int GetSelEnd();
1189 int GetSelStart();
1190 int GetThumbLength();
1191 int GetTickFreq();
1192 int GetValue();
1193 void SetRange(int minValue, int maxValue);
1194 void SetTickFreq(int n, int pos);
1195 void SetLineSize(int lineSize);
1196 void SetPageSize(int pageSize);
1197 void SetSelection(int startPos, int endPos);
1198 void SetThumbLength(int len);
1199 void SetTick(int tickPos);
1200 void SetValue(int value);
1201};
1202
1203
1204//----------------------------------------------------------------------
1205
f6bcfd97
BP
1206class wxSpinCtrl : public wxSpinButton {
1207public:
1208 wxSpinCtrl(wxWindow *parent,
1209 wxWindowID id = -1,
137b5242 1210 const wxString& value = wxPyEmptyString,
b68dc582
RD
1211 const wxPoint& pos = wxDefaultPosition,
1212 const wxSize& size = wxDefaultSize,
f6bcfd97
BP
1213 long style = wxSP_ARROW_KEYS,
1214 int min = 0, int max = 100, int initial = 0,
137b5242 1215 const wxString& name = wxPySpinCtrlNameStr);
09f3d4e6
RD
1216 %name(wxPreSpinCtrl)wxSpinCtrl();
1217
1218 bool Create(wxWindow *parent,
1219 wxWindowID id = -1,
137b5242 1220 const wxString& value = wxPyEmptyString,
09f3d4e6
RD
1221 const wxPoint& pos = wxDefaultPosition,
1222 const wxSize& size = wxDefaultSize,
1223 long style = wxSP_ARROW_KEYS,
1224 int min = 0, int max = 100, int initial = 0,
137b5242 1225 const wxString& name = wxPySpinCtrlNameStr);
f6bcfd97 1226
0122b7e3 1227 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
17c0e08c 1228 %pragma(python) addtomethod = "wxPreSpinCtrl:val._setOORInfo(val)"
f6bcfd97 1229
c368d904
RD
1230 int GetMax();
1231 int GetMin();
1232 int GetValue();
1233 void SetRange(int min, int max);
1234 void SetValue(int value);
1fded56b
RD
1235#ifdef __WXGTK__
1236 %addmethods {
1237 void SetSelection(long from, long to) {
1238 }
1239 }
1240#else
1241 void SetSelection(long from, long to);
1242#endif
f6bcfd97
BP
1243};
1244
1245
1246//----------------------------------------------------------------------
1247
e6056257 1248#ifndef __WXMAC__
d1679124
RD
1249enum { wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, };
1250
1251class wxToggleButton : public wxControl {
1252public:
1253 wxToggleButton(wxWindow *parent,
1254 wxWindowID id,
1255 const wxString& label,
1256 const wxPoint& pos = wxDefaultPosition,
1257 const wxSize& size = wxDefaultSize,
1258 long style = 0,
1259 const wxValidator& validator = wxDefaultValidator,
137b5242 1260 const wxString& name = wxPyCheckBoxNameStr);
09f3d4e6
RD
1261 %name(wxPreToggleButton)wxToggleButton();
1262
1263 bool Create(wxWindow *parent,
1264 wxWindowID id,
1265 const wxString& label,
1266 const wxPoint& pos = wxDefaultPosition,
1267 const wxSize& size = wxDefaultSize,
1268 long style = 0,
1269 const wxValidator& validator = wxDefaultValidator,
137b5242 1270 const wxString& name = wxPyCheckBoxNameStr);
d1679124 1271
0122b7e3 1272 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
17c0e08c 1273 %pragma(python) addtomethod = "wxPreToggleButton:val._setOORInfo(val)"
0122b7e3 1274
d1679124
RD
1275 void SetValue(bool value);
1276 bool GetValue() const ;
1277 void SetLabel(const wxString& label);
1278
1279};
1280
e6056257 1281#endif
68320e40 1282
d1679124
RD
1283//----------------------------------------------------------------------
1284//----------------------------------------------------------------------
1285//----------------------------------------------------------------------
1286
c368d904
RD
1287
1288