valRadio.h
gehe zur Dokumentation dieser Datei
00001 
00023 
00024 // Name:        valradio.h
00025 // Purpose:     wxRadio Validator class
00026 // Author:      Rüdiger Krauße
00027 // Modified by:
00028 // Created:     29/01/98
00029 // RCS-ID:      $Id: valRadio.h,v 1.6 2011-02-20 22:35:59 keinstein Exp $
00030 // Copyright:   (c) 1998 Julian Smart
00031 // Licence:     wxWindows license
00033 
00034 #ifndef _WX_VALRADIOH__
00035 #define _WX_VALRADIOH__
00036 
00037 //#if defined(__GNUG__) && !defined(__APPLE__)
00038 //#pragma interface "valRadio.h"
00039 //#endif
00040 
00041 #include "wx/defs.h"
00042 
00043 #if wxUSE_VALIDATORS
00044 
00045 #include "wx/validate.h"
00046 
00047 #define NV_MIN 1
00048 #define NV_MAX 2
00049 #define NV_BOTH 3
00050 #define NV_NNEG 1, 0
00051 
00052 class  wxRadioValidator: public wxValidator
00053 {
00054         DECLARE_DYNAMIC_CLASS(wxRadioValidator)
00055 
00056 public:
00057 
00058         wxRadioValidator(int *val = 0, int id = 0);
00059 
00060         wxRadioValidator(const wxRadioValidator& val);
00061 
00062         ~wxRadioValidator();
00063 
00064         // Make a clone of this validator (or return NULL) - currently necessary
00065         // if you're passing a reference to a validator.
00066         // Another possibility is to always pass a pointer to a new validator
00067         // (so the calling code can use a copy constructor of the relevant class).
00068         virtual wxObject *Clone() const
00069         {
00070                 return new wxRadioValidator(*this);
00071         }
00072 
00073         bool Copy(const wxRadioValidator& val);
00074 
00075         // Called when the value in the window must be validated.
00076         // This function can pop up an error message.
00077         virtual bool Validate(wxWindow *parent);
00078 
00079         // Called to transfer data to the window
00080         virtual bool TransferToWindow();
00081 
00082         // Called to transfer data to the window
00083         virtual bool TransferFromWindow();
00084 
00085         /*    // ACCESSORS
00086             inline long GetStyle() const { return m_validatorStyle; }
00087             inline void SetStyle(long style) { m_validatorStyle = style; }
00088 
00089             void SetIncludeList(const wxStringList& list);
00090             inline wxStringList& GetIncludeList() { return m_includeList; }
00091 
00092             void SetExcludeList(const wxStringList& list);
00093             inline wxStringList& GetExcludeList() { return m_excludeList; }
00094 
00095             // Filter keystrokes
00096             void OnChar(wxKeyEvent& event);
00097 
00098             bool IsInCharIncludeList(const wxString& val);
00099             bool IsNotInCharExcludeList(const wxString& val);
00100 
00101         DECLARE_EVENT_TABLE()
00102         */
00103 
00104 protected:
00105         int Id;
00106 
00107         int *m_intValue;
00108 
00109         bool CheckValidator() const
00110         {
00111                 wxCHECK_MSG( m_validatorWindow, FALSE,
00112                              _T("No window associated with validator") );
00113                 wxCHECK_MSG( m_validatorWindow->IsKindOf(CLASSINFO(wxRadioButton)), FALSE,
00114                              _T("wxTextValidator is only for wxRadioButton's") );
00115                 wxCHECK_MSG( m_intValue, FALSE,
00116                              _T("No variable storage for validator") );
00117 
00118                 return TRUE;
00119         }
00120 };
00121 
00122 #endif
00123 // wxUSE_VALIDATORS
00124 
00125 #endif
00126 // _WX_VALTEXTH__
00127 
00128 

Erzeugt am Sun Aug 21 2011 10:51:56 für Mutabor von doxygen 1.7.4