Debian Codegraph @

editor/DallasVectorPromptDialog.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 // DallasVectorPromptDialog.cpp : implementation file
20 //
21
22 #include "stdafx.h"
23 #include "editor.h"
24 #include "DallasVectorPromptDialog.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 // CDallasVectorPromptDialog dialog
34
35 CDallasVectorPromptDialog::CDallasVectorPromptDialog(CWnd *pParent /*=NULL*/)
36 : CDialog(CDallasVectorPromptDialog::IDD, pParent) {
37 //{{AFX_DATA_INIT(CDallasVectorPromptDialog)
38 // NOTE: the ClassWizard will add member initialization here
39 //}}AFX_DATA_INIT
40 m_PromptData1 = 0.0;
41 m_PromptData2 = 0.0;
42 m_PromptData3 = 0.0;
43 }
44
45 void CDallasVectorPromptDialog::DoDataExchange(CDataExchange *pDX) {
46 CDialog::DoDataExchange(pDX);
47 //{{AFX_DATA_MAP(CDallasVectorPromptDialog)
48 DDX_Control(pDX, IDC_DATA3_EDIT, m_Data3Edit);
49 DDX_Control(pDX, IDC_DATA2_EDIT, m_Data2Edit);
50 DDX_Control(pDX, IDC_DATA1_EDIT, m_Data1Edit);
51 //}}AFX_DATA_MAP
52 }
53
54 BEGIN_MESSAGE_MAP(CDallasVectorPromptDialog, CDialog)
55 //{{AFX_MSG_MAP(CDallasVectorPromptDialog)
56 //}}AFX_MSG_MAP
57 END_MESSAGE_MAP()
58
59 /////////////////////////////////////////////////////////////////////////////
60 // CDallasVectorPromptDialog message handlers
61
62 BOOL CDallasVectorPromptDialog::OnInitDialog() {
63 CDialog::OnInitDialog();
64
65 // TODO: Add extra initialization here
66 CString value;
67
68 value.Format("%f", m_PromptData1);
69 m_Data1Edit.SetWindowText(value.GetBuffer(0));
70
71 value.Format("%f", m_PromptData2);
72 m_Data2Edit.SetWindowText(value.GetBuffer(0));
73
74 value.Format("%f", m_PromptData3);
75 m_Data3Edit.SetWindowText(value.GetBuffer(0));
76
77 m_Data1Edit.SetLimitText(10);
78 m_Data2Edit.SetLimitText(10);
79 m_Data3Edit.SetLimitText(10);
80
81 return TRUE; // return TRUE unless you set the focus to a control
82 // EXCEPTION: OCX Property Pages should return FALSE
83 }
84
85 void CDallasVectorPromptDialog::OnOK() {
86 // TODO: Add extra validation here
87 CString value;
88
89 m_Data1Edit.GetWindowText(value);
90 m_PromptData1 = atof(value.GetBuffer(0));
91
92 m_Data2Edit.GetWindowText(value);
93 m_PromptData2 = atof(value.GetBuffer(0));
94
95 m_Data3Edit.GetWindowText(value);
96 m_PromptData3 = atof(value.GetBuffer(0));
97
98 CDialog::OnOK();
99 }