From 704ceca8d2cd8da51a5cc22f8c51fd61c762dbf5 Mon Sep 17 00:00:00 2001 From: Jaakko Salli Date: Mon, 29 Sep 2008 16:52:57 +0000 Subject: [PATCH] Removed wxPG_EX_LEGACY_VALIDATORS git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55954 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/propgrid/propgrid.h | 6 ---- interface/wx/propgrid/propgrid.h | 6 ---- samples/propgrid/propgrid.cpp | 1 - src/propgrid/propgrid.cpp | 50 ++------------------------------ 4 files changed, 3 insertions(+), 60 deletions(-) diff --git a/include/wx/propgrid/propgrid.h b/include/wx/propgrid/propgrid.h index 43761102a6..1e1163bcb2 100644 --- a/include/wx/propgrid/propgrid.h +++ b/include/wx/propgrid/propgrid.h @@ -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 diff --git a/interface/wx/propgrid/propgrid.h b/interface/wx/propgrid/propgrid.h index 70dd99174c..0629ec2a18 100644 --- a/interface/wx/propgrid/propgrid.h +++ b/interface/wx/propgrid/propgrid.h @@ -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. */ diff --git a/samples/propgrid/propgrid.cpp b/samples/propgrid/propgrid.cpp index 5772484f8c..aa8d738b00 100644 --- a/samples/propgrid/propgrid.cpp +++ b/samples/propgrid/propgrid.cpp @@ -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); diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 42c77e223a..931633ee5a 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -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) )