gui: Use newer wxWidgets event type names

Also add a comment about how the wxEVT_LIST_ITEM_DESELECTED bug only
affects Windows.
This commit is contained in:
Jonathan Li 2016-06-19 11:48:11 +01:00
parent b8ac54052c
commit 185012b2b7
4 changed files with 7 additions and 6 deletions

View File

@ -210,7 +210,7 @@ void Pcsx2App::PostMenuAction( MenuIdentifiers menu_id ) const
MainEmuFrame* mainFrame = GetMainFramePtr();
if( mainFrame == NULL ) return;
wxCommandEvent joe( wxEVT_COMMAND_MENU_SELECTED, menu_id );
wxCommandEvent joe( wxEVT_MENU, menu_id );
if( wxThread::IsMain() )
mainFrame->GetEventHandler()->ProcessEvent( joe );
else

View File

@ -191,7 +191,7 @@ void FirstTimeWizard::OnDoubleClicked( wxCommandEvent& evt )
wxWindow* forwardButton = FindWindow( wxID_FORWARD );
if( forwardButton == NULL ) return;
wxCommandEvent nextpg( wxEVT_COMMAND_BUTTON_CLICKED, wxID_FORWARD );
wxCommandEvent nextpg( wxEVT_BUTTON, wxID_FORWARD );
nextpg.SetEventObject( forwardButton );
forwardButton->GetEventHandler()->ProcessEvent( nextpg );
}

View File

@ -589,7 +589,7 @@ void MainEmuFrame::Menu_ShowConsole(wxCommandEvent &event)
// Use messages to relay open/close commands (thread-safe)
g_Conf->ProgLogBox.Visible = event.IsChecked();
wxCommandEvent evt( wxEVT_COMMAND_MENU_SELECTED, g_Conf->ProgLogBox.Visible ? wxID_OPEN : wxID_CLOSE );
wxCommandEvent evt( wxEVT_MENU, g_Conf->ProgLogBox.Visible ? wxID_OPEN : wxID_CLOSE );
wxGetApp().ProgramLog_PostEvent( evt );
}

View File

@ -199,7 +199,7 @@ Panels::BaseMcdListPanel::BaseMcdListPanel( wxWindow* parent )
void Panels::BaseMcdListPanel::RefreshMcds() const
{
wxCommandEvent refit( wxEVT_COMMAND_BUTTON_CLICKED );
wxCommandEvent refit( wxEVT_BUTTON );
refit.SetId( m_btn_Refresh->GetId() );
GetEventHandler()->AddPendingEvent( refit );
}
@ -423,6 +423,7 @@ Panels::MemoryCardListPanel_Simple::MemoryCardListPanel_Simple( wxWindow* parent
Bind(wxEVT_LIST_ITEM_ACTIVATED, &MemoryCardListPanel_Simple::OnItemActivated, this, m_listview->GetId()); //enter or double click
//Deselected is not working for some reason (e.g. when clicking an empty row at the table?) - avih
// wxMSW bug for virtual listviews. Works fine on Linux: http://trac.wxwidgets.org/ticket/1919 - turtleli
Bind(wxEVT_LIST_ITEM_DESELECTED, &MemoryCardListPanel_Simple::OnListSelectionChanged, this, m_listview->GetId());
Bind(wxEVT_LIST_ITEM_RIGHT_CLICK, &MemoryCardListPanel_Simple::OnOpenItemContextMenu, this, m_listview->GetId());
@ -441,10 +442,10 @@ Panels::MemoryCardListPanel_Simple::MemoryCardListPanel_Simple( wxWindow* parent
Bind(wxEVT_MENU, &MemoryCardListPanel_Simple::OnRenameFile, this, McdMenuId_Rename);
Bind(wxEVT_MENU, &MemoryCardListPanel_Simple::OnDuplicateFile, this, McdMenuId_Duplicate);
Bind(wxEVT_MENU, &MemoryCardListPanel_Simple::OnAssignUnassignFile, this, McdMenuId_AssignUnassign);
Bind(wxEVT_MENU, &MemoryCardListPanel_Simple::OnRefreshSelections, this, McdMenuId_RefreshList);
//because the wxEVT_COMMAND_LIST_ITEM_DESELECTED doesn't work (buttons stay enabled when clicking an empty area of the list),
//because the wxEVT_LIST_ITEM_DESELECTED doesn't work (buttons stay enabled when clicking an empty area of the list),
// m_listview can send us an event that indicates a change at the list. Ugly, but works.
g_uglyPanel=this;
m_listview->setExternHandler(g_uglyFunc);