Changeset 3148 in orxonox.OLD for orxonox/trunk/gui
- Timestamp:
- Dec 11, 2004, 3:33:05 PM (20 years ago)
- Location:
- orxonox/trunk/gui
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/gui/orxonox_gui_banner.cc
r3147 r3148 31 31 OrxonoxGuiBanner::OrxonoxGuiBanner () 32 32 { 33 // Banner Itself // 33 34 bannerEventBox = new EventBox ("BannerEventBox"); 34 35 bannerImage = new Image ("banner.xpm"); 35 36 bannerEventBox->fill(bannerImage); 36 37 bannerEventBox->connectSignal ("button_press_event", this, LogoWindowOpen); 37 logoWindowIsOpen = -1; 38 39 // Banner Window // 40 logoWindow = new Window("Logo"); 41 logoWindow->connectSignal("destroy", this, LogoWindowClose); 42 logoWindow->connectSignal("delete_event", this, LogoWindowClose); 43 logoEventBox = new EventBox(); 44 logoBox = new Box('v'); 45 logoLabel = new Label("OrxOnoX, " PACKAGE_VERSION); 46 logoImage = new Image("banner.xpm"); 47 logoEventBox->fill(logoImage); 48 49 logoBox->fill(logoLabel); 50 logoBox->fill(logoEventBox); 51 logoEventBox->connectSignal("button_press_event",this,LogoWindowClose); 52 53 logoWindow->fill (logoBox); 54 55 Window::addWindow (logoWindow); 38 56 } 39 57 … … 50 68 it shows it if it has been created 51 69 */ 52 void OrxonoxGuiBanner::logoWindow New()70 void OrxonoxGuiBanner::logoWindowOpen() 53 71 { 54 if (logoWindowIsOpen <= 0) 55 { 56 if (logoWindowIsOpen < 0) 57 { 58 // creating new Logo Window // 59 logoWindow = new Window("Logo"); 60 logoWindow->connectSignal("destroy", this, LogoWindowClose); 61 logoWindow->connectSignal("delete_event", this, LogoWindowClose); 62 logoEventBox = new EventBox(); 63 logoBox = new Box('v'); 64 logoLabel = new Label("OrxOnoX, " PACKAGE_VERSION); 65 logoImage = new Image("banner.xpm"); 66 logoEventBox->fill(logoImage); 67 68 logoBox->fill(logoLabel); 69 logoBox->fill(logoEventBox); 70 logoEventBox->connectSignal("button_press_event",this,LogoWindowClose); 71 72 logoWindow->fill (logoBox); 73 74 } 75 // showing Window // 76 logoWindowIsOpen = 1; 77 78 79 logoWindow->showall(); 80 } 72 logoWindow->open(); 81 73 } 82 74 … … 86 78 void OrxonoxGuiBanner::logoWindowClose() 87 79 { 88 logoWindowIsOpen = 0; 89 logoWindow->hide(); 80 logoWindow->close(); 90 81 } 91 82 … … 106 97 \param banner the Object that holds the banner-logo-window 107 98 */ 108 gint LogoWindowOpen (GtkWidget* widget, GdkEvent* event, void* banner)99 gint OrxonoxGuiBanner::LogoWindowOpen (GtkWidget* widget, GdkEvent* event, void* banner) 109 100 { 110 static_cast<OrxonoxGuiBanner*>(banner)->logoWindow New();101 static_cast<OrxonoxGuiBanner*>(banner)->logoWindowOpen(); 111 102 } 112 103 … … 118 109 \param banner the Object that holds the banner-logo-window 119 110 */ 120 gint LogoWindowClose (GtkWidget *widget, GdkEvent* event, void* banner)111 gint OrxonoxGuiBanner::LogoWindowClose (GtkWidget *widget, GdkEvent* event, void* banner) 121 112 { 122 113 static_cast<OrxonoxGuiBanner*>(banner)->logoWindowClose(); -
orxonox/trunk/gui/orxonox_gui_banner.h
r2595 r3148 23 23 // the logo Window 24 24 Window* logoWindow; 25 int logoWindowIsOpen;26 25 EventBox* logoEventBox; 27 26 Box* logoBox; … … 33 32 ~OrxonoxGuiBanner (); 34 33 35 void logoWindow New();34 void logoWindowOpen(); 36 35 void logoWindowClose(); 37 36 Widget* getWidget (); 37 38 static gint LogoWindowOpen (GtkWidget *widget, GdkEvent* event, void* banner); 39 static gint LogoWindowClose (GtkWidget *widget, GdkEvent* event, void* banner); 38 40 }; 39 41 40 gint LogoWindowOpen (GtkWidget *widget, GdkEvent* event, void* banner);41 gint LogoWindowClose (GtkWidget *widget, GdkEvent* event, void* banner);42 42 43 43 #endif /* _ORXONOX_GUI_BANNER_H */ -
orxonox/trunk/gui/orxonox_gui_gtk.cc
r3147 r3148 239 239 /* WINDOW */ 240 240 241 Window* Window::mainWindow = NULL; 242 243 void Window::addWindow(Window* windowToAdd) 244 { 245 if (!mainWindow) 246 { 247 mainWindow = windowToAdd; 248 return; 249 } 250 251 Widget* tmpWindow = mainWindow; 252 while (tmpWindow->next) 253 tmpWindow = tmpWindow->next; 254 tmpWindow->next = windowToAdd; 255 256 return; 257 } 258 259 260 241 261 /** 242 262 \brief Creating a new Window without a Name … … 264 284 void Window::init() 265 285 { 286 if (!mainWindow) 287 mainWindow = this; 288 266 289 isOpen = false; 267 290 … … 318 341 void Window::open() 319 342 { 320 isOpen = true; 321 gtk_grab_add(widget); 343 if (this != mainWindow) 344 { 345 isOpen = true; 346 gtk_widget_show_all(widget); 347 gtk_grab_add(widget); 348 } 322 349 } 323 350 … … 327 354 void Window::close() 328 355 { 329 isOpen = false; 330 gtk_grab_remove(widget); 356 if (this != mainWindow) 357 { 358 isOpen = false; 359 gtk_grab_remove(widget); 360 gtk_widget_hide (widget); 361 } 331 362 } 332 363 -
orxonox/trunk/gui/orxonox_gui_gtk.h
r3147 r3148 89 89 bool isOpen; 90 90 public: 91 static Window* mainWindow; 92 static void addWindow(Window* windowToAdd); 93 91 94 static Window* lastWindow; 92 95 Window (void);
Note: See TracChangeset
for help on using the changeset viewer.