X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8907154c1a8a6882c6797d1f16393ddfb23e7f3a..d23ec02c6ab52f60349601be999bab4cf6acbdc4:/src/common/valgen.cpp diff --git a/src/common/valgen.cpp b/src/common/valgen.cpp index 0b5282829b..505d8321a9 100644 --- a/src/common/valgen.cpp +++ b/src/common/valgen.cpp @@ -40,8 +40,7 @@ #include "wx/slider.h" #endif - - #include "wx/spinctrl.h" +#include "wx/spinctrl.h" #if wxUSE_SPINBTN #include "wx/spinbutt.h" @@ -49,6 +48,9 @@ #if wxUSE_CHECKLISTBOX #include "wx/checklst.h" #endif +#if wxUSE_TOGGLEBTN + #include "wx/tglbtn.h" +#endif #include "wx/valgen.h" @@ -125,6 +127,17 @@ bool wxGenericValidator::TransferToWindow(void) } } else #endif +#if wxUSE_TOGGLEBTN + if (m_validatorWindow->IsKindOf(CLASSINFO(wxToggleButton)) ) + { + wxToggleButton * pControl = (wxToggleButton *) m_validatorWindow; + if (m_pBool) + { + pControl->SetValue(*m_pBool); + return true; + } + } else +#endif // int controls #if wxUSE_GAUGE @@ -277,6 +290,7 @@ bool wxGenericValidator::TransferToWindow(void) } } else #endif + // array controls #if wxUSE_CHECKLISTBOX // NOTE: wxCheckListBox is a wxListBox, so wxCheckListBox MUST come first: @@ -358,6 +372,17 @@ bool wxGenericValidator::TransferFromWindow(void) } } else #endif +#if wxUSE_TOGGLEBTN + if (m_validatorWindow->IsKindOf(CLASSINFO(wxToggleButton)) ) + { + wxToggleButton *pControl = (wxToggleButton *) m_validatorWindow; + if (m_pBool) + { + *m_pBool = pControl->GetValue() ; + return true; + } + } else +#endif // INT CONTROLS *************************************** #if wxUSE_GAUGE