| 1 |
// BehaviorPage.cpp : implementation file |
|---|
| 2 |
// |
|---|
| 3 |
|
|---|
| 4 |
#include "stdafx.h" |
|---|
| 5 |
#include "Elephant.h" |
|---|
| 6 |
#include "BehaviorPage.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 |
// CBehaviorPage dialog |
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
CBehaviorPage::CBehaviorPage(CWnd* pParent /*=NULL*/) |
|---|
| 19 |
|
|---|
| 20 |
{ |
|---|
| 21 |
//{{AFX_DATA_INIT(CBehaviorPage) |
|---|
| 22 |
m_useAC = Globals::settings->baseSettings->GetCache("m_useAC") == "1"; |
|---|
| 23 |
m_restoreSessionFiles = Globals::settings->baseSettings->GetCache("m_restoreSessionFiles") == "1"; |
|---|
| 24 |
m_showToolTips = Globals::settings->baseSettings->GetCache("m_showToolTips") == "1"; |
|---|
| 25 |
m_showImportAC = Globals::settings->baseSettings->GetCache("m_showImportAC") == "1"; |
|---|
| 26 |
m_showScopeTips = Globals::settings->baseSettings->GetCache("m_showScopeTips") == "1"; |
|---|
| 27 |
m_fileTemplate = _T(Globals::settings->baseSettings->GetCache("fileTemplate").c_str()); |
|---|
| 28 |
m_name = _T(Globals::settings->baseSettings->GetCache("name").c_str()); |
|---|
| 29 |
m_csProjectLocation = _T(Globals::settings->baseSettings->GetCache("m_projectLocation").c_str()); |
|---|
| 30 |
m_closeAddonFiles = Globals::settings->baseSettings->GetCache("m_closeAddonFiles") == "1"; |
|---|
| 31 |
m_compilerAutoShow = Globals::settings->baseSettings->GetCache("m_compilerAutoShow") == "1"; |
|---|
| 32 |
m_useAbbreviations = Globals::settings->baseSettings->GetCache("m_useAbbreviations") == "1"; |
|---|
| 33 |
//}}AFX_DATA_INIT |
|---|
| 34 |
} |
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 |
void CBehaviorPage::DoDataExchange(CDataExchange* pDX) |
|---|
| 38 |
{ |
|---|
| 39 |
CDialog::DoDataExchange(pDX); |
|---|
| 40 |
//{{AFX_DATA_MAP(CBehaviorPage) |
|---|
| 41 |
DDX_Control(pDX, IDC_BUTTON12, m_b2); |
|---|
| 42 |
DDX_Control(pDX, IDC_EDIT7, m_projectLocation); |
|---|
| 43 |
DDX_Control(pDX, IDC_STATIC2, m_title2); |
|---|
| 44 |
DDX_Control(pDX, IDC_STATIC1, m_title1); |
|---|
| 45 |
DDX_Control(pDX, IDC_BUTTON1, m_b); |
|---|
| 46 |
DDX_Check(pDX, IDC_CHECK1, m_useAC); |
|---|
| 47 |
DDX_Check(pDX, IDC_CHECK3, m_restoreSessionFiles); |
|---|
| 48 |
DDX_Check(pDX, IDC_CHECK4, m_showToolTips); |
|---|
| 49 |
DDX_Check(pDX, IDC_CHECK5, m_showImportAC); |
|---|
| 50 |
DDX_Check(pDX, IDC_CHECK19, m_showScopeTips); |
|---|
| 51 |
DDX_Check(pDX, IDC_CHECK20, m_closeAddonFiles); |
|---|
| 52 |
|
|---|
| 53 |
DDX_Check(pDX, IDC_CHECK2, m_compilerAutoShow); |
|---|
| 54 |
DDX_Check(pDX, IDC_CHECK24, m_useAbbreviations); |
|---|
| 55 |
|
|---|
| 56 |
DDX_Text(pDX, IDC_EDIT1, m_fileTemplate); |
|---|
| 57 |
DDX_Text(pDX, IDC_EDIT2, m_name); |
|---|
| 58 |
DDX_Text(pDX, IDC_EDIT7, m_csProjectLocation); |
|---|
| 59 |
//}}AFX_DATA_MAP |
|---|
| 60 |
} |
|---|
| 61 |
|
|---|
| 62 |
|
|---|
| 63 |
BEGIN_MESSAGE_MAP(CBehaviorPage, CDialog) |
|---|
| 64 |
//{{AFX_MSG_MAP(CBehaviorPage) |
|---|
| 65 |
ON_BN_CLICKED(IDC_BUTTON1,OnButton1) |
|---|
| 66 |
ON_BN_CLICKED(IDC_BUTTON12, OnBrowse2) |
|---|
| 67 |
//}}AFX_MSG_MAP |
|---|
| 68 |
END_MESSAGE_MAP() |
|---|
| 69 |
|
|---|
| 70 |
///////////////////////////////////////////////////////////////////////////// |
|---|
| 71 |
// CBehaviorPage message handlers |
|---|
| 72 |
|
|---|
| 73 |
BOOL CBehaviorPage::OnInitDialog() |
|---|
| 74 |
{ |
|---|
| 75 |
CDialog::OnInitDialog(); |
|---|
| 76 |
|
|---|
| 77 |
SetupButton(&m_b); |
|---|
| 78 |
SetupButton(&m_b2); |
|---|
| 79 |
// |
|---|
| 80 |
// SetupTitle(&m_title1); |
|---|
| 81 |
// SetupTitle(&m_title2); |
|---|
| 82 |
|
|---|
| 83 |
return TRUE; // return TRUE unless you set the focus to a control |
|---|
| 84 |
// EXCEPTION: OCX Property Pages should return FALSE |
|---|
| 85 |
} |
|---|
| 86 |
|
|---|
| 87 |
void CBehaviorPage::OnButton1() |
|---|
| 88 |
{ |
|---|
| 89 |
string file = ""; |
|---|
| 90 |
if ( GetFileFromCFileDialog(Globals::lastDir,file,"d","D Source Files(*.d)|*.d",this)) |
|---|
| 91 |
{ |
|---|
| 92 |
m_fileTemplate = file.c_str(); |
|---|
| 93 |
UpdateData(FALSE); |
|---|
| 94 |
} |
|---|
| 95 |
|
|---|
| 96 |
|
|---|
| 97 |
|
|---|
| 98 |
|
|---|
| 99 |
} |
|---|
| 100 |
|
|---|
| 101 |
void CBehaviorPage::OnBrowse2() |
|---|
| 102 |
{ |
|---|
| 103 |
CDirDialog fd; |
|---|
| 104 |
if ( fd.DoBrowse() ) |
|---|
| 105 |
{ |
|---|
| 106 |
m_csProjectLocation = fd.m_strPath; |
|---|
| 107 |
UpdateData(FALSE); |
|---|
| 108 |
|
|---|
| 109 |
} |
|---|
| 110 |
|
|---|
| 111 |
} |
|---|