iconcombobox.h

来自「vc 和mapobjects地理信息系统组件开发 很有启发意义和参考价值」· C头文件 代码 · 共 78 行

H
78
字号
/*
Module : ICONCOMBOBOX.H
Purpose: Defines the interface for 2 MFC classes
         to implement an icon selection combo box
Created: PJN / 2-08-1998
History: None

Copyright (c) 1998 by PJ Naughter.  
All rights reserved.

*/

#ifndef __ICONCOMBOBOX_H__
#define __ICONCOMBOBOX_H__

class CSmallIconComboBox : public CComboBox
{
public:
//Methods
  int  AddIcon(UINT nIconID);
	int  InsertIcon(int nIndex, UINT nIconID);
  int  DeleteIcon(int nIndex);
  UINT GetCurSelIcon() const;
	int  SetCurSelIcon(UINT nIconID);
  int  AddString(LPCTSTR lpszString);
  int  InsertString(int nIndex, LPCTSTR lpszString);
  int  DeleteString(int nIndex);


protected:
	//{{AFX_VIRTUAL(CSmallIconComboBox)
	virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct);
	virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
	virtual void PreSubclassWindow();
	virtual void DeleteItem(LPDELETEITEMSTRUCT lpDeleteItemStruct);
	//}}AFX_VIRTUAL

	//{{AFX_MSG(CSmallIconComboBox)
	//}}AFX_MSG

	DECLARE_MESSAGE_MAP()
	DECLARE_DYNAMIC(CSmallIconComboBox)
};


class CLargeIconComboBox : public CSmallIconComboBox
{
public:
	short m_iHeight;

public:
	void SetHeight(short iHeight);
//Methods
  int  AddIcon(UINT nIconID);
	int  InsertIcon(int nIndex, UINT nIconID);
  //other public methods for the class are derived from CSmallIconComboBox

protected:
	//{{AFX_VIRTUAL(CLargeIconComboBox)
	virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct);
	virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
	virtual void PreSubclassWindow();
	//}}AFX_VIRTUAL

	//{{AFX_MSG(CLargeIconComboBox)
	//}}AFX_MSG

	DECLARE_MESSAGE_MAP()
	DECLARE_DYNAMIC(CLargeIconComboBox)
};


//DDX Support
void DDX_CBIcon(CDataExchange* pDX, int nIDC, UINT& nIconID);


#endif //__ICONCOMBOBOX_H__

⌨️ 快捷键说明

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