⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 skin.h

📁 著名的下载软件核心Shareaza
💻 H
字号:
//
// Skin.h
//
// Copyright (c) Shareaza Development Team, 2002-2004.
// This file is part of SHAREAZA (www.shareaza.com)
//
// Shareaza 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.
//
// Shareaza 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 Shareaza; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
//

#if !defined(AFX_SKIN_H__E4027F91_1EB1_4B0D_82E2_C8DD1E7F054F__INCLUDED_)
#define AFX_SKIN_H__E4027F91_1EB1_4B0D_82E2_C8DD1E7F054F__INCLUDED_

#pragma once

#include "CoolMenu.h"

class CCoolBarCtrl;
class CXMLElement;
class CSkinWindow;


class CSkin  
{
// Construction
public:
	CSkin();
	virtual ~CSkin();
	
// Operations
public:
	void	Apply();
	void	Clear();
	BOOL	LoadFromFile(LPCTSTR pszFile);
	BOOL	LoadFromResource(HINSTANCE hInstance, UINT nResourceID);
	BOOL	LoadFromString(const CString& strXML, const CString& strPath);
	BOOL	LoadFromXML(CXMLElement* pXML, const CString& strPath);
	BOOL	SelectCaption(CWnd* pWnd, int nIndex);
	BOOL	SelectCaption(CString& strCaption, int nIndex);
	void	DrawWrappedText(CDC* pDC, CRect* pBox, LPCTSTR pszText, BOOL bExclude = TRUE);
protected:
	void	ApplyRecursive(LPCTSTR pszPath);
	void	CreateDefault();
	void	Finalise();
	HBITMAP	LoadBitmap(CString& strName);

// Strings
public:
	BOOL	LoadString(CString& str, UINT nStringID);
protected:
	BOOL	LoadStrings(CXMLElement* pBase);
	CMap<UINT, UINT, CString, CString&>	m_pStrings;

// Menus
public:
	CMenu*	GetMenu(LPCTSTR pszName);
	UINT	TrackPopupMenu(LPCTSTR pszMenu, const CPoint& point, UINT nDefaultID = 0, UINT nFlags = 0);
	CMapStringToPtr	m_pMenus;
protected:
	BOOL	LoadMenus(CXMLElement* pBase);
	BOOL	LoadMenu(CXMLElement* pXML);
	BOOL	CreateMenu(CXMLElement* pXML, HMENU hMenu);
	CMenu	m_mnuDefault;
	
// Toolbars
public:
	BOOL	CreateToolBar(LPCTSTR pszName, CCoolBarCtrl* pBar);
	CMapStringToPtr m_pToolbars;
protected:
	BOOL	LoadToolbars(CXMLElement* pBase);
	BOOL	CreateToolBar(CXMLElement* pElement);

// Documents
public:
	CXMLElement*	GetDocument(LPCTSTR pszName);
protected:
	BOOL			LoadDocuments(CXMLElement* pBase);
	CMapStringToPtr	m_pDocuments;

// Watermarks
public:
	HBITMAP	GetWatermark(LPCTSTR pszName);
	BOOL	GetWatermark(CBitmap* pBitmap, LPCTSTR pszName);
protected:
	BOOL	LoadWatermarks(CXMLElement* pSub, const CString& strPath);
	CMapStringToString m_pWatermarks;

// Translate
public:
	BOOL	Translate(LPCTSTR pszName, CHeaderCtrl* pCtrl);
protected:
	BOOL	LoadListColumns(CXMLElement* pBase);
	CMapStringToString m_pLists;

// Dialogs
public:
	BOOL	Apply(LPCTSTR pszName, CDialog* pDialog, UINT nIconID = 0);
	CString	GetDialogCaption(LPCTSTR pszName);
protected:
	BOOL	LoadDialogs(CXMLElement* pBase);
	CMapStringToPtr		m_pDialogs;

// Window Skins
public:
	CSkinWindow*	GetWindowSkin(LPCTSTR pszWindow, LPCTSTR pszAppend = NULL);
	CSkinWindow*	GetWindowSkin(CWnd* pWnd);
protected:
	BOOL			LoadWindowSkins(CXMLElement* pSub, const CString& strPath);
	CPtrList		m_pSkins;

// Colour Scheme
public:
	COLORREF	m_crDialog;
	CBrush		m_brDialog;
	COLORREF	m_crPanelBack;
	CBitmap		m_bmPanelMark;
	COLORREF	m_crPanelText;
	COLORREF	m_crPanelBorder;
	COLORREF	m_crBannerBack;
	COLORREF	m_crBannerText;
	COLORREF	m_crSchemaRow[2];
protected:
	BOOL		LoadColourScheme(CXMLElement* pBase);

// Fonts
protected:
	CStringList	m_pFontPaths;
protected:
	BOOL		LoadFonts(CXMLElement* pBase, const CString& strPath);

// Other
protected:
	UINT	LookupCommandID(CXMLElement* pXML, LPCTSTR pszName = NULL);
	BOOL	LoadCommandMap(CXMLElement* pBase);
	BOOL	LoadCommandImages(CXMLElement* pBase, const CString& strPath);
	BOOL	LoadCommandBitmap(CXMLElement* pBase, const CString& strPath);

// Mode Suffixes
protected:
	static LPCTSTR m_pszModeSuffix[3][4];
	
};


extern CSkin Skin;

#endif // !defined(AFX_SKIN_H__E4027F91_1EB1_4B0D_82E2_C8DD1E7F054F__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -