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

📄 oandxappview.h

📁 一个类似黑白棋的软件源码,可用再symbina上.不错的
💻 H
字号:
// Copyright (c) 2004, Symbian Software Ltd. All rights reserved.

#ifndef __OANDX_APPVIEW_H__
#define __OANDX_APPVIEW_H__

#include <coecntrl.h>
#include <coedef.h>

class COandXAppView;
class MOandXGameControl;

class COandXTile : public CCoeControl
    {
public:
    COandXTile();
    ~COandXTile();
    void ConstructL(RWindow& aWindow);

public: // New function
    void SetOwnerAndObserver(COandXAppView* aControl);

public: // From CCoeControl
    TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
	TCoeInputCapabilities InputCapabilities() const;

private:
    void Draw(const TRect& aRect) const;
    
private: // New function
    void TryHitL();
    
protected:
    void FocusChanged(TDrawNow aDrawNow);
    void HandlePointerEventL(const TPointerEvent& aPointerEvent);

private:
    COandXAppView* iAppView; // Pointer to the owning view
    };


class COandXAppView : public CCoeControl, public MCoeControlObserver
    {
public:
    COandXAppView();
    ~COandXAppView();
    void ConstructL(const TRect& aRect, MOandXGameControl* aGameControl);
    
public: // From CCoeControl
    TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);

public:
    TInt IdOfFocusControl();
    void MoveFocusTo(const TInt aIndex);
    void ResetView();
    TBool TryHitSquareL(const COandXTile* aControl);
    TInt SquareStatus(const COandXTile* aControl);

private:
    void SwitchFocus(TInt aFromIndex, CCoeControl* aToControl);
    void DrawComps(TRect& aRect) const;
    COandXTile * CreateTileL();

private: // From CCoeControl
    void Draw(const TRect& aRect) const;
    TInt CountComponentControls() const;
    CCoeControl* ComponentControl(TInt aIndex) const;
    void SizeChanged();
    
private: // From MCoeControlObserver
    void HandleControlEventL(CCoeControl* aControl, TCoeEvent aEventType);

private:
    TRect iBoardRect;  // Board area
    TRect iBorderRect; // Bounding rectangle for border
    TInt iTileSide;    // allowing for line widths and border
    RPointerArray<COandXTile> iTiles; // View owns the tiles
    MOandXGameControl* iGameControl;  // View does not own the game control
    };

#endif // __OANDX_APPVIEW_H__

⌨️ 快捷键说明

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