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:
@@ -82,6 +82,10 @@ public:
|
||||
virtual void SetDescriptiveText(const wxString& text) = 0;
|
||||
virtual wxString GetDescriptiveText() const = 0;
|
||||
|
||||
#if wxUSE_NATIVE_SEARCH_CONTROL
|
||||
virtual const wxTextEntry* WXGetTextEntry() const wxOVERRIDE { return this; }
|
||||
#endif // wxUSE_NATIVE_SEARCH_CONTROL
|
||||
|
||||
private:
|
||||
// implement wxTextEntry pure virtual method
|
||||
virtual wxWindow *GetEditableWindow() wxOVERRIDE { return this; }
|
||||
|
Reference in New Issue
Block a user