Starshatter_Open
Open source Starshatter engine
Main Page
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
CmpCompleteDlg.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: CmpCompleteDlg.cpp
7
AUTHOR: John DiCamillo
8
9
10
OVERVIEW
11
========
12
*/
13
14
#include "
MemDebug.h
"
15
#include "
CmpCompleteDlg.h
"
16
#include "
CmpnScreen.h
"
17
#include "
Campaign.h
"
18
#include "
CombatEvent.h
"
19
#include "
Starshatter.h
"
20
21
#include "
Game.h
"
22
#include "
DataLoader.h
"
23
#include "
Video.h
"
24
#include "
Keyboard.h
"
25
#include "
Mouse.h
"
26
#include "
ImageBox.h
"
27
#include "
Button.h
"
28
#include "
FormatUtil.h
"
29
30
// +--------------------------------------------------------------------+
31
// DECLARE MAPPING FUNCTIONS:
32
33
DEF_MAP_CLIENT
(
CmpCompleteDlg
, OnClose);
34
35
// +--------------------------------------------------------------------+
36
37
CmpCompleteDlg::CmpCompleteDlg
(
Screen
* s,
FormDef
& def,
CmpnScreen
* mgr)
38
:
FormWindow
(s, 0, 0, s->Width(), s->Height()), manager(mgr),
39
lbl_info(0), img_title(0), btn_close(0)
40
{
41
Init
(def);
42
}
43
44
CmpCompleteDlg::~CmpCompleteDlg
()
45
{
46
}
47
48
void
49
CmpCompleteDlg::RegisterControls
()
50
{
51
img_title
= (
ImageBox
*)
FindControl
(100);
52
lbl_info
=
FindControl
(101);
53
btn_close
= (
Button
*)
FindControl
(1);
54
55
REGISTER_CLIENT
(
EID_CLICK
,
btn_close
,
CmpCompleteDlg
,
OnClose
);
56
}
57
58
void
59
CmpCompleteDlg::Show
()
60
{
61
FormWindow::Show
();
62
63
Campaign
* c =
Campaign::GetCampaign
();
64
65
if
(
img_title
&& c) {
66
DataLoader
* loader =
DataLoader::GetLoader
();
67
Starshatter
* stars =
Starshatter::GetInstance
();
68
CombatEvent
*
event
= c->
GetLastEvent
();
69
char
img_name[256];
70
71
if
(
event
) {
72
strcpy_s(img_name,
event
->ImageFile());
73
74
if
(!strstr(img_name,
".pcx"
)) {
75
strcat_s(img_name,
".pcx"
);
76
}
77
78
if
(loader) {
79
loader->
SetDataPath
(c->
Path
());
80
loader->
LoadBitmap
(img_name,
banner
);
81
loader->
SetDataPath
(0);
82
83
Rect
tgt_rect;
84
tgt_rect.
w
=
img_title
->
Width
();
85
tgt_rect.
h
=
img_title
->
Height
();
86
87
img_title
->
SetTargetRect
(tgt_rect);
88
img_title
->
SetPicture
(
banner
);
89
}
90
}
91
}
92
}
93
94
// +--------------------------------------------------------------------+
95
96
void
97
CmpCompleteDlg::ExecFrame
()
98
{
99
}
100
101
// +--------------------------------------------------------------------+
102
103
void
104
CmpCompleteDlg::OnClose
(
AWEvent
* event)
105
{
106
if
(
manager
)
107
manager
->
ShowCmdDlg
();
108
}
Stars45
CmpCompleteDlg.cpp
Generated on Tue Jun 5 2012 20:46:49 for Starshatter_Open by
1.8.1