|
// XMonoFontListCombo.h
//
// Author: Hans Dietrich
// hdietrich@gmail.com
//
// License:
// This software is released into the public domain. You are free to use
// it in any way you like, except that you may not sell this source code.
//
// This software is provided "as is" with no expressed or implied warranty.
// I accept no liability for any damage or loss of business that this
// software may cause.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef XMONOFONTLISTCOMBO_H
#define XMONOFONTLISTCOMBO_H
#include "XMonoFontListComboEdit.h"
//=============================================================================
class CXMonoFontListCombo : public CComboBox
//=============================================================================
{
// Construction
public:
CXMonoFontListCombo();
virtual ~CXMonoFontListCombo();
// Attributes
public:
CDC * m_pDC;
DWORD m_dwFontFilter;
CXMonoFontListComboEdit m_edit;
CXMonoFontListCombo& SetBold(BOOL bBold)
{
if (IsWindow(m_edit.m_hWnd))
{
m_edit.SetBold(bBold);
m_edit.RedrawWindow();
}
return *this;
}
CXMonoFontListCombo& SetFont(LOGFONT& lf);
CXMonoFontListCombo& SetFontFilter(DWORD dwFontFilter)
{ m_dwFontFilter = dwFontFilter; return *this; }
CXMonoFontListCombo& ShowMonospacedAsBold(BOOL bShow)
{ m_bShowMonospacedAsBold = bShow; return *this; }
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CXMonoFontListCombo)
public:
virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
protected:
virtual void PreSubclassWindow();
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL
// Implementation
protected:
CImageList m_FontType;
CFont m_BoldFont;
BOOL m_bShowMonospacedAsBold;
LOGFONT m_lfInitial;
LOGFONT m_lfCurrent;
int m_CurIndex;
void CreateFontTypeImages();
// Generated message map functions
protected:
//{{AFX_MSG(CXMonoFontListCombo)
afx_msg void OnTimer(UINT nIDEvent);
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif //XMONOFONTLISTCOMBO_H
|
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.
I attended St. Michael's College of the University of Toronto, with the intention of becoming a priest. A friend in the University's Computer Science Department got me interested in programming, and I have been hooked ever since.
Recently, I have moved to Los Angeles where I am doing consulting and development work.
For consulting and custom software development, please see
www.hdsoft.org.