| 1 | /////////////////////////////////////////////////////////////////////////////// |
| 2 | // Name: wx/univ/gauge.h |
| 3 | // Purpose: wxUniversal wxGauge declaration |
| 4 | // Author: Vadim Zeitlin |
| 5 | // Modified by: |
| 6 | // Created: 20.02.01 |
| 7 | // RCS-ID: $Id$ |
| 8 | // Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com) |
| 9 | // Licence: wxWindows licence |
| 10 | /////////////////////////////////////////////////////////////////////////////// |
| 11 | |
| 12 | #ifdef __GNUG__ |
| 13 | #pragma interface "gaugeuniv.h" |
| 14 | #endif |
| 15 | |
| 16 | // ---------------------------------------------------------------------------- |
| 17 | // wxGauge: a progress bar |
| 18 | // ---------------------------------------------------------------------------- |
| 19 | |
| 20 | class WXDLLEXPORT wxGauge : public wxGaugeBase |
| 21 | { |
| 22 | public: |
| 23 | wxGauge() { Init(); } |
| 24 | |
| 25 | wxGauge(wxWindow *parent, |
| 26 | wxWindowID id, |
| 27 | int range, |
| 28 | const wxPoint& pos = wxDefaultPosition, |
| 29 | const wxSize& size = wxDefaultSize, |
| 30 | long style = wxGA_HORIZONTAL, |
| 31 | const wxValidator& validator = wxDefaultValidator, |
| 32 | const wxString& name = wxGaugeNameStr) |
| 33 | { |
| 34 | Init(); |
| 35 | |
| 36 | (void)Create(parent, id, range, pos, size, style, validator, name); |
| 37 | } |
| 38 | |
| 39 | bool Create(wxWindow *parent, |
| 40 | wxWindowID id, |
| 41 | int range, |
| 42 | const wxPoint& pos = wxDefaultPosition, |
| 43 | const wxSize& size = wxDefaultSize, |
| 44 | long style = wxGA_HORIZONTAL, |
| 45 | const wxValidator& validator = wxDefaultValidator, |
| 46 | const wxString& name = wxGaugeNameStr); |
| 47 | |
| 48 | // implement base class virtuals |
| 49 | virtual void SetRange(int range); |
| 50 | virtual void SetValue(int pos); |
| 51 | |
| 52 | // wxUniv-specific methods |
| 53 | |
| 54 | // is it a smooth progress bar or a discrete one? |
| 55 | bool IsSmooth() const { return (GetWindowStyle() & wxGA_SMOOTH) != 0; } |
| 56 | |
| 57 | // is it a vertica; progress bar or a horizontal one? |
| 58 | bool IsVertical() const { return (GetWindowStyle() & wxGA_VERTICAL) != 0; } |
| 59 | |
| 60 | protected: |
| 61 | // common part of all ctors |
| 62 | void Init(); |
| 63 | |
| 64 | // return the def border for a progress bar |
| 65 | virtual wxBorder GetDefaultBorder() const; |
| 66 | |
| 67 | // return the default size |
| 68 | virtual wxSize DoGetBestClientSize() const; |
| 69 | |
| 70 | // draw the control |
| 71 | virtual void DoDraw(wxControlRenderer *renderer); |
| 72 | |
| 73 | DECLARE_DYNAMIC_CLASS(wxGauge) |
| 74 | }; |