-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathOptionsheet.cpp
114 lines (96 loc) · 2.55 KB
/
Optionsheet.cpp
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
// Optionsheet.cpp: Implementierungsdatei
//
#include "pch.h"
#include "stdafx.h"
//#include "display.h"
#include "resource.h"
#include "optionsdialog.h"
#include "optioninfo.h"
#include "optionsound.h"
#include "optionextras.h"
#include "Optionsheet.h"
#include "resource.h"
#include "main/win_main.h"
#ifdef _DEBUG
#undef new
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// COptionsheet
IMPLEMENT_DYNAMIC(COptionsheet, CPropertySheet)
COptionsheet::COptionsheet(UINT nIDCaption, CWnd * pParentWnd, UINT iSelectPage)
: CPropertySheet(nIDCaption, pParentWnd, iSelectPage)
{
}
COptionsheet::COptionsheet(LPCTSTR pszCaption, CWnd * pParentWnd, UINT iSelectPage)
: CPropertySheet(pszCaption, pParentWnd, iSelectPage)
{
AddPage(&graphics);
AddPage(&sound);
AddPage(&extras);
AddPage(&info);
}
COptionsheet::~COptionsheet()
{
}
BOOL COptionsheet::OnInitDialog()
{
//graphics.OnInitDialog();
BOOL bresult=CPropertySheet::OnInitDialog();
return bresult;
}
BEGIN_MESSAGE_MAP(COptionsheet, CPropertySheet)
//{{AFX_MSG_MAP(COptionsheet)
ON_COMMAND(ID_APPLY_NOW, OnApplyNow)
ON_COMMAND(IDOK,OnOK)
ON_WM_CLOSE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// Behandlungsroutinen für Nachrichten COptionsheet
void COptionsheet::OnApplyNow()
{
graphics.Apply();
graphics.SetModified(FALSE);
sound.Apply();
sound.SetModified(FALSE);
extras.Apply();
extras.SetModified(FALSE);
i4_win32_startup_options.save_option();
};
void COptionsheet::OnOK()
{
OnApplyNow();
graphics.Cleanup();
CPropertySheet::OnClose();
if (!graphics.resolutionchanged)
{
return;
}
char buf[300];
if (LoadString(i4_win32_instance,IDS_SETQUESTION,buf,300)==0)
{
strcpy(buf,"Set this mode right now?");
}
MessageBox(buf,NULL,MB_OK|MB_TOPMOST);
return;
/*if (MessageBox(buf,NULL,MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2|
MB_TOPMOST)==IDNO)
{
return;
}*/
//i4_current_app->get_display()->change_mode(i4_win32_startup_options.xres,
// i4_win32_startup_options.yres,i4_win32_startup_options.bits,
// I4_CHANGE_RESOLUTION); //Apply resolution change immediatelly.
}
void COptionsheet::Apply()
{
OnApplyNow();
}
void COptionsheet::OnClose()
{
// TODO: Code für die Behandlungsroutine für Nachrichten hier einfügen und/oder Standard aufrufen
CPropertySheet::OnClose();
}