0031939: Coding - correction of spelling errors in comments [part 2]
[occt.git] / samples / mfc / standard / Common / OCC_3dDoc.cpp
1 // OCC_3dDoc.cpp: implementation of the OCC_3dDoc class.
2 //
3 //////////////////////////////////////////////////////////////////////
4
5 #include <stdafx.h>
6 #include "OCC_3dDoc.h"
7
8 BEGIN_MESSAGE_MAP(OCC_3dDoc, OCC_3dBaseDoc)
9   ON_COMMAND(ID_OBJECT_DIM, OnObjectAddDimensions)
10 END_MESSAGE_MAP()
11
12 //////////////////////////////////////////////////////////////////////
13 // Construction/Destruction
14 //////////////////////////////////////////////////////////////////////
15
16 OCC_3dDoc::OCC_3dDoc (bool theIsResultDialog)
17 : myDimensionDlg()
18 {
19   if (theIsResultDialog)
20   {
21     myCResultDialog.Create(CResultDialog::IDD,NULL);
22
23     RECT dlgrect;
24     myCResultDialog.GetWindowRect(&dlgrect);
25     LONG width = dlgrect.right-dlgrect.left;
26     LONG height = dlgrect.bottom-dlgrect.top;
27
28     RECT MainWndRect;
29     AfxGetApp()->m_pMainWnd->GetWindowRect(&MainWndRect);
30     LONG left = MainWndRect.left+3;
31     LONG top = MainWndRect.top + 112;
32
33     myCResultDialog.MoveWindow(left,top,width,height);
34   }
35
36   myDimensionDlg.SetContext (myAISContext);
37   myDimensionDlg.Create(CDimensionDlg::IDD, NULL);
38 }
39
40 OCC_3dDoc::~OCC_3dDoc()
41 {
42
43 }
44
45 void OCC_3dDoc::PocessTextInDialog (CString theTitle,
46                                     CString theMessage)
47 {
48   myCResultDialog.SetTitle (theTitle);
49   myCResultDialog.SetText  (theMessage);
50   SetTitle (theTitle);
51 }
52
53 void OCC_3dDoc::ClearDialog()
54 {
55     myCResultDialog.Empty();
56 }
57
58 void OCC_3dDoc::AddTextInDialog(TCollection_AsciiString& aMessage)
59 {
60         CString TextToAdd(aMessage.ToCString());
61         CString CurrentText;
62         myCResultDialog.GetText(CurrentText);
63
64         CString Text;
65         Text = TextToAdd + CurrentText;
66
67     myCResultDialog.SetText(Text);
68
69 }
70
71 CString OCC_3dDoc::GetDialogText()
72 {
73         CString CurrentText;
74         myCResultDialog.GetText(CurrentText);
75
76         return CurrentText;
77
78 }
79
80 void OCC_3dDoc::SetDialogTitle(TCollection_AsciiString theTitle)
81 {
82     myCResultDialog.SetTitle(theTitle.ToCString());
83 }
84
85 void OCC_3dDoc::OnObjectAddDimensions() 
86 {
87   //Add dimensions dialog is opened here
88   myDimensionDlg.ShowWindow(SW_SHOW);
89   myDimensionDlg.UpdateStandardMode ();
90 }