NetPlayDiag: Get rid of event table

This commit is contained in:
Lioncash 2014-11-10 23:28:09 -05:00
parent 5891266e67
commit 3fed975bac
2 changed files with 7 additions and 9 deletions

View File

@ -49,10 +49,6 @@
#define INITIAL_PAD_BUFFER_SIZE 5
BEGIN_EVENT_TABLE(NetPlayDiag, wxFrame)
EVT_COMMAND(wxID_ANY, wxEVT_THREAD, NetPlayDiag::OnThread)
END_EVENT_TABLE()
static NetPlayServer* netplay_server = nullptr;
static NetPlayClient* netplay_client = nullptr;
NetPlayDiag *NetPlayDiag::npd = nullptr;
@ -309,6 +305,8 @@ NetPlayDiag::NetPlayDiag(wxWindow* const parent, const CGameListCtrl* const game
, m_start_btn(nullptr)
, m_game_list(game_list)
{
Bind(wxEVT_THREAD, &NetPlayDiag::OnThread, this);
wxPanel* const panel = new wxPanel(this);
// top crap
@ -534,7 +532,7 @@ void NetPlayDiag::OnQuit(wxCommandEvent&)
}
// update gui
void NetPlayDiag::OnThread(wxCommandEvent& event)
void NetPlayDiag::OnThread(wxThreadEvent& event)
{
// player list
m_playerids.clear();
@ -582,7 +580,9 @@ void NetPlayDiag::OnThread(wxCommandEvent& event)
// update selected game :/
{
m_selected_game.assign(WxStrToStr(event.GetString()));
m_game_btn->SetLabel(event.GetString().Prepend(_(" Game : ")));
wxString button_label = event.GetString();
m_game_btn->SetLabel(button_label.Prepend(_(" Game : ")));
}
break;
case NP_GUI_EVT_START_GAME :

View File

@ -82,11 +82,9 @@ public:
bool IsRecording() override;
private:
DECLARE_EVENT_TABLE()
void OnChat(wxCommandEvent& event);
void OnQuit(wxCommandEvent& event);
void OnThread(wxCommandEvent& event);
void OnThread(wxThreadEvent& event);
void OnChangeGame(wxCommandEvent& event);
void OnAdjustBuffer(wxCommandEvent& event);
void OnConfigPads(wxCommandEvent& event);