myconsole.h
来自「网络游戏通用架构, 这是基于boost和libevent写的一个程序」· C头文件 代码 · 共 80 行
H
80 行
#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 + =
减小字号Ctrl + -
显示快捷键?