vdk 2.4.0
progressbar.h
1/*
2 * ===========================
3 * VDK Visual Development Kit
4 * Version 0.4
5 * October 1998
6 * ===========================
7 *
8 * Copyright (C) 1998, Mario Motta
9 * Developed by Mario Motta <mmotta@guest.net>
10 *
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Library General Public
13 * License as published by the Free Software Foundation; either
14 * version 2 of the License, or (at your option) any later version.
15 *
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Library General Public License for more details.
20 *
21 * You should have received a copy of the GNU Library General Public
22 * License along with this library; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
24 * 02111-1307, USA.
25 */
26
27#ifndef PROGRESSBAR_H
28#define PROGRESSBAR_H
29#include <vdk/vdkobj.h>
30#include <vdk/vdkprops.h>
31class VDKForm;
39{
40
41protected:
42 double min,max;
43public:
47 VDKReadWriteValueProp<VDKProgressBar, double> Value;
51 VDKReadWriteValueProp<VDKProgressBar, int> BlockCount;
59 VDKReadWriteValueProp<VDKProgressBar, int> BarStyle;
70 VDKReadWriteValueProp<VDKProgressBar, int> BarOrientation;
74 VDKReadWriteValueProp<VDKProgressBar, bool> ActivityMode;
75public:
83 double min = 0.0, double max = 1.0);
87 virtual ~VDKProgressBar();
91 void Update(double val);
95 double Position();
96 void SetBlockCount(int bc)
97 {
98 gtk_progress_bar_set_discrete_blocks (GTK_PROGRESS_BAR (widget),
99 bc);
100 }
101 /*
102 GTK_PROGRESS_CONTINUOUS,
103 GTK_PROGRESS_DISCRETE
104 */
105 void SetBarStyle(int style)
106 {
107 gtk_progress_bar_set_bar_style (GTK_PROGRESS_BAR (widget),
108 (GtkProgressBarStyle) style);
109 }
110 /*
111 GTK_PROGRESS_LEFT_TO_RIGHT,
112 GTK_PROGRESS_RIGHT_TO_LEFT,
113 GTK_PROGRESS_BOTTOM_TO_TOP,
114 GTK_PROGRESS_TOP_TO_BOTTOM
115 */
116 void SetBarOrientation(int orientation)
117 {
118 gtk_progress_bar_set_orientation (GTK_PROGRESS_BAR (widget),
119 (GtkProgressBarOrientation) orientation);
120 }
121 /*
122 */
123 void SetActivityMode(bool flag)
124 {
125 gtk_progress_set_activity_mode (GTK_PROGRESS (widget),
126 flag);
127 }
128};
129#endif
VDKForm widgets, generally the outermost widget container.
Definition: forms.h:69
Definition: vdkobj.h:141
GtkWidget * widget
Definition: vdkobj.h:241
Provides a progress bar widget.
Definition: progressbar.h:39
VDKReadWriteValueProp< VDKProgressBar, int > BarOrientation
Definition: progressbar.h:70
void Update(double val)
Definition: progressbar.cc:57
VDKReadWriteValueProp< VDKProgressBar, int > BlockCount
Definition: progressbar.h:51
VDKReadWriteValueProp< VDKProgressBar, bool > ActivityMode
Definition: progressbar.h:74
virtual ~VDKProgressBar()
Definition: progressbar.cc:52
VDKReadWriteValueProp< VDKProgressBar, int > BarStyle
Definition: progressbar.h:59
double Position()
Definition: progressbar.cc:65
VDKReadWriteValueProp< VDKProgressBar, double > Value
Definition: progressbar.h:47
VDKProgressBar(VDKForm *owner, double min=0.0, double max=1.0)
Definition: progressbar.cc:33