]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/valgen.cpp
Applied patch [ 1428990 ] wxUniv: patch for toolbar button remain in pressed status
[wxWidgets.git] / src / common / valgen.cpp
index f1b5a10e455f06a5e2db842df21be9ba3d6e44cd..505d8321a9fcfd385b70bf8d82b1f0af83d71693 100644 (file)
@@ -9,10 +9,6 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma implementation "valgen.h"
-#endif
-
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
@@ -44,8 +40,7 @@
   #include "wx/slider.h"
 #endif
 
-
-  #include "wx/spinctrl.h"
+#include "wx/spinctrl.h"
 
 #if wxUSE_SPINBTN
   #include "wx/spinbutt.h"
@@ -53,6 +48,9 @@
 #if wxUSE_CHECKLISTBOX
   #include "wx/checklst.h"
 #endif
+#if wxUSE_TOGGLEBTN
+  #include "wx/tglbtn.h"
+#endif
 
 #include "wx/valgen.h"
 
@@ -129,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
@@ -281,6 +290,7 @@ bool wxGenericValidator::TransferToWindow(void)
         }
     } else
 #endif
+
     // array controls
 #if wxUSE_CHECKLISTBOX
     // NOTE: wxCheckListBox is a wxListBox, so wxCheckListBox MUST come first:
@@ -362,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