Starshatter_Open
Open source Starshatter engine
 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 
34 
35 // +--------------------------------------------------------------------+
36 
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 
45 {
46 }
47 
48 void
50 {
51  img_title = (ImageBox*) FindControl(100);
52  lbl_info = FindControl(101);
54 
56 }
57 
58 void
60 {
62 
64 
65  if (img_title && c) {
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);
89  }
90  }
91  }
92 }
93 
94 // +--------------------------------------------------------------------+
95 
96 void
98 {
99 }
100 
101 // +--------------------------------------------------------------------+
102 
103 void
105 {
106  if (manager)
107  manager->ShowCmdDlg();
108 }