Removed wxPG_EX_LEGACY_VALIDATORS
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55954 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
c8074be06b
commit
704ceca8d2
@ -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
|
||||
|
@ -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.
|
||||
*/
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
#endif
|
||||
|
||||
if ( m_wndEditor->GetSize().y > (m_lineHeight+6) )
|
||||
|
Loading…
Reference in New Issue
Block a user