📄 view.h
字号:
// 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -