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

📄 biaofengappview.cpp

📁 一个可以加载图片作为下拉菜单的symbian手机示例
💻 CPP
字号:
/*
 ============================================================================
 Name		: BiaofengAppView.cpp
 Author	  : 
 Copyright   : Your copyright notice
 Description : Application view implementation
 ============================================================================
 */

// INCLUDE FILES
#include <coemain.h>
#include "BiaofengAppView.h"

// ============================ MEMBER FUNCTIONS ===============================

// -----------------------------------------------------------------------------
// CBiaofengAppView::NewL()
// Two-phased constructor.
// -----------------------------------------------------------------------------
// 
CBiaofengAppView* CBiaofengAppView::NewL(const TRect& aRect,CMainWinControl *aWin )
	{
	CBiaofengAppView* self = CBiaofengAppView::NewLC(aRect,aWin );
	CleanupStack::Pop(self);
	return self;
	}

// -----------------------------------------------------------------------------
// CBiaofengAppView::NewLC()
// Two-phased constructor.
// -----------------------------------------------------------------------------
//
CBiaofengAppView* CBiaofengAppView::NewLC(const TRect& aRect,CMainWinControl *aWin )
	{
	CBiaofengAppView* self = new (ELeave) CBiaofengAppView;
	CleanupStack::PushL(self);
	self->ConstructL(aRect,aWin );
	return self;
	}

// -----------------------------------------------------------------------------
// CBiaofengAppView::ConstructL()
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void CBiaofengAppView::ConstructL(const TRect& aRect ,CMainWinControl *aWin )
	{
	// Create a window for this application view
//	CreateWindowL();
	iMainWin=aWin;
	// Set the windows size
	SetRect(aRect);
	
	// Activate the window, which makes it ready to be drawn
	ActivateL();
	}

// -----------------------------------------------------------------------------
// CBiaofengAppView::CBiaofengAppView()
// C++ default constructor can NOT contain any code, that might leave.
// -----------------------------------------------------------------------------
//
CBiaofengAppView::CBiaofengAppView()
	{
	// No implementation required
	}

// -----------------------------------------------------------------------------
// CBiaofengAppView::~CBiaofengAppView()
// Destructor.
// -----------------------------------------------------------------------------
//
CBiaofengAppView::~CBiaofengAppView()
	{
	// No implementation required
	}

// -----------------------------------------------------------------------------
// CBiaofengAppView::Draw()
// Draws the display.
// -----------------------------------------------------------------------------
//
void CBiaofengAppView::Draw(const TRect& /*aRect*/) const
	{
	// Get the standard graphics context
	CWindowGc& gc = SystemGc();

	// Gets the control's extent
	// TRect drawRect(Rect());
	
	 //gc.SetBrushColor(KRgbBlue);  // KRgbBlue  KRgbWhite
	 //gc.Clear(Rect());
/*	 
	TRect Rect1=TRect(50,30,100,50);
	 
	 gc.SetPenSize(TSize(3,3));
	 gc.SetPenColor(KRgbRed);
	 gc.DrawRect( Rect1 );
*/	 	
	// Clears the screen
	// gc.Clear(drawRect);
	 
	}

// -----------------------------------------------------------------------------
// CBiaofengAppView::SizeChanged()
// Called by framework when the view size is changed.
// -----------------------------------------------------------------------------
//
void CBiaofengAppView::SizeChanged()
	{
	DrawNow();
	}


TKeyResponse CBiaofengAppView::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
    {
    
    //if( iContainer )
    //	return (iContainer->OfferKeyEventL(aKeyEvent, aType));
    
    // iMainWin->iContainer->DrawNow();
    
    return EKeyWasNotConsumed;
    
    
    }

// -----------------------------------------------------------------------------
// CBiaofengAppView::HandlePointerEventL()
// Called by framework to handle pointer touch events.
// Note: although this method is compatible with earlier SDKs, 
// it will not be called in SDKs without Touch support.
// -----------------------------------------------------------------------------
//
void CBiaofengAppView::HandlePointerEventL(const TPointerEvent& aPointerEvent)
	{

	// Call base class HandlePointerEventL()
	CCoeControl::HandlePointerEventL(aPointerEvent);
	}

// End of File

⌨️ 快捷键说明

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