]> git.saurik.com Git - wxWidgets.git/commitdiff
Removed wxPG_EX_LEGACY_VALIDATORS
authorJaakko Salli <jaakko.salli@dnainternet.net>
Mon, 29 Sep 2008 16:52:57 +0000 (16:52 +0000)
committerJaakko Salli <jaakko.salli@dnainternet.net>
Mon, 29 Sep 2008 16:52:57 +0000 (16:52 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55954 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/propgrid/propgrid.h
interface/wx/propgrid/propgrid.h
samples/propgrid/propgrid.cpp
src/propgrid/propgrid.cpp

index 43761102a6f6f72ef21797103a91e39bed8a1060..1e1163bcb255ef44c7e06168642f7795cdfaea61 100644 (file)
@@ -241,12 +241,6 @@ wxPG_EX_AUTO_UNSPECIFIED_VALUES         = 0x00200000,
 */
 wxPG_EX_WRITEONLY_BUILTIN_ATTRIBUTES    = 0x00400000,
 
-/**
-    With this style Validators on properties will work same as in
-    wxPropertyGrid 1.2.
-*/
-wxPG_EX_LEGACY_VALIDATORS               = 0x00800000,
-
 /** Hides page selection buttons from toolbar.
 */
 wxPG_EX_HIDE_PAGE_BUTTONS               = 0x01000000
index 70dd99174cafd029824ffe513c08aceb3823254d..0629ec2a1817a1f1b0ee04a26c94eb2d98ee974b 100644 (file)
@@ -149,12 +149,6 @@ wxPG_EX_AUTO_UNSPECIFIED_VALUES         = 0x00200000,
 */
 wxPG_EX_WRITEONLY_BUILTIN_ATTRIBUTES    = 0x00400000,
 
-/**
-    With this style Validators on properties will work same as in wxPropertyGrid
-    1.2.
-*/
-wxPG_EX_LEGACY_VALIDATORS               = 0x00800000,
-
 /**
     Hides page selection buttons from tool bar.
 */
index 5772484f8ce72908f7a5b277b1cacbf3fc3cd5cf..aa8d738b0093fc8600e6056fba8a09670eaf9c46 100644 (file)
@@ -2846,7 +2846,6 @@ void FormMain::OnSelectStyle( wxCommandEvent& WXUNUSED(event) )
         ADD_FLAG(wxPG_EX_NATIVE_DOUBLE_BUFFERING)
         ADD_FLAG(wxPG_EX_AUTO_UNSPECIFIED_VALUES)
         ADD_FLAG(wxPG_EX_WRITEONLY_BUILTIN_ATTRIBUTES)
-        ADD_FLAG(wxPG_EX_LEGACY_VALIDATORS)
         wxMultiChoiceDialog dlg( this, wxT("Select extra window styles to use"),
                                  wxT("wxPropertyGrid Extra Style"), chs );
         dlg.SetSelections(sel);
index 42c77e223ab246b2903c190fdbcea3961cc6f877..931633ee5a4e3065b6186914bf0b5d827468eaf8 100644 (file)
@@ -3125,47 +3125,6 @@ bool wxPropertyGrid::ChangePropertyValue( wxPGPropArg id, wxVariant newValue )
 // Runs wxValidator for the selected property
 bool wxPropertyGrid::DoEditorValidate()
 {
-#if wxUSE_VALIDATORS
-    // With traditional validator style, we dont need to more
-    if ( !(GetExtraStyle() & wxPG_EX_LEGACY_VALIDATORS) )
-        return true;
-
-    if ( m_iFlags & wxPG_FL_VALIDATION_FAILED )
-    {
-        return false;
-    }
-
-    wxWindow* wnd = GetEditorControl();
-
-    wxValidator* validator = m_selected->GetValidator();
-    if ( validator && wnd )
-    {
-        // Use TextCtrl of ODComboBox instead
-        if ( wnd->IsKindOf(CLASSINFO(wxOwnerDrawnComboBox)) )
-        {
-            wnd = ((wxOwnerDrawnComboBox*)wnd)->GetTextCtrl();
-
-            if ( !wnd )
-                return true;
-        }
-
-        validator->SetWindow(wnd);
-
-        // Instead setting the flag after the failure, we set
-        // it before checking and then clear afterwards if things
-        // went fine. This trick is necessary since focus events
-        // may be triggered while in Validate.
-        m_iFlags |= wxPG_FL_VALIDATION_FAILED;
-        if ( !validator->Validate(this) )
-        {
-            // If you dpm't want to display message multiple times per change,
-            // comment the following line.
-            m_iFlags &= ~(wxPG_FL_VALIDATION_FAILED);
-            return false;
-        }
-        m_iFlags &= ~(wxPG_FL_VALIDATION_FAILED);
-    }
-#endif
     return true;
 }
 
@@ -3683,12 +3642,9 @@ bool wxPropertyGrid::DoSelectProperty( wxPGProperty* p, unsigned int flags )
 
                     // Set validator, if any
                 #if wxUSE_VALIDATORS
-                    if ( !(GetExtraStyle() & wxPG_EX_LEGACY_VALIDATORS) )
-                    {
-                        wxValidator* validator = p->GetValidator();
-                        if ( validator )
-                            m_wndEditor->SetValidator(*validator);
-                    }
+                    wxValidator* validator = p->GetValidator();
+                    if ( validator )
+                        m_wndEditor->SetValidator(*validator);
                 #endif
 
                     if ( m_wndEditor->GetSize().y > (m_lineHeight+6) )