2008-03-08 13:52:38 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: valgen.h
|
2008-03-10 15:24:38 +00:00
|
|
|
// Purpose: interface of wxGenericValidator
|
2008-03-08 13:52:38 +00:00
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Licence: wxWindows license
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxGenericValidator
|
|
|
|
@wxheader{valgen.h}
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
wxGenericValidator performs data transfer (but not validation or filtering) for
|
|
|
|
the following
|
|
|
|
basic controls: wxButton, wxCheckBox, wxListBox, wxStaticText, wxRadioButton,
|
|
|
|
wxRadioBox,
|
|
|
|
wxChoice, wxComboBox, wxGauge, wxSlider, wxScrollBar, wxSpinButton, wxTextCtrl,
|
|
|
|
wxCheckListBox.
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
It checks the type of the window and uses an appropriate type for that window.
|
|
|
|
For example,
|
|
|
|
wxButton and wxTextCtrl transfer data to and from a wxString variable;
|
|
|
|
wxListBox uses a
|
|
|
|
wxArrayInt; wxCheckBox uses a bool.
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
For more information, please see @ref overview_validatoroverview "Validator
|
|
|
|
overview".
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@library{wxcore}
|
|
|
|
@category{validator}
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-10 15:24:38 +00:00
|
|
|
@see @ref overview_validatoroverview "Validator overview", wxValidator,
|
2008-03-08 13:52:38 +00:00
|
|
|
wxTextValidator
|
|
|
|
*/
|
|
|
|
class wxGenericValidator : public wxValidator
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
Constructor taking a wxDateTime pointer. This will be
|
|
|
|
used for wxDatePickerCtrl.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param validator
|
2008-03-09 12:33:59 +00:00
|
|
|
Validator to copy.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param valPtr
|
2008-03-09 12:33:59 +00:00
|
|
|
A pointer to a variable that contains the value. This variable
|
|
|
|
should have a lifetime equal to or longer than the validator lifetime
|
|
|
|
(which is usually
|
|
|
|
determined by the lifetime of the window).
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
wxGenericValidator(const wxGenericValidator& validator);
|
2008-03-08 14:43:31 +00:00
|
|
|
wxGenericValidator(bool* valPtr);
|
|
|
|
wxGenericValidator(wxString* valPtr);
|
|
|
|
wxGenericValidator(int* valPtr);
|
|
|
|
wxGenericValidator(wxArrayInt* valPtr);
|
|
|
|
wxGenericValidator(wxDateTime* valPtr);
|
2008-03-08 13:52:38 +00:00
|
|
|
//@}
|
|
|
|
|
|
|
|
/**
|
|
|
|
Destructor.
|
|
|
|
*/
|
|
|
|
~wxGenericValidator();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Clones the generic validator using the copy constructor.
|
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
virtual wxValidator* Clone() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Transfers the value from the window to the appropriate data type.
|
|
|
|
*/
|
|
|
|
virtual bool TransferFromWindow();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Transfers the value to the window.
|
|
|
|
*/
|
|
|
|
virtual bool TransferToWindow();
|
|
|
|
};
|
2008-03-10 15:24:38 +00:00
|
|
|
|