| 1 |
// EventsPage.cpp : implementation file |
|---|
| 2 |
// |
|---|
| 3 |
|
|---|
| 4 |
#include "stdafx.h" |
|---|
| 5 |
#include "Elephant.h" |
|---|
| 6 |
#include "EventsPage.h" |
|---|
| 7 |
|
|---|
| 8 |
#ifdef _DEBUG |
|---|
| 9 |
#define new DEBUG_NEW |
|---|
| 10 |
#undef THIS_FILE |
|---|
| 11 |
static char THIS_FILE[] = __FILE__; |
|---|
| 12 |
#endif |
|---|
| 13 |
|
|---|
| 14 |
///////////////////////////////////////////////////////////////////////////// |
|---|
| 15 |
// CEventsPage dialog |
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
CEventsPage::CEventsPage(CWnd* pParent /*=NULL*/) |
|---|
| 19 |
|
|---|
| 20 |
{ |
|---|
| 21 |
//{{AFX_DATA_INIT(CEventsPage) |
|---|
| 22 |
m_startup = _T(Globals::settings->scriptSettings->GetCache("onStartup").c_str() ); |
|---|
| 23 |
m_close = _T(Globals::settings->scriptSettings->GetCache("onclos").c_str() ); |
|---|
| 24 |
m_fileOpen = _T(Globals::settings->scriptSettings->GetCache("onFileOpen").c_str()); |
|---|
| 25 |
m_fileClose = _T(Globals::settings->scriptSettings->GetCache("onFileClose").c_str()); |
|---|
| 26 |
m_doubleClick = _T(Globals::settings->scriptSettings->GetCache("onDoubleClick").c_str()); |
|---|
| 27 |
//}}AFX_DATA_INIT |
|---|
| 28 |
} |
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
void CEventsPage::DoDataExchange(CDataExchange* pDX) |
|---|
| 32 |
{ |
|---|
| 33 |
CDialog::DoDataExchange(pDX); |
|---|
| 34 |
//{{AFX_DATA_MAP(CEventsPage) |
|---|
| 35 |
DDX_Control(pDX, IDC_BUTTON5, m_b3); |
|---|
| 36 |
DDX_Control(pDX, IDC_BUTTON8, m_b5); |
|---|
| 37 |
DDX_Control(pDX, IDC_BUTTON7, m_b4); |
|---|
| 38 |
DDX_Control(pDX, IDC_BUTTON3, m_b2); |
|---|
| 39 |
DDX_Control(pDX, IDC_BUTTON1, m_b1); |
|---|
| 40 |
DDX_Text(pDX, IDC_EDIT1, m_startup); |
|---|
| 41 |
DDX_Text(pDX, IDC_EDIT2, m_close); |
|---|
| 42 |
DDX_Text(pDX, IDC_EDIT4, m_fileOpen); |
|---|
| 43 |
DDX_Text(pDX, IDC_EDIT5, m_fileClose); |
|---|
| 44 |
DDX_Text(pDX, IDC_EDIT6, m_doubleClick); |
|---|
| 45 |
//}}AFX_DATA_MAP |
|---|
| 46 |
} |
|---|
| 47 |
|
|---|
| 48 |
|
|---|
| 49 |
BEGIN_MESSAGE_MAP(CEventsPage, CDialog) |
|---|
| 50 |
//{{AFX_MSG_MAP(CEventsPage) |
|---|
| 51 |
ON_BN_CLICKED(IDC_BUTTON1, OnButton1) |
|---|
| 52 |
ON_BN_CLICKED(IDC_BUTTON3, OnButton3) |
|---|
| 53 |
ON_BN_CLICKED(IDC_BUTTON5, OnButton5) |
|---|
| 54 |
ON_BN_CLICKED(IDC_BUTTON7, OnButton7) |
|---|
| 55 |
ON_BN_CLICKED(IDC_BUTTON8, OnButton8) |
|---|
| 56 |
//}}AFX_MSG_MAP |
|---|
| 57 |
END_MESSAGE_MAP() |
|---|
| 58 |
|
|---|
| 59 |
///////////////////////////////////////////////////////////////////////////// |
|---|
| 60 |
// CEventsPage message handlers |
|---|
| 61 |
|
|---|
| 62 |
BOOL CEventsPage::OnInitDialog() |
|---|
| 63 |
{ |
|---|
| 64 |
CDialog::OnInitDialog(); |
|---|
| 65 |
|
|---|
| 66 |
SetupButton(&m_b1); |
|---|
| 67 |
SetupButton(&m_b2); |
|---|
| 68 |
SetupButton(&m_b3); |
|---|
| 69 |
SetupButton(&m_b4); |
|---|
| 70 |
SetupButton(&m_b5); |
|---|
| 71 |
|
|---|
| 72 |
return TRUE; // return TRUE unless you set the focus to a control |
|---|
| 73 |
// EXCEPTION: OCX Property Pages should return FALSE |
|---|
| 74 |
} |
|---|
| 75 |
|
|---|
| 76 |
void CEventsPage::OnButton1() |
|---|
| 77 |
{ |
|---|
| 78 |
string x; |
|---|
| 79 |
if ( GetFileFromCFileDialog(Globals::lastDir, x) ) |
|---|
| 80 |
{ |
|---|
| 81 |
m_startup = x.c_str(); |
|---|
| 82 |
UpdateData(FALSE); |
|---|
| 83 |
} |
|---|
| 84 |
|
|---|
| 85 |
} |
|---|
| 86 |
|
|---|
| 87 |
void CEventsPage::OnButton3() |
|---|
| 88 |
{ |
|---|
| 89 |
string x; |
|---|
| 90 |
if ( GetFileFromCFileDialog(Globals::lastDir, x) ) |
|---|
| 91 |
{ |
|---|
| 92 |
m_close = x.c_str(); |
|---|
| 93 |
UpdateData(FALSE); |
|---|
| 94 |
} |
|---|
| 95 |
|
|---|
| 96 |
} |
|---|
| 97 |
|
|---|
| 98 |
void CEventsPage::OnButton5() |
|---|
| 99 |
{ |
|---|
| 100 |
string x; |
|---|
| 101 |
if ( GetFileFromCFileDialog(Globals::lastDir, x) ) |
|---|
| 102 |
{ |
|---|
| 103 |
m_fileOpen = x.c_str(); |
|---|
| 104 |
UpdateData(FALSE); |
|---|
| 105 |
} |
|---|
| 106 |
} |
|---|
| 107 |
|
|---|
| 108 |
void CEventsPage::OnButton7() |
|---|
| 109 |
{ |
|---|
| 110 |
string x; |
|---|
| 111 |
if ( GetFileFromCFileDialog(Globals::lastDir, x) ) |
|---|
| 112 |
{ |
|---|
| 113 |
m_fileClose= x.c_str(); |
|---|
| 114 |
UpdateData(FALSE); |
|---|
| 115 |
} |
|---|
| 116 |
} |
|---|
| 117 |
|
|---|
| 118 |
void CEventsPage::OnButton8() |
|---|
| 119 |
{ |
|---|
| 120 |
string x; |
|---|
| 121 |
if ( GetFileFromCFileDialog(Globals::lastDir, x) ) |
|---|
| 122 |
{ |
|---|
| 123 |
m_doubleClick= x.c_str(); |
|---|
| 124 |
UpdateData(FALSE); |
|---|
| 125 |
} |
|---|
| 126 |
|
|---|
| 127 |
} |
|---|