forked from morbac/xmltools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDebugDlg.cpp
72 lines (53 loc) · 1.42 KB
/
DebugDlg.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
// DebugDlg.cpp : fichier d'implémentation
//
#include "stdafx.h"
#include "XMLTools.h"
#include "DebugDlg.h"
#include "afxdialogex.h"
// Boîte de dialogue CDebugDlg
IMPLEMENT_DYNAMIC(CDebugDlg, CDialog)
CDebugDlg::CDebugDlg(CWnd* pParent /*=NULL*/)
: CDialog(CDebugDlg::IDD, pParent)
{
}
CDebugDlg::~CDebugDlg()
{
}
void CDebugDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
}
void CDebugDlg::addLine(CString line) {
TRACE(line);
this->s_valDebug += line;
if (this->m_hWnd) {
CEdit* edit = (CEdit*) GetDlgItem(IDC_EDITDEBUG);
if (edit) {
edit->SetWindowText(this->s_valDebug);
edit->SetSel(0,-1); // select all text and move cursor at the end
edit->SetSel(-1);
}
}
}
BEGIN_MESSAGE_MAP(CDebugDlg, CDialog)
ON_WM_SIZE()
END_MESSAGE_MAP()
// Gestionnaires de messages de CDebugDlg
void CDebugDlg::OnSize(UINT nType, int cx, int cy) {
CDialog::OnSize(nType, cx, cy);
CWnd *txt_wnd = GetDlgItem(IDC_EDITDEBUG);
if (txt_wnd) {
int border = 8;
txt_wnd->MoveWindow(border, border, cx-2*border, cy-2*border);
}
}
BOOL CDebugDlg::OnInitDialog()
{
CDialog::OnInitDialog();
CRect myRect;
GetClientRect(&myRect);
ClientToScreen(myRect);
MoveWindow(myRect.left, myRect.top, myRect.Width(), myRect.Height());
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION : les pages de propriétés OCX devraient retourner FALSE
}