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

📄 myselectioncontrol.h

📁 一个可以加载图片作为下拉菜单的symbian手机示例
💻 H
字号:
/*
============================================================================
 Name        : MySelectionControl.h
 Author      : 
 Version     :
 Copyright   : Your copyright notice
 Description : CMySelectionControl declaration
============================================================================
*/

#ifndef MySELECTIONCONTROL_H
#define MySELECTIONCONTROL_H

//#include "ControlBase.h"
#include <coecntrl.h>	// CCoeControl
#include "Tag.h"

_LIT(KSelectName,"name");
_LIT(KAreaText,"area");
_LIT(KSexText,"sex");
_LIT(KHeadImage,"head");
_LIT(KAgeText,"age");
_LIT(KLabel,"lab");

_LIT(KValue,"value");
_LIT(KControlSelection,"select");

class CFbsBitmap;
class CMyPopMenuControl;

class CMySelectionControl :public CCoeControl
{
public:
	CMySelectionControl();
	virtual ~CMySelectionControl();
	void InitControlL(const CCoeControl* aParent);
	
protected:
	void SetDefaultSize(TInt aWidth,TInt aHeight);

	void SetDefaultSize(TSize aSize);
	
	void VertMoveControl(TInt aSpan);

private:
	void OutputText(CWindowGc & aGc,const TRgb &aColor ) const;

	void SizeChanged();

	void virtual Draw(const TRect& aRect) const;

	virtual void FocusChanged(TDrawNow aDrawNow);
	
	TInt CountComponentControls() const;

	CCoeControl* ComponentControl( TInt aIndex ) const;

public:
	//���?���¼�
	TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);   
	
	void SetTextL(const TDesC& aText);
	void SetUrlL(const TDesC& aUrl);
	void SetColor(const TRgb& aColor);
	void SetFont(const CFont* aFont);
	
	void LoadTextListL(TInt aTextResource);
	void LoadTextListL(const TDesC& aText);
	void LoadScrollBitmapL(TInt aBitmapResource, TInt aNumberOfBitmap);
	void CreateBitmapL(TInt aBitmapResource, TInt aNumberOfBitmap);
	TInt GetIntValue(const TDesC& aValue);

	void ParseTag(TTag& aTag);
	TTag GetTag();
	
    TInt GetScrollIndex() const;
	TPtrC GetSelectValue();

private:
	//�ı���Ϣ
	HBufC *  iText;

	CDesCArrayFlat* iTextList;
	RPointerArray<CFbsBitmap> iBitmapList;
	RPointerArray<CFbsBitmap> iScrollBitmap;

	const CFont*	iFont;
	TRgb	iColor;
	TInt iCurrentIndex;
	TPoint iTextTopLeft;
	TRect iSelectionRect;
	TInt iNumberOfItems;
	TBuf<3> iIntToBuf;
	TBuf<20> iSelectName;
	CMyPopMenuControl* iPopList;
	/*
	 * 2009-4-27
	 * Desciptor:
	 * */
	const CCoeControl* iParent;
};

#endif // MySELECTIONCONTROL_H

⌨️ 快捷键说明

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