// FontPreviewDlg.cpp : implementation file
//
#include "stdafx.h"
#include "..//Solidgraph.h"
#include "FontPreviewDlgNew.h"
#include ".\fontpreviewdlgnew.h"
// CFontPreviewDlg dialog
IMPLEMENT_DYNAMIC(CFontPreviewDlg, CDialog)
CFontPreviewDlg::CFontPreviewDlg(CWnd* pParent /*=NULL*/)
: CDialog(CFontPreviewDlg::IDD, pParent)
{
}
CFontPreviewDlg::~CFontPreviewDlg()
{
}
void CFontPreviewDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_FONT_SYMB_LIST, m_symb_list);
DDX_Control(pDX, IDC_FONTS_NAMES_LIST, m_names_list);
}
BEGIN_MESSAGE_MAP(CFontPreviewDlg, CDialog)
ON_WM_SIZE()
ON_WM_CTLCOLOR()
ON_LBN_SELCHANGE(IDC_FONTS_NAMES_LIST, OnLbnSelchangeFontsNamesList)
END_MESSAGE_MAP()
// CFontPreviewDlg message handlers
void CFontPreviewDlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
if (::IsWindow(m_names_list.m_hWnd))
{
m_names_list.MoveWindow(3,3,100,cy-6);
m_symb_list.MoveWindow(106,3,cx-109,cy-6);
}
}
static DWORD GetTextExtent(HDC hDC, LPCSTR s, int len)
{
SIZE dim;
DWORD dw;
GetTextExtentPoint32(hDC, s, len, &dim);
dw = ((dim.cy << 16) & 0xFFFF0000)| dim.cx;
return dw;
}
BOOL CFontPreviewDlg::OnInitDialog()
{
CDialog::OnInitDialog();
/*
Only in register version
*/
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
HBRUSH CFontPreviewDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
// Call the base class implementation first! Otherwise, it may
// undo what we are trying to accomplish here.
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
int cID = pWnd->GetDlgCtrlID();
if (cID == IDC_FONT_SYMB_LIST)
return (HBRUSH)GetStockObject(GRAY_BRUSH);
return hbr;}
void CFontPreviewDlg::OnLbnSelchangeFontsNamesList()
{
/*
Only in register version
*/
}