Scope
StorageSettingsPage.cpp
1 #include "StdAfx.h"
2 #include "StorageSettingsPage.h"
3 
4 namespace scope {
5  namespace gui {
6 
7 CStorageSettingsPage::CStorageSettingsPage()
8  : folder_edit(&scope_controller.GuiParameters.storage.folder, true, true)
9  , autosave_checkbox(&scope_controller.GuiParameters.storage.autosave, true, true)
10  , savelive_checkbox(&scope_controller.GuiParameters.storage.savelive, true, true)
11  , usetifftags_checkbox(&scope_controller.GuiParameters.storage.usetifftags, true, true)
12  , compresstiff_checkbox(&scope_controller.GuiParameters.storage.compresstiff, true, true) {
13 }
14 
15 BOOL CStorageSettingsPage::OnInitDialog(CWindow wndFocus, LPARAM lInitParam) {
16  folder_edit.AttachToDlgItem(GetDlgItem(IDC_FOLDER_TEXT));
17  autosave_checkbox.AttachToDlgItem(GetDlgItem(IDC_AUTOSAVE_CHECK));
18  savelive_checkbox.AttachToDlgItem(GetDlgItem(IDC_SAVELIVE_CHECK));
19  usetifftags_checkbox.AttachToDlgItem(GetDlgItem(IDC_USETIFFTAGS));
20  compresstiff_checkbox.AttachToDlgItem(GetDlgItem(IDC_COMPRESSTIFF));
21 
22  SetMsgHandled(false);
23  return 0;
24 }
25 
26 LRESULT CStorageSettingsPage::OnFolderButton(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) {
27  CFolderDialog dlgFolder(NULL, L"Pick a folder", BIF_RETURNONLYFSDIRS);
28 
29  // Open folder dialog and save result into GuiParameters
30  if ( dlgFolder.DoModal() == IDOK )
31  scope_controller.GuiParameters.storage.folder = std::wstring(dlgFolder.m_szFolderPath);
32 
33  return 0;
34 }
35 
36 }}
CScopeCheckBoxCtrl compresstiff_checkbox
Checkbox for compress tiff option.
bool AttachToDlgItem(HWND hWnd)
Attach the control to a dialog item.
Definition: ScopeEditCtrl.h:68
scope::ScopeController scope_controller
scope controller
CScopeEditCtrl< std::wstring > folder_edit
Edit control for storage folder.
Storage storage
the StorageParameters
Definition: Scope.h:234
LRESULT OnFolderButton(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled)
Opens dialog for folder choosing.
ScopeString folder
folder to Save into
Definition: Storage.h:25
This is the include file for standard system include files, or project specific include files that ar...
CScopeCheckBoxCtrl savelive_checkbox
Checkbox for save live option.
bool AttachToDlgItem(HWND hWnd)
Attach the control to a dialog item.
BOOL OnInitDialog(CWindow wndFocus, LPARAM lInitParam)
Handles dialog initialization.
CScopeCheckBoxCtrl usetifftags_checkbox
Checkbox for use tiff tags option.
CScopeCheckBoxCtrl autosave_checkbox
Checkbox for automatic save option.
static parameters::Scope GuiParameters
The complete pseudo-global parameter set of the microscope.