MenuSpawn.h
资源名称:GGBT.rar [点击查看]
上传用户:lds876
上传日期:2013-05-25
资源大小:567k
文件大小:3k
源码类别:
P2P编程
开发平台:
Visual C++
- // MenuSpawn.h: interface for the CMenuSpawn class.
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_MENUSPAWN_H__BB6F2F01_91FA_11D1_8B78_0000B43382FE__INCLUDED_)
- #define AFX_MENUSPAWN_H__BB6F2F01_91FA_11D1_8B78_0000B43382FE__INCLUDED_
- #if _MSC_VER >= 1000
- #pragma once
- #endif // _MSC_VER >= 1000
- class CMenuSpawn
- {
- public:
- struct ToolBarData
- { // struct for toolbar resource; guess you already know it ;)
- WORD wVersion;
- WORD wWidth;
- WORD wHeight;
- WORD wItemCount;
- };
- struct SpawnItem
- {
- int iImageIdx;
- int iCmd;
- char cText[128];
- };
- struct ImageItem
- {
- int iImageIdx;
- int iCmd;
- };
- public:
- void RemapMenuEx(CMenu * pMenu);
- bool Create(unsigned int bmpId, unsigned int bmpDisabledId, int iCount, ULONG lMenuCmdID[]);
- bool IsSpawnMenu(CMenu * pMenu, const int iItem, const bool bByPos);
- bool GetMenuItemText(CString &csText, CMenu * pMenu, const int cmd, bool bByPos);
- void TransparentBlt(CDC * pDestDc, int x, int y, int w, int h, CBitmap * pBmp, int sx, int sy, COLORREF crTransparent);
- void SetBackBitmap(const int iRes, COLORREF crBackColor);
- void SetBackBitmap(const int iRes);
- void SetTextColor(const COLORREF crNormal, const COLORREF crSelected);
- bool FindKeyboardShortcut(UINT nChar, UINT nFlags, CMenu * pMenu, LRESULT &lRes);
- bool SetFont(LOGFONT * lf);
- CSize szImage;
- bool MeasureItem(LPMEASUREITEMSTRUCT lpm);
- bool DrawItem(LPDRAWITEMSTRUCT lp);
- int FindImageItem(const int cmd);
- SpawnItem * AddSpawnItem(const char * txt, const int cmd);
- void AddImageItem(const int idx, WORD cmd);
- CImageList ilList;
- CImageList ilDisabledList;
- CImageList ilOther;
- static void OnSystemColorChange();
- int iSpawnItem;
- SpawnItem ** pSpawnItem;
- int iImageItem;
- ImageItem * pImageItem;
- bool bIsPopup;
- bool bBackBitmap;
- CBitmap bmpBack;
- bool LoadToolBarResource(unsigned int resId);
- bool AddToolBarResource(unsigned int resId);
- void EnableMenuItems(CMenu * pMenu, CWnd * pParent);
- CMenuSpawn();
- CMenuSpawn(const bool _IsPopup);
- virtual ~CMenuSpawn();
- enum {eNormalImgCmdID = 1, eUnusedImgCmdID};
- protected:
- void RemapMenu(CMenu * pMenu);
- void Init();
- void Clear();
- private:
- int m_iNormalImgInx;
- static HFONT hMenuFont, hGuiFont;
- static COLORREF crMenuText, crMenuTextSel;
- static COLORREF cr3dFace, crMenu, crHighlight, cr3dHilight, cr3dShadow, crGrayText, crMenuTitle;
- static COLORREF m_clrBtnFace, m_clrBtnHilight, m_clrBtnShadow;
- static vector<CImageList*> m_vImageList;
- };
- #endif // !defined(AFX_MENUSPAWN_H__BB6F2F01_91FA_11D1_8B78_0000B43382FE__INCLUDED_)