From a5d2f53f416293510d8f6f6066a374a8ad5d9962 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 13 May 2016 22:32:16 +0200 Subject: [PATCH] Inherit wxGauge from wxGaugeBase in wxGTK Ensure the proper class hierarchy in wxGTK, this notably allows to override SetValue() in classes derived from wxGauge, which didn't work in wxGTK (but did in wxMSW and wxOSX) before. Also remove the now unnecessary IsVertical(). --- include/wx/gtk/gauge.h | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/include/wx/gtk/gauge.h b/include/wx/gtk/gauge.h index 1e6ff39202..2e018566c5 100644 --- a/include/wx/gtk/gauge.h +++ b/include/wx/gtk/gauge.h @@ -13,7 +13,7 @@ // wxGauge //----------------------------------------------------------------------------- -class WXDLLIMPEXP_CORE wxGauge: public wxControl +class WXDLLIMPEXP_CORE wxGauge: public wxGaugeBase { public: wxGauge() { Init(); } @@ -40,17 +40,14 @@ public: const wxValidator& validator = wxDefaultValidator, const wxString& name = wxGaugeNameStr ); - // determinate mode API - void SetRange( int r ); - void SetValue( int pos ); + // implement base class virtual methods + void SetRange(int range) wxOVERRIDE; + int GetRange() const wxOVERRIDE; - int GetRange() const; - int GetValue() const; + void SetValue(int pos) wxOVERRIDE; + int GetValue() const wxOVERRIDE; - // indeterminate mode API - virtual void Pulse(); - - bool IsVertical() const { return HasFlag(wxGA_VERTICAL); } + virtual void Pulse() wxOVERRIDE; static wxVisualAttributes GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);