Pass outside wxPG a modified clone of wxEVT_TEXT event instead of hacking current event object.
Using a clone of event (with PG id) instead of replacing id in the currently processed event coming from wxPGTextCtrlEditor seems to be less intrusive and safer action. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78328 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
957f3c5b50
commit
55da8a0f86
@ -406,14 +406,12 @@ bool wxPGTextCtrlEditor::OnTextCtrlEvent( wxPropertyGrid* propGrid,
|
||||
}
|
||||
else if ( event.GetEventType() == wxEVT_TEXT )
|
||||
{
|
||||
//
|
||||
// Pass this event outside wxPropertyGrid so that,
|
||||
// if necessary, program can tell when user is editing
|
||||
// a textctrl.
|
||||
// FIXME: Is it safe to change event id in the middle of event
|
||||
// processing (seems to work, but...)?
|
||||
event.Skip();
|
||||
event.SetId(propGrid->GetId());
|
||||
// Pass this event (with PG id) outside wxPropertyGrid
|
||||
// with so that, if necessary, program can tell when user
|
||||
// is editing a textctrl.
|
||||
wxEvent *evt = event.Clone();
|
||||
evt->SetId(propGrid->GetId());
|
||||
propGrid->GetEventHandler()->QueueEvent(evt);
|
||||
|
||||
propGrid->EditorsValueWasModified();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user