Replace dynamic casts with virtual wxWindow::WXGetTextEntry()

Instead of checking for all text-like controls one by one in
wxCommandEvent::GetString(), call a virtual function checking for this.

This is simpler, less error-prone and faster -- at the cost of
increasing the vtbl size of all wxWindow-derived classes.

Closes https://github.com/wxWidgets/wxWidgets/pull/1696
This commit is contained in:
Vadim Zeitlin
2020-01-07 03:47:23 +01:00
parent 20ecab6268
commit 52ae67ef86
11 changed files with 33 additions and 27 deletions

View File

@@ -80,6 +80,8 @@ public:
virtual void Popup();
virtual void Dismiss();
virtual const wxTextEntry* WXGetTextEntry() const wxOVERRIDE { return this; }
virtual bool QtHandleFocusEvent(QWidget *handler, QFocusEvent *event) wxOVERRIDE;
protected: