File: gauge.h

package info (click to toggle)
wxpython3.0 3.0.2.0%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 482,760 kB
  • ctags: 518,293
  • sloc: cpp: 2,127,226; python: 294,045; makefile: 51,942; ansic: 19,033; sh: 3,013; xml: 1,629; perl: 17
file content (200 lines) | stat: -rw-r--r-- 5,778 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
/////////////////////////////////////////////////////////////////////////////
// Name:        gauge.h
// Purpose:     interface of wxGauge
// Author:      wxWidgets team
// Licence:     wxWindows licence
/////////////////////////////////////////////////////////////////////////////


// ----------------------------------------------------------------------------
// wxGauge style flags
// ----------------------------------------------------------------------------

#define wxGA_HORIZONTAL      wxHORIZONTAL
#define wxGA_VERTICAL        wxVERTICAL

// Win32 only, is default (and only) on some other platforms
#define wxGA_SMOOTH          0x0020

/**
    @class wxGauge

    A gauge is a horizontal or vertical bar which shows a quantity (often
    time).

    wxGauge supports two working modes: determinate and indeterminate progress.

    The first is the usual working mode (see SetValue() and SetRange()) while
    the second can be used when the program is doing some processing but you
    don't know how much progress is being done. In this case, you can
    periodically call the Pulse() function to make the progress bar switch to
    indeterminate mode (graphically it's usually a set of blocks which move or
    bounce in the bar control).

    wxGauge supports dynamic switch between these two work modes.

    There are no user commands for the gauge.

    @beginStyleTable
    @style{wxGA_HORIZONTAL}
           Creates a horizontal gauge.
    @style{wxGA_VERTICAL}
           Creates a vertical gauge.
    @style{wxGA_SMOOTH}
           Creates smooth progress bar with one pixel wide update step (not
           supported by all platforms).
    @endStyleTable

    @library{wxcore}
    @category{ctrl}
    @appearance{gauge}

    @see wxSlider, wxScrollBar
*/
class wxGauge : public wxControl
{
public:
    /**
        Default constructor.
    */
    wxGauge();

    /**
        Constructor, creating and showing a gauge.

        @param parent
            Window parent.
        @param id
            Window identifier.
        @param range
            Integer range (maximum value) of the gauge.
            See SetRange() for more details about the meaning of this value
            when using the gauge in indeterminate mode.
        @param pos
            Window position.
        @param size
            Window size.
        @param style
            Gauge style.
        @param validator
            Window validator.
        @param name
            Window name.

        @see Create()
    */
    wxGauge(wxWindow* parent, wxWindowID id, int range,
            const wxPoint& pos = wxDefaultPosition,
            const wxSize& size = wxDefaultSize,
            long style = wxGA_HORIZONTAL,
            const wxValidator& validator = wxDefaultValidator,
            const wxString& name = wxGaugeNameStr);

    /**
        Destructor, destroying the gauge.
    */
    virtual ~wxGauge();

    /**
        Creates the gauge for two-step construction. See wxGauge() for further
        details.
    */
    bool Create(wxWindow* parent, wxWindowID id, int range,
                const wxPoint& pos = wxDefaultPosition,
                const wxSize& size = wxDefaultSize, long style = wxGA_HORIZONTAL,
                const wxValidator& validator = wxDefaultValidator,
                const wxString& name = wxGaugeNameStr);

    /**
        Returns the width of the 3D bezel face.

        @remarks This method is not implemented (returns 0) for most platforms.

        @see SetBezelFace()
    */
    int GetBezelFace() const;

    /**
        Returns the maximum position of the gauge.

        @see SetRange()
    */
    int GetRange() const;

    /**
        Returns the 3D shadow margin width.

        @remarks This method is not implemented (returns 0) for most platforms.

        @see SetShadowWidth()
    */
    int GetShadowWidth() const;

    /**
        Returns the current position of the gauge.

        @see SetValue()
    */
    int GetValue() const;

    /**
        Returns @true if the gauge is vertical (has @c wxGA_VERTICAL style) and
        @false otherwise.
    */
    bool IsVertical() const;

    /**
        Switch the gauge to indeterminate mode (if required) and makes the
        gauge move a bit to indicate the user that some progress has been made.

        @note After calling this function the value returned by GetValue() is
              undefined and thus you need to explicitly call SetValue() if you
              want to restore the determinate mode.
    */
    virtual void Pulse();

    /**
        Sets the 3D bezel face width.

        @remarks This method is not implemented (doesn't do anything) for most
                 platforms.

        @see GetBezelFace()
    */
    void SetBezelFace(int width);

    /**
        Sets the range (maximum value) of the gauge. This function makes the
        gauge switch to determinate mode, if it's not already.

        When the gauge is in indeterminate mode, under wxMSW the gauge
        repeatedly goes from zero to @a range and back; under other ports
        when in indeterminate mode, the @a range setting is ignored.

        @see GetRange()
    */
    void SetRange(int range);

    /**
        Sets the 3D shadow width.

        @remarks This method is not implemented (doesn't do anything) for most
                 platforms.
    */
    void SetShadowWidth(int width);

    /**
        Sets the position of the gauge. The @a pos must be between 0 and the
        gauge range as returned by GetRange(), inclusive.

        This function makes the gauge switch to determinate mode, if it was in
        indeterminate mode before.

        @param pos
            Position for the gauge level.

        @see GetValue()
    */
    void SetValue(int pos);
};