Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3287 in orxonox.OLD for orxonox/branches/updater


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

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

Location:
orxonox/branches/updater/src/gui
Files:
4 edited

Legend:

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

    r3165 r3287  
    3232{
    3333  // Banner Itself //
    34   bannerEventBox = new EventBox ("BannerEventBox");
    35   bannerImage = new Image ("banner.xpm");
     34  bannerEventBox = new EventBox("BannerEventBox");
     35  bannerImage = new Image("banner.xpm");
    3636  bannerEventBox->fill(bannerImage);
    3737
  • orxonox/branches/updater/src/gui/orxonox_gui_flags.cc

    r3158 r3287  
    6464  strcat (flagText, "orxonox");
    6565  FlagsText (widget);
    66   flagsLabel->setText (flagText);
     66  flagsLabel->setTitle(flagText);
    6767}
    6868
  • 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}
  • orxonox/branches/updater/src/gui/orxonox_gui_gtk.h

    r3281 r3287  
    33 \brief Contains all th different Widgets.
    44*/
    5 
    65#ifndef _ORXONOX_GUI_GTK_H
    76#define _ORXONOX_GUI_GTK_H
     
    3534
    3635#ifdef HAVE_GTK2
    37 bool initGTK(int argc, char *argv[]);
     36bool initGTK(int argc, char* argv[]);
    3837bool mainloopGTK(void);
    3938#endif /* HAVE_GTK2 */
     
    5958  char* label; //!< The name of the Widget. Some do display it, Options need it to save;
    6059#ifdef HAVE_GTK2
    61   gulong connectSignal (char* event, gint (*signal)(GtkWidget*, GdkEvent*, void *));
    62   gulong connectSignal (char* event, gint (*signal)(GtkWidget*, Widget *));
    63   gulong connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, GdkEvent*, void *));
    64   gulong connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, GdkEventKey*, void *));
     60  gulong connectSignal (char* event, gint (*signal)(GtkWidget*, GdkEvent*, void* ));
     61  gulong connectSignal (char* event, gint (*signal)(GtkWidget*, Widget* ));
     62  gulong connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, GdkEvent*, void* ));
     63  gulong connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, GdkEventKey*, void* ));
    6564  void disconnectSignal (gulong signalID);
    6665#endif /* HAVE_GTK2 */
     
    6867  void hide ();
    6968  void setSize(int width, int height);
     69  virtual void setTitle(char* title) = 0;
    7070
    7171  void walkThrough (void (*function)(Widget*));
     
    7474 
    7575#ifdef HAVE_GTK2
    76   static gint doNothingSignal (GtkWidget *widget, GdkEvent* event, void* nothing);
     76  static gint doNothingSignal (GtkWidget* widget, GdkEvent* event, void* nothing);
    7777#endif /* HAVE_GTK2 */
    7878};
     
    8888  void setGroupName (char* name);
    8989  char* getGroupName (void);
     90
     91  virtual void fill (Widget* lowerWidget) = 0;
    9092};
    9193
     
    106108  //  void setBorderWidth (int borderwidth);
    107109  //  virtual void setTitle (char* title) = 0;
    108   void fill (Widget *lowerWidget);
     110  void fill (Widget* lowerWidget);
    109111};
    110112
     
    122124  static void addWindow(Window* windowToAdd);
    123125
    124   Window (void);
    125   Window (char* windowName);
    126   void init ();
    127  
    128   void setTitle (char* title);
    129   void showall ();
    130   void open();
    131   void close();
    132 
    133 #ifdef HAVE_GTK2
    134   static gint windowOpen (GtkWidget *widget, GdkEvent* event, void* window);
    135   static gint windowClose (GtkWidget *widget, GdkEvent* event, void* window);
    136   static gint orxonox_gui_quit (GtkWidget *widget, GdkEvent *event, gpointer data);
     126  Window(void);
     127  Window(char* windowName);
     128  void init();
     129 
     130  void setTitle(char* title);
     131  void showall(void);
     132  void open(void);
     133  void close(void);
     134
     135#ifdef HAVE_GTK2
     136  static gint windowOpen(GtkWidget* widget, GdkEvent* event, void* window);
     137  static gint windowClose(GtkWidget* widget, GdkEvent* event, void* window);
     138  static gint orxonox_gui_quit(GtkWidget* widget, GdkEvent* event, gpointer data);
    137139#endif /* HAVE_GTK2 */
    138140};
     
    150152  void init(void);
    151153 
    152   void setTitle (char* title);
     154  void setTitle(char* title);
    153155};
    154156
     
    164166  void init(void);
    165167 
    166   void setTitle (char* title);
     168  void setTitle(char* title);
    167169};
    168170
     
    179181  Box (char boxtype);
    180182  void init(char boxtype);
    181 
     183 
    182184  void fill (Widget* lowerWidget);
    183185
    184 };
    185 
    186 //! Image is the keeper of one Image
    187 /**
    188  * Images are mighty cool.
    189  * Images can help you lighten up the Programming process, and will give everyone a better impression of the Software.
    190  */
    191 class Image : public Widget
    192 {
    193  public:
    194   Image (char* imgaename);
    195   void init(void);
     186  void setTitle(char* title);
    196187};
    197188
     
    203194{
    204195 public:
    205   //virtual gint OptionChange (GtkWidget *widget, GdkEvent *event, gpointer data);
     196  //virtual gint OptionChange (GtkWidget* widget, GdkEvent* event, gpointer data);
    206197  void init(void);
    207198
     
    314305  void init(void);
    315306 
    316   void setText (char* text);
     307  void setTitle(char* text);
    317308  char* getText ();
    318309};
     
    326317  ~ProgressBar ();
    327318  void init (void);
    328  
     319
     320  void setTitle(char* title);
     321
    329322  void setProgress (double progress);
    330323  void setTotalSize (double totalSize);
     
    339332};
    340333
    341 //gint orxonox_gui_quit (GtkWidget *widget, GdkEvent *event, gpointer data);
     334//! Image is the keeper of one Image
     335/**
     336 * Images are mighty cool.
     337 * Images can help you lighten up the Programming process, and will give everyone a better impression of the Software.
     338 */
     339class Image : public Widget
     340{
     341 public:
     342  Image (char* imgaename);
     343  void init(void);
     344
     345  void setTitle(char* title);
     346};
     347
     348//gint orxonox_gui_quit (GtkWidget* widget, GdkEvent* event, gpointer data);
    342349
    343350#endif /* _ORXONOX_GUI_GTK_H */
Note: See TracChangeset for help on using the changeset viewer.