7fd59977 |
1 | // OCC_3dDoc.cpp: implementation of the OCC_3dDoc class. |
2 | // |
3 | ////////////////////////////////////////////////////////////////////// |
4 | |
5 | #include <stdafx.h> |
6 | #include "OCC_3dDoc.h" |
7 | |
47162471 |
8 | BEGIN_MESSAGE_MAP(OCC_3dDoc, OCC_3dBaseDoc) |
9 | ON_COMMAND(ID_OBJECT_DIM, OnObjectAddDimensions) |
10 | END_MESSAGE_MAP() |
11 | |
7fd59977 |
12 | ////////////////////////////////////////////////////////////////////// |
13 | // Construction/Destruction |
14 | ////////////////////////////////////////////////////////////////////// |
15 | |
47162471 |
16 | OCC_3dDoc::OCC_3dDoc (bool theIsResultDialog) |
17 | : myDimensionDlg() |
7fd59977 |
18 | { |
47162471 |
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; |
7fd59977 |
32 | |
47162471 |
33 | myCResultDialog.MoveWindow(left,top,width,height); |
34 | } |
7fd59977 |
35 | |
47162471 |
36 | myDimensionDlg.SetContext (myAISContext); |
37 | myDimensionDlg.Create(CDimensionDlg::IDD, NULL); |
7fd59977 |
38 | } |
39 | |
40 | OCC_3dDoc::~OCC_3dDoc() |
41 | { |
42 | |
43 | } |
44 | |
576f8b11 |
45 | void OCC_3dDoc::PocessTextInDialog (CString theTitle, |
46 | CString theMessage) |
7fd59977 |
47 | { |
576f8b11 |
48 | myCResultDialog.SetTitle (theTitle); |
49 | myCResultDialog.SetText (theMessage); |
50 | SetTitle (theTitle); |
7fd59977 |
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 | { |
5c573e69 |
82 | myCResultDialog.SetTitle(theTitle.ToCString()); |
7fd59977 |
83 | } |
47162471 |
84 | |
85 | void OCC_3dDoc::OnObjectAddDimensions() |
86 | { |
87 | //Add dimentions dialog is opened here |
88 | myDimensionDlg.ShowWindow(SW_SHOW); |
89 | myDimensionDlg.UpdateStandardMode (); |
90 | } |