aknexgriddialogchangesize.cpp

来自「symbian ui的 例子 初学者可以 好好看看,这个是培训的资料,应该比较宝」· C++ 代码 · 共 61 行

CPP
61
字号
/* Copyright (c) 2005, Nokia. All rights reserved */

// INCLUDE FILES
#include "AknExGridDialogChangesize.h"
#include "AknExGridContainerAsSelection.h"
#include "AknExGrid.hrh"

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

// -----------------------------------------------------------------------------
// CAknExGridDialogChangeSize::CAknExGridDialogChangeSize()
// C++ default constructor can NOT contain any code, that might leave.
// -----------------------------------------------------------------------------
//
CAknExGridDialogChangeSize::CAknExGridDialogChangeSize(
        CAknExGridContainerAsSelection* aContainer )
        : iContainer( aContainer )
    {
        // No implementation required
    }

// -----------------------------------------------------------------------------
// CAknExGridDialogChangeSize::PreLayoutDynInitL()
// Sets parameters before showing dialog.
// -----------------------------------------------------------------------------
//
void CAknExGridDialogChangeSize::PreLayoutDynInitL()
    {
    // Get the number editor value of columns and rows from the selection grid
    TInt numberOfColumns = iContainer->NumberOfColumns();
    TInt numberOfRows = iContainer->NumberOfRows();

    // Set the number editor values to ChangeSize dialog.
    SetNumberEditorValue( EAknExGridDialogChangeSizeColumns , numberOfColumns );
    SetNumberEditorValue( EAknExGridDialogChangeSizeRows , numberOfRows );
    }

// -----------------------------------------------------------------------------
// CAknExGridDialogChangeSize::OkToExitL()
// Updates member variables of CAknExGridContainerAsSelection
// -----------------------------------------------------------------------------
//
TBool CAknExGridDialogChangeSize::OkToExitL( TInt /*aKeycode*/ )
    {
    // the number editor value of columns and rows setted in dialog
    TInt numberOfColumns = NumberEditorValue(
                            EAknExGridDialogChangeSizeColumns );
    TInt numberOfRows = NumberEditorValue(
                            EAknExGridDialogChangeSizeRows );

    // Update the number of columns and rows in Selection Grid
    // with the number of columns and rows in ChangeSize dialog.
    iContainer->SetNumberOfColumns( numberOfColumns );
    iContainer->SetNumberOfRows( numberOfRows );

    return ETrue;

    }

// End of File

⌨️ 快捷键说明

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