| 1 |
// ProjectFilesComboBox.cpp : implementation file |
|---|
| 2 |
// |
|---|
| 3 |
|
|---|
| 4 |
#include "stdafx.h" |
|---|
| 5 |
#include "Elephant.h" |
|---|
| 6 |
#include "ProjectFilesComboBox.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 |
// CProjectFilesComboBox |
|---|
| 16 |
|
|---|
| 17 |
CProjectFilesComboBox::CProjectFilesComboBox() |
|---|
| 18 |
{ |
|---|
| 19 |
} |
|---|
| 20 |
|
|---|
| 21 |
CProjectFilesComboBox::~CProjectFilesComboBox() |
|---|
| 22 |
{ |
|---|
| 23 |
} |
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
BEGIN_MESSAGE_MAP(CProjectFilesComboBox, CComboBoxSuper) |
|---|
| 27 |
//{{AFX_MSG_MAP(CProjectFilesComboBox) |
|---|
| 28 |
ON_CONTROL_REFLECT(CBN_SELCHANGE, OnSelchange) |
|---|
| 29 |
ON_WM_KEYUP() |
|---|
| 30 |
//}}AFX_MSG_MAP |
|---|
| 31 |
END_MESSAGE_MAP() |
|---|
| 32 |
|
|---|
| 33 |
///////////////////////////////////////////////////////////////////////////// |
|---|
| 34 |
// CProjectFilesComboBox message handlers |
|---|
| 35 |
|
|---|
| 36 |
void CProjectFilesComboBox::OnSelchange() |
|---|
| 37 |
{ |
|---|
| 38 |
|
|---|
| 39 |
if ( !Globals::currentProject ) return; |
|---|
| 40 |
int sel = GetCurSel(); |
|---|
| 41 |
|
|---|
| 42 |
CString file; |
|---|
| 43 |
GetLBText(sel,file); |
|---|
| 44 |
|
|---|
| 45 |
|
|---|
| 46 |
string fileOpen = Globals::currentProject->PathForFile(file.GetBuffer(0)); |
|---|
| 47 |
|
|---|
| 48 |
Globals::theApp.OpenFile(fileOpen); |
|---|
| 49 |
|
|---|
| 50 |
CMainFrame* mf = static_cast<CMainFrame*>(Globals::theApp.m_pMainWnd); |
|---|
| 51 |
mf->SetStatusBarText(fileOpen.c_str()); |
|---|
| 52 |
|
|---|
| 53 |
|
|---|
| 54 |
} |
|---|
| 55 |
|
|---|
| 56 |
void CProjectFilesComboBox::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags) |
|---|
| 57 |
{ |
|---|
| 58 |
if ( nChar == VK_ESCAPE ) |
|---|
| 59 |
{ |
|---|
| 60 |
|
|---|
| 61 |
CMainFrame* m = (CMainFrame*)Globals::theApp.m_pMainWnd; |
|---|
| 62 |
if ( m ){ |
|---|
| 63 |
|
|---|
| 64 |
CElephantView* v = m->GetActiveView(); |
|---|
| 65 |
if ( v ) |
|---|
| 66 |
{ |
|---|
| 67 |
CScintillaCtrl& rCtrl = v->GetCtrl(); |
|---|
| 68 |
rCtrl.SetFocus(); |
|---|
| 69 |
} |
|---|
| 70 |
|
|---|
| 71 |
return; |
|---|
| 72 |
} |
|---|
| 73 |
|
|---|
| 74 |
|
|---|
| 75 |
|
|---|
| 76 |
} |
|---|
| 77 |
|
|---|
| 78 |
CComboBoxSuper::OnKeyUp(nChar, nRepCnt, nFlags); |
|---|
| 79 |
|
|---|
| 80 |
} |
|---|