Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2289 from lioncash/netplay
DolphinWX: Break the netplay UI controls into separate classes.
- Loading branch information
Showing
14 changed files
with
1,284 additions
and
1,167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright 2015 Dolphin Emulator Project | ||
// Licensed under GPLv2 | ||
// Refer to the license.txt file included. | ||
|
||
#include <wx/button.h> | ||
#include <wx/listbox.h> | ||
#include <wx/sizer.h> | ||
|
||
#include "DolphinWX/NetPlay/ChangeGameDialog.h" | ||
#include "DolphinWX/NetPlay/NetWindow.h" | ||
|
||
ChangeGameDialog::ChangeGameDialog(wxWindow* parent, const CGameListCtrl* const game_list, wxString& game_name) | ||
: wxDialog(parent, wxID_ANY, _("Change Game")) | ||
, m_game_name(game_name) | ||
{ | ||
m_game_lbox = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, nullptr, wxLB_SORT); | ||
m_game_lbox->Bind(wxEVT_LISTBOX_DCLICK, &ChangeGameDialog::OnPick, this); | ||
|
||
NetPlayDialog::FillWithGameNames(m_game_lbox, *game_list); | ||
|
||
wxButton* const ok_btn = new wxButton(this, wxID_OK, _("Change")); | ||
ok_btn->Bind(wxEVT_BUTTON, &ChangeGameDialog::OnPick, this); | ||
|
||
wxBoxSizer* const szr = new wxBoxSizer(wxVERTICAL); | ||
szr->Add(m_game_lbox, 1, wxLEFT | wxRIGHT | wxTOP | wxEXPAND, 5); | ||
szr->Add(ok_btn, 0, wxALL | wxALIGN_RIGHT, 5); | ||
|
||
SetSizerAndFit(szr); | ||
SetFocus(); | ||
} | ||
|
||
void ChangeGameDialog::OnPick(wxCommandEvent& event) | ||
{ | ||
// return the selected game name | ||
m_game_name = m_game_lbox->GetStringSelection(); | ||
EndModal(wxID_OK); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright 2015 Dolphin Emulator Project | ||
// Licensed under GPLv2 | ||
// Refer to the license.txt file included. | ||
|
||
#pragma once | ||
|
||
#include <wx/dialog.h> | ||
|
||
class CGameListCtrl; | ||
class wxListBox; | ||
|
||
class ChangeGameDialog final : public wxDialog | ||
{ | ||
public: | ||
ChangeGameDialog(wxWindow* parent, const CGameListCtrl* const game_list, wxString& game_name); | ||
|
||
private: | ||
void OnPick(wxCommandEvent& event); | ||
|
||
wxListBox* m_game_lbox; | ||
wxString& m_game_name; | ||
}; |
Oops, something went wrong.