vdk 2.4.0
|
00001 /* 00002 * =========================== 00003 * VDK Visual Development Kit 00004 * Version 0.4 00005 * October 1998 00006 * =========================== 00007 * 00008 * Copyright (C) 1998, Mario Motta 00009 * Developed by Mario Motta <mmotta@guest.net> 00010 * 00011 * This library is free software; you can redistribute it and/or 00012 * modify it under the terms of the GNU Library General Public 00013 * License as published by the Free Software Foundation; either 00014 * version 2 of the License, or (at your option) any later version. 00015 * 00016 * This library is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00019 * Library General Public License for more details. 00020 * 00021 * You should have received a copy of the GNU Library General Public 00022 * License along with this library; if not, write to the Free Software 00023 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 00024 * 02111-1307, USA. 00025 */ 00026 00027 #ifndef PROGRESSBAR_H 00028 #define PROGRESSBAR_H 00029 #include <vdk/vdkobj.h> 00030 #include <vdk/vdkprops.h> 00031 class VDKForm; 00038 class VDKProgressBar: public VDKObject 00039 { 00040 00041 protected: 00042 double min,max; 00043 public: 00047 VDKReadWriteValueProp<VDKProgressBar, double> Value; 00051 VDKReadWriteValueProp<VDKProgressBar, int> BlockCount; 00059 VDKReadWriteValueProp<VDKProgressBar, int> BarStyle; 00070 VDKReadWriteValueProp<VDKProgressBar, int> BarOrientation; 00074 VDKReadWriteValueProp<VDKProgressBar, bool> ActivityMode; 00075 public: 00082 VDKProgressBar(VDKForm* owner, 00083 double min = 0.0, double max = 1.0); 00087 virtual ~VDKProgressBar(); 00091 void Update(double val); 00095 double Position(); 00096 void SetBlockCount(int bc) 00097 { 00098 gtk_progress_bar_set_discrete_blocks (GTK_PROGRESS_BAR (widget), 00099 bc); 00100 } 00101 /* 00102 GTK_PROGRESS_CONTINUOUS, 00103 GTK_PROGRESS_DISCRETE 00104 */ 00105 void SetBarStyle(int style) 00106 { 00107 gtk_progress_bar_set_bar_style (GTK_PROGRESS_BAR (widget), 00108 (GtkProgressBarStyle) style); 00109 } 00110 /* 00111 GTK_PROGRESS_LEFT_TO_RIGHT, 00112 GTK_PROGRESS_RIGHT_TO_LEFT, 00113 GTK_PROGRESS_BOTTOM_TO_TOP, 00114 GTK_PROGRESS_TOP_TO_BOTTOM 00115 */ 00116 void SetBarOrientation(int orientation) 00117 { 00118 gtk_progress_bar_set_orientation (GTK_PROGRESS_BAR (widget), 00119 (GtkProgressBarOrientation) orientation); 00120 } 00121 /* 00122 */ 00123 void SetActivityMode(bool flag) 00124 { 00125 gtk_progress_set_activity_mode (GTK_PROGRESS (widget), 00126 flag); 00127 } 00128 }; 00129 #endif