wsexampledialog.cpp

来自「Symbian智能手机操作系统源代码值的参考_服务器」· C++ 代码 · 共 80 行

CPP
80
字号
                                              //
//============================================================================
// Name     : CWSExampleDialog from WSExampleDialog.h
// Part of  : WSExample
// Created  : 10/08/2005 by Forum Nokia
// Implementation notes: Initial content was generated by Series 60 AppWizard.
//                       
// Version  : 1.0
// Copyright: Nokia Corporation
//============================================================================
//

// INCLUDE FILES
#include    "WSExampleDialog.h"

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

#include "WSExample.hrh"

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


// Destructor
CWSExampleDialog::~CWSExampleDialog()
    {
    }

// ---------------------------------------------------------
// CWSExampleDialog::OkToExitL(TInt aButtonId)
// called by framework when the OK button is pressed
// ---------------------------------------------------------
TBool CWSExampleDialog::OkToExitL(TInt aButtonId)
{
    if ( aButtonId == EAknSoftkeyOptions )
        {
        iAvkonAppUi->ProcessCommandL( EAknSoftkeyOptions );
        }
    else if ( aButtonId == EAknSoftkeyExit )
        {
        iAvkonAppUi->ProcessCommandL( EEikCmdExit );
        }
    
    return EFalse;
}

// ---------------------------------------------------------
// CWSExampleDialog::PreLayoutDynInitL();
// called by framework before dialog is shown 
// ---------------------------------------------------------
void CWSExampleDialog::PreLayoutDynInitL()
    {
    }

// ---------------------------------------------------------
// CWSExampleDialog::SetListBoxText();
// Set the main dialog listbox texts to aArray 
// ---------------------------------------------------------
void CWSExampleDialog::SetListBoxTextL( CDesC16ArrayFlat* aArray )
    {
    CEikTextListBox* listBox = 
        static_cast <CEikTextListBox*>(ControlOrNull(EWSExampleDlgList));
    CDesCArray* listArray = 
        static_cast<CDesCArray*>(listBox->Model()->ItemTextArray());

    listArray->Reset();

    for( TInt c = 0; c < aArray->Count(); c++ )
        {
        listArray->AppendL( aArray->operator[](c) );
        }

    listBox->HandleItemAdditionL();
    listBox->SetCurrentItemIndexAndDraw( 0 );
    }


// End of File

⌨️ 快捷键说明

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