Debian Codegraph @

editor/LevelInfoDialog.cpp

raw symbols SCIP
1 /*
2 * Descent 3
3 * Copyright (C) 2024 Parallax Software
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 // LevelInfoDialog.cpp : implementation file
20 //
21
22 #include "stdafx.h"
23 #include "editor.h"
24 #include "LevelInfoDialog.h"
25
26 #ifdef _DEBUG
27 #define new DEBUG_NEW
28 #undef THIS_FILE
29 static char THIS_FILE[] = __FILE__;
30 #endif
31
32 /////////////////////////////////////////////////////////////////////////////
33 // CLevelInfoDialog dialog
34
35 CLevelInfoDialog::CLevelInfoDialog(level_info *li, CWnd *pParent /*=NULL*/) : CDialog(CLevelInfoDialog::IDD, pParent) {
36 //{{AFX_DATA_INIT(CLevelInfoDialog)
37 m_copyright = _T("");
38 m_designer = _T("");
39 m_name = _T("");
40 m_notes = _T("");
41 //}}AFX_DATA_INIT
42
43 m_level_info = li;
44
45 m_name = li->name;
46 m_designer = li->designer;
47 m_copyright = li->copyright;
48 m_notes = li->notes;
49 }
50
51 void CLevelInfoDialog::GetLevelInfo(level_info *li) {
52 strcpy(li->name, (LPCSTR)m_name);
53 strcpy(li->designer, (LPCSTR)m_designer);
54 strcpy(li->copyright, (LPCSTR)m_copyright);
55 strcpy(li->notes, (LPCSTR)m_notes);
56 }
57
58 void CLevelInfoDialog::DoDataExchange(CDataExchange *pDX) {
59 CDialog::DoDataExchange(pDX);
60 //{{AFX_DATA_MAP(CLevelInfoDialog)
61 DDX_Text(pDX, IDC_COPYRIGHT, m_copyright);
62 DDX_Text(pDX, IDC_DESIGNER, m_designer);
63 DDX_Text(pDX, IDC_LEVEL_NAME, m_name);
64 DDX_Text(pDX, IDC_NOTES, m_notes);
65 //}}AFX_DATA_MAP
66 }
67
68 BEGIN_MESSAGE_MAP(CLevelInfoDialog, CDialog)
69 //{{AFX_MSG_MAP(CLevelInfoDialog)
70 //}}AFX_MSG_MAP
71 END_MESSAGE_MAP()
72
73 /////////////////////////////////////////////////////////////////////////////
74 // CLevelInfoDialog message handlers
75
76 void CLevelInfoDialog::OnOK() {
77 CDialog::OnOK();
78
79 // Copy the new data into our original struct
80 GetLevelInfo(m_level_info);
81 }