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

📄 myconsole.h

📁 网络游戏通用架构, 这是基于boost和libevent写的一个程序
💻 H
字号:
#ifndef MYCONSOLE_H
#define MYCONSOLE_H

#include <stddef.h>
#include <string>
#include <wx/wx.h>

using namespace std;

#include "module.h"
#include "connection.h"
#include "remote.h"

class MyFrame;

class MyConsole : public wxApp, public Module
{
public:
    MyConsole();
    ~MyConsole();
public:
    bool OnInit(void);
    void operator () (void);
    int init(void) { return 0; }
    void breathe(void) {}
    void shutdown(void) {}
    MyFrame& getFrame(void)
    {
        recursive_mutex::scoped_lock lock( _mutex );
        return *_frame;
    }
protected:
    MyFrame* _frame;
};


class World;


class MyFrame : public wxFrame, public Remote
{
    friend class MyConsole;
public:
    MyFrame( const wxString& __title );
    ~MyFrame();
public:
    MyFrame& operator << ( const string __str );
public:
    void OnQuit( wxCommandEvent& _event );
    void OnAbout( wxCommandEvent& _event );
    void OnLogon( wxCommandEvent& _event );
    void OnLogout( wxCommandEvent& _event );
    void OnEnter( wxCommandEvent& _event );
    void disconnected(void);
protected:
    string _name;
    string _password;
    string _chatmsg;
    World* _world;
    wxTextCtrl* _output;
    wxTextCtrl* _input;
    wxTextCtrl* _ip;
    wxTextCtrl* _port;
    wxTextCtrl* _name_ctl;
    wxTextCtrl* _password_ctl;
    wxButton* _logon_button;
    wxButton* _logout_button;
private:
    // 声明事件表
    DECLARE_EVENT_TABLE()
};

enum{
    MY_LOGON= wxID_HIGHEST+1,
    MY_LOGOUT,
    MY_INPUT,
};

#endif

⌨️ 快捷键说明

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