SourceCode/PROMS/FONTS/Size Project/src/XMonoFontListCombo.h

91 lines
2.4 KiB
C++

// 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