Commit before breaking everything
[matches/honours.git] / research / transmission_spectroscopy / TOF / Win32++ / samples / DialogBars / src / MyDialog.cpp
1 ///////////////////////////////////////\r
2 // MyDialog.cpp\r
3 \r
4 #include "stdafx.h"\r
5 #include "MyDialog.h"\r
6 #include "resource.h"\r
7 \r
8 \r
9 // Definitions for the CMyDialog class\r
10 CMyDialog::CMyDialog(UINT nResID, CWnd* pParent)\r
11         : CDialog(nResID, pParent)\r
12 {\r
13 }\r
14 \r
15 CMyDialog::~CMyDialog()\r
16 {\r
17 }\r
18 \r
19 BOOL CMyDialog::OnInitDialog()\r
20 {\r
21         // Set the Icon\r
22         SetIconLarge(IDW_MAIN);\r
23         SetIconSmall(IDW_MAIN);\r
24 \r
25         // Attach the dialog items to the CWnd objects\r
26         AttachItem(IDC_PROGRESS1, m_ProgressBar);\r
27         AttachItem(IDC_SCROLLBAR1, m_ScrollBar);\r
28         AttachItem(IDC_SLIDER1, m_Slider);\r
29 \r
30         return true;\r
31 }\r
32 \r
33 void CMyDialog::OnOK()\r
34 {\r
35         MessageBox(_T("OK Button Pressed.  Program will exit now."), _T("Button"), MB_OK);\r
36         CDialog::OnOK();\r
37 }\r
38 \r
39 void CMyDialog::SetProgress(int nPos)\r
40 {\r
41         m_ProgressBar.SetProgress(nPos);\r
42 }\r
43 \r
44 void CMyDialog::SetScroll(int nPos)\r
45 {\r
46         m_ScrollBar.SetScroll(nPos);\r
47 }\r
48 \r
49 void CMyDialog::SetSlider(int nPos)\r
50 {\r
51         m_Slider.SetPos(nPos, TRUE);\r
52 }\r
53 \r
54 void CMyDialog::SetStatic(BOOL IsSlider, int nPos)\r
55 {\r
56         CString str;\r
57         if (IsSlider)\r
58                 str.Format(_T("Slider Position %d"), nPos);\r
59         else\r
60                 str.Format(_T("Scroll Position %d"), nPos);\r
61 \r
62         // Set the text in the static control\r
63         SetDlgItemText(IDC_STATIC2, str);\r
64 }\r
65 \r

UCC git Repository :: git.ucc.asn.au