| 1 |
#include "stdafx.h" |
| 2 |
#include "WinCS.h" |
| 3 |
#include "APIConsoleDlg.h" |
| 4 |
|
| 5 |
IMPLEMENT_DYNAMIC(CAPIConsoleDlg, CDialog) |
| 6 |
|
| 7 |
BEGIN_MESSAGE_MAP(CAPIConsoleDlg, CDialog) |
| 8 |
ON_BN_CLICKED(IDOK, &CAPIConsoleDlg::OnBnClickedOk) |
| 9 |
ON_WM_SIZE() |
| 10 |
ON_WM_CTLCOLOR() |
| 11 |
END_MESSAGE_MAP() |
| 12 |
|
| 13 |
////////////////////////////////////////////////////////////////////////// |
| 14 |
|
| 15 |
CAPIConsoleDlg::CAPIConsoleDlg(CWnd* pParent /*=NULL*/) |
| 16 |
: CDialog(CAPIConsoleDlg::IDD, pParent) |
| 17 |
{ |
| 18 |
m_hIcon = AfxGetApp()->LoadIcon(IDI_PLUGIN); |
| 19 |
} |
| 20 |
|
| 21 |
CAPIConsoleDlg::~CAPIConsoleDlg() |
| 22 |
{ |
| 23 |
} |
| 24 |
|
| 25 |
void CAPIConsoleDlg::DoDataExchange(CDataExchange* pDX) |
| 26 |
{ |
| 27 |
CDialog::DoDataExchange(pDX); |
| 28 |
DDX_Control(pDX, IDC_EDIT_API_CONSOLE_TEXT, m_xEditText); |
| 29 |
} |
| 30 |
|
| 31 |
BOOL CAPIConsoleDlg::OnInitDialog() |
| 32 |
{ |
| 33 |
CDialog::OnInitDialog(); |
| 34 |
|
| 35 |
SetIcon(m_hIcon, TRUE); |
| 36 |
SetIcon(m_hIcon, FALSE); |
| 37 |
|
| 38 |
m_xEditText.SetWindowText(STRING_EMPTY); |
| 39 |
|
| 40 |
return TRUE; |
| 41 |
} |
| 42 |
|
| 43 |
void CAPIConsoleDlg::OnSize(UINT nType, int cx, int cy) |
| 44 |
{ |
| 45 |
CDialog::OnSize(nType, cx, cy); |
| 46 |
|
| 47 |
CEdit *pEdit = (CEdit *)GetDlgItem(IDC_EDIT_API_CONSOLE_TEXT); |
| 48 |
|
| 49 |
if (pEdit != NULL) |
| 50 |
{ |
| 51 |
pEdit->MoveWindow(0, 0, cx, cy); |
| 52 |
} |
| 53 |
} |
| 54 |
|
| 55 |
HBRUSH CAPIConsoleDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) |
| 56 |
{ |
| 57 |
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor); |
| 58 |
int nCtlID = pWnd->GetDlgCtrlID(); |
| 59 |
|
| 60 |
switch (nCtlID) |
| 61 |
{ |
| 62 |
case IDC_EDIT_API_CONSOLE_TEXT: |
| 63 |
hbr = static_cast<HBRUSH>(GetStockObject(WHITE_BRUSH)); |
| 64 |
pDC->SetBkColor(RGB(255, 255, 255)); |
| 65 |
break; |
| 66 |
} |
| 67 |
|
| 68 |
return hbr; |
| 69 |
} |
| 70 |
|
| 71 |
////////////////////////////////////////////////////////////////////////// |