📄 alphaimagelist.h
字号:
/*********************************************************
* Simple IE-like Menu And Toolbar
* Version: 1.3
* Date: Semptember 1, 2003
* Autor: Michal Mecinski
* E-mail: mimec@mimec.w.pl
* WWW: http://www.mimec.w.pl
*
* You may freely use and modify this code, but don't remove
* this copyright note.
*
* There is no warranty of any kind, express or implied, for this class.
* The author does not take the responsibility for any damage
* resulting from the use of it.
*
* Let me know if you find this code useful, and
* send me any modifications and bug reports.
*
* Copyright (C) 2002-03 by Michal Mecinski
*********************************************************/
#pragma once
// image list styles
#define AILS_OLD 0 // use old 16 color images
#define AILS_NEW 1 // use new 8-32 bit images
// image list selectors
#define AIL_NORMAL 0
#define AIL_HOT 1
#define AIL_DISABLED 2
/////////////如果是VC6.0以下版本必需加入以下定义
///////////////////////////////////////////////////////////
#define BTNS_SHOWTEXT 0x0040 // ignored unless TBSTYLE_EX_MIXEDBUTTONS is set
#define BTNS_WHOLEDROPDOWN 0x0080 // draw drop-down arrow, but without split arrow section
#define SPI_GETFLATMENU 0x1022
#define SPI_GETKEYBOARDCUES 0x100A
#define TPM_VERPOSANIMATION 0x1000L
#define MIIM_FTYPE 0x00000100
#define COLOR_MENUHILIGHT 29
#define DT_HIDEPREFIX 0x00100000
#define BTNS_BUTTON TBSTYLE_BUTTON // 0x0000
#define BTNS_SEP TBSTYLE_SEP // 0x0001
#define BTNS_CHECK TBSTYLE_CHECK // 0x0002
#define BTNS_GROUP TBSTYLE_GROUP // 0x0004
#define BTNS_CHECKGROUP TBSTYLE_CHECKGROUP // (TBSTYLE_GROUP | TBSTYLE_CHECK)
#define BTNS_DROPDOWN TBSTYLE_DROPDOWN // 0x0008
#define BTNS_AUTOSIZE TBSTYLE_AUTOSIZE // 0x0010; automatically calculate the cx of the button
#define BTNS_NOPREFIX TBSTYLE_NOPREFIX // 0x0020; this button should not have accel prefix
/////////////////////////////////////////////////////////
class CAlphaImageList
{
public:
CAlphaImageList();
virtual ~CAlphaImageList();
public:
// Create with given image size, style and initial count
BOOL Create(int nWidth, int nHeight, int nStyle, int nCnt=0);
// Add bitmap resource
BOOL AddBitmap(UINT nID);
// Draw image of given type
BOOL Draw(CDC* pDC, CPoint ptPos, int nImgList, int nIndex);
// Get handle of image list
HIMAGELIST GetImageList(int nImgList);
protected:
CImageList m_ilNormal; // normal images
CImageList m_ilHot; // hot images (saturated)
CImageList m_ilDisabled; // disabled images (grayscale)
int m_nBmpDepth; // imagelist bitmap depth (ILC_COLOR4/24/32)
CSize m_szImg; // size of images
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -