Click here to Skip to main content
15,886,049 members
Articles / Desktop Programming / MFC

Using Skins Without MFC

Rate me:
Please Sign up or sign in to vote.
5.00/5 (13 votes)
17 Jul 2001GPL32 min read 234K   12K   129  
A Simple Skinning Library
/* SkinStyle - Win32 Skinning Library 
 * Author: John Roark <jroark@cs.usfca.edu>
 */

/*
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/

// SkinDialog.h: interface for the SkinDialog class.
//
//////////////////////////////////////////////////////////////////////
#ifndef _SKINDIALOG_H_
#define _SKINDIALOG_H_

#include "SkinObject.h"
#include "SkinButton.h"
#include "IniFile.h"
#include "TransLabel.h"
#include "KToolTip.h"
#include "DynArray.h"
#include "Bitmap.h"

class SkinDialog : public SkinObject  
{
public:
	virtual void OnDraw(HDC hDC);
	void Free();
	virtual HWND CreateEx(LPCTSTR lpszName, int x, int y, HINSTANCE hInst, LPCTSTR lpszSkinFile);
	virtual BOOL OnButtonPressed(char *ButtonName) { return TRUE; }
	SkinDialog();
	virtual ~SkinDialog();

	
	void SetSticky(bool sticky) { _sticky = sticky; }
	virtual LRESULT WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);

private:
	BOOL m_Loading;
	char m_SkinPath[MAX_PATH];
	bool _has_focus;
	bool _sticky;

protected:
	void LoadStatic();
	void LoadButtons();
	Bitmap m_Disabled;
	Bitmap m_Over;
	Bitmap m_Selected;

	void LoadSkin(char *SkinFile);

	IniFile m_SkinFile;

	CDynArray< SkinButton > m_Buttons;
	CDynArray< TransLabel > m_Labels;
	CDynArray< KToolTip > m_ToolTips;
};

#endif // _SKINDIALOG_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.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


Written By
Software Developer (Senior)
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