| 1 |
// BuildOutputBarDlg.cpp : implementation file |
|---|
| 2 |
// |
|---|
| 3 |
|
|---|
| 4 |
#include "stdafx.h" |
|---|
| 5 |
#include "Elephant.h" |
|---|
| 6 |
#include "BuildOutputBarDlg.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 |
// CBuildOutputBarDlg dialog |
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
CBuildOutputBarDlg::CBuildOutputBarDlg(CWnd* pParent /*=NULL*/) |
|---|
| 19 |
: CDialog(CBuildOutputBarDlg::IDD, pParent) |
|---|
| 20 |
{ |
|---|
| 21 |
//{{AFX_DATA_INIT(CBuildOutputBarDlg) |
|---|
| 22 |
// NOTE: the ClassWizard will add member initialization here |
|---|
| 23 |
//}}AFX_DATA_INIT |
|---|
| 24 |
} |
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
void CBuildOutputBarDlg::DoDataExchange(CDataExchange* pDX) |
|---|
| 28 |
{ |
|---|
| 29 |
CDialog::DoDataExchange(pDX); |
|---|
| 30 |
//{{AFX_DATA_MAP(CBuildOutputBarDlg) |
|---|
| 31 |
DDX_Control(pDX, IDC_EDIT1, m_buildEdit); |
|---|
| 32 |
//}}AFX_DATA_MAP |
|---|
| 33 |
} |
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 |
BEGIN_MESSAGE_MAP(CBuildOutputBarDlg, CDialog) |
|---|
| 37 |
//{{AFX_MSG_MAP(CBuildOutputBarDlg) |
|---|
| 38 |
ON_WM_SIZE() |
|---|
| 39 |
ON_WM_KEYUP() |
|---|
| 40 |
//}}AFX_MSG_MAP |
|---|
| 41 |
END_MESSAGE_MAP() |
|---|
| 42 |
|
|---|
| 43 |
///////////////////////////////////////////////////////////////////////////// |
|---|
| 44 |
// CBuildOutputBarDlg message handlers |
|---|
| 45 |
|
|---|
| 46 |
void CBuildOutputBarDlg::OnSize(UINT nType, int cx, int cy) |
|---|
| 47 |
{ |
|---|
| 48 |
CDialog::OnSize(nType, cx, cy); |
|---|
| 49 |
|
|---|
| 50 |
m_buildEdit.MoveWindow(0,0,cx,cy); |
|---|
| 51 |
} |
|---|
| 52 |
|
|---|
| 53 |
BOOL CBuildOutputBarDlg::PreTranslateMessage(MSG* pMsg) |
|---|
| 54 |
{ |
|---|
| 55 |
// TODO: Add your specialized code here and/or call the base class |
|---|
| 56 |
|
|---|
| 57 |
return Globals::theApp.m_pMainWnd->PreTranslateMessage(pMsg); |
|---|
| 58 |
} |
|---|
| 59 |
|
|---|
| 60 |
BOOL CBuildOutputBarDlg::OnInitDialog() |
|---|
| 61 |
{ |
|---|
| 62 |
|
|---|
| 63 |
CDialog::OnInitDialog(); |
|---|
| 64 |
|
|---|
| 65 |
int size = atoi(Globals::settings->baseSettings->GetCache("buildOutputFontSize").c_str() ); |
|---|
| 66 |
string fontName = Globals::settings->baseSettings->GetCache("buildOutputFontName"); |
|---|
| 67 |
|
|---|
| 68 |
CFont font; |
|---|
| 69 |
font.CreateFont( |
|---|
| 70 |
size, // nHeight |
|---|
| 71 |
0, // nWidth |
|---|
| 72 |
0, // nEscapement |
|---|
| 73 |
0, // nOrientation |
|---|
| 74 |
FW_NORMAL, // nWeight |
|---|
| 75 |
FALSE, // bItalic |
|---|
| 76 |
FALSE, // bUnderline |
|---|
| 77 |
0, // cStrikeOut |
|---|
| 78 |
ANSI_CHARSET, // nCharSet |
|---|
| 79 |
OUT_DEFAULT_PRECIS, // nOutPrecision |
|---|
| 80 |
CLIP_DEFAULT_PRECIS, // nClipPrecision |
|---|
| 81 |
DEFAULT_QUALITY, // nQuality |
|---|
| 82 |
DEFAULT_PITCH | FF_SWISS, // nPitchAndFamily |
|---|
| 83 |
fontName.c_str()); // lpszFacename |
|---|
| 84 |
|
|---|
| 85 |
m_buildEdit.SetFont(&font,true); |
|---|
| 86 |
font.Detach(); |
|---|
| 87 |
|
|---|
| 88 |
return TRUE; // return TRUE unless you set the focus to a control |
|---|
| 89 |
// EXCEPTION: OCX Property Pages should return FALSE |
|---|
| 90 |
} |
|---|
| 91 |
|
|---|
| 92 |
void CBuildOutputBarDlg::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags) |
|---|
| 93 |
{ |
|---|
| 94 |
if ( nChar == VK_ESCAPE ) |
|---|
| 95 |
{ |
|---|
| 96 |
|
|---|
| 97 |
CMainFrame* m = (CMainFrame*)Globals::theApp.m_pMainWnd; |
|---|
| 98 |
if ( m ){ |
|---|
| 99 |
|
|---|
| 100 |
CElephantView* v = m->GetActiveView(); |
|---|
| 101 |
if ( v ) |
|---|
| 102 |
{ |
|---|
| 103 |
CScintillaCtrl& rCtrl = v->GetCtrl(); |
|---|
| 104 |
rCtrl.SetFocus(); |
|---|
| 105 |
} |
|---|
| 106 |
|
|---|
| 107 |
return; |
|---|
| 108 |
} |
|---|
| 109 |
|
|---|
| 110 |
|
|---|
| 111 |
|
|---|
| 112 |
} |
|---|
| 113 |
CDialog::OnKeyUp(nChar, nRepCnt, nFlags); |
|---|
| 114 |
} |
|---|