Click here to Skip to main content
15,891,902 members
Articles / Desktop Programming / MFC

"Skinned" UI control library (VC++)

Rate me:
Please Sign up or sign in to vote.
3.74/5 (8 votes)
27 Mar 2007CPOL4 min read 90.2K   15K   71  
This article demonstrates how to leverage the power of images and inheritance to achieve a "skinned" look for your Windows applications.
#if !defined(AFX_EDITDLG_H__EE03A544_57BC_47A5_9368_753A107949C1__INCLUDED_)
#define AFX_EDITDLG_H__EE03A544_57BC_47A5_9368_753A107949C1__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// EditDlg.h : header file
//

#include "..\..\Common\UIClasses\SkinnedEdit.h"

#define ID_EDIT	6800
/////////////////////////////////////////////////////////////////////////////
// CEditDlg dialog

class CEditDlg : public CDialog
{
// Construction
public:
	void SetEditControlType(UINT nType);
	CEditDlg(CWnd* pParent = NULL);   // standard constructor
	void SetEditControlProperties(CSkinnedEdit& SkinnedEditControl);

// Dialog Data
	//{{AFX_DATA(CEditDlg)
	enum { IDD = IDD_EDIT_DIALOG };
		// NOTE: the ClassWizard will add data members here
	//}}AFX_DATA


// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CEditDlg)
	public:
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	CString m_csEditText;
	CSkinnedEdit m_Edit;

	// Generated message map functions
	//{{AFX_MSG(CEditDlg)
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnPaint();
	afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

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

#endif // !defined(AFX_EDITDLG_H__EE03A544_57BC_47A5_9368_753A107949C1__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
CEO IDYeah Creations
India India
My company: http://www.idyeah.com
My blog: http://blog.idyeah.com

Comments and Discussions