📄 cmainboard.h
字号:
/*
Crazy Eggs Editor
Author : Kevin Lynx
Date : 2007.1.26
*/
#ifndef CMAIN_BOARD_H
#define CMAIN_BOARD_H
#include <ImageFont.h>
#include <Widget.h>
#include <ButtonWidget.h>
#include <ButtonListener.h>
#include <Dialog.h>
#include <DialogListener.h>
using namespace Sexy;
class Editor;
class CInputDlg;
/*
Board properties
*/
const int G_AREA_WIDTH = 14;
const int G_AREA_HEIGHT = 12;
const int G_EGG_WIDTH = 40;
const int G_EGG_HEIGHT = 40;
/*
Draw Information
*/
const int G_START_X = 80;
const int G_START_Y = 40;
class CMainBoard : public Widget, public ButtonListener, public DialogListener
{
/*
Controls ID
*/
public:
enum
{
BTN_SAVE_ID = 1,
BTN_PUTFULL_ID,
DLG_SAVE_ID,
DLG_INPUT_ID
};
public:
CMainBoard( Editor *editor );
~CMainBoard();
void Init();
void Update();
void Draw( Graphics *g );
void AddedToManager( WidgetManager *theWidgetManager );
void RemovedFromManager( WidgetManager *theWidgetManager );
void MouseMove( int x, int y );
void MouseDown( int x, int y, int theClickCount );
void ButtonDepress( int theId );
void DialogButtonDepress( int theDialogId, int theButtonId );
private:
void Reset();
void DrawEggs( Graphics *g );
bool mouseInBoard( int x, int y );
bool SaveLevel( const char *fileName );
std::string GetFileName();
void CreateSaveDlg();
void CreateInputDlg();
void PutFull();
private:
Editor *m_Editor;
ButtonWidget *m_btnSave;
ButtonWidget *m_btnPutfull;
Dialog *m_dlgSave;
CInputDlg *m_dlgInput;
int m_mouseX;
int m_mouseY;
bool m_cursorLeft; //show left part of the cursor's pic ?
int m_area[G_AREA_HEIGHT][G_AREA_WIDTH];
int m_eggsCount; //how many eggs the user has put
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -