Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/gui/orxonox_gui.cc @ 3165

Last change on this file since 3165 was 3165, checked in by bensch, 19 years ago

orxonox/trunk/gui: compiling as not-GTK possibe, but it is not usable yet

File size: 2.9 KB
Line 
1/*
2   orxonox - the future of 3D-vertical-scrollers
3
4   Copyright (C) 2004 orx
5
6   This program is free software; you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation; either version 2, or (at your option)
9   any later version.
10
11   This program is distributed in the hope that it will be useful,
12   but WITHOUT ANY WARRANTY; without even the implied warranty of
13   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   GNU General Public License for more details.
15
16   You should have received a copy of the GNU General Public License
17   along with this program; if not, write to the Free Software Foundation,
18   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
19
20
21   ### File Specific:
22   main-programmer: Benjamin Grauer
23
24   ToDO:
25   way to start gui without GTK (textmode)
26   curl interface to Download cool stuff
27
28   chain all the windows when starting the GUI (DANGER: performance!!)
29
30   widgets save themselves
31   good way to step through all the Widgets
32   ... many more ...
33   label -> protected : getlabel function
34
35*/
36#include "orxonox_gui.h"
37#include "orxonox_gui_video.h"
38#include "orxonox_gui_audio.h"
39#include "orxonox_gui_exec.h"
40#include "orxonox_gui_flags.h"
41#include "orxonox_gui_banner.h"
42#include "orxonox_gui_keys.h"
43
44  Window* orxonoxGUI;
45  OrxonoxGuiVideo* video;
46  OrxonoxGuiAudio* audio;
47  OrxonoxGuiExec* exec;
48  OrxonoxGuiFlags* flags;
49  OrxonoxGuiBanner* banner;
50  OrxonoxGuiKeys* keys;
51
52int main( int argc, char *argv[] )
53{
54  OrxonoxGui* orxonoxgui = new OrxonoxGui(argc, argv);
55  return 0;
56}
57
58/* ORXONOXGUI */
59
60/**
61   \brief Initializes the Gui
62*/
63OrxonoxGui::OrxonoxGui (int argc, char *argv[])
64{
65#ifdef HAVE_GTK2
66  initGTK(argc, argv);
67#endif
68  orxonoxGUI = new Window( "Grafical OrxOnoX loader, "PACKAGE_VERSION);
69#ifdef HAVE_GTK2
70  orxonoxGUI->connectSignal ("destroy", orxonoxGUI->orxonox_gui_quit);
71  orxonoxGUI->connectSignal ("delete_event", orxonoxGUI->orxonox_gui_quit);
72#endif /* HAVE_GTK2 */
73 
74  Box* windowBox = new Box ('h');
75
76  banner = new OrxonoxGuiBanner();
77  windowBox->fill (banner->getWidget());
78 
79  Box* optionBox = new Box ('v');
80 
81  Box* avBox = new Box ('h');
82
83  video = new OrxonoxGuiVideo ();
84  avBox->fill (video->getWidget ());
85  audio = new OrxonoxGuiAudio ();
86  avBox->fill (audio->getWidget ());
87     
88  optionBox->fill (avBox);
89
90  keys = new OrxonoxGuiKeys ();
91  optionBox->fill (keys->getWidget ());
92
93  exec = new OrxonoxGuiExec (orxonoxGUI);
94  optionBox->fill (exec->getWidget ());
95
96  flags = new OrxonoxGuiFlags (orxonoxGUI);
97
98
99  optionBox->fill (flags->getWidget ());
100  windowBox->fill (optionBox);
101 
102  orxonoxGUI->fill (windowBox);
103  flags->setTextFromFlags (orxonoxGUI);
104
105  exec->setFilename ("~/.orxonox.conf");
106  exec->readFromFile (orxonoxGUI);
107  orxonoxGUI->walkThrough(orxonoxGUI->listOptions);
108
109  orxonoxGUI->showall ();
110
111 
112#ifdef HAVE_GTK2
113  mainloopGTK();
114#endif
115}
116
Note: See TracBrowser for help on using the repository browser.