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

📄 ggballappui.cpp

📁 一个symbian上成熟的小游戏源码
💻 CPP
字号:
/* Copyright (c) 2008, Nokia. All rights reserved */

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

#include "GGBall.pan"
#include "GGBallAppUi.h"
#include "GGBallAppView.h"
#include "GGBall.hrh"
//#include "GGBallEnv.h"

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

	//CGGBallEnv::Init();
	InitFont();

    iAppView = CGGBallAppView::NewL(ApplicationRect(),this); 
    AddToStackL(iAppView);
	
    }

CGGBallAppUi::CGGBallAppUi()                              
    {
		iPaneHeight=22;
		iMenuItemHeigt=22;
    }

CGGBallAppUi::~CGGBallAppUi()
    {
    if (iAppView)
        {
        iEikonEnv->RemoveFromStack(iAppView);
        delete iAppView;
        iAppView = NULL;
        }

	CEikonEnv::Static()->ReleaseScreenFont( iFont );
    }

void CGGBallAppUi::HandleCommandL(TInt aCommand)
    {
	/*
    switch(aCommand)
        {
        case EEikCmdExit:
        case EAknSoftkeyExit:
            Exit();
            break;

        case EGGBallCommand1:
            {
            _LIT(message,"Command 1");
            CAknInformationNote* informationNote = new (ELeave) CAknInformationNote;
            informationNote->ExecuteLD(message);
            }
            break;

        default:
            Panic(EGGBallBasicUi);
            break;
        }
		*/
    }

void CGGBallAppUi::Quit()
{
	Exit();
}

void CGGBallAppUi::InitFont()
{
	iSCreenSize = CEikonEnv::Static()->ScreenDevice()->SizeInPixels();
	TInt fontHeightInPixel = 0;
	if ( ( iSCreenSize.iWidth == 176 && 208 == iSCreenSize.iHeight) ||
		( iSCreenSize.iWidth == 208 && 208 == iSCreenSize.iHeight) )
	{
		fontHeightInPixel = 3;
	}
	else if ( 240 == iSCreenSize.iWidth && 320 == iSCreenSize.iHeight )
	{
		fontHeightInPixel = 4;
	}
	else if ( 320 == iSCreenSize.iWidth && 240 == iSCreenSize.iHeight )
	{
		fontHeightInPixel = 4;
	}
	else if ( 352 == iSCreenSize.iWidth && 416 == iSCreenSize.iHeight )
	{
		fontHeightInPixel = 5;
	}
	else if ( 800 == iSCreenSize.iWidth && 352 == iSCreenSize.iHeight )
	{ 
		fontHeightInPixel = 10;
	}
	
	TFontSpec fs= TFontSpec(_L("CombinedChinesePlain12"), 12);
	CCoeEnv::Static()->ScreenDevice()->GetNearestFontInPixels(iFont, fs);  // 根据fs得到字体	
}


const CFont* CGGBallAppUi::Font()
{
	return iFont;
}

TSize CGGBallAppUi::ScreenSize()
{
	return iSCreenSize;	
}

TInt CGGBallAppUi::PaneHeigth()
{
	return iPaneHeight;
}

TInt CGGBallAppUi::MenuItemHeight()
{
	return iMenuItemHeigt;
}

⌨️ 快捷键说明

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