Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

orxonox/branches/updater: updated gui, so now it deletes itself when closing the app.

File:
1 edited

Legend:

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

    r3288 r3289  
    4444
    4545 public:
    46   ~Widget ();
    47 
    48   Widget* next; //!< next always points to the next Widget in the list. Every Widget has a next one, or has NULL as next
    49 #ifdef HAVE_GTK2
    50   GtkWidget* widget; //!< widget is the gtk_widget that the specific Object Contains.
    51 #endif /* HAVE_GTK2 */
    52   void init(void);
    53   int isOption; //!< with this Paramenter one can set the option-type: -2:Container, -1: Box, 0: not an Option, 1: Bool-option, 2: int-option, 3: float option, 4:char option, 5: char* option
    54   /**
    55      \briefdefines isOption states
    56   */
    57   enum option { containerType = -2, boxType = -1, nothingType = 0, boolType = 1, intType = 2};
    58   char* label; //!< The name of the Widget. Some do display it, Options need it to save;
    59 #ifdef HAVE_GTK2
     46  virtual ~Widget ();
     47  void init(void);
     48  void destroy(void);
     49
     50  void show ();
     51  void hide ();
     52  void setSize(int width, int height);
     53  virtual void setTitle(char* title) = 0;  //!< An abstract Function, that sets the title of Widgets.
     54
     55  void walkThrough (void (*function)(Widget*));
     56  static void listOptions (Widget* widget);
     57  static void setOptions (Widget* widget);
     58 
     59#ifdef HAVE_GTK2
     60  // Connection - Functions
     61
    6062  gulong connectSignal (char* event, gint (*signal)(GtkWidget*, GdkEvent*, void* ));
    6163  gulong connectSignal (char* event, gint (*signal)(GtkWidget*, Widget* ));
     
    6365  gulong connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, GdkEventKey*, void* ));
    6466  void disconnectSignal (gulong signalID);
    65 #endif /* HAVE_GTK2 */
    66   void show ();
    67   void hide ();
    68   void setSize(int width, int height);
    69   virtual void setTitle(char* title) = 0;
    70 
    71   void walkThrough (void (*function)(Widget*));
    72   static void listOptions (Widget* widget);
    73   static void setOptions (Widget* widget);
    74  
    75 #ifdef HAVE_GTK2
     67
     68  // Signals
    7669  static gint doNothingSignal (GtkWidget* widget, GdkEvent* event, void* nothing);
    7770#endif /* HAVE_GTK2 */
     71
     72  Widget* next;                     //!< next always points to the next Widget in the list. Every Widget has a next one, or has NULL as next
     73#ifdef HAVE_GTK2
     74  GtkWidget* widget;                //!< widget is the gtk_widget that the specific Object Contains.
     75#endif /* HAVE_GTK2 */
     76  int isOption;                     //!< with this Paramenter one can set the option-type: -2:Container, -1: Box, 0: not an Option, 1: Bool-option, 2: int-option, 3: float option, 4:char option, 5: char* option
     77
     78  //! defines isOption states
     79  enum option { containerType = -2, boxType = -1, nothingType = 0, boolType = 1, intType = 2};
     80  char* label;                      //!< The name of the Widget. Some do display it, Options need it to save;
    7881};
    7982
     
    8689
    8790  void init(void);
     91  void destroy(void);
     92
    8893  void setGroupName (char* name);
    8994  char* getGroupName (void);
    9095
    91   virtual void fill (Widget* lowerWidget) = 0;
     96  virtual void fill (Widget* lowerWidget) = 0; //!< An abstract function, that fills Packers.
    9297};
    9398
     
    106111 public:
    107112  void init(void);
     113  void destroy(void);
     114
    108115  //  void setBorderWidth (int borderwidth);
    109116  //  virtual void setTitle (char* title) = 0;
     
    119126{
    120127 private:
    121   bool isOpen;                //!< A bool Variable that checks if a Window is already open.
    122  public:
    123   static Window* mainWindow;  //!< Pointer to the First Window that was opened. By default this should be the GUI's main-Window.
     128  bool isOpen;                      //!< A bool Variable that checks if a Window is already open.
     129 public:
     130  static Window* mainWindow;        //!< Pointer to the First Window that was opened. By default this should be the GUI's main-Window.
    124131  static void addWindow(Window* windowToAdd);
    125132
    126133  Window(void);
    127134  Window(char* windowName);
     135  ~Window(void);
    128136  void init();
     137  void destroy(void);
    129138 
    130139  void setTitle(char* title);
     
    134143
    135144#ifdef HAVE_GTK2
     145  // Signals
    136146  static gint windowOpen(GtkWidget* widget, GdkEvent* event, void* window);
    137147  static gint windowClose(GtkWidget* widget, GdkEvent* event, void* window);
     
    148158{
    149159 public:
     160  Frame(void);
    150161  Frame (char* frameName);
    151   Frame (void);
    152   void init(void);
     162  ~Frame(void);
     163  void init(void);
     164  void destroy(void);
    153165 
    154166  void setTitle(char* title);
     
    162174{
    163175 public:
     176  EventBox (void);
    164177  EventBox (char* eventBoxName);
    165   EventBox (void);
    166   void init(void);
     178  ~EventBox(void);
     179  void init(void);
     180  void destroy(void);
    167181 
    168182  void setTitle(char* title);
     
    180194  Box (void);
    181195  Box (char boxtype);
     196  ~Box(void);
    182197  void init(char boxtype);
     198  void destroy(void);
    183199 
    184200  void fill (Widget* lowerWidget);
     
    199215  //virtual gint OptionChange (GtkWidget* widget, GdkEvent* event, gpointer data);
    200216  void init(void);
     217  void destroy(void);
    201218
    202219  int value; //!< every option has a value either true or false (0,1) or something else like 25 for 25% of the volume
     
    221238 public:
    222239  Button (char* buttonname);
    223   void init(void);
    224 
    225   void setTitle(char* title);
    226  
     240  ~Button(void);
     241  void init(void);
     242  void destroy(void);
     243
     244  void setTitle(char* title);
    227245  void redraw();
    228246};
     
    235253 public:
    236254  CheckButton (char* buttonname);
    237 #ifdef HAVE_GTK2
    238   static gint OptionChange (GtkWidget* widget, Widget* checkbutton);
    239 #endif /* HAVE_GTK2 */
    240  
    241   void init(void);
    242   void setTitle(char* title);
    243 
     255  ~CheckButton(void);
     256  void init(void);
     257  void destroy(void);
     258
     259  void setTitle(char* title);
    244260  bool isActive();           //!< a Bool value to see, if this CheckButton is active.
    245261  void redraw ();
     262
     263#ifdef HAVE_GTK2
     264  // Signals
     265  static gint OptionChange (GtkWidget* widget, Widget* checkbutton);
     266#endif /* HAVE_GTK2 */
    246267};
    247268
     
    253274{
    254275 public:
    255   Slider (char* slidername,int start, int end);
     276  Slider(char* slidername,int start, int end);
     277  ~Slider(void);
    256278  void init(int start, int end);
     279  void destroy(void);
    257280
    258281  void setTitle(char* title);
    259282  void setValue(int value);
    260 
    261 #ifdef HAVE_GTK2
     283  void redraw();
     284
     285#ifdef HAVE_GTK2
     286  // Signals
    262287  static gint OptionChange (GtkWidget* widget, Widget* slider);
    263288#endif /* HAVE_GTK2 */
    264   void redraw();
    265289};
    266290
     
    270294 private:
    271295#ifdef HAVE_GTK2
    272   GtkWidget* menu;     //!< The menu That will hold the Options.
    273   GtkWidget* item;     //!< One Item From a Menu.
    274 #endif /* HAVE_GTK2 */
    275   va_list itemlist;    //!< The list to readin multiple Options.
     296  GtkWidget* menu;                      //!< The menu That will hold the Options.
     297  GtkWidget* item;                      //!< One Item From a Menu.
     298#endif /* HAVE_GTK2 */
     299  va_list itemlist;                     //!< The list to readin multiple Options.
    276300 
    277301 public:
    278302  Menu (char* menuname, ...);
    279   void init(void);
    280 
    281   void setTitle(char* title);
    282 
     303  ~Menu(void);
     304  void init(void);
     305  void destroy(void);
     306 
     307  void setTitle(char* title);
    283308  void addItem(char* itemName);
    284309#ifdef HAVE_GTK2
     
    291316class OptionLabel : public Option
    292317{
     318 private:
     319
    293320 public:
    294321  OptionLabel(char* label, char* value);
    295   void init(void);
    296  
    297   char* cValue;   //!< The Value the Label will have.
     322  ~OptionLabel(void);
     323  void init(void);
     324  void destroy(void);
     325 
    298326 
    299327  void setValue(char* newValue);
    300328  void setTitle(char* title);
    301329  void redraw();
     330
     331  char* cValue;                          //!< The Value the Label will have. \todo make private
     332
    302333};
    303334
     
    306337{
    307338 public:
    308   Label ();
     339  Label (void);
    309340  Label (char* text);
    310   void init(void);
     341  ~Label(void);
     342  void init(void);
     343  void destroy(void);
    311344 
    312345  void setTitle(char* text);
     
    320353  ProgressBar (void);
    321354  ProgressBar (char* label);
    322   ~ProgressBar ();
    323   void init (void);
    324 
    325   void setTitle(char* title);
    326 
     355  ~ProgressBar (void);
     356  void init(void);
     357  void destroy(void);
     358
     359  void setTitle(char* title);
    327360  void setProgress (double progress);
    328361  void setTotalSize (double totalSize);
     
    346379 public:
    347380  Image (char* imgaename);
    348   void init(void);
     381  ~Image(void);
     382  void init(void);
     383  void destroy(void);
    349384
    350385  void setTitle(char* title);
Note: See TracChangeset for help on using the changeset viewer.