1
/////////////////////////////////////////////////////////////////////////////
3
// Purpose: SWIG interface for wxValidator
7
// Created: 24-June-1997
8
// RCS-ID: $Id: _validator.i 69707 2011-11-08 17:44:35Z RD $
9
// Copyright: (c) 2003 by Total Control Software
10
// Licence: wxWindows license
11
/////////////////////////////////////////////////////////////////////////////
16
//---------------------------------------------------------------------------
17
//---------------------------------------------------------------------------
21
A validator has up to three purposes:
23
1) To validate the data in the window that's associated
25
2) To transfer data to and from the window.
26
3) To filter input, using its role as a wxEvtHandler
27
to intercept e.g. OnChar.
29
Note that wxValidator and derived classes use reference counting.
32
class wxValidator : public wxEvtHandler
35
%pythonAppend wxValidator "self._setOORInfo(self)"
36
%typemap(out) wxValidator*; // turn off this typemap
41
// Turn it back on again
42
%typemap(out) wxValidator* { $result = wxPyMake_wxObject($1, $owner); }
45
// Make a clone of this validator (or return NULL)
48
// Called when the value in the window must be validated.
49
// This function can pop up an error message.
50
virtual bool Validate(wxWindow *parent);
52
// Called to transfer data to the window
53
virtual bool TransferToWindow();
55
// Called to transfer data from the window
56
virtual bool TransferFromWindow();
58
wxWindow* GetWindow();
59
void SetWindow(wxWindow* window);
61
// validators beep by default if invalid key is pressed, these functions
63
static bool IsSilent();
64
static void SuppressBellOnError(bool suppress = true);
65
static void SetBellOnError(int doIt = true);
67
%property(Window, GetWindow, SetWindow, doc="See `GetWindow` and `SetWindow`");
71
//---------------------------------------------------------------------------
73
IMP_PYCALLBACK_BOOL_WXWIN(wxPyValidator, wxValidator, Validate);
74
IMP_PYCALLBACK_BOOL_(wxPyValidator, wxValidator, TransferToWindow);
75
IMP_PYCALLBACK_BOOL_(wxPyValidator, wxValidator, TransferFromWindow);
77
IMPLEMENT_DYNAMIC_CLASS(wxPyValidator, wxValidator);
81
class wxPyValidator : public wxValidator {
83
%pythonAppend wxPyValidator "self._setOORInfo(self);" setCallbackInfo(PyValidator)
87
void _setCallbackInfo(PyObject* self, PyObject* _class, int incref=1);
93
const wxValidator wxDefaultValidator;
96
//---------------------------------------------------------------------------