FS2_Open
Open source remastering of the Freespace 2 engine
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
backgroundchooser.cpp
Go to the documentation of this file.
1
// BackgroundChooser.cpp : implementation file
2
//
3
4
#include "
stdafx.h
"
5
#include "
fred.h
"
6
#include "BackgroundChooser.h"
7
#include "
ship/ship.h
"
8
9
#ifdef _DEBUG
10
#undef THIS_FILE
11
static
char
THIS_FILE[] = __FILE__;
12
#endif
13
15
// BackgroundChooser dialog
16
17
18
BackgroundChooser::BackgroundChooser
(
int
numBackgrounds)
19
: CDialog(
BackgroundChooser
::IDD)
20
{
21
//{{AFX_DATA_INIT(BackgroundChooser)
22
//}}AFX_DATA_INIT
23
24
m_numBackgrounds
= numBackgrounds;
25
m_chosenBackground
= -1;
26
}
27
28
29
void
BackgroundChooser::DoDataExchange
(CDataExchange* pDX)
30
{
31
CDialog::DoDataExchange(pDX);
32
//{{AFX_DATA_MAP(BackgroundChooser)
33
//}}AFX_DATA_MAP
34
}
35
36
37
BEGIN_MESSAGE_MAP(
BackgroundChooser
, CDialog)
38
//{{AFX_MSG_MAP(BackgroundChooser)
39
//}}AFX_MSG_MAP
40
END_MESSAGE_MAP()
41
43
// BackgroundChooser message handlers
44
45
BOOL
BackgroundChooser
::OnInitDialog()
46
{
47
int
i
;
48
49
for
(i = 0; i < m_numBackgrounds; i++)
50
{
51
char
temp
[
NAME_LENGTH
];
52
sprintf
(temp,
"Background %d"
, i + 1);
53
54
((CComboBox*) GetDlgItem(
IDC_BACKGROUND
))->AddString(temp);
55
}
56
((CComboBox*) GetDlgItem(
IDC_BACKGROUND
))->SetCurSel(0);
57
58
CDialog::OnInitDialog();
59
UpdateData(
FALSE
);
60
return
TRUE
;
61
}
62
63
void
BackgroundChooser::OnOK
()
64
{
65
UpdateData(
TRUE
);
66
67
m_chosenBackground
= ((CComboBox*) GetDlgItem(
IDC_BACKGROUND
))->GetCurSel();
68
69
CDialog::OnOK();
70
}
71
72
void
BackgroundChooser::OnCancel
()
73
{
74
// TODO: Add extra cleanup here
75
76
CDialog::OnCancel();
77
}
78
79
void
BackgroundChooser::OnClose
()
80
{
81
OnCancel
();
82
}
83
84
int
BackgroundChooser::GetChosenBackground
()
85
{
86
return
m_chosenBackground
;
87
}
i
int i
Definition:
multi_pxo.cpp:466
BackgroundChooser::OnOK
void OnOK()
Definition:
backgroundchooser.cpp:63
TRUE
#define TRUE
Definition:
pstypes.h:399
IDC_BACKGROUND
#define IDC_BACKGROUND
Definition:
resource.h:1127
BackgroundChooser::m_chosenBackground
int m_chosenBackground
Definition:
backgroundchooser.h:39
BackgroundChooser::BackgroundChooser
BackgroundChooser(int numBackgrounds)
Definition:
backgroundchooser.cpp:18
stdafx.h
sprintf
sprintf(buf,"(%f,%f,%f)", v3->xyz.x, v3->xyz.y, v3->xyz.z)
BackgroundChooser::OnClose
afx_msg void OnClose()
Definition:
backgroundchooser.cpp:79
BackgroundChooser
Definition:
backgroundchooser.h:13
BOOL
int BOOL
Definition:
config.h:80
BackgroundChooser::OnCancel
void OnCancel()
Definition:
backgroundchooser.cpp:72
NAME_LENGTH
#define NAME_LENGTH
Definition:
globals.h:15
BackgroundChooser::GetChosenBackground
int GetChosenBackground()
Definition:
backgroundchooser.cpp:84
ship.h
temp
int temp
Definition:
lua.cpp:4996
BackgroundChooser::DoDataExchange
virtual void DoDataExchange(CDataExchange *pDX)
Definition:
backgroundchooser.cpp:29
FALSE
#define FALSE
Definition:
pstypes.h:400
BackgroundChooser::m_numBackgrounds
int m_numBackgrounds
Definition:
backgroundchooser.h:38
fred.h
code
fred2
backgroundchooser.cpp
Generated on Sun May 1 2016 16:22:14 for FS2_Open by
1.8.10