Changeset 3287 in orxonox.OLD for orxonox/branches/updater/src/gui/orxonox_gui_gtk.cc
- Timestamp:
- Dec 26, 2004, 3:07:19 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/updater/src/gui/orxonox_gui_gtk.cc
r3275 r3287 612 612 } 613 613 #endif /* HAVE_GTK2 */ 614 615 614 } 616 615 … … 640 639 } 641 640 642 /* IMAGE */ 643 644 /** 645 \brief Creates a new Image 646 \param imagename the location of the Image on the Hard Disc 647 */ 648 Image::Image (char* imagename) 649 { 650 this->init(); 641 /** 642 \brief Sets the Title of a Box. 643 \title the new Title to set. 644 */ 645 void Box::setTitle(char* title) 646 { 651 647 if (label) 652 648 delete []label; 653 label = new char[strlen(imagename)+1]; 654 strcpy(label, imagename); 655 656 #ifdef HAVE_GTK2 657 widget = gtk_image_new_from_file (imagename); 658 #endif /* HAVE_GTK2 */ 659 } 660 661 /** 662 \brief Initializes a new Image 663 */ 664 void Image::init() 665 { 666 isOption = 0; 667 668 static_cast<Widget*>(this)->init(); 669 } 670 649 label = new char[strlen(title)+1]; 650 strcpy(label, title); 651 } 671 652 672 653 /* OPTION */ … … 1108 1089 { 1109 1090 this->init(); 1110 this->setT ext(text);1091 this->setTitle(text); 1111 1092 } 1112 1093 … … 1130 1111 \param text The text to be inserted into the Label. 1131 1112 */ 1132 void Label::setT ext(char* text)1113 void Label::setTitle(char* text) 1133 1114 { 1134 1115 if (label) … … 1165 1146 { 1166 1147 this->init(); 1167 // this->setLabel(label);1148 this->setTitle (label); 1168 1149 } 1169 1150 … … 1192 1173 1193 1174 /** 1175 \brief Sets a ned Title to the ProgressBar. 1176 \param title The now title of the ProgressBar. 1177 */ 1178 void ProgressBar::setTitle(char* title) 1179 { 1180 if (label) 1181 delete []label; 1182 label = new char [strlen(title)+1]; 1183 strcpy(label, title); 1184 } 1185 1186 /** 1194 1187 \brief Sets the Total size of the Bar. (ex. The maximum one can download) 1195 1188 */ … … 1213 1206 #endif /* HAVE_GTK2 */ 1214 1207 PRINTF(3)("Progress: %f\n", progress*100.0/totalSize); 1215 1216 1208 } 1217 1209 … … 1223 1215 return this->progress; 1224 1216 } 1217 1218 /* IMAGE */ 1219 1220 /** 1221 \brief Creates a new Image 1222 \param imagename the location of the Image on the Hard Disc 1223 */ 1224 Image::Image (char* imagename) 1225 { 1226 this->init(); 1227 if (label) 1228 delete []label; 1229 label = new char[strlen(imagename)+1]; 1230 strcpy(label, imagename); 1231 1232 #ifdef HAVE_GTK2 1233 widget = gtk_image_new_from_file (imagename); 1234 #endif /* HAVE_GTK2 */ 1235 } 1236 1237 /** 1238 \brief Initializes a new Image 1239 */ 1240 void Image::init() 1241 { 1242 isOption = 0; 1243 1244 static_cast<Widget*>(this)->init(); 1245 } 1246 1247 /** 1248 \brief Sets a ned Title to the Image. 1249 \param title The now title of the OptionLabel. 1250 */ 1251 void Image::setTitle(char* title) 1252 { 1253 if (label) 1254 delete []label; 1255 label = new char [strlen(title)+1]; 1256 strcpy(label, title); 1257 }
Note: See TracChangeset
for help on using the changeset viewer.