X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c693edf3bc9539378a7ac56d90d41d89c7dc7579..fed628b632d8ae95efded1f6a6894573c7a76bef:/src/generic/propform.cpp diff --git a/src/generic/propform.cpp b/src/generic/propform.cpp index 686db00abf..e8f651083c 100644 --- a/src/generic/propform.cpp +++ b/src/generic/propform.cpp @@ -150,7 +150,7 @@ bool wxPropertyFormView::AssociateNames(void) while (node) { wxWindow *win = (wxWindow *)node->Data(); - if (win->GetName() != _T("")) + if (win->GetName() != wxT("")) { wxProperty *prop = m_propertySheet->GetProperty(win->GetName()); if (prop) @@ -207,18 +207,18 @@ void wxPropertyFormView::OnCommand(wxWindow& win, wxCommandEvent& event) if (!m_propertySheet) return; - if (win.GetName() == _T("")) + if (win.GetName() == wxT("")) return; - if (wxStrcmp(win.GetName(), _T("ok")) == 0) + if (wxStrcmp(win.GetName(), wxT("ok")) == 0) OnOk(event); - else if (wxStrcmp(win.GetName(), _T("cancel")) == 0) + else if (wxStrcmp(win.GetName(), wxT("cancel")) == 0) OnCancel(event); - else if (wxStrcmp(win.GetName(), _T("help")) == 0) + else if (wxStrcmp(win.GetName(), wxT("help")) == 0) OnHelp(event); - else if (wxStrcmp(win.GetName(), _T("update")) == 0) + else if (wxStrcmp(win.GetName(), wxT("update")) == 0) OnUpdate(event); - else if (wxStrcmp(win.GetName(), _T("revert")) == 0) + else if (wxStrcmp(win.GetName(), wxT("revert")) == 0) OnRevert(event); else { @@ -242,6 +242,20 @@ void wxPropertyFormView::OnCommand(wxWindow& win, wxCommandEvent& event) } } +// Extend event processing to call OnCommand +bool wxPropertyFormView::ProcessEvent(wxEvent& event) +{ + if (wxEvtHandler::ProcessEvent(event)) + return TRUE; + else if (event.IsCommandEvent() && !event.IsKindOf(CLASSINFO(wxUpdateUIEvent)) && event.GetEventObject()) + { + OnCommand(* ((wxWindow*) event.GetEventObject()), (wxCommandEvent&) event); + return TRUE; + } + else + return FALSE; +} + void wxPropertyFormView::OnDoubleClick(wxControl *item) { if (!m_propertySheet) @@ -413,16 +427,16 @@ bool wxRealFormValidator::OnCheckValue( wxProperty *property, wxPropertyFormView if (!StringToFloat(WXSTRINGCAST value, &val)) { wxChar buf[200]; - wxSprintf(buf, _T("Value %s is not a valid real number!"), (const wxChar *)value); - wxMessageBox(buf, _T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow); + wxSprintf(buf, wxT("Value %s is not a valid real number!"), (const wxChar *)value); + wxMessageBox(buf, wxT("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow); return FALSE; } if (val < m_realMin || val > m_realMax) { wxChar buf[200]; - wxSprintf(buf, _T("Value must be a real number between %.2f and %.2f!"), m_realMin, m_realMax); - wxMessageBox(buf, _T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow); + wxSprintf(buf, wxT("Value must be a real number between %.2f and %.2f!"), m_realMin, m_realMax); + wxMessageBox(buf, wxT("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow); return FALSE; } return TRUE; @@ -484,8 +498,8 @@ bool wxIntegerFormValidator::OnCheckValue(wxProperty *property, wxPropertyFormVi if (!StringToLong(WXSTRINGCAST value, &val)) { wxChar buf[200]; - wxSprintf(buf, _T("Value %s is not a valid integer!"), (const wxChar *)value); - wxMessageBox(buf, _T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow); + wxSprintf(buf, wxT("Value %s is not a valid integer!"), (const wxChar *)value); + wxMessageBox(buf, wxT("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow); return FALSE; } }