-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGoToLineDlg.cpp
More file actions
53 lines (44 loc) · 1.04 KB
/
GoToLineDlg.cpp
File metadata and controls
53 lines (44 loc) · 1.04 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
#include "GoToLineDlg.h"
#include "Rad/Windowxx.h"
#include <tchar.h>
#include "resource.h"
extern HINSTANCE g_hInstance;
DWORD GoToLineDlg::DoModal(HWND hWndParent)
{
GoToLineDlg dlg;
DLGCREATESTRUCT dcs = {};
GetCreateDlg(dcs);
dcs.lpTemplateName = MAKEINTRESOURCE(IDD_GOTOLINE);
dcs.hWndParent = hWndParent;
if (dlg.Dialog::DoModal(dcs) == IDOK)
return dlg.m_Line;
else
return -1;
}
LRESULT GoToLineDlg::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
LRESULT ret = 0;
switch (uMsg)
{
HANDLE_MSG(WM_COMMAND, OnCommand);
}
if (!IsHandled())
ret = Dialog::HandleMessage(uMsg, wParam, lParam);
return ret;
}
void GoToLineDlg::OnCommand(int id, HWND hWndCtl, UINT codeNotify)
{
switch (id)
{
case IDOK:
m_Line = GetDlgItemInt(GetHWND(), IDC_LINE, NULL, FALSE);
EndDialog(*this, IDOK);
break;
case IDCANCEL:
EndDialog(*this, IDCANCEL);
break;
default:
SetHandled(false);
break;
}
}