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

📄 drawimageappui.cpp

📁 symbian的画图程序
💻 CPP
字号:
/*
============================================================================
 Name		: CDrawImageAppUi.cpp
 Author	  : caitong
 Copyright   : Your copyright notice
 Description : CDrawImageAppUi implementation
============================================================================
*/

// INCLUDE FILES
#include "DrawImageApp.h"
#include "DrawImageAppui.h"
#include "DrawImageContainer.h"
#include <DrawImage.rsg>
#include "DrawImage.hrh"
#include "DrawImage.hlp.hrh"

#include <avkon.hrh>
#include <aknnotewrappers.h>
#include <aknmessagequerydialog.h>
#include <hlplch.h>

// ================= MEMBER FUNCTIONS =======================
//
// ----------------------------------------------------------
// CDrawImageAppUi::ConstructL()
//
// ----------------------------------------------------------
//
void CDrawImageAppUi::ConstructL()
	{
	BaseConstructL();

	iAppContainer = new (ELeave) CDrawImageContainer;
	iAppContainer->SetMopParent( this );
	iAppContainer->ConstructL( ClientRect() );
	AddToStackL( iAppContainer );
	}

// ----------------------------------------------------
// CDrawImageAppUi::~CDrawImageAppUi()
// Destructor
// Frees reserved resources
// ----------------------------------------------------
//
CDrawImageAppUi::~CDrawImageAppUi()
	{
	if (iAppContainer)
		{
		RemoveFromStack( iAppContainer );
		delete iAppContainer;
		}
	}

// ------------------------------------------------------------------------------
// CDrawImageAppUi::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane)
//  This function is called by the EIKON framework just before it displays
//  a menu pane. Its default implementation is empty, and by overriding it,
//  the application can set the state of menu items dynamically according
//  to the state of application data.
// ------------------------------------------------------------------------------
//
void CDrawImageAppUi::DynInitMenuPaneL(
	TInt /*aResourceId*/,CEikMenuPane* /*aMenuPane*/)
	{
	}

// ----------------------------------------------------
// CDrawImageAppUi::HandleKeyEventL(
//	 const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
// takes care of key event handling
// ----------------------------------------------------
//
TKeyResponse CDrawImageAppUi::HandleKeyEventL(
	const TKeyEvent& /*aKeyEvent*/,TEventCode /*aType*/)
	{
	return EKeyWasNotConsumed;
	}

// ----------------------------------------------------
// CDrawImageAppUi::HandleCommandL(TInt aCommand)
// takes care of command handling
// ----------------------------------------------------
//
void CDrawImageAppUi::HandleCommandL(TInt aCommand)
	{
	switch ( aCommand )
		{
		case EAknSoftkeyExit:
		case EEikCmdExit:
			{
			Exit();
			break;
			}
		case EDrawImageCmdAppTest:
			{
			// Load localized message from the resource file
			HBufC* message = CEikonEnv::Static()->AllocReadResourceLC(R_MESSAGE_TEXT);
			// Show information note dialog
			CAknInformationNote* note = new (ELeave) CAknInformationNote;
			note->ExecuteLD(message->Des());
			CleanupStack::PopAndDestroy(message);
			break;
			}
		case EDrawImageCmdHelp:
			{
			CArrayFix<TCoeHelpContext>* buf = CCoeAppUi::AppHelpContextL();
			HlpLauncher::LaunchHelpApplicationL(iEikonEnv->WsSession(), buf);
			break;
			}
		case EDrawImageCmdAbout:
			{
			CAknMessageQueryDialog* dlg = new (ELeave)CAknMessageQueryDialog(); 
			dlg->PrepareLC(R_ABOUT_QUERY_DIALOG);
			HBufC* title = iEikonEnv->AllocReadResourceLC(R_ABOUT_DIALOG_TITLE);
			dlg->QueryHeading()->SetTextL(*title);
			CleanupStack::PopAndDestroy(); //title
			HBufC* msg = iEikonEnv->AllocReadResourceLC(R_ABOUT_DIALOG_TEXT);
			dlg->SetMessageTextL(*msg);
			CleanupStack::PopAndDestroy(); //msg
			dlg->RunLD(); 
			break;
			}
			
		// TODO: Add Your command handling code here

		default:
			break;
		}
	}

CArrayFix<TCoeHelpContext>* CDrawImageAppUi::HelpContextL() const
	{
	CArrayFixFlat<TCoeHelpContext>* array = new(ELeave)CArrayFixFlat<TCoeHelpContext>(1);
	CleanupStack::PushL(array);
	array->AppendL(TCoeHelpContext(KUidDrawImage, KGeneral_Information));
	CleanupStack::Pop(array);
	return array;
	}



⌨️ 快捷键说明

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