Override DoEnable() instead of Enable() in wxGTK controls
This is slightly simpler, as it doesn't require checking whether the control state really changes or not (it always does if DoEnable() is called) and allows disabling the controls before creating them, e.g. code like wxButton* const b = new wxButton(); b->Disable(); b->Create(this, wxID_OK); works as expected now instead of spewing GTK+ errors.
This commit is contained in:
@@ -41,7 +41,6 @@ public:
|
||||
virtual void SetLabel(const wxString& label) wxOVERRIDE;
|
||||
virtual void SetValue(bool val);
|
||||
virtual bool GetValue() const;
|
||||
virtual bool Enable( bool enable = true ) wxOVERRIDE;
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
@@ -52,6 +51,8 @@ protected:
|
||||
virtual void DoApplyWidgetStyle(GtkRcStyle *style) wxOVERRIDE;
|
||||
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const wxOVERRIDE;
|
||||
|
||||
virtual void DoEnable(bool enable) wxOVERRIDE;
|
||||
|
||||
private:
|
||||
typedef wxControl base_type;
|
||||
|
||||
|
Reference in New Issue
Block a user