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

📄 aknexgridcontainerasmenu.h

📁 symbian 格子的生成和使用源代码 让你明白九宫格生成原理 适合游戏开发
💻 H
字号:
/* Copyright (c) 2004, Nokia. All rights reserved */


#ifndef __AKNEXGRIDCONTAINERASMENU_H__
#define __AKNEXGRIDCONTAINERASMENU_H__

// INCLUDES
#include <aknview.h>
#include "AknExGridContainerAsSelection.h"
#include "AknExGridCommonConstants.h"


// CONSTANTS
// Number of components in the Menu container
const TInt KNumberOfComponentMenu = 2;  // do not include iGrid

// the initial number of items
const TInt KNumOfColumnsInMenu = 9;
const TInt KNumOfRowsInMenu = 3;

// the initial number of items to be created.
const TInt KInitialNumOfItemsInMenu = 27;

// grid size
const TInt KMenuGridViewWidth = 169;
const TInt KMenuGridViewHeight = 103;

// FORWARD DECLARATIONS
class CEikLabel;

// CLASS DECLARATION
/**
*  CAknExGridContainerAsMenu  container control class.
*/
class CAknExGridContainerAsMenu : public CAknExGridContainerAsSelection
    {
    public: // Constructors and destructor

        /**
        * NewL.
        * Two-phased constructor.
        * @param aRect The rectangle this container will be drawn to.
        * @return Pointer to the created instance of CAknExGridContainerAsMenu.
        */
        static CAknExGridContainerAsMenu* NewL( const TRect& aRect );

        /**
        * NewLC.
        * Two-phased constructor.
        * @param aRect The rectangle this container will be drawn to.
        * @return Pointer to the created instance of CAknExGridContainerAsMenu.
        */
        static CAknExGridContainerAsMenu* NewLC( const TRect& aRect );

        /**
        * ~CAknExGridContainerAsMenu.
        * Destructor.
        */
        virtual ~CAknExGridContainerAsMenu();

    public: // New functions

        /**
        * ShowGridInMenuL.
        * Creates a grid in the menu and shows it.
        */
        void ShowGridInMenuL();

        /**
        * AutoTestL.
        * Runs different tests.
        * @return ETrue if there are still tests to be run.
        */
        TBool AutoTestL();

    public: // Functions from base classes

        /**
        * DetermineChangeSizeL
        * Shows a dialog to change size.
        */
        void DetermineChangeSizeL();

    private: // Constructors and destructors

        /**
        * CAknExGridContainerAsMenu.
        * C++ default constructor.
        */
        CAknExGridContainerAsMenu();

        /**
        * ConstructL.
        * 2nd phase constructor.
        * @param aRect Frame rectangle for container.
        */
        void ConstructL( const TRect& aRect );

    private: // Functions from base classes

        /**
        * From CoeControl, SizeChanged.
        * Called by framework when the view size is changed.
        */
        void SizeChanged();

        /**
        * From CoeControl, CountComponentControls.
        * Returns the number of components owned by this container.
        * @return Number of component controls
        */
        TInt CountComponentControls() const;

        /**
        * From CCoeControl, ComponentControl.
        * Returns pointer to a particular control.
        * @param aIndex Index of wanted control
        * @return Pointer to component control
        */
        CCoeControl* ComponentControl( TInt aIndex ) const;

        /**
        * From CCoeControl, Draw.
        * Draws this container to the screen.
        * @param aRect The region of the control to be redrawn.
        */
        void Draw( const TRect& aRect ) const;

        /**
        * From MCoeControlObserver, HandleControlEventL
        * Handle event from observed control.
        * @param aControl The control that sent the event.
        * @param aEventType The event type.
        */
        void HandleControlEventL(
            CCoeControl* aControl, TCoeEvent aEventType );

    private: // Enumerations

        enum TMenuTitles
            {
            EMenuTest1=0,
            EMenuTest2,
            EMenuTest3,
            EMenuTest4,
            EMenuTest5,
            EMenuTest6,
            EMenuTest7,
            EMenuTest8,
            EMenuTest9,
            EMenuTest10,
            EMenuTest11,
            EMenuTest12,
            EMenuTest13,
            ENumberOfMenuTitles
            };

    private: // Data

        /**
        * iLabel, example label.
        * Owned by CAknExGridContainer object.
        */
        CEikLabel* iLabel;

        /**
        * iToDoLabel, example label.
        * Owned by CAknExGridContainer object.
        */
        CEikLabel* iToDoLabel;

        /**
        * iTitles, the title list.
        * Owned by CAknExGridContainerAsGMS object.
        */
        CDesCArrayFlat* iTitles;

        /**
        * iTestNumber, the next test to be run.
        */
        TInt iTestNumber;
    };

#endif  // __AKNEXGRIDCONTAINERASMENU_H__

// End of File

⌨️ 快捷键说明

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