Scope
MainDlgView.cpp
1 #include "stdafx.h"
2 #include "MainDlgView.h"
3 
4 namespace scope {
5  namespace gui {
6 
8  : m_ScanSingleButton(&scope_controller.StartSingleButton)
9  , m_ScanLiveButton(&scope_controller.StartLiveButton)
10  , m_StopButton(&scope_controller.StopButton)
11  , m_QuitButton(&scope_controller.QuitButton)
12 {}
13 
14 CMainDlgView::~CMainDlgView() {
15  DBOUT(L"CMainDlgView::~CMainDlgView()\n");
16 
17 }
18 
19 BOOL CMainDlgView::OnInitDialog(CWindow wndFocus, LPARAM lInitParam) {
20  // Replace placeholder with scan settings property sheet
21  HWND hWndPlaceHolder = GetDlgItem(IDC_SCANSETTINGS_HOLDER);
22  ::ShowWindow(hWndPlaceHolder, FALSE);
23  CRect rc;
24  ::GetWindowRect(hWndPlaceHolder, &rc);
25  ScreenToClient(&rc);
26  m_sheetScanSettings.Create(m_hWnd, 0, rc);
27 
28  // Replace placeholder with experiment settings property sheet
29  hWndPlaceHolder = GetDlgItem(IDC_EXPERIMENTSETTINGS_HOLDER);
30  ::ShowWindow(hWndPlaceHolder, FALSE);
31  ::GetWindowRect(hWndPlaceHolder, &rc);
32  ScreenToClient(&rc);
33  m_sheetExperimentSettings.Create(m_hWnd, 0, rc);
34 
35  // Attach buttons to controls
36  m_ScanLiveButton.AttachToDlgItem(GetDlgItem(ID_SCAN_CONT));
37  m_ScanSingleButton.AttachToDlgItem(GetDlgItem(IDC_SCAN_SINGLE));
38  m_StopButton.AttachToDlgItem(GetDlgItem(ID_STOP));
39  m_QuitButton.AttachToDlgItem(GetDlgItem(IDC_QUIT));
40 
41  return 0;
42 }
43 
44 BOOL CMainDlgView::PreTranslateMessage(MSG* pMsg) {
45  pMsg;
46  return FALSE;
47 }
48 
49  }}
HWND Create(const HWND hWndParent, const int nStartPage, const CRect &rc)
Adds all the settingspages.
CExperimentSettingsSheet m_sheetExperimentSettings
the settings sheet for the different scan modes
Definition: MainDlgView.h:24
BOOL OnInitDialog(CWindow wndFocus, LPARAM lInitParam)
Replace placeholders with property sheets (for scan settings and experiment settings) ...
Definition: MainDlgView.cpp:19
CMainDlgView()
Attach buttons to ScopeController.
Definition: MainDlgView.cpp:7
This is the include file for standard system include files, or project specific include files that ar...
CScopeButtonCtrl m_QuitButton
to quit the application
Definition: MainDlgView.h:36
#define DBOUT(s)
A debug output to the debug console.
Definition: helpers.h:153
CScopeButtonCtrl m_ScanSingleButton
to start single frame scan
Definition: MainDlgView.h:30
HWND Create(const HWND hWndParent, const int nStartPage, const CRect &rc)
Adds the pages and do some magic.
CScopeButtonCtrl m_ScanLiveButton
to start live scanning
Definition: MainDlgView.h:27
CScopeButtonCtrl m_StopButton
to stop whatever scanning
Definition: MainDlgView.h:33
CScanSettingsSheet m_sheetScanSettings
the settings sheet with all the stuff
Definition: MainDlgView.h:21
bool AttachToDlgItem(HWND hWnd)
Attach the control to a dialog item.