Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 26, 2004, 3:07:19 AM (19 years ago)
Author:
bensch
Message:

orxonox/branches/updater: gtk_gui: now setTitle is a virtual function of Widget.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/updater/src/gui/orxonox_gui_gtk.cc

    r3275 r3287  
    612612    }
    613613#endif /* HAVE_GTK2 */
    614 
    615614}
    616615
     
    640639}
    641640
    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*/
     645void Box::setTitle(char* title)
     646{
    651647  if (label)
    652648    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}
    671652
    672653/* OPTION */
     
    11081089{
    11091090  this->init();
    1110   this->setText(text);
     1091  this->setTitle(text);
    11111092}
    11121093
     
    11301111   \param text The text to be inserted into the Label.
    11311112*/
    1132 void Label::setText (char* text)
     1113void Label::setTitle(char* text)
    11331114{
    11341115  if (label)
     
    11651146{
    11661147  this->init();
    1167   //  this->setLabel (label);
     1148  this->setTitle (label);
    11681149}
    11691150
     
    11921173
    11931174/**
     1175   \brief Sets a ned Title to the ProgressBar.
     1176   \param title The now title of the ProgressBar.
     1177*/
     1178void 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/**
    11941187   \brief Sets the Total size of the Bar. (ex. The maximum one can download)
    11951188*/
     
    12131206#endif /* HAVE_GTK2 */
    12141207  PRINTF(3)("Progress: %f\n", progress*100.0/totalSize);
    1215 
    12161208}
    12171209
     
    12231215  return this->progress;
    12241216}
     1217
     1218/* IMAGE */
     1219
     1220/**
     1221   \brief Creates a new Image
     1222   \param imagename the location of the Image on the Hard Disc
     1223*/
     1224Image::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*/
     1240void 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*/
     1251void 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.