-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathNag.cpp
More file actions
115 lines (90 loc) · 2.51 KB
/
Nag.cpp
File metadata and controls
115 lines (90 loc) · 2.51 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
// Nag.cpp : implementation file
//
#include "stdafx.h"
#include "HexEditor.h"
#include "Nag.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// Nag dialog
Nag::Nag(CWnd* pParent)
: CDialog(Nag::IDD, pParent)
{
TheText = &NagText[0];
//{{AFX_DATA_INIT(Nag)
//}}AFX_DATA_INIT
}
void Nag::SetTextPtr(char *Ptr)
{
TheText = Ptr;
}
void Nag::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(Nag)
DDX_Control(pDX, IDOK, m_Ok);
DDX_Control(pDX, IDC_EDIT_NAGTEXT, m_Text);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(Nag, CDialog)
//{{AFX_MSG_MAP(Nag)
ON_WM_SHOWWINDOW()
ON_EN_VSCROLL(IDC_EDIT_NAGTEXT, OnVscrollEditNagtext)
ON_WM_MOUSEMOVE()
ON_WM_MOUSEWHEEL()
ON_WM_LBUTTONUP()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// Nag message handlers
void Nag::OnShowWindow(BOOL bShow, UINT nStatus)
{
CDialog::OnShowWindow(bShow, nStatus);
GotoDlgCtrl (GetDlgItem(IDCANCEL));
// TODO: Add your message handler code here
}
BOOL Nag::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
// m_Text.SetWindowText(NagText);
m_Text.SetWindowText(TheText);
m_Ok.EnableWindow(FALSE);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void Nag::OnVscrollEditNagtext()
{
// TODO: Add your control notification handler code here
if (m_Text.GetScrollPos(SB_VERT) >= m_Text.GetScrollLimit(SB_VERT))
m_Ok.EnableWindow(TRUE);
}
void Nag::OnOK()
{
// TODO: Add extra validation here
CDialog::OnOK();
}
void Nag::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
if (m_Text.GetScrollPos(SB_VERT) >= m_Text.GetScrollLimit(SB_VERT))
m_Ok.EnableWindow(TRUE);
CDialog::OnMouseMove(nFlags, point);
}
BOOL Nag::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt)
{
// TODO: Add your message handler code here and/or call default
if (m_Text.GetScrollPos(SB_VERT) >= m_Text.GetScrollLimit(SB_VERT))
m_Ok.EnableWindow(TRUE);
return CDialog::OnMouseWheel(nFlags, zDelta, pt);
}
void Nag::OnLButtonUp(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
if (m_Text.GetScrollPos(SB_VERT) >= m_Text.GetScrollLimit(SB_VERT))
m_Ok.EnableWindow(TRUE);
CDialog::OnLButtonUp(nFlags, point);
}