view.h
来自「也是一个基于S60的源代码」· C头文件 代码 · 共 73 行
H
73 行
// view.h
//
// Copyright (c) 2000 Symbian Ltd. All rights reserved.
//
#ifndef __VIEW_H
#define __VIEW_H
#include <coecntrl.h>
#include <coemain.h>
#include "engine.h"
// forward declarations
class CGameController;
class MGameViewCmdHandler;
class CFleetView : public CCoeControl
{
public:
// construct/destruct/setup
~CFleetView();
void ConstructL(const TRect& aRect);
void SetController(TFleet& aFleet, MGameViewCmdHandler& aCmdHandler);
// zoom
void SetZoomL(TInt aZoomFactor);
TInt GetZoom() const;
// cursor
void SetCursorOff();
void SetCursor(TInt aX, TInt aY);
TBool CursorOn() const;
void GetCursor(TInt& aX, TInt& aY) const;
// incremental drawing
void DrawTilesNow() const;
private:
// from CCoeControl
void Draw(const TRect&) const;
void HandlePointerEventL(const TPointerEvent& aPointerEvent);
TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
// auxiliary draw functions
void DrawOutside() const;
void DrawBorders() const;
void DrawHorizontalBorder(const TRect& aRect) const;
void DrawVerticalBorder(const TRect& aRect) const;
void DrawTiles() const;
void DrawTile(TInt aX, TInt aY) const;
// cursor movement
void MoveCursor(TInt aDx, TInt aDy);
private:
TRect iViewRect;
TFleet* iFleet;
MGameViewCmdHandler* iCmdHandler;
// cursor
TBool iCursorOn;
TInt iCursorX;
TInt iCursorY;
// scale to use when calculating drawing stuff
TInt iZoomFactor;
// pre-calculated drawing stuff
CFont* iBorderFont;
CFont* iTileFont;
TRect iBoardRect; // whole board
TRect iTopBorder; // all of top border
TRect iBottomBorder; // all bottom border
TRect iLeftBorder; // left border, excluding top and bottom
TRect iRightBorder; // right border, excluding top and bottom
TInt iTileSize; // side of tile (1/8th sea area)
TInt iBorderSize; // size of border
};
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?