Vegastrike 0.5.1 rc1
1.0
Original sources for Vegastrike Evolved
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
windowcontroller.cpp
Go to the documentation of this file.
1
/*
2
* Vega Strike
3
* Copyright (C) 2003 Mike Byron
4
*
5
* http://vegastrike.sourceforge.net/
6
*
7
* This program is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU General Public License
9
* as published by the Free Software Foundation; either version 2
10
* of the License, or (at your option) any later version.
11
*
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20
*/
21
22
#include "
vegastrike.h
"
23
24
#include "
eventmanager.h
"
25
26
#include "
windowcontroller.h
"
27
28
//Make everything happen.
29
void
WindowController::run
(
void
)
30
{
31
if
(
m_window
) {
32
m_window
->
setDeleteOnClose
(
true
);
//We want the window to delete itself.
33
m_window
->
setController
(
this
);
34
m_window
->
open
();
35
}
else
{
36
//We have no window. Close down.
37
delete
this
;
38
}
39
}
40
41
void
WindowController::draw
(
void
)
42
{
43
//Do nothing.
44
}
45
46
//Process a command from the window.
47
bool
WindowController::processWindowCommand
(
const
EventCommandId
&command,
Control
*control )
48
{
49
if
(command ==
"Window::Close"
) {
50
//Our window is closing.
51
if
(
m_deleteOnWindowClose
) {
52
delete
this
;
53
//We return false so that the window itself can see this command.
54
return
false
;
55
}
56
}
57
//Didn't find a handler.
58
return
false
;
59
}
60
61
//CONSTRUCTOR
62
WindowController::WindowController
() : m_window( NULL )
63
, m_deleteOnWindowClose( true )
64
{}
65
66
//DESTRUCTOR
67
WindowController::~WindowController
(
void
) {}
68
src
gui
windowcontroller.cpp
Generated on Fri May 29 2015 23:07:33 for Vegastrike 0.5.1 rc1 by
1.8.4