ARGH
[matches/honours.git] / research / transmission_spectroscopy / TOF / Win32++ / samples / DialogBars / src / Slider.cpp
1 //////////////////////////////////////////////\r
2 // MySlider.cpp\r
3 \r
4 #include "stdafx.h"\r
5 #include "Slider.h"\r
6 #include "DialogApp.h"\r
7 \r
8 void CMySlider::OnInitialUpdate()\r
9 {\r
10         // Called automatically via AttachDlgItem\r
11 \r
12         // Set a tic mark every ten units for the slider control\r
13         SetTicFreq(10);\r
14 }\r
15 \r
16 LRESULT CMySlider::OnMessageReflect(UINT uMsg, WPARAM wParam, LPARAM lParam)\r
17 {\r
18         UNREFERENCED_PARAMETER(wParam);\r
19         UNREFERENCED_PARAMETER(lParam);\r
20 \r
21         switch (uMsg)\r
22         {\r
23         case WM_HSCROLL:\r
24                 {\r
25                         // Get the slider bar position\r
26                         int nPos = GetPos();\r
27 \r
28                         // Get a reference to the MyDialog object\r
29                         CMyDialog& MyDialog = GetDialogApp().GetDialog();\r
30 \r
31                         MyDialog.SetProgress(nPos);             // Set the progress bar position\r
32                         MyDialog.SetScroll(nPos);               // Set the scroll bar position\r
33                         MyDialog.SetStatic(TRUE, nPos); // Set the static text\r
34                         break;\r
35                 }\r
36         }\r
37 \r
38         return 0;\r
39 }\r
40 \r
41 void CMySlider::SetSlider(int nPos)\r
42 {\r
43         // Set the slider position\r
44         //::SendMessage(m_hWnd, TBM_SETPOS, TRUE, nPos);\r
45         SetPos(nPos, TRUE);\r
46 }\r
47 \r

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