1 /////////////////////////////////////////////////////////////////////////////// 2 // Name: wx/gtk/activityindicator.h 3 // Purpose: Declaration of wxActivityIndicator for wxGTK. 4 // Author: Vadim Zeitlin 5 // Created: 2015-03-05 6 // Copyright: (c) 2015 Vadim Zeitlin <vadim@wxwidgets.org> 7 // Licence: wxWindows licence 8 /////////////////////////////////////////////////////////////////////////////// 9 10 #ifndef _WX_GTK_ACTIVITYINDICATOR_H_ 11 #define _WX_GTK_ACTIVITYINDICATOR_H_ 12 13 // With GTK+ 3 we can always be certain that this control is available, so use 14 // the normal base class. With GTK+ 2 however, we may determine during run-time 15 // that we need to fall back to the generic implementation because the GTK+ 16 // version is earlier than 2.20, so we need to inherit from the generic class. 17 #ifdef __WXGTK3__ 18 #define wxActivityIndicatorGtkBase wxActivityIndicatorBase 19 #else 20 #include "wx/generic/activityindicator.h" 21 22 #define wxActivityIndicatorGtkBase wxActivityIndicatorGeneric 23 #endif 24 25 // ---------------------------------------------------------------------------- 26 // wxActivityIndicator: implementation using GtkSpinner. 27 // ---------------------------------------------------------------------------- 28 29 class WXDLLIMPEXP_ADV wxActivityIndicator : public wxActivityIndicatorGtkBase 30 { 31 public: wxActivityIndicator()32 wxActivityIndicator() 33 { 34 } 35 36 explicit 37 wxActivityIndicator(wxWindow* parent, 38 wxWindowID winid = wxID_ANY, 39 const wxPoint& pos = wxDefaultPosition, 40 const wxSize& size = wxDefaultSize, 41 long style = 0, 42 const wxString& name = wxActivityIndicatorNameStr) 43 { 44 Create(parent, winid, pos, size, style, name); 45 } 46 47 bool Create(wxWindow* parent, 48 wxWindowID winid = wxID_ANY, 49 const wxPoint& pos = wxDefaultPosition, 50 const wxSize& size = wxDefaultSize, 51 long style = 0, 52 const wxString& name = wxActivityIndicatorNameStr); 53 54 virtual void Start() wxOVERRIDE; 55 virtual void Stop() wxOVERRIDE; 56 virtual bool IsRunning() const wxOVERRIDE; 57 58 protected: 59 virtual wxSize DoGetBestClientSize() const wxOVERRIDE; 60 61 private: 62 wxDECLARE_DYNAMIC_CLASS(wxActivityIndicator); 63 wxDECLARE_NO_COPY_CLASS(wxActivityIndicator); 64 }; 65 66 #endif // _WX_GTK_ACTIVITYINDICATOR_H_ 67