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
|
// HotKeyDlg.cpp : implementation file
//
#include "stdafx.h"
#include "SelectionEditor.h"
#include "HotKeyDlg.h"
#include ".\hotkeydlg.h"
#include "datastore.h"
#include "sourcedlg.h"
using namespace std;
// CHotKeyDlg dialog
IMPLEMENT_DYNAMIC(CHotKeyDlg, CDialog)
CHotKeyDlg::CHotKeyDlg(CWnd* pParent /*=NULL*/)
: CDialog(CHotKeyDlg::IDD, pParent)
{
// hotkey.SetLimitText(1);
}
CHotKeyDlg::~CHotKeyDlg()
{
}
void CHotKeyDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_EDIT1, hotkey);
DDX_Control(pDX, IDC_CHECK1, shiftKey);
DDX_Control(pDX, IDC_CHECK2, ctrlKey);
DDX_Control(pDX, IDC_CHECK3, altKey);
}
BEGIN_MESSAGE_MAP(CHotKeyDlg, CDialog)
ON_BN_CLICKED(IDOK, OnBnClickedOk)
END_MESSAGE_MAP()
// CHotKeyDlg message handlers
void CHotKeyDlg::OnBnClickedOk()
{
UpdateData(0);
string s;
if(shiftKey.GetCheck())
s+="Shift_";
if(ctrlKey.GetCheck())
s+="Control_";
if(altKey.GetCheck())
s+="Alt_";
char buf[10];
hotkey.GetLine(0,buf,10);
s+=buf;
datastore.curKey=s;
CSourceDlg dlg;
INT_PTR nResponse = dlg.DoModal();
OnOK();
}
|