[83e312]: OptionsMisc.cpp Maximize Restore History

Download this file

OptionsMisc.cpp    125 lines (108 with data), 3.4 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
// OptionsMisc.cpp : implementation file
//
#include "stdafx.h"
#include "passwordsafe.h"
#include "corelib/PwsPlatform.h"
#include "corelib/Pwsprefs.h" // for DoubleClickAction enums
#if defined(POCKET_PC)
#include "pocketpc/resource.h"
#else
#include "resource.h"
#endif
#include "OptionsMisc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// COptionsMisc property page
IMPLEMENT_DYNCREATE(COptionsMisc, CPropertyPage)
COptionsMisc::COptionsMisc() : CPropertyPage(COptionsMisc::IDD)
{
//{{AFX_DATA_INIT(COptionsMisc)
//}}AFX_DATA_INIT
}
COptionsMisc::~COptionsMisc()
{
}
void COptionsMisc::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(COptionsMisc)
DDX_Check(pDX, IDC_CONFIRMDELETE, m_confirmdelete);
DDX_Check(pDX, IDC_SAVEIMMEDIATELY, m_saveimmediately);
DDX_Check(pDX, IDC_MAINTAINDATETIMESTAMPS, m_maintaindatetimestamps);
DDX_Check(pDX, IDC_ESC_EXITS, m_escexits);
DDX_Radio(pDX, IDC_DOUBLE_CLICK_COPIES, m_doubleclickaction); // only first!
DDX_Check(pDX, IDC_HOTKEY_ENABLE, m_hotkey_enabled);
// JHF class CHotKeyCtrl not defined under WinCE
#if !defined(POCKET_PC)
DDX_Control(pDX, IDC_HOTKEY_CTRL, m_hotkey);
#endif
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(COptionsMisc, CPropertyPage)
//{{AFX_MSG_MAP(COptionsMisc)
ON_BN_CLICKED(IDC_HOTKEY_ENABLE, OnEnableHotKey)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
BOOL COptionsMisc::OnInitDialog()
{
CPropertyPage::OnInitDialog();
CButton *pBCopyRB = (CButton *)GetDlgItem(IDC_DOUBLE_CLICK_COPIES);
CButton *pBEditRB = (CButton *)GetDlgItem(IDC_DOUBLE_CLICK_EDITS);
CButton *pAutoTypeRB = (CButton *)GetDlgItem(IDC_DOUBLE_CLICK_AUTOTYPES);
CButton *pBrowseRB = (CButton *)GetDlgItem(IDC_DOUBLE_CLICK_BROWSE);
switch (m_doubleclickaction) {
case PWSprefs::DoubleClickCopy:
pBCopyRB->SetCheck(1); pBEditRB->SetCheck(0);
pAutoTypeRB->SetCheck(0); pBrowseRB->SetCheck(0);
break;
case PWSprefs::DoubleClickEdit:
pBCopyRB->SetCheck(0); pBEditRB->SetCheck(1);
pAutoTypeRB->SetCheck(0); pBrowseRB->SetCheck(0);
break;
case PWSprefs::DoubleClickAutoType:
pBCopyRB->SetCheck(0); pBEditRB->SetCheck(0);
pAutoTypeRB->SetCheck(1); pBrowseRB->SetCheck(0);
break;
case PWSprefs::DoubleClickBrowse:
pBCopyRB->SetCheck(0); pBEditRB->SetCheck(0);
pAutoTypeRB->SetCheck(0); pBrowseRB->SetCheck(1);
break;
default:
ASSERT(0);
}
// JHF ditto here
#if !defined(POCKET_PC)
m_hotkey.SetHotKey(LOWORD(m_hotkey_value),HIWORD(m_hotkey_value));
if (m_hotkey_enabled == FALSE)
m_hotkey.EnableWindow(FALSE);
#endif
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// COptionsMisc message handlers
void COptionsMisc::OnEnableHotKey()
{
// JHF : no hotkeys on WinCE
#if !defined(POCKET_PC)
if (((CButton*)GetDlgItem(IDC_HOTKEY_ENABLE))->GetCheck() == 1)
GetDlgItem(IDC_HOTKEY_CTRL)->EnableWindow(TRUE);
else
GetDlgItem(IDC_HOTKEY_CTRL)->EnableWindow(FALSE);
#endif
}
void COptionsMisc::OnOK()
{
UpdateData(TRUE);
// JHF ditto
#if !defined(POCKET_PC)
WORD wVirtualKeyCode, wModifiers;
m_hotkey.GetHotKey(wVirtualKeyCode, wModifiers);
DWORD v = wVirtualKeyCode | (wModifiers << 16);
m_hotkey_value = v;
#endif
CPropertyPage::OnOK();
}