0031431: Visualization, PrsMgr_PresentableObject - simplify HLR computing interface
[occt.git] / samples / mfc / standard / Common / ResultDialog.cpp
1 // ResultDialog.cpp : implementation file
2 //
3
4 #include <stdafx.h>
5
6 #include "ResultDialog.h"
7
8 /////////////////////////////////////////////////////////////////////////////
9 // CResultDialog dialog
10
11
12 CResultDialog::CResultDialog(CWnd* pParent /*=NULL*/)
13         : CDialog(CResultDialog::IDD, pParent)
14 {
15
16 }
17
18
19 void 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
28 BEGIN_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
33 END_MESSAGE_MAP()
34
35 /////////////////////////////////////////////////////////////////////////////
36 // CResultDialog message handlers
37
38 void CResultDialog::Empty()
39 {
40    pEd = (CRichEditCtrl *) GetDlgItem (IDC_RICHEDIT_ResultDialog);
41    //pEd->Clear();
42    pEd->SetWindowText (L"");
43 }
44
45 void CResultDialog::SetText(const CString & aText)
46 {
47    pEd = (CRichEditCtrl *) GetDlgItem (IDC_RICHEDIT_ResultDialog);
48    pEd->SetWindowText(aText);
49 }
50
51 void CResultDialog::GetText(CString & aText)
52 {
53    pEd = (CRichEditCtrl *) GetDlgItem (IDC_RICHEDIT_ResultDialog);
54    pEd->GetWindowText(aText);
55 }
56
57 BOOL 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
68 void CResultDialog::SetTitle(const CString & aTitle)
69 {
70   SetWindowText(aTitle);
71 }
72
73 void CResultDialog::OnCopySelectionToClipboard() 
74 {
75         // TODO: Add your control notification handler code here
76         pEd = (CRichEditCtrl *) GetDlgItem (IDC_RICHEDIT_ResultDialog);
77         pEd->Copy( );
78 }
79
80 void 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