bmpmanipappui.cpp

来自「该源码主要用于在手机平台上对图像的一些简单处理」· C++ 代码 · 共 98 行

CPP
98
字号
/* Copyright (c) 2003, Nokia Mobile Phones. All rights reserved */

#include <avkon.hrh>
#include "EikonEnvironment.h"
#include "Bmpmanip.pan"
#include "BmpmanipAppUi.h"
#include "BmpmanipAppView.h"
#include "Bmpmanip.hrh"


void CBmpmanipAppUi::ConstructL()
    {
    BaseConstructL(EAknEnableSkin);

    iAppView = CBmpmanipAppView::NewL(ClientRect());    

    AddToStackL(iAppView);
    }

CBmpmanipAppUi::CBmpmanipAppUi()                              
    {
    // No implementation required
    }

CBmpmanipAppUi::~CBmpmanipAppUi()
    {
    if (iAppView)
        {
        iEikonEnv->RemoveFromStack(iAppView);
        }

    delete iAppView;
    iAppView = NULL;
    }

void CBmpmanipAppUi::HandleCommandL(TInt aCommand)
    {
	_LIT(KMessage, "Waiting for gif file to load");
	
	//Generally, any command operation would just be allowed to leave directly, but here
	//we want to perform some error condition checking.  Rather than put the entire switch statement
	//inside the TRAPD macro, we create a helper function to make things clearer.

	TInt err (KErrNone);

	switch(aCommand)
		{
	case EAknSoftkeyExit:
	case EEikCmdExit:
		Exit();
		break;

	default:
		TRAP(err,CommandHandlerL(aCommand));
		break;
		}


	//If we try and perform an action before the gif file is loaded
	if (err == KErrInUse)
		{
		NEikonEnvironment::MessageBox(KMessage);
		}
	else if (err != KErrNone)
		{
		User::Leave(err);
		}

    }

void CBmpmanipAppUi::CommandHandlerL(TInt aCommand)
	{
	switch(aCommand)
		{
	case EBmpmanipCmdRotate90:
		{
		iAppView->RotateImageClockwiseL(CBmpmanipAppView::E90Degrees);
		}
		break;

	case EBmpmanipCmdRotate180:
		iAppView->RotateImageClockwiseL(CBmpmanipAppView::E180Degrees);
		break;

	case EBmpmanipCmdRotate270:
		iAppView->RotateImageClockwiseL(CBmpmanipAppView::E270Degrees);
		break;

	case EBmpmanipCmdSave:
		iAppView->SaveL();
		break;

	default:
		User::Panic (KBmpmanip, EBmpmanipBasicUi);
		break;
		}
	}

⌨️ 快捷键说明

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