Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

orxonox/trunk/gui: modularity improvement: taken the gtk-stuff out of the main GUI

File size: 2.6 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*/
25
26#include <iostream.h>
27
28#include "orxonox_gui.h"
29#include "orxonox_gui_video.h"
30#include "orxonox_gui_audio.h"
31#include "orxonox_gui_exec.h"
32#include "orxonox_gui_flags.h"
33#include "orxonox_gui_banner.h"
34#include "orxonox_gui_keys.h"
35
36  Window* orxonoxGUI;
37  OrxonoxGuiVideo* video;
38  OrxonoxGuiAudio* audio;
39  OrxonoxGuiExec* exec;
40  OrxonoxGuiFlags* flags;
41  OrxonoxGuiBanner* banner;
42  OrxonoxGuiKeys* keys;
43
44int main( int argc, char *argv[] )
45{
46  Window::lastWindow = NULL;
47  OrxonoxGui* orxonoxgui = new OrxonoxGui(argc, argv);
48  return 0;
49}
50
51/* ORXONOXGUI */
52
53/**
54   \brief Initializes the Gui
55*/
56OrxonoxGui::OrxonoxGui (int argc, char *argv[])
57{
58  gtk_init (&argc, &argv);
59  gtk_rc_parse( "rc" );
60 
61  orxonoxGUI = new Window( "Grafical OrxOnoX loader, "PACKAGE_VERSION);
62  orxonoxGUI->connectSignal ("destroy", orxonoxGUI->orxonox_gui_quit);
63  orxonoxGUI->connectSignal ("delete_event", orxonoxGUI->orxonox_gui_quit);
64 
65  Box* windowBox = new Box ('h');
66
67  banner = new OrxonoxGuiBanner();
68  windowBox->fill (banner->getWidget());
69 
70  Box* optionBox = new Box ('v');
71 
72  Box* avBox = new Box ('h');
73
74  video = new OrxonoxGuiVideo ();
75  avBox->fill (video->getWidget ());
76  audio = new OrxonoxGuiAudio ();
77  avBox->fill (audio->getWidget ());
78     
79  optionBox->fill (avBox);
80
81  keys = new OrxonoxGuiKeys ();
82  optionBox->fill (keys->getWidget ());
83
84  exec = new OrxonoxGuiExec (orxonoxGUI);
85  optionBox->fill (exec->getWidget ());
86
87  flags = new OrxonoxGuiFlags (orxonoxGUI);
88
89
90  optionBox->fill (flags->getWidget ());
91  windowBox->fill (optionBox);
92 
93  orxonoxGUI->fill (windowBox);
94  flags->setTextFromFlags (orxonoxGUI);
95
96  exec->setFilename ("~/.orxonox.conf");
97  exec->readFromFile (orxonoxGUI);
98  orxonoxGUI->walkThrough(orxonoxGUI->listOptions);
99
100  orxonoxGUI->showall ();
101
102 
103  gtk_main();
104}
105
Note: See TracBrowser for help on using the repository browser.