main.h

来自「WYD Server 753 (Development)」· C头文件 代码 · 共 87 行

H
87
字号
/* by My Destiny Team */

#ifndef __WX_GAMESERVER_MAIN__
#define __WX_GAMESERVER_MAIN__

#include <wx/wx.h>
#include <wx/menu.h>
#include <wx/frame.h>
#include <wx/utils.h>
#include <wx/timer.h>
#include <wx/msgdlg.h>
#include <wx/menuitem.h>
#include <wx/statusbr.h>
#include <wx/aboutdlg.h>
#include <wx/textctrl.h>

typedef enum __eLog {
    NORMAL,
    INFO,
    WARN
} eLog;

// Escreve o log na janela e no arquivo de log
void Log(eLog log, const char *str, ...);

// Escreve o log no status barvoid RefStatusBar();
class wxMain : public wxApp
{
public:
    wxMain();
    ~wxMain();

    virtual bool OnInit();
};

class wxGameServer : public wxFrame
{
public:
    wxGameServer();
    ~wxGameServer();
    // Fecha o aplicativo    void CloseApp();    // Inicia os processos do servidor    void Init();
    /* Event's */
    void OnGeneralTimer(wxCommandEvent& event);
    void OnSelectTimer(wxCommandEvent& event);
    void OnCloseMenuItemClick(wxCommandEvent& event);
    void OnAboutMenuItemClick(wxCommandEvent& event);

    /* ID's */
    static const long ID_WINDOW;
    static const long ID_LOG_TEXT;
    static const long ID_STATUS_BAR;
    static const long ID_SELECT_TIMER;
    static const long ID_GENERAL_TIMER;

    /* Menu ID's */
    static const long ID_FILE_ITEM_MENU;
    static const long ID_ABOUT_ITEM_MENU;

    wxTimer selTimer;
    wxTimer generalTimer;
    wxTextCtrl *logText;
    wxStatusBar *statusBar;

#ifdef WIN32
    WSADATA wsaData;
#endif

private:
    wxMenuBar *menuBar;
    wxMenu *srvMenu, *helpMenu;
    wxMenuItem *fileMenuItem, *aboutMenuItem;
};

// Info da janela
extern wxGameServer *GameServer;

#endif // __WX_GAMESERVER_MAIN__

⌨️ 快捷键说明

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