Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1894 in orxonox.OLD for orxonox/branches/gui


Ignore:
Timestamp:
May 18, 2004, 11:02:07 AM (21 years ago)
Author:
bensch
Message:

orxonox/branches/gui/guicc: updating for transfer

Location:
orxonox/branches/gui/guicc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/gui/guicc/orxonox_gui.cc

    r1893 r1894  
    55    gtk_init (&argc, &argv);
    66    Window* orxonoxGUI = new Window("Graphical Orxonox Launcher");
    7     orxonoxGUI->connectSignal (orxonoxGUI, "destroy", orxonox_gui_quit);
    8     orxonoxGUI->show ();
     7    orxonoxGUI->connectSignal ("destroy", orxonoxGUI->orxonox_gui_quit);
     8    orxonoxGUI->connectSignal ("delete_event", orxonoxGUI->orxonox_gui_quit);
     9
     10    Frame* Frametest = new Frame ("Test");
     11    orxonoxGUI->fill(Frametest);
     12    //Frame test = orxonoxGUI->down;
     13    //test.setTitle("shit");
     14    orxonoxGUI->showall ();
    915
    1016    gtk_main();
    1117    return 0;
    1218  }
     19
     20
     21/* WIDGET */
     22void Widget::show()
     23{
     24  gtk_widget_show (widget);
     25}
     26
     27void Widget::connectSignal (char* event, gint ( *signal)( GtkWidget*, GdkEvent*, void *))
     28{
     29  g_signal_connect (G_OBJECT (this->widget), event, G_CALLBACK (signal), NULL);
     30}
     31
     32 /* CONTAINERS*/
     33
     34void Container::fill (Widget *lowerWidget)
     35{
     36  gtk_container_add (GTK_CONTAINER(this->widget), lowerWidget->widget);
     37  this->down = lowerWidget;
     38}
     39
     40// gtk_container_set_border_width (GTK_CONTAINER (widget), 5);
     41
     42  /* WINDOW */
    1343
    1444Window::Window (void)
     
    2353  gtk_window_set_policy(GTK_WINDOW(widget), TRUE, TRUE, TRUE);
    2454  this->setTitle(windowName);
    25   //  g_signal_connect (G_OBJECT (widget), "delete_event", G_CALLBACK (gtk_main_quit), NULL);
    26   // g_signal_connect (G_OBJECT (widget), "destroy", G_CALLBACK (orxonox_gui_quit), orxonox_settings);
    27   // gtk_container_set_border_width (GTK_CONTAINER (widget), 5);
    2855}
    2956
     
    3158{}
    3259
    33 void Window::show ()
     60void Window::showall ()
    3461{
    3562  gtk_widget_show_all  (widget);
     
    4168}
    4269
    43 void Widget::connectSignal (Widget* thisWidget, char* event, gint ( *signal)( GtkWidget*, GdkEvent*, void *))
    44 {
    45   g_signal_connect (G_OBJECT (thisWidget->widget), event, G_CALLBACK (signal), NULL);
    46 }
    4770
    4871
    49 gint orxonox_gui_quit ( GtkWidget *widget, GdkEvent *event, gpointer data)
     72gint Window::orxonox_gui_quit ( GtkWidget *widget, GdkEvent *event, gpointer data)
    5073{
    5174  gtk_main_quit();
    5275  return FALSE;
    5376}
     77
     78
     79   /* FRAME */
     80
     81Frame::Frame (void)
     82{
     83  widget = gtk_frame_new ("");
     84}
     85Frame::Frame (char* title)
     86{
     87  widget = gtk_frame_new (title);
     88}
     89Frame::~Frame ()
     90{}
     91
     92void Frame::setTitle (char* title)
     93{
     94  gtk_frame_set_label (GTK_FRAME (widget), title);
     95}
  • orxonox/branches/gui/guicc/orxonox_gui.h

    r1893 r1894  
    55#include <stdlib.h>
    66#include <string.h>
    7 #include <gtk/gtk.h>
     7#include <gtk/gtkmain.h>
     8#include <gtk/gtkwindow.h>
     9#include <gtk/gtkframe.h>
    810
    911
     
    1315
    1416  Widget* next;
    15   
     17 protected:
    1618
    1719 public:
    18   GtkWidget* widget;
     20  GtkWidget* widget; 
     21
    1922  //virtual void create ();
    20   virtual void show () = 0;
    2123  //  void addWidget ();
    22   static void connectSignal (Widget* thisWidget, char* event, gint (*signal)(GtkWidget*, GdkEvent*,  void *));
     24   void connectSignal (char* event, gint (*signal)(GtkWidget*, GdkEvent*,  void *));
     25   void show ();
    2326};
    2427
     
    3134  int policy;
    3235  char* label;
    33   Widget* down;
     36
    3437 
    3538 public:
     39  Widget* down;
    3640  void setBorderWidth (int borderwidth);
    3741  virtual void setTitle (char* title) = 0;
     42  void fill (Widget *lowerWidget);
    3843};
    3944
     
    4954  ~Window ();
    5055  void setTitle (char* title);
    51   void show ();
     56  void showall ();
     57  static gint orxonox_gui_quit ( GtkWidget *widget, GdkEvent *event, gpointer data);
     58
     59};
     60
     61class Frame :public Container
     62{
     63 private:
     64
     65 public:
     66  Frame (char* frameName);
     67  Frame (void);
     68  ~Frame ();
     69  void setTitle (char* title);
    5270
    5371};
     
    5876};
    5977
    60 gint orxonox_gui_quit ( GtkWidget *widget, GdkEvent *event, gpointer data);
     78//gint orxonox_gui_quit ( GtkWidget *widget, GdkEvent *event, gpointer data);
    6179
    6280#endif /* _ORXONOX_GUI_H */
Note: See TracChangeset for help on using the changeset viewer.