Click here to Skip to main content
15,879,535 members
Articles / Desktop Programming / MFC

SolidGraph CAD System

Rate me:
Please Sign up or sign in to vote.
4.97/5 (78 votes)
12 Sep 20062 min read 375K   29.8K   209  
A SolidGraph CAD system source code.
// 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
	*/
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions