Additional "text updated" event generation added to fix premature event receiving on EM_REPLACESEL
(fixes #19)
This commit is contained in:
parent
349bc34fa8
commit
79ae4855e3
@ -103,6 +103,7 @@ void wxZRColaCharacterCatalogPanel::OnGridClick(wxGridEvent& event)
|
|||||||
ZRColaApp *app = (ZRColaApp*)wxTheApp;
|
ZRColaApp *app = (ZRColaApp*)wxTheApp;
|
||||||
if (app->m_mainWnd) {
|
if (app->m_mainWnd) {
|
||||||
app->m_mainWnd->m_panel->m_decomposed->WriteText(m_grid->GetCellValue(event.GetRow(), event.GetCol()));
|
app->m_mainWnd->m_panel->m_decomposed->WriteText(m_grid->GetCellValue(event.GetRow(), event.GetCol()));
|
||||||
|
app->m_mainWnd->m_panel->m_decomposed->SendTextUpdatedEvent(); // Fixes #19: Premature EN_CHANGE event on EM_REPLACESEL.
|
||||||
app->m_mainWnd->m_panel->m_decomposed->SetFocus();
|
app->m_mainWnd->m_panel->m_decomposed->SetFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,6 +117,7 @@ void wxZRColaCharacterCatalogPanel::OnGridKeyDown(wxKeyEvent& event)
|
|||||||
ZRColaApp *app = (ZRColaApp*)wxTheApp;
|
ZRColaApp *app = (ZRColaApp*)wxTheApp;
|
||||||
if (app->m_mainWnd) {
|
if (app->m_mainWnd) {
|
||||||
app->m_mainWnd->m_panel->m_decomposed->WriteText(m_grid->GetCellValue(m_grid->GetCursorRow(), m_grid->GetCursorColumn()));
|
app->m_mainWnd->m_panel->m_decomposed->WriteText(m_grid->GetCellValue(m_grid->GetCursorRow(), m_grid->GetCursorColumn()));
|
||||||
|
app->m_mainWnd->m_panel->m_decomposed->SendTextUpdatedEvent(); // Fixes #19: Premature EN_CHANGE event on EM_REPLACESEL.
|
||||||
app->m_mainWnd->m_panel->m_decomposed->SetFocus();
|
app->m_mainWnd->m_panel->m_decomposed->SetFocus();
|
||||||
|
|
||||||
event.StopPropagation();
|
event.StopPropagation();
|
||||||
|
@ -107,6 +107,7 @@ bool wxZRColaKeyHandler::ProcessEvent(wxEvent& event)
|
|||||||
if (obj && obj->IsKindOf(wxCLASSINFO(wxTextCtrl))) {
|
if (obj && obj->IsKindOf(wxCLASSINFO(wxTextCtrl))) {
|
||||||
// Push text to source control.
|
// Push text to source control.
|
||||||
((wxTextCtrl*)obj)->WriteText(ks.chr);
|
((wxTextCtrl*)obj)->WriteText(ks.chr);
|
||||||
|
((wxTextCtrl*)obj)->SendTextUpdatedEvent(); // Fixes #19: Premature EN_CHANGE event on EM_REPLACESEL.
|
||||||
|
|
||||||
// Event is fully processed now.
|
// Event is fully processed now.
|
||||||
event.StopPropagation();
|
event.StopPropagation();
|
||||||
@ -148,6 +149,7 @@ bool wxZRColaKeyHandler::ProcessEvent(wxEvent& event)
|
|||||||
if (obj && obj->IsKindOf(wxCLASSINFO(wxTextCtrl))) {
|
if (obj && obj->IsKindOf(wxCLASSINFO(wxTextCtrl))) {
|
||||||
// Push text to source control.
|
// Push text to source control.
|
||||||
((wxTextCtrl*)obj)->WriteText(chr);
|
((wxTextCtrl*)obj)->WriteText(chr);
|
||||||
|
((wxTextCtrl*)obj)->SendTextUpdatedEvent(); // Fixes #19: Premature EN_CHANGE event on EM_REPLACESEL.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user