Changeset 3244 in orxonox.OLD for orxonox/branches/updater/src/gui/orxonox_gui_gtk.cc
- Timestamp:
- Dec 21, 2004, 8:33:13 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/updater/src/gui/orxonox_gui_gtk.cc
r3192 r3244 1141 1141 return label; 1142 1142 } 1143 1144 /** 1145 \breif Creates a new ProgressBar. 1146 */ 1147 ProgressBar::ProgressBar (void) 1148 { 1149 this->init (); 1150 } 1151 1152 /** 1153 \breif Creates a new ProgressBar. 1154 \param label The name you want to get the ProgressBar. 1155 */ 1156 ProgressBar::ProgressBar (char* label) 1157 { 1158 this->init(); 1159 // this->setLabel (label); 1160 } 1161 1162 /** 1163 \destructs a ProgressBar 1164 */ 1165 ProgressBar::~ProgressBar () 1166 { 1167 } 1168 1169 /** 1170 \brief Initializes a ProgressBar 1171 */ 1172 void ProgressBar::init (void) 1173 { 1174 isOption = 0; 1175 progress = 0.0; 1176 totalSize = 0.0; 1177 1178 static_cast<Widget*>(this)->init(); 1179 #ifdef HAVE_GTK2 1180 adjustment = (GtkAdjustment*)gtk_adjustment_new(0, 0, 100, 0, 0, 0); 1181 widget = gtk_progress_bar_new_with_adjustment(adjustment); 1182 #endif /* HAVE_GTK2 */ 1183 } 1184 1185 /** 1186 \brief Sets the Total size of the Bar. (ex. The maximum one can download) 1187 */ 1188 void setTotalSize (double totalSize) 1189 { 1190 1191 } 1192 1193 /** 1194 \brief Sets the progress maximum is this->totalSize 1195 */ 1196 void ProgressBar::setProgress (double progress) 1197 { 1198 this->progress = progress; 1199 1200 if (this->progress > this->totalSize) 1201 this->progress = this->totalSize; 1202 1203 #ifdef HAVE_GTK2 1204 gtk_progress_set_value(GTK_PROGRESS(widget), this->progress*100.0/this->totalSize); 1205 #endif /* HAVE_GTK2 */ 1206 } 1207 1208 /** 1209 \brief returns the Progress Status 1210 */ 1211 double ProgressBar::getProgress (void) 1212 { 1213 return this->progress; 1214 }
Note: See TracChangeset
for help on using the changeset viewer.