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

📄 ltguilistctrl.h

📁 Blood 2全套源码
💻 H
字号:
// LTGUIListCtrl.h: interface for the CLTGUIListCtrl class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_LTGUILISTCTRL_H__F502A543_575A_11D2_BDA0_0060971BDC6D__INCLUDED_)
#define AFX_LTGUILISTCTRL_H__F502A543_575A_11D2_BDA0_0060971BDC6D__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

#include "LTGUICtrl.h"
#include "stdlith.h"

class CLTGUIListCtrl : public CLTGUICtrl  
{
public:
	CLTGUIListCtrl();
	virtual ~CLTGUIListCtrl();

	// Creation
	DBOOL		Create ( int nHeight );
	
	// Destroy the control
	void		Destroy ( );	

	// Render the control
	void		Render ( HSURFACE hDestSurf );
	
	// Width/Height calculations
	int			GetWidth ( );
	int			GetHeight ( );
	
	// Handle a keypress
	DBOOL		HandleKeyDown(int key, int rep);

	// Commonly used keyboard messages	
	void		OnUp ( );
	void		OnDown ( );
	void		OnLeft ( );
	void		OnRight ( );
	void		OnEnter ( );

	// Set the number of pixels between items
	void		SetItemSpacing ( int nSpacing )		{ m_nItemSpacing=nSpacing; }

	// Sets the height of the listbox
	void		SetHeight(int nHeight)				{ m_nHeight=nHeight; }

	// Sets whether or not the items should wrap when scrolling
	void		SetScrollWrap(DBOOL bWrap)			{ m_bScrollWrap=bWrap; }

	// Sets whether or not to box the items
	void		EnableBoxFormat(DBOOL bEnable)		{ m_bEnableBoxFormat = bEnable; }

	// Add/Remove controls to the array
	int			AddControl ( CLTGUICtrl *pControl );
	void		RemoveControl ( CLTGUICtrl *pControl );
	void		RemoveControl ( int nIndex );
	void		RemoveAllControls ( );
	int			GetNum ( )							{ return m_controlArray.GetSize(); }

	CLTGUICtrl	*GetControl ( int nIndex );

	void		SelectItem ( int nIndex );
	int			GetSelectedItem ( )					{ return m_nCurrentIndex; }

	int			GetLastDisplayedIndex ( )			{ return GetLastDisplayedIndex(GetStartIndex()); }
	int			GetStartIndex ( )					{ return m_nFirstDisplayedItem; }
	void		SetStartIndex ( int nIndex )		{ m_nFirstDisplayedItem=nIndex; }

protected:
	int			GetLastDisplayedIndex ( int nStartIndex );

protected:	
	int			m_nItemSpacing;			// The number of pixels between items
	int			m_nCurrentIndex;		// Selected item
	int			m_nFirstDisplayedItem;	// First item displayed on the screen
	int			m_nHeight;				// Height of the control
	DBOOL		m_bScrollWrap;			// True if we should wrap when scrolling up and down
	DBOOL		m_bEnableBoxFormat;		// Formats the controls to a box.  Otherwise the controls position is used.

	CMoArray<CLTGUICtrl *>	m_controlArray;
};

#endif // !defined(AFX_LTGUILISTCTRL_H__F502A543_575A_11D2_BDA0_0060971BDC6D__INCLUDED_)

⌨️ 快捷键说明

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