Starshatter_Open
Open source Starshatter engine
Main Page
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
ModInfoDlg.cpp
Go to the documentation of this file.
1
/* Project Starshatter 4.5
2
Destroyer Studios LLC
3
Copyright © 1997-2004. All Rights Reserved.
4
5
SUBSYSTEM: Stars.exe
6
FILE: ModInfoDlg.cpp
7
AUTHOR: John DiCamillo
8
9
10
OVERVIEW
11
========
12
Mod Config Dialog Active Window class
13
*/
14
15
#include "
MemDebug.h
"
16
#include "
ModInfoDlg.h
"
17
#include "
BaseScreen.h
"
18
#include "
ModConfig.h
"
19
#include "
ModInfo.h
"
20
21
#include "
Game.h
"
22
#include "
DataLoader.h
"
23
#include "
Button.h
"
24
#include "
ListBox.h
"
25
#include "
ImageBox.h
"
26
#include "
Video.h
"
27
#include "
Keyboard.h
"
28
#include "
Mouse.h
"
29
#include "
ParseUtil.h
"
30
31
// +--------------------------------------------------------------------+
32
// DECLARE MAPPING FUNCTIONS:
33
34
DEF_MAP_CLIENT
(
ModInfoDlg
, OnAccept);
35
36
// +--------------------------------------------------------------------+
37
38
ModInfoDlg::ModInfoDlg
(
Screen
* s,
FormDef
& def,
BaseScreen
* mgr)
39
:
FormWindow
(s, 0, 0, s->Width(), s->Height()), manager(mgr),
40
btn_accept(0), mod_info(0)
41
{
42
Init
(def);
43
}
44
45
ModInfoDlg::~ModInfoDlg
()
46
{
47
}
48
49
// +--------------------------------------------------------------------+
50
51
void
52
ModInfoDlg::RegisterControls
()
53
{
54
btn_accept
= (
Button
*)
FindControl
( 1);
55
56
if
(
btn_accept
)
57
REGISTER_CLIENT
(
EID_CLICK
,
btn_accept
,
ModInfoDlg
,
OnAccept
);
58
59
lbl_name
=
FindControl
(101);
60
lbl_desc
=
FindControl
(102);
61
lbl_copy
=
FindControl
(103);
62
63
img_logo
= (
ImageBox
*)
FindControl
(200);
64
65
if
(
img_logo
) {
66
img_logo
->
GetPicture
(
bmp_default
);
67
img_logo
->
SetBlendMode
(
Video::BLEND_SOLID
);
68
}
69
}
70
71
// +--------------------------------------------------------------------+
72
73
void
74
ModInfoDlg::Show
()
75
{
76
FormWindow::Show
();
77
}
78
79
// +--------------------------------------------------------------------+
80
81
void
82
ModInfoDlg::ExecFrame
()
83
{
84
if
(
Keyboard::KeyDown
(VK_RETURN)) {
85
if
(
btn_accept
&&
btn_accept
->
IsEnabled
())
86
OnAccept
(0);
87
}
88
}
89
90
// +--------------------------------------------------------------------+
91
92
void
93
ModInfoDlg::SetModInfo
(
ModInfo
* info)
94
{
95
mod_info
= info;
96
97
if
(
mod_info
) {
98
if
(
lbl_name
)
lbl_name
->
SetText
(
mod_info
->
Name
());
99
if
(
lbl_desc
)
lbl_desc
->
SetText
(
mod_info
->
Description
());
100
if
(
lbl_copy
)
lbl_copy
->
SetText
(
mod_info
->
Copyright
());
101
102
if
(
img_logo
&&
mod_info
->
LogoImage
() &&
mod_info
->
LogoImage
()->
Width
() > 32)
103
img_logo
->
SetPicture
(*
mod_info
->
LogoImage
());
104
else
if
(
img_logo
)
105
img_logo
->
SetPicture
(
bmp_default
);
106
}
107
}
108
109
// +--------------------------------------------------------------------+
110
111
void
112
ModInfoDlg::OnAccept
(
AWEvent
* event)
113
{
114
manager
->
ShowModDlg
();
115
}
Stars45
ModInfoDlg.cpp
Generated on Tue Jun 5 2012 20:46:58 for Starshatter_Open by
1.8.1