Click here to Skip to main content
15,885,833 members
Articles / Desktop Programming / MFC

CKCSideBannerWnd: An MFC Banner Control that Can Add a Professional-looking Feel to Most Windows...

Rate me:
Please Sign up or sign in to vote.
4.94/5 (94 votes)
6 Nov 2003CPOL10 min read 357.7K   2.3K   138  
A CWnd-derived control that can attach itself to any window, without the programmer making provisions for it
// SideBannerDlg.h : header file
//

#if !defined(AFX_SIDEBANNERDLG_H__C18B421C_857A_453B_B0C1_A9E0C991B369__INCLUDED_)
#define AFX_SIDEBANNERDLG_H__C18B421C_857A_453B_B0C1_A9E0C991B369__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "KCSideBannerWnd.h"

/////////////////////////////////////////////////////////////////////////////
// CSideBannerDlg dialog

class CSideBannerDlg : public CDialog
{
// Construction
public:
	CSideBannerDlg(CWnd* pParent = NULL);	// standard constructor
	~CSideBannerDlg();

// Dialog Data
	//{{AFX_DATA(CSideBannerDlg)
	enum { IDD = IDD_SIDEBANNER_DIALOG };
	CComboBox	m_ctlVert;
	CComboBox	m_ctlHorz;
	int		m_bFillType;
	CString	m_strCaption;
	CString	m_strTitle;
	int		m_nCapOffsetX;
	int		m_nEdgeOffsetX;
	int		m_nCapOffsetY;
	int		m_nEdgeOffsetY;
	int		m_nBannerSize;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CSideBannerDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	void				SwapOffsetValues();

	HICON m_hIcon;
	CKCSideBannerWnd m_banner;
	unsigned int m_uFlags;
	HBRUSH m_hBrush;
	CFont m_fontTitle;
	CFont m_fontCaption;

	// Generated message map functions
	//{{AFX_MSG(CSideBannerDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnButtonTop();
	afx_msg void OnButtonLeft();
	afx_msg void OnButtonBottom();
	afx_msg void OnButtonRight();
	afx_msg void OnChangeEditCaption();
	afx_msg void OnChangeEditTitle();
	afx_msg void OnRadioFlat();
	afx_msg void OnRadioGradient();
	afx_msg void OnChangeEditCapoffset();
	afx_msg void OnChangeEditEdgeoffset();
	afx_msg void OnChangeEditBannersize();
	afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
	afx_msg void OnStaticCol1();
	afx_msg void OnStaticCol2();
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnSelchangeAlignment();
	afx_msg void OnRadioTexture();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_SIDEBANNERDLG_H__C18B421C_857A_453B_B0C1_A9E0C991B369__INCLUDED_)

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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
Ireland Ireland
Peter Mares has no comment on himself. I'll let the objective humanoids do the damage Wink | ;)
He is currently developing a hobby MMO to prove that he can do it Wink | ;)

My Blog

All good things were meant to be improved

Comments and Discussions