-
Notifications
You must be signed in to change notification settings - Fork 0
/
PSX.cpp
202 lines (161 loc) · 3.7 KB
/
PSX.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
#include "stdafx.h"
#include "psx.h"
#include "mainfrm.h"
#include "padview.h"
#include "paddoc.h"
#include "padframe.h"
#include "vfcdlg.h"
#include "mncdlg.h"
#include "ttabdlg.h"
#include "ztabdlg.h"
#include "ttudlg.h"
#include "vardlg.h"
#include "ctl3d.h"
BEGIN_MESSAGE_MAP(CPsxApp, CWinApp)
//{{AFX_MSG_MAP(CPsxApp)
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
ON_COMMAND(ID_PAGE_SETUP, OnPageSetup)
ON_COMMAND(ID_VFCHI, OnVfchi)
ON_COMMAND(ID_MNCHI, OnMnchi)
ON_COMMAND(ID_TABELLEN_T, OnTabellenT)
ON_COMMAND(ID_TABELLEN_Z, OnTabellenZ)
ON_COMMAND(ID_TTU, OnTtu)
ON_COMMAND(ID_KOMVAR, OnKomvar)
//}}AFX_MSG_MAP
// Standard file based document commands
ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
END_MESSAGE_MAP()
CPsxApp SuperPadApp;
CPsxApp::CPsxApp()
{
}
BOOL CPsxApp::InitInstance()
{
Ctl3dRegister(AfxGetInstanceHandle());
Ctl3dAutoSubclass(AfxGetInstanceHandle());
CPadFrame::Initialize();
AddDocTemplate(
new CMultiDocTemplate(IDR_TEXTTYPE,
RUNTIME_CLASS(CPadDoc),
RUNTIME_CLASS(CPadFrame),
RUNTIME_CLASS(CPadView)));
CMainFrame* pMainFrame = new CMainFrame;
if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
return FALSE;
m_pMainWnd = pMainFrame;
UINT nCmdShow = m_nCmdShow;
m_nCmdShow = SW_HIDE;
((CMainFrame*)m_pMainWnd)->InitialShowWindow(nCmdShow);
m_pMainWnd->UpdateWindow();
if (!m_pMainWnd->IsIconic() && m_lpCmdLine[0] == 0 &&
m_splash.Create(m_pMainWnd))
{
m_splash.ShowWindow(SW_SHOW);
m_splash.UpdateWindow();
}
m_dwSplashTime = ::GetCurrentTime();
LoadStdProfileSettings();
CPadView::Initialize();
dlgPageSetup.Initialize();
if (m_lpCmdLine[0] == '\0')
OnFileNew();
else
OpenDocumentFile(m_lpCmdLine);
m_nCmdShow = nCmdShow;
m_pMainWnd->UpdateWindow();
return TRUE;
}
BOOL CPsxApp::OnIdle(LONG lCount)
{
// call base class idle first
BOOL bResult = CWinApp::OnIdle(lCount);
// then do our work
if (m_splash.m_hWnd != NULL)
{
if (::GetCurrentTime() - m_dwSplashTime > 5000)
{
// timeout expired, destroy the splash window
m_splash.DestroyWindow();
m_pMainWnd->UpdateWindow();
// NOTE: don't set bResult to FALSE,
// CWinApp::OnIdle may have returned TRUE
}
else
{
// check again later...
bResult = TRUE;
}
}
return bResult;
}
BOOL CPsxApp::PreTranslateMessage(MSG* pMsg)
{
BOOL bResult = CWinApp::PreTranslateMessage(pMsg);
if (m_splash.m_hWnd != NULL &&
(pMsg->message == WM_KEYDOWN ||
pMsg->message == WM_SYSKEYDOWN ||
pMsg->message == WM_LBUTTONDOWN ||
pMsg->message == WM_RBUTTONDOWN ||
pMsg->message == WM_MBUTTONDOWN ||
pMsg->message == WM_NCLBUTTONDOWN ||
pMsg->message == WM_NCRBUTTONDOWN ||
pMsg->message == WM_NCMBUTTONDOWN))
{
m_splash.DestroyWindow();
m_pMainWnd->UpdateWindow();
}
return bResult;
}
int CPsxApp::ExitInstance()
{
dlgPageSetup.Terminate();
CPadView::Terminate();
CPadFrame::Terminate();
Ctl3dUnregister(AfxGetInstanceHandle());
return CWinApp::ExitInstance();
}
/////////////////////////////////////////////////////////////////////////////
// CPsxApp message handlers
void CPsxApp::OnAppAbout()
{
CAboutBox about;
about.DoModal();
}
CPageSetupDlg dlgPageSetup;
void CPsxApp::OnPageSetup()
{
dlgPageSetup.DoModal();
}
/////////////////////////////////////////////////////////////////////////////
void CPsxApp::OnVfchi()
{
CVfcDlg vfchi;
vfchi.DoModal();
}
void CPsxApp::OnMnchi()
{
CMncDlg mnc;
mnc.DoModal();
}
void CPsxApp::OnTabellenT()
{
CttabDlg ttab;
ttab.DoModal();
}
void CPsxApp::OnTabellenZ()
{
CztabDlg ztab;
ztab.DoModal();
}
void CPsxApp::OnTtu()
{
CttuDlg tt;
tt.DoModal();
}
void CPsxApp::OnKomvar()
{
CVarDlg var;
var.DoModal();
}