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

📄 emptyui.cpp

📁 Symbian 第三版的一个传统应用程序构架的例子。Container容器为其构架类
💻 CPP
字号:
#include <aknnotewrappers.h>
#include <hlplch.h>
#include <avkon.hrh>
#include <EIKENV.H>

#include "Empty.rsg"
#include "EmptyUi.h"
#include "EmptyContainer.h" 
#include "Empty.hrh"
#include "Empty.h"



TBool iEView = ETrue;
void CEmptyUi::ConstructL()
	{
    BaseConstructL();
    TBool iEView = ETrue;
    switch (iEView)
    	{
    	case ETrue:
		    //iAppContainer = new (ELeave) CEmptyContainer;
		    //iAppContainer->MakeVisible( EFalse );
		    iAppContainer2 = new (ELeave) CEmptyContainer2;
		    iAppContainer2->SetMopParent(this);
		    iAppContainer2->ConstructL(ClientRect(),iAppContainer2);
		    AddToStackL(iAppContainer2);
		    break;
	    case EFalse:
		    //iAppContainer2 = new (ELeave) CEmptyContainer2;
		    //iAppContainer2->MakeVisible( EFalse );
		    iAppContainer = new (ELeave) CEmptyContainer;
		    iAppContainer->SetMopParent(this);
		    iAppContainer->ConstructL(ClientRect());
		    AddToStackL(iAppContainer);
		    break;
        default:
            break;  
    	}

	
    //_LIT(EmptyResource,"z:\\resource\\apps\\Empty.RSC");
    //TInt irscOffset=CEikonEnv::Static()->AddResourceFileL(EmptyResource);
    
	}


CEmptyUi::~CEmptyUi()
    {
    if ( iAppContainer )
        {
        RemoveFromStack( iAppContainer );
        delete iAppContainer;
        
        }
    if ( iAppContainer2 )
        {
        RemoveFromStack( iAppContainer2 );
        delete iAppContainer2;
        
        }
   }

void CEmptyUi::DynInitMenuPaneL(
    TInt /*aResourceId*/,CEikMenuPane* /*aMenuPane*/)
    {
    }

TKeyResponse CEmptyUi::HandleKeyEventL(
    const TKeyEvent& /*aKeyEvent*/,TEventCode /*aType*/)
    {
    return EKeyWasNotConsumed;
    }

void CEmptyUi::HandleCommandL(TInt aCommand)
    {
    switch (aCommand)
        {
        case EAknSoftkeyExit:
        case EEikCmdExit:
        case EAknCmdExit:
            Exit();
            break;
        case EEmptyCmdTest:
            {
			HBufC* helloText;
			helloText = iEikonEnv->AllocReadResourceL( R_EXAMPLE_TEXT_HELLO );
			iEikonEnv->InfoMsg( *helloText );
			delete helloText;
            break;
			}       
        case EEmptyCmdHello:
			{
			HBufC* helloText;

			helloText = iEikonEnv->AllocReadResourceL( R_EXAMPLE_TEXT_HELLO );
			CleanupStack::PushL( helloText );
			CAknInformationNote* informationNote = new (ELeave) CAknInformationNote;
				informationNote->ExecuteLD( *helloText );
			CleanupStack::PopAndDestroy();
            break;
			}
		case EEmptyCmdSwith:
			{

			if(iEView)
				{
				RemoveFromStack(iAppContainer2);
			    iAppContainer = new (ELeave) CEmptyContainer;
			    iAppContainer->SetMopParent(this);
			    iAppContainer->ConstructL(ClientRect());
				AddToStackL(iAppContainer);
				iEView=EFalse;
				}
			else
				{
				RemoveFromStack(iAppContainer);
			    iAppContainer2 = new (ELeave) CEmptyContainer2;
			    iAppContainer2->SetMopParent(this);
			    iAppContainer2->ConstructL(ClientRect(),iAppContainer2);
				AddToStackL(iAppContainer2);
				iEView = ETrue;
				}
        	}

        default:
            break;      
        }
    }


/*CArrayFix <TCoeHelpContext>* CEmptyUi::SwithL() const
    {
    CArrayFixFlat <TCoeHelpContext>* array = 
                new ( ELeave )CArrayFixFlat <TCoeHelpContext> ( 1 );
    CleanupStack::PushL( array );
    _LIT(KContextChinese,"ContextChinese");
    array->AppendL( TCoeHelpContext(KUidEmpty, KContextChinese) );
    CleanupStack::Pop( array );
    return array;
    }
*/

⌨️ 快捷键说明

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