-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathOptionExtras.cpp
More file actions
128 lines (105 loc) · 2.87 KB
/
Copy pathOptionExtras.cpp
File metadata and controls
128 lines (105 loc) · 2.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
// OptionExtras.cpp: Implementierungsdatei
//
#include "pch.h"
#include "stdafx.h"
#include "resource.h"
//#include "golgotha.h"
#include "OptionExtras.h"
#include "main/win_main.h"
#include "string/string.h"
/*
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
*/
/////////////////////////////////////////////////////////////////////////////
// Eigenschaftenseite OptionExtras
IMPLEMENT_DYNCREATE(OptionExtras, CPropertyPage)
OptionExtras::OptionExtras() :
CPropertyPage(OptionExtras::IDD)
{
//{{AFX_DATA_INIT(OptionExtras)
// HINWEIS: Der Klassen-Assistent fügt hier Elementinitialisierung ein
//}}AFX_DATA_INIT
}
OptionExtras::~OptionExtras()
{
}
void OptionExtras::DoDataExchange(CDataExchange * pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(OptionExtras)
DDX_Control(pDX, IDC_LANGSELECT, m_langselect);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(OptionExtras, CPropertyPage)
//{{AFX_MSG_MAP(OptionExtras)
ON_BN_CLICKED(IDC_STEREOMODE, OnStereomode)
ON_CBN_EDITCHANGE(IDC_LANGSELECT, OnEditchangeLangselect)
ON_CBN_SELENDOK(IDC_LANGSELECT, OnSelendokLangselect)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// Behandlungsroutinen für Nachrichten OptionExtras
void OptionExtras::OnStereomode()
{
// TODO: Code für die Behandlungsroutine der Steuerelement-Benachrichtigung hier einfügen
SetModified(TRUE);
}
void OptionExtras::Apply()
{
if (!m_hWnd)
{
return;
}
i4_win32_startup_options.stereo=IsDlgButtonChecked(IDC_STEREOMODE);
//CEdit *ed=m_langselect.GetEditCtrl();
char mybuf[255];
m_langselect.GetWindowText(mybuf,255);
if (strlen(mybuf)==0)
{
ZeroMemory(i4_win32_startup_options.langcode,10);
}
else
{
i4_str langstring(mybuf);
int st=langstring.find_first_of("[")+1;
int en=langstring.find_last_of("]");
i4_str langsubstr;
if ((st==-1)||(en==-1))
{
langsubstr=langstring;
}
else
{
en=en-st; //need the length
langsubstr=langstring.substr(st,en);
}
strncpy(i4_win32_startup_options.langcode,langsubstr.c_str(),9);
}
}
BOOL OptionExtras::OnInitDialog()
{
CPropertyPage::OnInitDialog();
CheckDlgButton(IDC_STEREOMODE,i4_win32_startup_options.stereo);
m_langselect.SetWindowText("");
//CEdit *ed=m_langselect.GetEditCtrl();
//ed->SetWindowText(i4_win32_startup_options.langcode);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX-Eigenschaftenseiten sollten FALSE zurückgeben
}
BOOL OptionExtras::OnApply()
{
// TODO: Speziellen Code hier einfügen und/oder Basisklasse aufrufen
return CPropertyPage::OnApply();
}
void OptionExtras::OnEditchangeLangselect()
{
SetModified(TRUE);
}
void OptionExtras::OnSelendokLangselect()
{
SetModified(TRUE);
}