0024355: Compiler Warning level 4 for MFC samples
[occt.git] / samples / mfc / standard / Common / ResultDialog.cpp
CommitLineData
7fd59977 1// ResultDialog.cpp : implementation file
2//
3
4#include <stdafx.h>
5
6#include "ResultDialog.h"
7
8/////////////////////////////////////////////////////////////////////////////
9// CResultDialog dialog
10
11
12CResultDialog::CResultDialog(CWnd* pParent /*=NULL*/)
13 : CDialog(CResultDialog::IDD, pParent)
14{
15
16}
17
18
19void CResultDialog::DoDataExchange(CDataExchange* pDX)
20{
21 CDialog::DoDataExchange(pDX);
22 //{{AFX_DATA_MAP(CResultDialog)
23 // NOTE: the ClassWizard will add DDX and DDV calls here
24 //}}AFX_DATA_MAP
25}
26
27
28BEGIN_MESSAGE_MAP(CResultDialog, CDialog)
29 //{{AFX_MSG_MAP(CResultDialog)
30 ON_BN_CLICKED(IDC_CopySelectionToClipboard, OnCopySelectionToClipboard)
31 ON_BN_CLICKED(IDC_CopyAllToClipboard, OnCopyAllToClipboard)
32 //}}AFX_MSG_MAP
33END_MESSAGE_MAP()
34
35/////////////////////////////////////////////////////////////////////////////
36// CResultDialog message handlers
37
38void CResultDialog::Empty()
39{
40 pEd = (CRichEditCtrl *) GetDlgItem (IDC_RICHEDIT_ResultDialog);
41 //pEd->Clear();
42 pEd->SetWindowText("");
43}
44
5c573e69 45void CResultDialog::SetText(const CString & aText)
7fd59977 46{
47 pEd = (CRichEditCtrl *) GetDlgItem (IDC_RICHEDIT_ResultDialog);
48 pEd->SetWindowText(aText);
49}
50
51void CResultDialog::GetText(CString & aText)
52{
53 pEd = (CRichEditCtrl *) GetDlgItem (IDC_RICHEDIT_ResultDialog);
54 pEd->GetWindowText(aText);
55}
56
57BOOL CResultDialog::OnInitDialog()
58{
59 CDialog::OnInitDialog();
60
61 // TODO: Add extra initialization here
62 pEd = (CRichEditCtrl *) GetDlgItem (IDC_RICHEDIT_ResultDialog);
63
64 return TRUE; // return TRUE unless you set the focus to a control
65 // EXCEPTION: OCX Property Pages should return FALSE
66}
67
5c573e69 68void CResultDialog::SetTitle(const CString & aTitle)
7fd59977 69{
70 SetWindowText(aTitle);
71}
72
73void CResultDialog::OnCopySelectionToClipboard()
74{
75 // TODO: Add your control notification handler code here
76 pEd = (CRichEditCtrl *) GetDlgItem (IDC_RICHEDIT_ResultDialog);
77 pEd->Copy( );
78}
79
80void CResultDialog::OnCopyAllToClipboard()
81{
82 // TODO: Add your control notification handler code here
83 pEd = (CRichEditCtrl *) GetDlgItem (IDC_RICHEDIT_ResultDialog);
84 CHARRANGE CurrentSel;
85 pEd->GetSel( CurrentSel );
86
87 pEd->SetSel(0,-1 );
88 pEd->Copy( );
89
90 pEd->SetSel( CurrentSel );
91}
92
93
94