2009-07-28 21:32:10 +00:00
|
|
|
|
// Copyright (C) 2003 Dolphin Project.
|
2009-02-23 06:15:48 +00:00
|
|
|
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
|
// the Free Software Foundation, version 2.0.
|
|
|
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
// GNU General Public License 2.0 for more details.
|
|
|
|
|
|
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
|
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
|
|
|
|
|
|
// Official SVN repository and contact information can be found at
|
|
|
|
|
// http://code.google.com/p/dolphin-emu/
|
|
|
|
|
|
|
|
|
|
|
2009-06-28 12:50:51 +00:00
|
|
|
|
/*
|
2009-06-20 11:05:52 +00:00
|
|
|
|
1.1 Windows
|
|
|
|
|
|
2009-05-13 22:23:54 +00:00
|
|
|
|
CFrame is the main parent window. Inside CFrame there is m_Panel which is the
|
|
|
|
|
parent for the rendering window (when we render to the main window). In Windows
|
|
|
|
|
the rendering window is created by giving CreateWindow() m_Panel->GetHandle()
|
|
|
|
|
as parent window and creating a new child window to m_Panel. The new child
|
|
|
|
|
window handle that is returned by CreateWindow() can be accessed from
|
|
|
|
|
Core::GetWindowHandle().
|
2009-06-28 12:50:51 +00:00
|
|
|
|
*/
|
2009-06-20 11:05:52 +00:00
|
|
|
|
|
2009-02-23 06:15:48 +00:00
|
|
|
|
|
2009-05-14 08:46:18 +00:00
|
|
|
|
// FIXME: why doesn't it work on windows???
|
|
|
|
|
#ifndef _WIN32
|
|
|
|
|
#include "Common.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
2009-06-20 11:05:52 +00:00
|
|
|
|
#include "Setup.h" // Common
|
|
|
|
|
|
2009-05-13 22:49:53 +00:00
|
|
|
|
#if defined(HAVE_SFML) && HAVE_SFML || defined(_WIN32)
|
2009-05-13 21:50:24 +00:00
|
|
|
|
#include "NetWindow.h"
|
2009-05-13 22:23:54 +00:00
|
|
|
|
#endif
|
2009-05-13 21:50:24 +00:00
|
|
|
|
|
2009-06-20 11:05:52 +00:00
|
|
|
|
#include "Common.h" // Common
|
|
|
|
|
#include "FileUtil.h"
|
|
|
|
|
#include "FileSearch.h"
|
|
|
|
|
#include "Timer.h"
|
|
|
|
|
|
2009-02-23 06:15:48 +00:00
|
|
|
|
#include "Globals.h" // Local
|
|
|
|
|
#include "Frame.h"
|
|
|
|
|
#include "ConfigMain.h"
|
|
|
|
|
#include "PluginManager.h"
|
|
|
|
|
#include "MemcardManager.h"
|
|
|
|
|
#include "CheatsWindow.h"
|
2009-04-24 18:04:50 +00:00
|
|
|
|
#include "InfoWindow.h"
|
2009-02-23 06:15:48 +00:00
|
|
|
|
#include "AboutDolphin.h"
|
|
|
|
|
#include "GameListCtrl.h"
|
|
|
|
|
#include "BootManager.h"
|
2009-08-31 23:09:50 +00:00
|
|
|
|
#include "LogWindow.h"
|
2009-06-16 19:10:37 +00:00
|
|
|
|
#include "WxUtils.h"
|
2009-02-23 06:15:48 +00:00
|
|
|
|
|
|
|
|
|
#include "ConfigManager.h" // Core
|
|
|
|
|
#include "Core.h"
|
2009-08-08 01:39:56 +00:00
|
|
|
|
#include "OnFrame.h"
|
2009-02-23 06:15:48 +00:00
|
|
|
|
#include "HW/DVDInterface.h"
|
|
|
|
|
#include "State.h"
|
|
|
|
|
#include "VolumeHandler.h"
|
2009-02-27 23:44:15 +00:00
|
|
|
|
#include "NANDContentLoader.h"
|
2009-02-23 06:15:48 +00:00
|
|
|
|
|
|
|
|
|
#include <wx/datetime.h> // wxWidgets
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Resources
|
|
|
|
|
extern "C" {
|
|
|
|
|
#include "../resources/Dolphin.c" // Dolphin icon
|
|
|
|
|
#include "../resources/toolbar_browse.c"
|
|
|
|
|
#include "../resources/toolbar_file_open.c"
|
|
|
|
|
#include "../resources/toolbar_fullscreen.c"
|
|
|
|
|
#include "../resources/toolbar_help.c"
|
|
|
|
|
#include "../resources/toolbar_pause.c"
|
|
|
|
|
#include "../resources/toolbar_play.c"
|
|
|
|
|
#include "../resources/toolbar_plugin_dsp.c"
|
|
|
|
|
#include "../resources/toolbar_plugin_gfx.c"
|
|
|
|
|
#include "../resources/toolbar_plugin_options.c"
|
|
|
|
|
#include "../resources/toolbar_plugin_pad.c"
|
|
|
|
|
#include "../resources/toolbar_refresh.c"
|
|
|
|
|
#include "../resources/toolbar_stop.c"
|
|
|
|
|
#include "../resources/Boomy.h" // Theme packages
|
|
|
|
|
#include "../resources/Vista.h"
|
|
|
|
|
#include "../resources/X-Plastik.h"
|
|
|
|
|
#include "../resources/KDE.h"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Other Windows
|
|
|
|
|
wxCheatsWindow* CheatsWindow;
|
2009-04-24 18:04:50 +00:00
|
|
|
|
wxInfoWindow* InfoWindow;
|
2009-02-23 06:15:48 +00:00
|
|
|
|
|
2009-08-25 07:49:23 +00:00
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
2009-02-23 06:15:48 +00:00
|
|
|
|
// Create menu items
|
2009-08-25 07:49:23 +00:00
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2009-02-23 06:15:48 +00:00
|
|
|
|
void CFrame::CreateMenu()
|
|
|
|
|
{
|
2009-04-16 02:32:21 +00:00
|
|
|
|
if (GetMenuBar())
|
|
|
|
|
GetMenuBar()->Destroy();
|
|
|
|
|
|
|
|
|
|
wxMenuBar* menuBar = new wxMenuBar(wxMB_DOCKABLE);
|
2009-02-23 06:15:48 +00:00
|
|
|
|
|
|
|
|
|
// file menu
|
|
|
|
|
wxMenu* fileMenu = new wxMenu;
|
2009-04-16 02:32:21 +00:00
|
|
|
|
fileMenu->Append(wxID_OPEN, _T("&Open...\tCtrl+O"));
|
2009-02-24 07:30:10 +00:00
|
|
|
|
|
2009-02-23 06:15:48 +00:00
|
|
|
|
wxMenu *externalDrive = new wxMenu;
|
2009-04-16 02:32:21 +00:00
|
|
|
|
m_pSubMenuDrive = fileMenu->AppendSubMenu(externalDrive, _T("&Boot from DVD Drive..."));
|
2009-02-24 15:04:12 +00:00
|
|
|
|
|
|
|
|
|
drives = cdio_get_devices();
|
|
|
|
|
for (int i = 0; drives[i] != NULL && i < 24; i++) {
|
|
|
|
|
externalDrive->Append(IDM_DRIVE1 + i, wxString::FromAscii(drives[i]));
|
2009-02-23 06:15:48 +00:00
|
|
|
|
}
|
2009-02-24 15:04:12 +00:00
|
|
|
|
|
2009-02-23 06:15:48 +00:00
|
|
|
|
fileMenu->AppendSeparator();
|
|
|
|
|
fileMenu->Append(wxID_REFRESH, _T("&Refresh List"));
|
|
|
|
|
fileMenu->AppendSeparator();
|
|
|
|
|
fileMenu->Append(IDM_BROWSE, _T("&Browse for ISOs..."));
|
|
|
|
|
|
|
|
|
|
fileMenu->AppendSeparator();
|
2009-06-29 09:24:39 +00:00
|
|
|
|
fileMenu->Append(wxID_EXIT, _T("E&xit\tAlt+F4"));
|
2009-04-16 02:32:21 +00:00
|
|
|
|
menuBar->Append(fileMenu, _T("&File"));
|
2009-02-23 06:15:48 +00:00
|
|
|
|
|
|
|
|
|
// Emulation menu
|
|
|
|
|
wxMenu* emulationMenu = new wxMenu;
|
2009-06-29 09:24:39 +00:00
|
|
|
|
emulationMenu->Append(IDM_PLAY, _T("&Play\tF10"));
|
2009-04-16 02:32:21 +00:00
|
|
|
|
emulationMenu->Append(IDM_STOP, _T("&Stop"));
|
2009-08-21 19:55:03 +00:00
|
|
|
|
emulationMenu->AppendSeparator();
|
|
|
|
|
emulationMenu->Append(IDM_RECORD, _T("Start &Recording..."));
|
|
|
|
|
emulationMenu->Append(IDM_PLAYRECORD, _T("P&lay Recording..."));
|
|
|
|
|
emulationMenu->AppendSeparator();
|
|
|
|
|
emulationMenu->Append(IDM_CHANGEDISC, _T("Change &Disc"));
|
|
|
|
|
|
2009-08-22 02:05:02 +00:00
|
|
|
|
emulationMenu->Append(IDM_FRAMESTEP, _T("&Frame Stepping"), wxEmptyString, wxITEM_CHECK);
|
|
|
|
|
|
2009-08-08 01:39:56 +00:00
|
|
|
|
wxMenu *skippingMenu = new wxMenu;
|
2009-08-22 02:05:02 +00:00
|
|
|
|
m_pSubMenuFrameSkipping = emulationMenu->AppendSubMenu(skippingMenu, _T("Frame S&kipping"));
|
2009-08-08 01:39:56 +00:00
|
|
|
|
for(int i = 0; i < 10; i++)
|
|
|
|
|
skippingMenu->Append(IDM_FRAMESKIP0 + i, wxString::Format(_T("%i"), i), wxEmptyString, wxITEM_RADIO);
|
|
|
|
|
|
2009-02-23 06:15:48 +00:00
|
|
|
|
emulationMenu->AppendSeparator();
|
2009-06-29 09:24:39 +00:00
|
|
|
|
emulationMenu->Append(IDM_SCREENSHOT, _T("Take S&creenshot\tF9"));
|
|
|
|
|
emulationMenu->AppendSeparator();
|
2009-02-23 06:15:48 +00:00
|
|
|
|
wxMenu *saveMenu = new wxMenu;
|
|
|
|
|
wxMenu *loadMenu = new wxMenu;
|
2009-06-28 01:11:35 +00:00
|
|
|
|
m_pSubMenuLoad = emulationMenu->AppendSubMenu(loadMenu, _T("&Load State"));
|
|
|
|
|
m_pSubMenuSave = emulationMenu->AppendSubMenu(saveMenu, _T("Sa&ve State"));
|
|
|
|
|
|
|
|
|
|
saveMenu->Append(IDM_SAVESTATEFILE, _T("Save State..."));
|
2009-06-28 21:11:51 +00:00
|
|
|
|
loadMenu->Append(IDM_UNDOSAVESTATE, _T("Last Overwritten State\tShift+F12"));
|
2009-06-28 01:11:35 +00:00
|
|
|
|
saveMenu->AppendSeparator();
|
|
|
|
|
|
|
|
|
|
loadMenu->Append(IDM_LOADSTATEFILE, _T("Load State..."));
|
|
|
|
|
loadMenu->Append(IDM_LOADLASTSTATE, _T("Last Saved State\tF11"));
|
2009-06-28 21:11:51 +00:00
|
|
|
|
loadMenu->Append(IDM_UNDOLOADSTATE, _T("Undo Load State\tF12"));
|
2009-06-28 01:11:35 +00:00
|
|
|
|
loadMenu->AppendSeparator();
|
|
|
|
|
|
2009-06-28 19:47:02 +00:00
|
|
|
|
for (int i = 1; i <= 8; i++) {
|
2009-06-28 01:11:35 +00:00
|
|
|
|
loadMenu->Append(IDM_LOADSLOT1 + i - 1, wxString::Format(_T("Slot %i\tF%i"), i, i));
|
|
|
|
|
saveMenu->Append(IDM_SAVESLOT1 + i - 1, wxString::Format(_T("Slot %i\tShift+F%i"), i, i));
|
2009-02-23 06:15:48 +00:00
|
|
|
|
}
|
2009-04-16 02:32:21 +00:00
|
|
|
|
menuBar->Append(emulationMenu, _T("&Emulation"));
|
2009-02-23 06:15:48 +00:00
|
|
|
|
|
|
|
|
|
// Options menu
|
|
|
|
|
wxMenu* pOptionsMenu = new wxMenu;
|
2009-04-16 02:32:21 +00:00
|
|
|
|
pOptionsMenu->Append(IDM_CONFIG_MAIN, _T("Co&nfigure..."));
|
2009-02-23 06:15:48 +00:00
|
|
|
|
pOptionsMenu->AppendSeparator();
|
|
|
|
|
pOptionsMenu->Append(IDM_CONFIG_GFX_PLUGIN, _T("&Graphics Settings"));
|
|
|
|
|
pOptionsMenu->Append(IDM_CONFIG_DSP_PLUGIN, _T("&DSP Settings"));
|
|
|
|
|
pOptionsMenu->Append(IDM_CONFIG_PAD_PLUGIN, _T("&Pad Settings"));
|
|
|
|
|
pOptionsMenu->Append(IDM_CONFIG_WIIMOTE_PLUGIN, _T("&Wiimote Settings"));
|
2009-08-31 21:46:29 +00:00
|
|
|
|
pOptionsMenu->AppendSeparator();
|
|
|
|
|
pOptionsMenu->Append(IDM_TOGGLE_FULLSCREEN, _T("&Fullscreen\tAlt+Enter"));
|
2009-04-16 02:32:21 +00:00
|
|
|
|
menuBar->Append(pOptionsMenu, _T("&Options"));
|
2009-02-23 06:15:48 +00:00
|
|
|
|
|
2009-03-02 21:58:56 +00:00
|
|
|
|
// Tools menu
|
|
|
|
|
wxMenu* toolsMenu = new wxMenu;
|
|
|
|
|
toolsMenu->Append(IDM_MEMCARD, _T("&Memcard Manager"));
|
|
|
|
|
toolsMenu->Append(IDM_CHEATS, _T("Action &Replay Manager"));
|
2009-04-24 18:04:50 +00:00
|
|
|
|
toolsMenu->Append(IDM_INFO, _T("System Information"));
|
2009-05-13 21:50:24 +00:00
|
|
|
|
|
2009-07-15 15:09:20 +00:00
|
|
|
|
#if defined(HAVE_SFML) && HAVE_SFML
|
2009-05-13 21:50:24 +00:00
|
|
|
|
toolsMenu->Append(IDM_NETPLAY, _T("Start &NetPlay"));
|
2009-07-15 15:09:20 +00:00
|
|
|
|
#endif
|
2009-04-28 02:30:50 +00:00
|
|
|
|
|
|
|
|
|
if (DiscIO::CNANDContentManager::Access().GetNANDLoader(FULL_WII_MENU_DIR).IsValid())
|
|
|
|
|
{
|
|
|
|
|
toolsMenu->Append(IDM_LOAD_WII_MENU, _T("Load Wii Menu"));
|
|
|
|
|
}
|
2009-02-27 23:44:15 +00:00
|
|
|
|
|
2009-04-16 02:32:21 +00:00
|
|
|
|
menuBar->Append(toolsMenu, _T("&Tools"));
|
2009-02-23 06:15:48 +00:00
|
|
|
|
|
2009-04-28 02:30:50 +00:00
|
|
|
|
wxMenu* viewMenu = new wxMenu;
|
|
|
|
|
viewMenu->AppendCheckItem(IDM_TOGGLE_TOOLBAR, _T("Show &Toolbar"));
|
|
|
|
|
viewMenu->Check(IDM_TOGGLE_TOOLBAR, SConfig::GetInstance().m_InterfaceToolbar);
|
|
|
|
|
viewMenu->AppendCheckItem(IDM_TOGGLE_STATUSBAR, _T("Show &Statusbar"));
|
|
|
|
|
viewMenu->Check(IDM_TOGGLE_STATUSBAR, SConfig::GetInstance().m_InterfaceStatusbar);
|
2009-08-31 23:09:50 +00:00
|
|
|
|
viewMenu->AppendCheckItem(IDM_LOGWINDOW, _T("Show &Logwindow"));
|
2009-09-01 14:33:16 +00:00
|
|
|
|
viewMenu->Check(IDM_LOGWINDOW, SConfig::GetInstance().m_InterfaceLogWindow);
|
2009-08-27 19:38:35 +00:00
|
|
|
|
viewMenu->AppendCheckItem(IDM_CONSOLEWINDOW, _T("Show &Console"));
|
|
|
|
|
viewMenu->Check(IDM_CONSOLEWINDOW, SConfig::GetInstance().m_InterfaceConsole);
|
2009-04-28 02:30:50 +00:00
|
|
|
|
viewMenu->AppendSeparator();
|
|
|
|
|
|
|
|
|
|
viewMenu->AppendCheckItem(IDM_LISTWII, _T("Show Wii"));
|
|
|
|
|
viewMenu->Check(IDM_LISTWII, SConfig::GetInstance().m_ListWii);
|
|
|
|
|
viewMenu->AppendCheckItem(IDM_LISTGC, _T("Show GameCube"));
|
|
|
|
|
viewMenu->Check(IDM_LISTGC, SConfig::GetInstance().m_ListGC);
|
2009-06-07 02:27:36 +00:00
|
|
|
|
viewMenu->AppendCheckItem(IDM_LISTWAD, _T("Show Wad"));
|
|
|
|
|
viewMenu->Check(IDM_LISTWAD, SConfig::GetInstance().m_ListWad);
|
2009-04-28 02:30:50 +00:00
|
|
|
|
viewMenu->AppendCheckItem(IDM_LISTJAP, _T("Show JAP"));
|
|
|
|
|
viewMenu->Check(IDM_LISTJAP, SConfig::GetInstance().m_ListJap);
|
|
|
|
|
viewMenu->AppendCheckItem(IDM_LISTPAL, _T("Show PAL"));
|
|
|
|
|
viewMenu->Check(IDM_LISTPAL, SConfig::GetInstance().m_ListPal);
|
|
|
|
|
viewMenu->AppendCheckItem(IDM_LISTUSA, _T("Show USA"));
|
|
|
|
|
viewMenu->Check(IDM_LISTUSA, SConfig::GetInstance().m_ListUsa);
|
|
|
|
|
viewMenu->AppendCheckItem(IDM_LISTDRIVES, _T("Show Drives"));
|
|
|
|
|
viewMenu->Check(IDM_LISTDRIVES, SConfig::GetInstance().m_ListDrives);
|
2009-06-06 07:36:22 +00:00
|
|
|
|
viewMenu->AppendSeparator();
|
2009-06-07 02:27:36 +00:00
|
|
|
|
viewMenu->Append(IDM_PURGECACHE, _T("Purge Cache"));
|
2009-04-28 02:30:50 +00:00
|
|
|
|
menuBar->Append(viewMenu, _T("&View"));
|
|
|
|
|
|
2009-02-23 06:15:48 +00:00
|
|
|
|
// Help menu
|
|
|
|
|
wxMenu* helpMenu = new wxMenu;
|
|
|
|
|
/*helpMenu->Append(wxID_HELP, _T("&Help"));
|
|
|
|
|
re-enable when there's something useful to display*/
|
|
|
|
|
helpMenu->Append(IDM_HELPWEBSITE, _T("Dolphin &Web Site"));
|
|
|
|
|
helpMenu->Append(IDM_HELPGOOGLECODE, _T("Dolphin at &Google Code"));
|
|
|
|
|
helpMenu->AppendSeparator();
|
|
|
|
|
helpMenu->Append(IDM_HELPABOUT, _T("&About..."));
|
2009-04-16 02:32:21 +00:00
|
|
|
|
menuBar->Append(helpMenu, _T("&Help"));
|
2009-02-23 06:15:48 +00:00
|
|
|
|
|
2009-08-25 01:50:27 +00:00
|
|
|
|
if (UseDebugger) g_pCodeWindow->CreateMenu(SConfig::GetInstance().m_LocalCoreStartupParameter, menuBar);
|
|
|
|
|
|
2009-02-23 06:15:48 +00:00
|
|
|
|
// Associate the menu bar with the frame
|
2009-04-16 02:32:21 +00:00
|
|
|
|
SetMenuBar(menuBar);
|
2009-02-23 06:15:48 +00:00
|
|
|
|
}
|
2009-08-25 07:49:23 +00:00
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
2009-02-23 06:15:48 +00:00
|
|
|
|
|
|
|
|
|
|
2009-08-25 07:49:23 +00:00
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
2009-02-23 06:15:48 +00:00
|
|
|
|
// Create toolbar items
|
2009-08-25 07:49:23 +00:00
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2009-08-27 07:33:07 +00:00
|
|
|
|
void CFrame::PopulateToolbar(wxAuiToolBar* ToolBar)
|
2009-02-23 06:15:48 +00:00
|
|
|
|
{
|
|
|
|
|
int w = m_Bitmaps[Toolbar_FileOpen].GetWidth(),
|
|
|
|
|
h = m_Bitmaps[Toolbar_FileOpen].GetHeight();
|
2009-08-27 07:33:07 +00:00
|
|
|
|
ToolBar->SetToolBitmapSize(wxSize(w, h));
|
|
|
|
|
|
|
|
|
|
ToolBar->AddTool(wxID_OPEN, _T("Open"), m_Bitmaps[Toolbar_FileOpen], _T("Open file..."));
|
|
|
|
|
ToolBar->AddTool(wxID_REFRESH, _T("Refresh"), m_Bitmaps[Toolbar_Refresh], _T("Refresh"));
|
|
|
|
|
ToolBar->AddTool(IDM_BROWSE, _T("Browse"), m_Bitmaps[Toolbar_Browse], _T("Browse for an ISO directory..."));
|
|
|
|
|
ToolBar->AddSeparator();
|
|
|
|
|
ToolBar->AddTool(IDM_PLAY, wxT(""), m_Bitmaps[Toolbar_Play], _T("Play"));
|
|
|
|
|
ToolBar->AddTool(IDM_STOP, _T("Stop"), m_Bitmaps[Toolbar_Stop], _T("Stop"));
|
|
|
|
|
ToolBar->AddTool(IDM_TOGGLE_FULLSCREEN, _T("Fullscr."), m_Bitmaps[Toolbar_FullScreen], _T("Toggle Fullscreen"));
|
|
|
|
|
ToolBar->AddTool(IDM_SCREENSHOT, _T("Scr.Shot"), m_Bitmaps[Toolbar_FullScreen], _T("Take Screenshot"));
|
|
|
|
|
ToolBar->AddSeparator();
|
|
|
|
|
ToolBar->AddTool(IDM_CONFIG_MAIN, _T("Config"), m_Bitmaps[Toolbar_PluginOptions], _T("Configure..."));
|
|
|
|
|
ToolBar->AddTool(IDM_CONFIG_GFX_PLUGIN, _T("Gfx"), m_Bitmaps[Toolbar_PluginGFX], _T("Graphics settings"));
|
|
|
|
|
ToolBar->AddTool(IDM_CONFIG_DSP_PLUGIN, _T("DSP"), m_Bitmaps[Toolbar_PluginDSP], _T("DSP settings"));
|
|
|
|
|
ToolBar->AddTool(IDM_CONFIG_PAD_PLUGIN, _T("Pad"), m_Bitmaps[Toolbar_PluginPAD], _T("Pad settings"));
|
|
|
|
|
ToolBar->AddTool(IDM_CONFIG_WIIMOTE_PLUGIN, _T("Wiimote"), m_Bitmaps[Toolbar_Wiimote], _T("Wiimote settings"));
|
|
|
|
|
ToolBar->AddSeparator();
|
|
|
|
|
ToolBar->AddTool(IDM_HELPABOUT, _T("About"), m_Bitmaps[Toolbar_Help], _T("About Dolphin"));
|
2009-02-23 06:15:48 +00:00
|
|
|
|
|
|
|
|
|
// after adding the buttons to the toolbar, must call Realize() to reflect
|
|
|
|
|
// the changes
|
2009-08-27 07:33:07 +00:00
|
|
|
|
ToolBar->Realize();
|
|
|
|
|
}
|
|
|
|
|
void CFrame::PopulateToolbarAui(wxAuiToolBar* ToolBar)
|
|
|
|
|
{
|
|
|
|
|
int w = m_Bitmaps[Toolbar_FileOpen].GetWidth(),
|
|
|
|
|
h = m_Bitmaps[Toolbar_FileOpen].GetHeight();
|
|
|
|
|
ToolBar->SetToolBitmapSize(wxSize(w, h));
|
|
|
|
|
|
2009-08-30 19:44:42 +00:00
|
|
|
|
ToolBar->AddTool(IDM_SAVE_PERSPECTIVE, wxT("Save"), g_pCodeWindow->m_Bitmaps[Toolbar_GotoPC], wxT("Save current perspective"));
|
|
|
|
|
ToolBar->AddTool(IDM_PERSPECTIVES_ADD_PANE, wxT("Add"), g_pCodeWindow->m_Bitmaps[Toolbar_GotoPC], wxT("Add new pane"));
|
|
|
|
|
ToolBar->AddTool(IDM_EDIT_PERSPECTIVES, wxT("Edit"), g_pCodeWindow->m_Bitmaps[Toolbar_GotoPC], wxT("Edit current perspective"), wxITEM_CHECK);
|
|
|
|
|
ToolBar->AddTool(IDM_TAB_SPLIT, wxT("Split"), g_pCodeWindow->m_Bitmaps[Toolbar_GotoPC], wxT("Tab split"), wxITEM_CHECK);
|
|
|
|
|
|
|
|
|
|
ToolBar->SetToolDropDown(IDM_SAVE_PERSPECTIVE, true);
|
2009-08-27 07:33:07 +00:00
|
|
|
|
|
|
|
|
|
ToolBar->Realize();
|
2009-02-23 06:15:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Delete and recreate the toolbar
|
|
|
|
|
void CFrame::RecreateToolbar()
|
|
|
|
|
{
|
2009-08-25 10:58:13 +00:00
|
|
|
|
m_ToolBar = new wxAuiToolBar(this, ID_TOOLBAR, wxDefaultPosition, wxDefaultSize,
|
2009-08-25 01:50:27 +00:00
|
|
|
|
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_OVERFLOW | wxAUI_TB_TEXT);
|
2009-08-25 07:49:23 +00:00
|
|
|
|
PopulateToolbar(m_ToolBar);
|
2009-09-01 12:44:02 +00:00
|
|
|
|
|
2009-08-25 07:49:23 +00:00
|
|
|
|
m_Mgr->AddPane(m_ToolBar, wxAuiPaneInfo().
|
2009-08-25 06:34:58 +00:00
|
|
|
|
Name(wxT("TBMain")).Caption(wxT("TBMain")).
|
2009-08-25 01:50:27 +00:00
|
|
|
|
ToolbarPane().Top().
|
2009-08-25 07:49:23 +00:00
|
|
|
|
LeftDockable(false).RightDockable(false).Floatable(false));
|
2009-08-25 01:50:27 +00:00
|
|
|
|
|
|
|
|
|
if (UseDebugger)
|
|
|
|
|
{
|
2009-08-27 07:33:07 +00:00
|
|
|
|
m_ToolBarDebug = new wxAuiToolBar(this, ID_TOOLBAR_DEBUG, wxDefaultPosition, wxDefaultSize,
|
2009-08-25 01:50:27 +00:00
|
|
|
|
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_OVERFLOW | wxAUI_TB_TEXT);
|
2009-08-27 07:33:07 +00:00
|
|
|
|
g_pCodeWindow->PopulateToolbar(m_ToolBarDebug);
|
2009-09-01 12:44:02 +00:00
|
|
|
|
|
2009-08-27 07:33:07 +00:00
|
|
|
|
m_Mgr->AddPane(m_ToolBarDebug, wxAuiPaneInfo().
|
2009-08-25 06:34:58 +00:00
|
|
|
|
Name(wxT("TBDebug")).Caption(wxT("TBDebug")).
|
2009-08-25 01:50:27 +00:00
|
|
|
|
ToolbarPane().Top().
|
2009-08-25 07:49:23 +00:00
|
|
|
|
LeftDockable(false).RightDockable(false).Floatable(false));
|
2009-08-27 07:33:07 +00:00
|
|
|
|
|
|
|
|
|
m_ToolBarAui = new wxAuiToolBar(this, ID_TOOLBAR_AUI, wxDefaultPosition, wxDefaultSize,
|
|
|
|
|
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_OVERFLOW | wxAUI_TB_TEXT);
|
|
|
|
|
PopulateToolbarAui(m_ToolBarAui);
|
|
|
|
|
m_Mgr->AddPane(m_ToolBarAui, wxAuiPaneInfo().
|
|
|
|
|
Name(wxT("TBAui")).Caption(wxT("TBAui")).
|
|
|
|
|
ToolbarPane().Top().
|
|
|
|
|
LeftDockable(false).RightDockable(false).Floatable(false));
|
2009-08-25 01:50:27 +00:00
|
|
|
|
}
|
2009-02-23 06:15:48 +00:00
|
|
|
|
}
|
2009-06-18 08:22:02 +00:00
|
|
|
|
|
2009-02-23 06:15:48 +00:00
|
|
|
|
void CFrame::InitBitmaps()
|
|
|
|
|
{
|
|
|
|
|
// Get selected theme
|
|
|
|
|
int Theme = SConfig::GetInstance().m_LocalCoreStartupParameter.iTheme;
|
|
|
|
|
|
2009-06-18 08:22:02 +00:00
|
|
|
|
// Save memory by only having one set of bitmaps loaded at any time. I mean, they are still
|
|
|
|
|
// in the exe, which is in memory, but at least we wont make another copy of all of them. */
|
2009-02-23 06:15:48 +00:00
|
|
|
|
switch (Theme)
|
|
|
|
|
{
|
|
|
|
|
case BOOMY:
|
|
|
|
|
{
|
|
|
|
|
// These are stored as 48x48
|
|
|
|
|
m_Bitmaps[Toolbar_FileOpen] = wxGetBitmapFromMemory(toolbar_file_open_png);
|
|
|
|
|
m_Bitmaps[Toolbar_Refresh] = wxGetBitmapFromMemory(toolbar_refresh_png);
|
|
|
|
|
m_Bitmaps[Toolbar_Browse] = wxGetBitmapFromMemory(toolbar_browse_png);
|
|
|
|
|
m_Bitmaps[Toolbar_Play] = wxGetBitmapFromMemory(toolbar_play_png);
|
|
|
|
|
m_Bitmaps[Toolbar_Stop] = wxGetBitmapFromMemory(toolbar_stop_png);
|
|
|
|
|
m_Bitmaps[Toolbar_Pause] = wxGetBitmapFromMemory(toolbar_pause_png);
|
|
|
|
|
m_Bitmaps[Toolbar_PluginOptions]= wxGetBitmapFromMemory(toolbar_plugin_options_png);
|
|
|
|
|
m_Bitmaps[Toolbar_PluginGFX] = wxGetBitmapFromMemory(toolbar_plugin_gfx_png);
|
|
|
|
|
m_Bitmaps[Toolbar_PluginDSP] = wxGetBitmapFromMemory(toolbar_plugin_dsp_png);
|
|
|
|
|
m_Bitmaps[Toolbar_PluginPAD] = wxGetBitmapFromMemory(toolbar_plugin_pad_png);
|
2009-02-27 06:24:54 +00:00
|
|
|
|
m_Bitmaps[Toolbar_Wiimote] = wxGetBitmapFromMemory(toolbar_plugin_pad_png);
|
|
|
|
|
m_Bitmaps[Toolbar_Screenshot] = wxGetBitmapFromMemory(toolbar_fullscreen_png);
|
2009-02-23 06:15:48 +00:00
|
|
|
|
m_Bitmaps[Toolbar_FullScreen] = wxGetBitmapFromMemory(toolbar_fullscreen_png);
|
|
|
|
|
m_Bitmaps[Toolbar_Help] = wxGetBitmapFromMemory(toolbar_help_png);
|
|
|
|
|
|
|
|
|
|
// Scale the 48x48 bitmaps to 24x24
|
|
|
|
|
for (size_t n = Toolbar_FileOpen; n <= Toolbar_Help; n++)
|
|
|
|
|
{
|
|
|
|
|
m_Bitmaps[n] = wxBitmap(m_Bitmaps[n].ConvertToImage().Scale(24, 24));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case VISTA:
|
|
|
|
|
{
|
|
|
|
|
// These are stored as 24x24 and need no scaling
|
|
|
|
|
m_Bitmaps[Toolbar_FileOpen] = wxGetBitmapFromMemory(Toolbar_Open1_png);
|
|
|
|
|
m_Bitmaps[Toolbar_Refresh] = wxGetBitmapFromMemory(Toolbar_Refresh1_png);
|
|
|
|
|
m_Bitmaps[Toolbar_Browse] = wxGetBitmapFromMemory(Toolbar_Browse1_png);
|
|
|
|
|
m_Bitmaps[Toolbar_Play] = wxGetBitmapFromMemory(Toolbar_Play1_png);
|
|
|
|
|
m_Bitmaps[Toolbar_Stop] = wxGetBitmapFromMemory(Toolbar_Stop1_png);
|
|
|
|
|
m_Bitmaps[Toolbar_Pause] = wxGetBitmapFromMemory(Toolbar_Pause1_png);
|
|
|
|
|
m_Bitmaps[Toolbar_PluginOptions]= wxGetBitmapFromMemory(Toolbar_Options1_png);
|
|
|
|
|
m_Bitmaps[Toolbar_PluginGFX] = wxGetBitmapFromMemory(Toolbar_Gfx1_png);
|
|
|
|
|
m_Bitmaps[Toolbar_PluginDSP] = wxGetBitmapFromMemory(Toolbar_DSP1_png);
|
|
|
|
|
m_Bitmaps[Toolbar_PluginPAD] = wxGetBitmapFromMemory(Toolbar_Pad1_png);
|
|
|
|
|
m_Bitmaps[Toolbar_Wiimote] = wxGetBitmapFromMemory(Toolbar_Wiimote1_png);
|
2009-02-27 06:24:54 +00:00
|
|
|
|
m_Bitmaps[Toolbar_Screenshot] = wxGetBitmapFromMemory(Toolbar_Fullscreen1_png);
|
2009-02-23 06:15:48 +00:00
|
|
|
|
m_Bitmaps[Toolbar_FullScreen] = wxGetBitmapFromMemory(Toolbar_Fullscreen1_png);
|
|
|
|
|
m_Bitmaps[Toolbar_Help] = wxGetBitmapFromMemory(Toolbar_Help1_png);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case XPLASTIK:
|
|
|
|
|
{
|
|
|
|
|
m_Bitmaps[Toolbar_FileOpen] = wxGetBitmapFromMemory(Toolbar_Open2_png);
|
|
|
|
|
m_Bitmaps[Toolbar_Refresh] = wxGetBitmapFromMemory(Toolbar_Refresh2_png);
|
|
|
|
|
m_Bitmaps[Toolbar_Browse] = wxGetBitmapFromMemory(Toolbar_Browse2_png);
|
|
|
|
|
m_Bitmaps[Toolbar_Play] = wxGetBitmapFromMemory(Toolbar_Play2_png);
|
|
|
|
|
m_Bitmaps[Toolbar_Stop] = wxGetBitmapFromMemory(Toolbar_Stop2_png);
|
|
|
|
|
m_Bitmaps[Toolbar_Pause] = wxGetBitmapFromMemory(Toolbar_Pause2_png);
|
|
|
|
|
m_Bitmaps[Toolbar_PluginOptions]= wxGetBitmapFromMemory(Toolbar_Options2_png);
|
|
|
|
|
m_Bitmaps[Toolbar_PluginGFX] = wxGetBitmapFromMemory(Toolbar_Gfx2_png);
|
|
|
|
|
m_Bitmaps[Toolbar_PluginDSP] = wxGetBitmapFromMemory(Toolbar_DSP2_png);
|
|
|
|
|
m_Bitmaps[Toolbar_PluginPAD] = wxGetBitmapFromMemory(Toolbar_Pad2_png);
|
|
|
|
|
m_Bitmaps[Toolbar_Wiimote] = wxGetBitmapFromMemory(Toolbar_Wiimote2_png);
|
2009-02-27 06:24:54 +00:00
|
|
|
|
m_Bitmaps[Toolbar_Screenshot] = wxGetBitmapFromMemory(Toolbar_Fullscreen2_png);
|
2009-02-23 06:15:48 +00:00
|
|
|
|
m_Bitmaps[Toolbar_FullScreen] = wxGetBitmapFromMemory(Toolbar_Fullscreen2_png);
|
|
|
|
|
m_Bitmaps[Toolbar_Help] = wxGetBitmapFromMemory(Toolbar_Help2_png);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case KDE:
|
|
|
|
|
{
|
|
|
|
|
m_Bitmaps[Toolbar_FileOpen] = wxGetBitmapFromMemory(Toolbar_Open3_png);
|
|
|
|
|
m_Bitmaps[Toolbar_Refresh] = wxGetBitmapFromMemory(Toolbar_Refresh3_png);
|
|
|
|
|
m_Bitmaps[Toolbar_Browse] = wxGetBitmapFromMemory(Toolbar_Browse3_png);
|
|
|
|
|
m_Bitmaps[Toolbar_Play] = wxGetBitmapFromMemory(Toolbar_Play3_png);
|
|
|
|
|
m_Bitmaps[Toolbar_Stop] = wxGetBitmapFromMemory(Toolbar_Stop3_png);
|
|
|
|
|
m_Bitmaps[Toolbar_Pause] = wxGetBitmapFromMemory(Toolbar_Pause3_png);
|
|
|
|
|
m_Bitmaps[Toolbar_PluginOptions]= wxGetBitmapFromMemory(Toolbar_Options3_png);
|
|
|
|
|
m_Bitmaps[Toolbar_PluginGFX] = wxGetBitmapFromMemory(Toolbar_Gfx3_png);
|
|
|
|
|
m_Bitmaps[Toolbar_PluginDSP] = wxGetBitmapFromMemory(Toolbar_DSP3_png);
|
|
|
|
|
m_Bitmaps[Toolbar_PluginPAD] = wxGetBitmapFromMemory(Toolbar_Pad3_png);
|
|
|
|
|
m_Bitmaps[Toolbar_Wiimote] = wxGetBitmapFromMemory(Toolbar_Wiimote3_png);
|
2009-02-27 06:24:54 +00:00
|
|
|
|
m_Bitmaps[Toolbar_Screenshot] = wxGetBitmapFromMemory(Toolbar_Fullscreen3_png);
|
2009-02-23 06:15:48 +00:00
|
|
|
|
m_Bitmaps[Toolbar_FullScreen] = wxGetBitmapFromMemory(Toolbar_Fullscreen3_png);
|
|
|
|
|
m_Bitmaps[Toolbar_Help] = wxGetBitmapFromMemory(Toolbar_Help3_png);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default: PanicAlert("Theme selection went wrong");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Update in case the bitmap has been updated
|
2009-08-27 10:10:07 +00:00
|
|
|
|
//if (GetToolBar() != NULL) RecreateToolbar();
|
|
|
|
|
|
|
|
|
|
aNormalFile = wxArtProvider::GetBitmap(wxART_NORMAL_FILE, wxART_OTHER, wxSize(16,16));
|
2009-02-23 06:15:48 +00:00
|
|
|
|
}
|
2009-08-25 07:49:23 +00:00
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
2009-02-23 06:15:48 +00:00
|
|
|
|
|
|
|
|
|
|
2009-08-25 07:49:23 +00:00
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
// Menu items
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
2009-02-23 06:15:48 +00:00
|
|
|
|
// Start the game or change the disc
|
|
|
|
|
void CFrame::BootGame()
|
|
|
|
|
{
|
|
|
|
|
// Rerecording
|
|
|
|
|
#ifdef RERECORDING
|
|
|
|
|
Core::RerecordingStart();
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
if (Core::GetState() != Core::CORE_UNINITIALIZED)
|
|
|
|
|
{
|
|
|
|
|
if (Core::GetState() == Core::CORE_RUN)
|
|
|
|
|
{
|
|
|
|
|
Core::SetState(Core::CORE_PAUSE);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Core::SetState(Core::CORE_RUN);
|
|
|
|
|
}
|
|
|
|
|
UpdateGUI();
|
|
|
|
|
}
|
2009-07-01 04:55:53 +00:00
|
|
|
|
// Start the selected ISO, return if gamelist is empty
|
|
|
|
|
else if (m_GameListCtrl->GetSelectedISO() == 0) return;
|
|
|
|
|
else if (m_GameListCtrl->GetSelectedISO()->IsValid())
|
2009-02-23 06:15:48 +00:00
|
|
|
|
{
|
|
|
|
|
BootManager::BootCore(m_GameListCtrl->GetSelectedISO()->GetFileName());
|
|
|
|
|
}
|
2009-06-18 08:22:02 +00:00
|
|
|
|
// Start the default ISO, or if we don't have a default ISO, start the last
|
|
|
|
|
// started ISO
|
2009-02-23 06:15:48 +00:00
|
|
|
|
else if (!SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultGCM.empty() &&
|
|
|
|
|
wxFileExists(wxString(SConfig::GetInstance().m_LocalCoreStartupParameter.
|
|
|
|
|
m_strDefaultGCM.c_str(), wxConvUTF8)))
|
|
|
|
|
{
|
|
|
|
|
BootManager::BootCore(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultGCM);
|
|
|
|
|
}
|
|
|
|
|
else if (!SConfig::GetInstance().m_LastFilename.empty() &&
|
|
|
|
|
wxFileExists(wxString(SConfig::GetInstance().m_LastFilename.c_str(), wxConvUTF8)))
|
|
|
|
|
{
|
|
|
|
|
BootManager::BootCore(SConfig::GetInstance().m_LastFilename);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2009-06-18 08:22:02 +00:00
|
|
|
|
// Open file to boot
|
2009-02-23 06:15:48 +00:00
|
|
|
|
void CFrame::OnOpen(wxCommandEvent& WXUNUSED (event))
|
|
|
|
|
{
|
|
|
|
|
DoOpen(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CFrame::DoOpen(bool Boot)
|
|
|
|
|
{
|
2009-07-30 07:09:26 +00:00
|
|
|
|
std::string currentDir = File::GetCurrentDir();
|
2009-02-24 07:18:08 +00:00
|
|
|
|
|
2009-02-23 06:15:48 +00:00
|
|
|
|
wxString path = wxFileSelector(
|
|
|
|
|
_T("Select the file to load"),
|
|
|
|
|
wxEmptyString, wxEmptyString, wxEmptyString,
|
|
|
|
|
wxString::Format
|
|
|
|
|
(
|
|
|
|
|
_T("All GC/Wii files (elf, dol, gcm, iso, wad)|*.elf;*.dol;*.gcm;*.iso;*.gcz;*.wad|All files (%s)|%s"),
|
|
|
|
|
wxFileSelectorDefaultWildcardStr,
|
|
|
|
|
wxFileSelectorDefaultWildcardStr
|
|
|
|
|
),
|
|
|
|
|
wxFD_OPEN | wxFD_PREVIEW | wxFD_FILE_MUST_EXIST,
|
|
|
|
|
this);
|
2009-06-18 08:22:02 +00:00
|
|
|
|
|
2009-07-01 04:55:53 +00:00
|
|
|
|
bool fileChosen = !path.IsEmpty();
|
2009-02-23 06:15:48 +00:00
|
|
|
|
|
2009-07-30 07:09:26 +00:00
|
|
|
|
std::string currentDir2 = File::GetCurrentDir();
|
2009-02-24 07:18:08 +00:00
|
|
|
|
|
|
|
|
|
if (currentDir != currentDir2)
|
|
|
|
|
{
|
2009-06-18 08:22:02 +00:00
|
|
|
|
PanicAlert("Current dir changed from %s to %s after wxFileSelector!",currentDir.c_str(),currentDir2.c_str());
|
2009-07-30 07:09:26 +00:00
|
|
|
|
File::SetCurrentDir(currentDir.c_str());
|
2009-02-24 07:18:08 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2009-02-23 06:15:48 +00:00
|
|
|
|
// Should we boot a new game or just change the disc?
|
2009-06-18 08:22:02 +00:00
|
|
|
|
if (Boot)
|
2009-02-23 06:15:48 +00:00
|
|
|
|
{
|
2009-06-18 08:22:02 +00:00
|
|
|
|
if (!fileChosen)
|
|
|
|
|
return;
|
2009-08-02 05:59:55 +00:00
|
|
|
|
BootManager::BootCore(std::string(path.mb_str()));
|
2009-02-23 06:15:48 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2009-06-18 08:22:02 +00:00
|
|
|
|
if (!fileChosen)
|
|
|
|
|
path = wxT("");
|
2009-08-12 05:57:59 +00:00
|
|
|
|
// temp is deleted by changediscCallback
|
|
|
|
|
char * temp = new char[strlen(path.mb_str())];
|
|
|
|
|
strncpy(temp, path.mb_str(), strlen(path.mb_str()));
|
|
|
|
|
DVDInterface::ChangeDisc(temp);
|
2009-02-23 06:15:48 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2009-08-22 02:05:02 +00:00
|
|
|
|
void CFrame::OnFrameStep(wxCommandEvent& event)
|
|
|
|
|
{
|
|
|
|
|
Frame::SetFrameStepping(event.IsChecked());
|
|
|
|
|
}
|
|
|
|
|
|
2009-02-23 06:15:48 +00:00
|
|
|
|
void CFrame::OnChangeDisc(wxCommandEvent& WXUNUSED (event))
|
|
|
|
|
{
|
|
|
|
|
DoOpen(false);
|
|
|
|
|
}
|
|
|
|
|
|
2009-08-21 09:26:34 +00:00
|
|
|
|
void CFrame::OnRecord(wxCommandEvent& WXUNUSED (event))
|
|
|
|
|
{
|
|
|
|
|
wxString path = wxFileSelector(
|
|
|
|
|
_T("Select The Recording File"),
|
|
|
|
|
wxEmptyString, wxEmptyString, wxEmptyString,
|
|
|
|
|
wxString::Format
|
|
|
|
|
(
|
|
|
|
|
_T("Dolphin TAS Movies (*.dtm)|*.dtm|All files (%s)|%s"),
|
|
|
|
|
wxFileSelectorDefaultWildcardStr,
|
|
|
|
|
wxFileSelectorDefaultWildcardStr
|
|
|
|
|
),
|
|
|
|
|
wxFD_SAVE | wxFD_PREVIEW | wxFD_FILE_MUST_EXIST,
|
|
|
|
|
this);
|
|
|
|
|
|
|
|
|
|
if(path.IsEmpty())
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
// TODO: Take controller settings from Gamecube Configuration menu
|
2009-08-21 19:55:03 +00:00
|
|
|
|
if(Frame::BeginRecordingInput(path.mb_str(), 1))
|
|
|
|
|
BootGame();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CFrame::OnPlayRecording(wxCommandEvent& WXUNUSED (event))
|
|
|
|
|
{
|
|
|
|
|
wxString path = wxFileSelector(
|
|
|
|
|
_T("Select The Recording File"),
|
|
|
|
|
wxEmptyString, wxEmptyString, wxEmptyString,
|
|
|
|
|
wxString::Format
|
|
|
|
|
(
|
|
|
|
|
_T("Dolphin TAS Movies (*.dtm)|*.dtm|All files (%s)|%s"),
|
|
|
|
|
wxFileSelectorDefaultWildcardStr,
|
|
|
|
|
wxFileSelectorDefaultWildcardStr
|
|
|
|
|
),
|
|
|
|
|
wxFD_OPEN | wxFD_PREVIEW | wxFD_FILE_MUST_EXIST,
|
|
|
|
|
this);
|
|
|
|
|
|
|
|
|
|
if(path.IsEmpty())
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if(Frame::PlayInput(path.mb_str()))
|
|
|
|
|
BootGame();
|
2009-08-21 09:26:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
2009-02-23 06:15:48 +00:00
|
|
|
|
void CFrame::OnPlay(wxCommandEvent& WXUNUSED (event))
|
|
|
|
|
{
|
|
|
|
|
BootGame();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CFrame::OnBootDrive(wxCommandEvent& event)
|
|
|
|
|
{
|
2009-02-24 15:04:12 +00:00
|
|
|
|
BootManager::BootCore(drives[event.GetId()-IDM_DRIVE1]);
|
2009-02-23 06:15:48 +00:00
|
|
|
|
}
|
2009-06-20 11:05:52 +00:00
|
|
|
|
|
2009-02-23 06:15:48 +00:00
|
|
|
|
|
|
|
|
|
// Refresh the file list and browse for a favorites directory
|
|
|
|
|
void CFrame::OnRefresh(wxCommandEvent& WXUNUSED (event))
|
|
|
|
|
{
|
|
|
|
|
if (m_GameListCtrl)
|
|
|
|
|
{
|
|
|
|
|
m_GameListCtrl->Update();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CFrame::OnBrowse(wxCommandEvent& WXUNUSED (event))
|
|
|
|
|
{
|
|
|
|
|
m_GameListCtrl->BrowseForDirectory();
|
|
|
|
|
}
|
2009-02-27 03:56:34 +00:00
|
|
|
|
|
2009-06-20 11:05:52 +00:00
|
|
|
|
// Create screenshot
|
2009-02-27 03:56:34 +00:00
|
|
|
|
void CFrame::OnScreenshot(wxCommandEvent& WXUNUSED (event))
|
|
|
|
|
{
|
2009-06-28 19:47:02 +00:00
|
|
|
|
Core::ScreenShot();
|
2009-02-27 03:56:34 +00:00
|
|
|
|
}
|
2009-02-23 06:15:48 +00:00
|
|
|
|
|
|
|
|
|
// Stop the emulation
|
|
|
|
|
void CFrame::DoStop()
|
|
|
|
|
{
|
|
|
|
|
// Rerecording
|
|
|
|
|
#ifdef RERECORDING
|
|
|
|
|
Core::RerecordingStop();
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
if (Core::GetState() != Core::CORE_UNINITIALIZED)
|
|
|
|
|
{
|
2009-04-28 23:47:18 +00:00
|
|
|
|
// Ask for confirmation in case the user accidently clicked Stop / Escape
|
|
|
|
|
if(SConfig::GetInstance().m_LocalCoreStartupParameter.bConfirmStop)
|
|
|
|
|
if(!AskYesNo("Are you sure you want to stop the current emulation?", "Confirm", wxYES_NO))
|
|
|
|
|
return;
|
2009-08-21 09:26:34 +00:00
|
|
|
|
|
|
|
|
|
// TODO: Show the author/description dialog here
|
|
|
|
|
if(Frame::IsRecordingInput())
|
|
|
|
|
Frame::EndRecordingInput();
|
2009-08-21 20:15:33 +00:00
|
|
|
|
if(Frame::IsPlayingInput())
|
|
|
|
|
Frame::EndPlayInput();
|
2009-04-28 23:47:18 +00:00
|
|
|
|
|
2009-02-23 06:15:48 +00:00
|
|
|
|
Core::Stop();
|
|
|
|
|
UpdateGUI();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CFrame::OnStop(wxCommandEvent& WXUNUSED (event))
|
|
|
|
|
{
|
2009-04-28 23:47:18 +00:00
|
|
|
|
DoStop();
|
2009-02-23 06:15:48 +00:00
|
|
|
|
}
|
2009-06-20 11:05:52 +00:00
|
|
|
|
|
2009-02-23 06:15:48 +00:00
|
|
|
|
void CFrame::OnConfigMain(wxCommandEvent& WXUNUSED (event))
|
|
|
|
|
{
|
|
|
|
|
CConfigMain ConfigMain(this);
|
|
|
|
|
if (ConfigMain.ShowModal() == wxID_OK)
|
|
|
|
|
m_GameListCtrl->Update();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CFrame::OnPluginGFX(wxCommandEvent& WXUNUSED (event))
|
|
|
|
|
{
|
|
|
|
|
CPluginManager::GetInstance().OpenConfig(
|
|
|
|
|
GetHandle(),
|
|
|
|
|
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin.c_str(),
|
|
|
|
|
PLUGIN_TYPE_VIDEO
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CFrame::OnPluginDSP(wxCommandEvent& WXUNUSED (event))
|
|
|
|
|
{
|
|
|
|
|
CPluginManager::GetInstance().OpenConfig(
|
|
|
|
|
GetHandle(),
|
|
|
|
|
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str(),
|
|
|
|
|
PLUGIN_TYPE_DSP
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CFrame::OnPluginPAD(wxCommandEvent& WXUNUSED (event))
|
|
|
|
|
{
|
|
|
|
|
CPluginManager::GetInstance().OpenConfig(
|
|
|
|
|
m_Panel->GetHandle(),
|
|
|
|
|
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strPadPlugin[0].c_str(),
|
|
|
|
|
PLUGIN_TYPE_PAD
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
void CFrame::OnPluginWiimote(wxCommandEvent& WXUNUSED (event))
|
|
|
|
|
{
|
|
|
|
|
CPluginManager::GetInstance().OpenConfig(
|
|
|
|
|
GetHandle(),
|
|
|
|
|
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strWiimotePlugin[0].c_str(),
|
|
|
|
|
PLUGIN_TYPE_WIIMOTE
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CFrame::OnHelp(wxCommandEvent& event)
|
|
|
|
|
{
|
|
|
|
|
switch (event.GetId())
|
|
|
|
|
{
|
|
|
|
|
case IDM_HELPABOUT:
|
|
|
|
|
{
|
|
|
|
|
AboutDolphin frame(this);
|
|
|
|
|
frame.ShowModal();
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case IDM_HELPWEBSITE:
|
2009-02-24 19:31:32 +00:00
|
|
|
|
WxUtils::Launch("http://www.dolphin-emu.com/");
|
2009-02-23 06:15:48 +00:00
|
|
|
|
break;
|
|
|
|
|
case IDM_HELPGOOGLECODE:
|
2009-02-24 19:31:32 +00:00
|
|
|
|
WxUtils::Launch("http://code.google.com/p/dolphin-emu/");
|
2009-02-23 06:15:48 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2009-08-27 07:33:07 +00:00
|
|
|
|
|
|
|
|
|
void CFrame::OnToolBar(wxCommandEvent& event)
|
|
|
|
|
{
|
|
|
|
|
switch (event.GetId())
|
|
|
|
|
{
|
2009-08-30 19:44:42 +00:00
|
|
|
|
case IDM_SAVE_PERSPECTIVE:
|
2009-09-01 14:33:16 +00:00
|
|
|
|
if (Perspectives.size() == 0)
|
|
|
|
|
{
|
|
|
|
|
wxMessageBox(wxT("Please create a perspective before saving"), wxT("Notice"), wxOK, this);
|
|
|
|
|
return;
|
|
|
|
|
}
|
2009-08-30 19:44:42 +00:00
|
|
|
|
Save();
|
|
|
|
|
break;
|
|
|
|
|
case IDM_PERSPECTIVES_ADD_PANE:
|
|
|
|
|
AddPane();
|
2009-08-27 07:33:07 +00:00
|
|
|
|
break;
|
2009-08-30 19:44:42 +00:00
|
|
|
|
case IDM_EDIT_PERSPECTIVES:
|
|
|
|
|
TogglePaneStyle(m_ToolBarAui->GetToolToggled(IDM_EDIT_PERSPECTIVES));
|
|
|
|
|
break;
|
2009-08-27 17:17:48 +00:00
|
|
|
|
case IDM_TAB_SPLIT:
|
|
|
|
|
ToggleNotebookStyle(wxAUI_NB_TAB_SPLIT);
|
|
|
|
|
break;
|
2009-08-27 07:33:07 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2009-08-30 19:44:42 +00:00
|
|
|
|
void CFrame::OnSelectPerspective(wxCommandEvent& event)
|
|
|
|
|
{
|
|
|
|
|
int _Selection = event.GetId() - IDM_PERSPECTIVES_0;
|
2009-08-31 05:56:30 +00:00
|
|
|
|
if (Perspectives.size() <= _Selection) _Selection = 0;
|
2009-08-30 19:44:42 +00:00
|
|
|
|
ActivePerspective = _Selection;
|
2009-08-31 05:56:30 +00:00
|
|
|
|
DoLoadPerspective();
|
2009-08-30 19:44:42 +00:00
|
|
|
|
}
|
|
|
|
|
void CFrame::OnDropDownToolbarItem(wxAuiToolBarEvent& event)
|
|
|
|
|
{
|
|
|
|
|
event.Skip();
|
|
|
|
|
|
|
|
|
|
if (event.IsDropDownClicked())
|
|
|
|
|
{
|
|
|
|
|
wxAuiToolBar* tb = static_cast<wxAuiToolBar*>(event.GetEventObject());
|
|
|
|
|
|
|
|
|
|
tb->SetToolSticky(event.GetId(), true);
|
|
|
|
|
|
|
|
|
|
// create the popup menu
|
|
|
|
|
wxMenu menuPopup;
|
|
|
|
|
wxMenuItem* m1 = new wxMenuItem(&menuPopup, IDM_ADD_PERSPECTIVE, wxT("Create new perspective"));
|
|
|
|
|
menuPopup.Append(m1);
|
|
|
|
|
|
|
|
|
|
if (Perspectives.size() > 0)
|
|
|
|
|
{
|
|
|
|
|
menuPopup.Append(new wxMenuItem(&menuPopup));
|
|
|
|
|
for (int i = 0; i < Perspectives.size(); i++)
|
|
|
|
|
{
|
|
|
|
|
wxMenuItem* Item = new wxMenuItem(&menuPopup, IDM_PERSPECTIVES_0 + i, wxString::FromAscii(Perspectives.at(i).Name.c_str()), wxT(""), wxITEM_CHECK);
|
|
|
|
|
menuPopup.Append(Item);
|
|
|
|
|
if (i == ActivePerspective) Item->Check(true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// line up our menu with the button
|
|
|
|
|
wxRect rect = tb->GetToolRect(event.GetId());
|
|
|
|
|
wxPoint pt = tb->ClientToScreen(rect.GetBottomLeft());
|
|
|
|
|
pt = ScreenToClient(pt);
|
|
|
|
|
|
|
|
|
|
PopupMenu(&menuPopup, pt);
|
|
|
|
|
|
|
|
|
|
// make sure the button is "un-stuck"
|
|
|
|
|
tb->SetToolSticky(event.GetId(), false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void CFrame::OnCreatePerspective(wxCommandEvent& event)
|
|
|
|
|
{
|
|
|
|
|
wxTextEntryDialog dlg(this, wxT("Enter a name for the new perspective:"), wxT("Create new perspective"));
|
|
|
|
|
|
|
|
|
|
dlg.SetValue(wxString::Format(wxT("Perspective %u"), unsigned(Perspectives.size() + 1)));
|
|
|
|
|
if (dlg.ShowModal() != wxID_OK) return;
|
|
|
|
|
|
|
|
|
|
SPerspectives Tmp;
|
|
|
|
|
Tmp.Name = dlg.GetValue().mb_str();
|
|
|
|
|
Perspectives.push_back(Tmp);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CFrame::TogglePaneStyle(bool On)
|
|
|
|
|
{
|
|
|
|
|
wxAuiPaneInfoArray& AllPanes = m_Mgr->GetAllPanes();
|
|
|
|
|
for (int i = 0; i < AllPanes.GetCount(); ++i)
|
|
|
|
|
{
|
|
|
|
|
wxAuiPaneInfo& Pane = AllPanes.Item(i);
|
|
|
|
|
if (Pane.window->IsKindOf(CLASSINFO(wxAuiNotebook)))
|
|
|
|
|
{
|
|
|
|
|
Pane.CaptionVisible(On);
|
|
|
|
|
Pane.Show();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
m_Mgr->Update();
|
|
|
|
|
}
|
2009-08-27 17:17:48 +00:00
|
|
|
|
void CFrame::ToggleNotebookStyle(long Style)
|
|
|
|
|
{
|
|
|
|
|
wxAuiPaneInfoArray& AllPanes = m_Mgr->GetAllPanes();
|
|
|
|
|
for (int i = 0, Count = AllPanes.GetCount(); i < Count; ++i)
|
|
|
|
|
{
|
|
|
|
|
wxAuiPaneInfo& Pane = AllPanes.Item(i);
|
|
|
|
|
if (Pane.window->IsKindOf(CLASSINFO(wxAuiNotebook)))
|
|
|
|
|
{
|
|
|
|
|
wxAuiNotebook* NB = (wxAuiNotebook*)Pane.window;
|
|
|
|
|
NB->SetWindowStyleFlag(NB->GetWindowStyleFlag() ^ Style);
|
|
|
|
|
NB->Refresh();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2009-08-29 06:08:14 +00:00
|
|
|
|
void CFrame::ResizeConsole()
|
|
|
|
|
{
|
2009-08-30 22:04:30 +00:00
|
|
|
|
for (int i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++)
|
2009-08-29 06:08:14 +00:00
|
|
|
|
{
|
2009-08-30 22:04:30 +00:00
|
|
|
|
if (!m_Mgr->GetAllPanes().Item(i).window->IsKindOf(CLASSINFO(wxAuiNotebook))) continue;
|
|
|
|
|
for(u32 j = 0; j <= wxDynamicCast(m_Mgr->GetAllPanes().Item(i).window, wxAuiNotebook)->GetPageCount(); j++)
|
2009-08-29 06:08:14 +00:00
|
|
|
|
{
|
2009-08-30 22:04:30 +00:00
|
|
|
|
if (wxDynamicCast(m_Mgr->GetAllPanes().Item(i).window, wxAuiNotebook)->GetPageText(j).IsSameAs(wxT("Console")))
|
2009-08-29 06:08:14 +00:00
|
|
|
|
{
|
2009-08-30 08:22:05 +00:00
|
|
|
|
#ifdef _WIN32
|
|
|
|
|
// ----------------------------------------------------------
|
|
|
|
|
// Get OS version
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
int wxBorder, Border, LowerBorder, MenuBar, ScrollBar, WidthReduction;
|
|
|
|
|
OSVERSIONINFO osvi;
|
|
|
|
|
ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
|
|
|
|
|
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
|
|
|
|
|
GetVersionEx(&osvi);
|
|
|
|
|
if (osvi.dwMajorVersion == 6) // Vista (same as 7?)
|
|
|
|
|
{
|
|
|
|
|
wxBorder = 2;
|
|
|
|
|
Border = 4;
|
|
|
|
|
LowerBorder = 6;
|
|
|
|
|
MenuBar = 30; // Including upper border
|
|
|
|
|
ScrollBar = 19;
|
|
|
|
|
}
|
|
|
|
|
else // XP
|
|
|
|
|
{
|
|
|
|
|
wxBorder = 2;
|
|
|
|
|
Border = 4;
|
|
|
|
|
LowerBorder = 6;
|
|
|
|
|
MenuBar = 30;
|
|
|
|
|
ScrollBar = 19;
|
|
|
|
|
}
|
|
|
|
|
WidthReduction = 30 - Border;
|
|
|
|
|
// --------------------------------
|
2009-08-29 06:08:14 +00:00
|
|
|
|
// Get the client size
|
2009-08-30 22:04:30 +00:00
|
|
|
|
int X = m_Mgr->GetAllPanes().Item(i).window->GetClientSize().GetX();
|
|
|
|
|
int Y = m_Mgr->GetAllPanes().Item(i).window->GetClientSize().GetY();
|
2009-08-30 08:22:05 +00:00
|
|
|
|
int InternalWidth = X - wxBorder*2 - ScrollBar;
|
|
|
|
|
int InternalHeight = Y - wxBorder*2;
|
|
|
|
|
int WindowWidth = InternalWidth + Border*2;
|
|
|
|
|
int WindowHeight = InternalHeight;
|
2009-08-29 06:08:14 +00:00
|
|
|
|
// Resize buffer
|
|
|
|
|
ConsoleListener* Console = LogManager::GetInstance()->getConsoleListener();
|
2009-08-30 08:22:33 +00:00
|
|
|
|
//Console->Log(LogTypes::LNOTICE, StringFromFormat("Window WxH:%i %i\n", X, Y).c_str());
|
2009-08-30 08:22:05 +00:00
|
|
|
|
Console->PixelSpace(0,0, InternalWidth,InternalHeight, false);
|
|
|
|
|
// Move the window to hide the border
|
|
|
|
|
MoveWindow(GetConsoleWindow(), -Border-wxBorder,-MenuBar-wxBorder, WindowWidth + 100,WindowHeight, true);
|
|
|
|
|
// Move it to the bottom of the view order so that it doesn't hide the notebook tabs
|
|
|
|
|
// ...
|
|
|
|
|
#endif
|
2009-08-29 06:08:14 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2009-08-25 07:49:23 +00:00
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
2009-02-23 06:15:48 +00:00
|
|
|
|
|
2009-08-25 07:49:23 +00:00
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
2009-08-29 06:08:14 +00:00
|
|
|
|
// Miscellaneous menus
|
2009-08-25 07:49:23 +00:00
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2009-05-13 21:50:24 +00:00
|
|
|
|
// NetPlay stuff
|
|
|
|
|
void CFrame::OnNetPlay(wxCommandEvent& WXUNUSED (event))
|
|
|
|
|
{
|
2009-05-13 22:23:54 +00:00
|
|
|
|
#if defined(HAVE_SFML) && HAVE_SFML
|
2009-05-13 21:50:24 +00:00
|
|
|
|
new NetPlay(this, m_GameListCtrl->GetGamePaths(), m_GameListCtrl->GetGameNames());
|
2009-05-13 22:23:54 +00:00
|
|
|
|
#endif
|
2009-05-13 21:50:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
2009-02-23 06:15:48 +00:00
|
|
|
|
void CFrame::OnMemcard(wxCommandEvent& WXUNUSED (event))
|
|
|
|
|
{
|
|
|
|
|
CMemcardManager MemcardManager(this);
|
|
|
|
|
MemcardManager.ShowModal();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CFrame::OnShow_CheatsWindow(wxCommandEvent& WXUNUSED (event))
|
|
|
|
|
{
|
|
|
|
|
CheatsWindow = new wxCheatsWindow(this, wxDefaultPosition, wxSize(600, 390));
|
|
|
|
|
}
|
2009-03-20 19:12:04 +00:00
|
|
|
|
|
2009-04-24 18:04:50 +00:00
|
|
|
|
void CFrame::OnShow_InfoWindow(wxCommandEvent& WXUNUSED (event))
|
|
|
|
|
{
|
|
|
|
|
InfoWindow = new wxInfoWindow(this, wxDefaultPosition, wxSize(600, 390));
|
|
|
|
|
}
|
|
|
|
|
|
2009-03-20 19:12:04 +00:00
|
|
|
|
|
2009-02-27 23:44:15 +00:00
|
|
|
|
void CFrame::OnLoadWiiMenu(wxCommandEvent& WXUNUSED (event))
|
|
|
|
|
{
|
2009-08-12 05:57:59 +00:00
|
|
|
|
BootManager::BootCore(FULL_WII_MENU_DIR);
|
2009-02-27 23:44:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
2009-06-18 08:22:02 +00:00
|
|
|
|
// Toogle fullscreen. In Windows the fullscreen mode is accomplished by expanding the m_Panel to cover
|
|
|
|
|
// the entire screen (when we render to the main window).
|
2009-02-23 06:15:48 +00:00
|
|
|
|
void CFrame::OnToggleFullscreen(wxCommandEvent& WXUNUSED (event))
|
|
|
|
|
{
|
2009-08-25 06:34:58 +00:00
|
|
|
|
DoFullscreen(true);
|
2009-02-23 06:15:48 +00:00
|
|
|
|
UpdateGUI();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CFrame::OnToggleDualCore(wxCommandEvent& WXUNUSED (event))
|
|
|
|
|
{
|
|
|
|
|
SConfig::GetInstance().m_LocalCoreStartupParameter.bUseDualCore = !SConfig::GetInstance().m_LocalCoreStartupParameter.bUseDualCore;
|
|
|
|
|
SConfig::GetInstance().SaveSettings();
|
|
|
|
|
}
|
2009-03-20 19:12:04 +00:00
|
|
|
|
|
2009-02-23 06:15:48 +00:00
|
|
|
|
void CFrame::OnToggleSkipIdle(wxCommandEvent& WXUNUSED (event))
|
|
|
|
|
{
|
|
|
|
|
SConfig::GetInstance().m_LocalCoreStartupParameter.bSkipIdle = !SConfig::GetInstance().m_LocalCoreStartupParameter.bSkipIdle;
|
|
|
|
|
SConfig::GetInstance().SaveSettings();
|
|
|
|
|
}
|
|
|
|
|
|
2009-06-28 01:11:35 +00:00
|
|
|
|
void CFrame::OnLoadStateFromFile(wxCommandEvent& WXUNUSED (event))
|
|
|
|
|
{
|
|
|
|
|
wxString path = wxFileSelector(
|
|
|
|
|
_T("Select the state to load"),
|
|
|
|
|
wxEmptyString, wxEmptyString, wxEmptyString,
|
|
|
|
|
wxString::Format
|
|
|
|
|
(
|
|
|
|
|
_T("All Save States (sav, s##)|*.sav;*.s??|All files (%s)|%s"),
|
|
|
|
|
wxFileSelectorDefaultWildcardStr,
|
|
|
|
|
wxFileSelectorDefaultWildcardStr
|
|
|
|
|
),
|
|
|
|
|
wxFD_OPEN | wxFD_PREVIEW | wxFD_FILE_MUST_EXIST,
|
|
|
|
|
this);
|
|
|
|
|
|
|
|
|
|
if(path)
|
2009-08-02 05:59:55 +00:00
|
|
|
|
State_LoadAs((const char*)path.mb_str());
|
2009-06-28 01:11:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CFrame::OnSaveStateToFile(wxCommandEvent& WXUNUSED (event))
|
|
|
|
|
{
|
|
|
|
|
wxString path = wxFileSelector(
|
|
|
|
|
_T("Select the state to save"),
|
|
|
|
|
wxEmptyString, wxEmptyString, wxEmptyString,
|
|
|
|
|
wxString::Format
|
|
|
|
|
(
|
|
|
|
|
_T("All Save States (sav, s##)|*.sav;*.s??|All files (%s)|%s"),
|
|
|
|
|
wxFileSelectorDefaultWildcardStr,
|
|
|
|
|
wxFileSelectorDefaultWildcardStr
|
|
|
|
|
),
|
|
|
|
|
wxFD_SAVE,
|
|
|
|
|
this);
|
|
|
|
|
|
|
|
|
|
if(path)
|
2009-08-02 05:59:55 +00:00
|
|
|
|
State_SaveAs((const char*)path.mb_str());
|
2009-06-28 01:11:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CFrame::OnLoadLastState(wxCommandEvent& WXUNUSED (event))
|
|
|
|
|
{
|
|
|
|
|
State_LoadLastSaved();
|
|
|
|
|
}
|
|
|
|
|
|
2009-06-28 21:11:51 +00:00
|
|
|
|
void CFrame::OnUndoLoadState(wxCommandEvent& WXUNUSED (event))
|
2009-06-28 01:11:35 +00:00
|
|
|
|
{
|
2009-06-28 21:11:51 +00:00
|
|
|
|
State_UndoLoadState();
|
2009-06-28 01:11:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
2009-06-28 21:11:51 +00:00
|
|
|
|
void CFrame::OnUndoSaveState(wxCommandEvent& WXUNUSED (event))
|
|
|
|
|
{
|
|
|
|
|
State_UndoSaveState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2009-02-23 06:15:48 +00:00
|
|
|
|
void CFrame::OnLoadState(wxCommandEvent& event)
|
|
|
|
|
{
|
|
|
|
|
int id = event.GetId();
|
|
|
|
|
int slot = id - IDM_LOADSLOT1 + 1;
|
|
|
|
|
State_Load(slot);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CFrame::OnSaveState(wxCommandEvent& event)
|
|
|
|
|
{
|
|
|
|
|
int id = event.GetId();
|
|
|
|
|
int slot = id - IDM_SAVESLOT1 + 1;
|
|
|
|
|
State_Save(slot);
|
|
|
|
|
}
|
|
|
|
|
|
2009-08-08 01:39:56 +00:00
|
|
|
|
void CFrame::OnFrameSkip(wxCommandEvent& event)
|
|
|
|
|
{
|
|
|
|
|
int amount = event.GetId() - IDM_FRAMESKIP0;
|
|
|
|
|
|
|
|
|
|
Frame::SetFrameSkipping((unsigned int)amount);
|
|
|
|
|
}
|
2009-08-25 07:49:23 +00:00
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
2009-08-08 01:39:56 +00:00
|
|
|
|
|
2009-08-25 07:49:23 +00:00
|
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
2009-08-27 10:10:07 +00:00
|
|
|
|
// Notebooks
|
2009-08-25 07:49:23 +00:00
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2009-08-27 19:38:35 +00:00
|
|
|
|
#ifdef _WIN32
|
|
|
|
|
wxWindow * CFrame::GetWxWindowHwnd(HWND hWnd)
|
|
|
|
|
{
|
|
|
|
|
wxWindow * Win = new wxWindow();
|
|
|
|
|
Win->SetHWND((WXHWND)hWnd);
|
|
|
|
|
Win->AdoptAttributesFromHWND();
|
|
|
|
|
return Win;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
wxWindow * CFrame::GetWxWindow(wxString Name)
|
|
|
|
|
{
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
|
HWND hWnd = ::FindWindow(NULL, Name.c_str());
|
|
|
|
|
if (hWnd)
|
|
|
|
|
{
|
|
|
|
|
wxWindow * Win = new wxWindow();
|
|
|
|
|
Win->SetHWND((WXHWND)hWnd);
|
|
|
|
|
Win->AdoptAttributesFromHWND();
|
|
|
|
|
return Win;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
#endif
|
|
|
|
|
if (FindWindowByName(Name))
|
|
|
|
|
{
|
|
|
|
|
return FindWindowByName(Name);
|
|
|
|
|
}
|
|
|
|
|
else if (FindWindowByLabel(Name))
|
|
|
|
|
{
|
|
|
|
|
return FindWindowByLabel(Name);
|
|
|
|
|
}
|
|
|
|
|
else if (GetNootebookPage(Name))
|
|
|
|
|
{
|
|
|
|
|
return GetNootebookPage(Name);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2009-08-30 10:01:45 +00:00
|
|
|
|
wxWindow * CFrame::GetNootebookPage(wxString Name)
|
|
|
|
|
{
|
2009-08-30 22:04:30 +00:00
|
|
|
|
for (int i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++)
|
2009-08-30 10:01:45 +00:00
|
|
|
|
{
|
2009-08-30 22:04:30 +00:00
|
|
|
|
if (!m_Mgr->GetAllPanes().Item(i).window->IsKindOf(CLASSINFO(wxAuiNotebook))) continue;
|
|
|
|
|
wxAuiNotebook * NB = (wxAuiNotebook*)m_Mgr->GetAllPanes().Item(i).window;
|
|
|
|
|
for(u32 j = 0; j < NB->GetPageCount(); j++)
|
2009-08-30 10:01:45 +00:00
|
|
|
|
{
|
2009-08-30 22:04:30 +00:00
|
|
|
|
if (NB->GetPageText(j).IsSameAs(Name)) return NB->GetPage(j);
|
2009-08-30 10:01:45 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
void CFrame::AddRemoveBlankPage()
|
|
|
|
|
{
|
2009-08-30 22:04:30 +00:00
|
|
|
|
for (int i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++)
|
2009-08-30 10:01:45 +00:00
|
|
|
|
{
|
2009-08-30 22:04:30 +00:00
|
|
|
|
if (!m_Mgr->GetAllPanes().Item(i).window->IsKindOf(CLASSINFO(wxAuiNotebook))) continue;
|
|
|
|
|
wxAuiNotebook * NB = (wxAuiNotebook*)m_Mgr->GetAllPanes().Item(i).window;
|
|
|
|
|
for(u32 j = 0; j < NB->GetPageCount(); j++)
|
2009-08-30 10:01:45 +00:00
|
|
|
|
{
|
2009-08-30 22:04:30 +00:00
|
|
|
|
if (NB->GetPageText(j).IsSameAs(wxT("<>")) && NB->GetPageCount() > 1) NB->DeletePage(j);
|
2009-08-30 10:01:45 +00:00
|
|
|
|
}
|
2009-08-30 22:04:30 +00:00
|
|
|
|
if (NB->GetPageCount() == 0) NB->AddPage(CreateEmptyPanel(), wxT("<>"), true);
|
2009-08-30 10:01:45 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2009-08-27 15:53:19 +00:00
|
|
|
|
int CFrame::GetNootebookAffiliation(wxString Name)
|
|
|
|
|
{
|
2009-08-30 22:04:30 +00:00
|
|
|
|
for (int i = 0, j = 0; i < m_Mgr->GetAllPanes().GetCount(); i++)
|
2009-08-27 15:53:19 +00:00
|
|
|
|
{
|
2009-08-30 22:04:30 +00:00
|
|
|
|
if (!m_Mgr->GetAllPanes().Item(i).window->IsKindOf(CLASSINFO(wxAuiNotebook))) continue;
|
|
|
|
|
wxAuiNotebook * NB = (wxAuiNotebook*)m_Mgr->GetAllPanes().Item(i).window;
|
|
|
|
|
for(u32 k = 0; k < NB->GetPageCount(); k++)
|
2009-08-27 15:53:19 +00:00
|
|
|
|
{
|
2009-08-30 22:04:30 +00:00
|
|
|
|
if (NB->GetPageText(k).IsSameAs(Name)) return j;
|
|
|
|
|
}
|
|
|
|
|
j++;
|
2009-08-27 15:53:19 +00:00
|
|
|
|
}
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
2009-08-31 05:56:30 +00:00
|
|
|
|
void CFrame::ClosePages()
|
|
|
|
|
{
|
2009-08-31 23:09:50 +00:00
|
|
|
|
DoToggleWindow(IDM_LOGWINDOW, false);
|
2009-09-01 12:44:02 +00:00
|
|
|
|
DoToggleWindow(IDM_CONSOLEWINDOW, false);
|
2009-08-31 05:56:30 +00:00
|
|
|
|
DoToggleWindow(IDM_CODEWINDOW, false);
|
|
|
|
|
DoToggleWindow(IDM_REGISTERWINDOW, false);
|
|
|
|
|
DoToggleWindow(IDM_BREAKPOINTWINDOW, false);
|
|
|
|
|
DoToggleWindow(IDM_MEMORYWINDOW, false);
|
|
|
|
|
DoToggleWindow(IDM_JITWINDOW, false);
|
|
|
|
|
DoToggleWindow(IDM_SOUNDWINDOW, false);
|
|
|
|
|
DoToggleWindow(IDM_VIDEOWINDOW, false);
|
|
|
|
|
}
|
2009-08-27 15:53:19 +00:00
|
|
|
|
void CFrame::DoToggleWindow(int Id, bool Show)
|
2009-09-01 12:44:02 +00:00
|
|
|
|
{
|
2009-08-27 15:53:19 +00:00
|
|
|
|
switch (Id)
|
|
|
|
|
{
|
2009-08-31 23:09:50 +00:00
|
|
|
|
case IDM_LOGWINDOW: ToggleLogWindow(Show, UseDebugger ? g_pCodeWindow->iLogWindow : 0); break;
|
2009-08-27 19:38:35 +00:00
|
|
|
|
case IDM_CONSOLEWINDOW: ToggleConsole(Show, UseDebugger ? g_pCodeWindow->iConsoleWindow : 0); break;
|
2009-09-01 12:44:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!UseDebugger) return;
|
|
|
|
|
|
|
|
|
|
switch (Id)
|
|
|
|
|
{
|
2009-08-30 19:44:42 +00:00
|
|
|
|
case IDM_CODEWINDOW: g_pCodeWindow->OnToggleCodeWindow(Show, g_pCodeWindow->iCodeWindow); break;
|
2009-08-27 15:53:19 +00:00
|
|
|
|
case IDM_REGISTERWINDOW: g_pCodeWindow->OnToggleRegisterWindow(Show, g_pCodeWindow->iRegisterWindow); break;
|
|
|
|
|
case IDM_BREAKPOINTWINDOW: g_pCodeWindow->OnToggleBreakPointWindow(Show, g_pCodeWindow->iBreakpointWindow); break;
|
|
|
|
|
case IDM_MEMORYWINDOW: g_pCodeWindow->OnToggleMemoryWindow(Show, g_pCodeWindow->iMemoryWindow); break;
|
|
|
|
|
case IDM_JITWINDOW: g_pCodeWindow->OnToggleJitWindow(Show, g_pCodeWindow->iJitWindow); break;
|
|
|
|
|
case IDM_SOUNDWINDOW: g_pCodeWindow->OnToggleSoundWindow(Show, g_pCodeWindow->iSoundWindow); break;
|
|
|
|
|
case IDM_VIDEOWINDOW: g_pCodeWindow->OnToggleVideoWindow(Show, g_pCodeWindow->iVideoWindow); break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void CFrame::OnNotebookPageChanged(wxAuiNotebookEvent& event)
|
|
|
|
|
{
|
|
|
|
|
event.Skip();
|
2009-08-27 19:38:35 +00:00
|
|
|
|
if (!UseDebugger) return;
|
|
|
|
|
|
2009-08-30 10:01:45 +00:00
|
|
|
|
// Remove the blank page if any
|
|
|
|
|
AddRemoveBlankPage();
|
|
|
|
|
|
2009-08-27 15:53:19 +00:00
|
|
|
|
// Update the notebook affiliation
|
2009-08-31 23:09:50 +00:00
|
|
|
|
if(GetNootebookAffiliation(wxT("Log")) >= 0) g_pCodeWindow->iLogWindow = GetNootebookAffiliation(wxT("Log"));
|
2009-08-30 10:01:45 +00:00
|
|
|
|
if(GetNootebookAffiliation(wxT("Console")) >= 0) g_pCodeWindow->iConsoleWindow = GetNootebookAffiliation(wxT("Console"));
|
2009-08-27 15:53:19 +00:00
|
|
|
|
if(GetNootebookAffiliation(wxT("Code")) >= 0) g_pCodeWindow->iCodeWindow = GetNootebookAffiliation(wxT("Code"));
|
|
|
|
|
if(GetNootebookAffiliation(wxT("Registers")) >= 0) g_pCodeWindow->iRegisterWindow = GetNootebookAffiliation(wxT("Registers"));
|
|
|
|
|
if(GetNootebookAffiliation(wxT("Breakpoints")) >= 0) g_pCodeWindow->iBreakpointWindow = GetNootebookAffiliation(wxT("Breakpoints"));
|
|
|
|
|
if(GetNootebookAffiliation(wxT("JIT")) >= 0) g_pCodeWindow->iJitWindow = GetNootebookAffiliation(wxT("JIT"));
|
|
|
|
|
if(GetNootebookAffiliation(wxT("Memory")) >= 0) g_pCodeWindow->iMemoryWindow = GetNootebookAffiliation(wxT("Memory"));
|
|
|
|
|
if(GetNootebookAffiliation(wxT("Sound")) >= 0) g_pCodeWindow->iSoundWindow = GetNootebookAffiliation(wxT("Sound"));
|
|
|
|
|
if(GetNootebookAffiliation(wxT("Video")) >= 0) g_pCodeWindow->iVideoWindow = GetNootebookAffiliation(wxT("Video"));
|
|
|
|
|
}
|
2009-08-27 10:10:07 +00:00
|
|
|
|
void CFrame::OnNotebookPageClose(wxAuiNotebookEvent& event)
|
2009-06-28 01:11:35 +00:00
|
|
|
|
{
|
2009-08-27 10:10:07 +00:00
|
|
|
|
// Override event
|
|
|
|
|
event.Veto();
|
|
|
|
|
|
|
|
|
|
wxAuiNotebook* Ctrl = (wxAuiNotebook*)event.GetEventObject();
|
|
|
|
|
|
2009-08-31 23:09:50 +00:00
|
|
|
|
if (Ctrl->GetPageText(event.GetSelection()).IsSameAs(wxT("Log"))) { GetMenuBar()->FindItem(IDM_LOGWINDOW)->Check(false); DoToggleWindow(IDM_LOGWINDOW, false); }
|
2009-08-27 19:38:35 +00:00
|
|
|
|
if (Ctrl->GetPageText(event.GetSelection()).IsSameAs(wxT("Console"))) { GetMenuBar()->FindItem(IDM_CONSOLEWINDOW)->Check(false); DoToggleWindow(IDM_CONSOLEWINDOW, false); }
|
2009-08-27 10:10:07 +00:00
|
|
|
|
if (Ctrl->GetPageText(event.GetSelection()).IsSameAs(wxT("Registers"))) { GetMenuBar()->FindItem(IDM_REGISTERWINDOW)->Check(false); DoToggleWindow(IDM_REGISTERWINDOW, false); }
|
|
|
|
|
if (Ctrl->GetPageText(event.GetSelection()).IsSameAs(wxT("Breakpoints"))) { GetMenuBar()->FindItem(IDM_BREAKPOINTWINDOW)->Check(false); DoToggleWindow(IDM_BREAKPOINTWINDOW, false); }
|
|
|
|
|
if (Ctrl->GetPageText(event.GetSelection()).IsSameAs(wxT("JIT"))) { GetMenuBar()->FindItem(IDM_JITWINDOW)->Check(false); DoToggleWindow(IDM_JITWINDOW, false); }
|
|
|
|
|
if (Ctrl->GetPageText(event.GetSelection()).IsSameAs(wxT("Memory"))) { GetMenuBar()->FindItem(IDM_MEMORYWINDOW)->Check(false); DoToggleWindow(IDM_MEMORYWINDOW, false); }
|
|
|
|
|
if (Ctrl->GetPageText(event.GetSelection()).IsSameAs(wxT("Sound"))) { GetMenuBar()->FindItem(IDM_SOUNDWINDOW)->Check(false); DoToggleWindow(IDM_SOUNDWINDOW, false); }
|
|
|
|
|
if (Ctrl->GetPageText(event.GetSelection()).IsSameAs(wxT("Video"))) { GetMenuBar()->FindItem(IDM_VIDEOWINDOW)->Check(false); DoToggleWindow(IDM_VIDEOWINDOW, false); }
|
|
|
|
|
}
|
2009-08-27 15:53:19 +00:00
|
|
|
|
void CFrame::OnAllowNotebookDnD(wxAuiNotebookEvent& event)
|
|
|
|
|
{
|
|
|
|
|
event.Skip();
|
2009-08-30 10:01:45 +00:00
|
|
|
|
event.Allow();
|
|
|
|
|
wxAuiNotebook* Ctrl = (wxAuiNotebook*)event.GetEventObject();
|
2009-08-27 15:53:19 +00:00
|
|
|
|
// If we drag away the last one the tab bar goes away and we can't add any panes to it
|
2009-08-30 10:01:45 +00:00
|
|
|
|
//if (Ctrl->GetPageCount() == 1) Ctrl->AddPage(CreateEmptyPanel(), wxT("<>"), true);
|
2009-08-27 15:53:19 +00:00
|
|
|
|
}
|
2009-08-27 10:10:07 +00:00
|
|
|
|
void CFrame::HidePane()
|
|
|
|
|
{
|
2009-08-30 22:04:30 +00:00
|
|
|
|
// Get the first notebook
|
|
|
|
|
wxAuiNotebook * NB;
|
|
|
|
|
for (int i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++)
|
|
|
|
|
{
|
|
|
|
|
if (m_Mgr->GetAllPanes().Item(i).window->IsKindOf(CLASSINFO(wxAuiNotebook)))
|
|
|
|
|
NB = (wxAuiNotebook*)m_Mgr->GetAllPanes().Item(i).window;
|
|
|
|
|
}
|
|
|
|
|
if (NB->GetPageCount() == 0)
|
|
|
|
|
m_Mgr->GetPane(wxT("Pane 1")).Hide();
|
2009-08-27 10:10:07 +00:00
|
|
|
|
else
|
2009-08-30 22:04:30 +00:00
|
|
|
|
m_Mgr->GetPane(wxT("Pane 1")).Show();
|
2009-08-27 10:10:07 +00:00
|
|
|
|
m_Mgr->Update();
|
|
|
|
|
|
|
|
|
|
SetSimplePaneSize();
|
|
|
|
|
}
|
2009-09-01 12:44:02 +00:00
|
|
|
|
void CFrame::DoRemovePageString(wxString Str, bool Hide, bool Destroy)
|
2009-08-27 19:38:35 +00:00
|
|
|
|
{
|
2009-08-30 22:04:30 +00:00
|
|
|
|
for (int i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++)
|
2009-08-27 19:38:35 +00:00
|
|
|
|
{
|
2009-08-30 22:04:30 +00:00
|
|
|
|
if (!m_Mgr->GetAllPanes().Item(i).window->IsKindOf(CLASSINFO(wxAuiNotebook))) continue;
|
|
|
|
|
wxAuiNotebook * NB = (wxAuiNotebook*)m_Mgr->GetAllPanes().Item(i).window;
|
|
|
|
|
for (int j = 0; j < NB->GetPageCount(); j++)
|
2009-08-27 19:38:35 +00:00
|
|
|
|
{
|
2009-09-01 12:44:02 +00:00
|
|
|
|
if (NB->GetPageText(j).IsSameAs(Str))
|
|
|
|
|
{
|
|
|
|
|
if (!Destroy)
|
|
|
|
|
{
|
|
|
|
|
// Reparent to avoid destruction if the notebook is closed and destroyed
|
|
|
|
|
wxWindow * Win = NB->GetPage(j);
|
|
|
|
|
NB->RemovePage(j);
|
|
|
|
|
Win->Reparent(this);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
NB->DeletePage(j);
|
|
|
|
|
}
|
|
|
|
|
//if (Hide) Win->Hide();
|
|
|
|
|
break;
|
|
|
|
|
}
|
2009-08-27 19:38:35 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2009-09-01 12:44:02 +00:00
|
|
|
|
|
2009-08-27 19:38:35 +00:00
|
|
|
|
}
|
2009-08-30 22:04:30 +00:00
|
|
|
|
wxAuiNotebook * CFrame::GetNotebook(int NBId)
|
|
|
|
|
{
|
|
|
|
|
int Ret = 0;
|
|
|
|
|
for (int i = 0, j = 0; i < m_Mgr->GetAllPanes().GetCount(); i++)
|
|
|
|
|
{
|
|
|
|
|
if (!m_Mgr->GetAllPanes().Item(i).window->IsKindOf(CLASSINFO(wxAuiNotebook))) continue;
|
|
|
|
|
if (j == NBId) return (wxAuiNotebook*)m_Mgr->GetAllPanes().Item(i).window;
|
|
|
|
|
j++;
|
|
|
|
|
}
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2009-09-01 12:44:02 +00:00
|
|
|
|
void CFrame::ShowAllNotebooks(bool Window)
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0, j = 0; i < m_Mgr->GetAllPanes().GetCount(); i++)
|
|
|
|
|
{
|
|
|
|
|
if (m_Mgr->GetAllPanes().Item(i).window->IsKindOf(CLASSINFO(wxAuiNotebook)))
|
|
|
|
|
{
|
|
|
|
|
if (Window)
|
|
|
|
|
m_Mgr->GetAllPanes().Item(i).Show();
|
|
|
|
|
else
|
|
|
|
|
m_Mgr->GetAllPanes().Item(i).window->Hide();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
m_Mgr->Update();
|
|
|
|
|
}
|
|
|
|
|
void CFrame::HideAllNotebooks(bool Window)
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++)
|
|
|
|
|
{
|
|
|
|
|
if (m_Mgr->GetAllPanes().Item(i).window->IsKindOf(CLASSINFO(wxAuiNotebook)))
|
|
|
|
|
{
|
|
|
|
|
if (Window)
|
|
|
|
|
m_Mgr->GetAllPanes().Item(i).Hide();
|
|
|
|
|
else
|
|
|
|
|
m_Mgr->GetAllPanes().Item(i).window->Hide();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
m_Mgr->Update();
|
|
|
|
|
}
|
2009-09-01 07:32:07 +00:00
|
|
|
|
// Close all panes with notebooks
|
|
|
|
|
void CFrame::CloseAllNotebooks()
|
|
|
|
|
{
|
|
|
|
|
int i = 0;
|
|
|
|
|
while(GetNotebookCount() > 0)
|
|
|
|
|
{
|
|
|
|
|
if (m_Mgr->GetAllPanes().Item(i).window->IsKindOf(CLASSINFO(wxAuiNotebook)))
|
|
|
|
|
{
|
2009-09-01 12:44:02 +00:00
|
|
|
|
m_Mgr->GetAllPanes().Item(i).DestroyOnClose(true);
|
|
|
|
|
m_Mgr->ClosePane(m_Mgr->GetAllPanes().Item(i));
|
|
|
|
|
//m_Mgr->GetAllPanes().Item(i).window->Hide();
|
|
|
|
|
//m_Mgr->DetachPane(m_Mgr->GetAllPanes().Item(i).window);
|
2009-09-01 07:32:07 +00:00
|
|
|
|
|
|
|
|
|
i = 0;
|
|
|
|
|
//Console->Log(LogTypes::LCUSTOM, StringFromFormat(" %i Pane\n", i).c_str());
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
i++;
|
|
|
|
|
//Console->Log(LogTypes::LCUSTOM, StringFromFormat(" %i No pane\n", i).c_str());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
2009-08-30 22:04:30 +00:00
|
|
|
|
int CFrame::GetNotebookCount()
|
|
|
|
|
{
|
|
|
|
|
int Ret = 0;
|
|
|
|
|
for (int i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++)
|
|
|
|
|
{
|
|
|
|
|
if (m_Mgr->GetAllPanes().Item(i).window->IsKindOf(CLASSINFO(wxAuiNotebook))) Ret++;
|
|
|
|
|
}
|
|
|
|
|
return Ret;
|
|
|
|
|
}
|
2009-08-30 19:44:42 +00:00
|
|
|
|
void CFrame::DoAddPage(wxWindow * Win, int i, std::string Name)
|
|
|
|
|
{
|
|
|
|
|
if (!Win) return;
|
2009-08-30 22:04:30 +00:00
|
|
|
|
if (GetNotebookCount() == 0) return;
|
|
|
|
|
if (i < 0 || i > GetNotebookCount()-1) i = 0;
|
|
|
|
|
if (Win && GetNotebook(i)->GetPageIndex(Win) != wxNOT_FOUND) return;
|
|
|
|
|
GetNotebook(i)->AddPage(Win, wxString::FromAscii(Name.c_str()), true, aNormalFile );
|
2009-08-30 19:44:42 +00:00
|
|
|
|
|
2009-08-31 05:56:30 +00:00
|
|
|
|
/*
|
2009-08-30 19:44:42 +00:00
|
|
|
|
ConsoleListener* Console = LogManager::GetInstance()->getConsoleListener();
|
|
|
|
|
Console->Log(LogTypes::LCUSTOM, StringFromFormat("Add: %s\n", Name.c_str()).c_str());
|
2009-08-31 05:56:30 +00:00
|
|
|
|
*/
|
2009-08-30 19:44:42 +00:00
|
|
|
|
}
|
2009-08-27 10:10:07 +00:00
|
|
|
|
void CFrame::DoRemovePage(wxWindow * Win, bool Hide)
|
|
|
|
|
{
|
2009-08-30 19:44:42 +00:00
|
|
|
|
// If m_dialog is NULL, then possibly the system didn't report the checked menu item status correctly.
|
|
|
|
|
// It should be true just after the menu item was selected, if there was no modeless dialog yet.
|
2009-09-01 02:41:48 +00:00
|
|
|
|
//wxASSERT(Win != NULL);
|
2009-08-27 10:10:07 +00:00
|
|
|
|
|
|
|
|
|
if (Win)
|
|
|
|
|
{
|
2009-08-30 22:04:30 +00:00
|
|
|
|
for (int i = 0; i < GetNotebookCount(); i++)
|
2009-08-27 10:10:07 +00:00
|
|
|
|
{
|
2009-08-30 22:04:30 +00:00
|
|
|
|
if (GetNotebook(i)->GetPageIndex(Win) != wxNOT_FOUND) GetNotebook(i)->RemovePage(GetNotebook(i)->GetPageIndex(Win));
|
2009-08-27 10:10:07 +00:00
|
|
|
|
}
|
2009-09-01 12:44:02 +00:00
|
|
|
|
// Reparent to avoid destruction if the notebook is closed and destroyed
|
|
|
|
|
Win->Reparent(this);
|
|
|
|
|
|
2009-08-27 10:10:07 +00:00
|
|
|
|
if (Hide) Win->Hide();
|
|
|
|
|
}
|
2009-06-28 01:11:35 +00:00
|
|
|
|
}
|
2009-02-23 06:15:48 +00:00
|
|
|
|
|
2009-03-20 18:25:36 +00:00
|
|
|
|
// Enable and disable the toolbar
|
2009-02-23 06:15:48 +00:00
|
|
|
|
void CFrame::OnToggleToolbar(wxCommandEvent& event)
|
|
|
|
|
{
|
2009-03-20 19:12:04 +00:00
|
|
|
|
SConfig::GetInstance().m_InterfaceToolbar = event.IsChecked();
|
2009-08-27 07:33:07 +00:00
|
|
|
|
DoToggleToolbar(event.IsChecked());
|
|
|
|
|
}
|
|
|
|
|
void CFrame::DoToggleToolbar(bool Show)
|
|
|
|
|
{
|
|
|
|
|
if (Show)
|
2009-02-23 06:15:48 +00:00
|
|
|
|
{
|
2009-08-27 07:33:07 +00:00
|
|
|
|
m_Mgr->GetPane(wxT("TBMain")).Show();
|
|
|
|
|
if (UseDebugger) { m_Mgr->GetPane(wxT("TBDebug")).Show(); m_Mgr->GetPane(wxT("TBAui")).Show(); }
|
2009-08-25 07:49:23 +00:00
|
|
|
|
m_Mgr->Update();
|
2009-02-23 06:15:48 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2009-08-27 07:33:07 +00:00
|
|
|
|
m_Mgr->GetPane(wxT("TBMain")).Hide();
|
|
|
|
|
if (UseDebugger) { m_Mgr->GetPane(wxT("TBDebug")).Hide(); m_Mgr->GetPane(wxT("TBAui")).Hide(); }
|
2009-08-25 07:49:23 +00:00
|
|
|
|
m_Mgr->Update();
|
2009-02-23 06:15:48 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2009-03-20 18:25:36 +00:00
|
|
|
|
// Enable and disable the status bar
|
2009-02-23 06:15:48 +00:00
|
|
|
|
void CFrame::OnToggleStatusbar(wxCommandEvent& event)
|
|
|
|
|
{
|
2009-03-20 19:12:04 +00:00
|
|
|
|
SConfig::GetInstance().m_InterfaceStatusbar = event.IsChecked();
|
|
|
|
|
if (SConfig::GetInstance().m_InterfaceStatusbar == true)
|
2009-02-23 06:15:48 +00:00
|
|
|
|
m_pStatusBar->Show();
|
|
|
|
|
else
|
|
|
|
|
m_pStatusBar->Hide();
|
|
|
|
|
|
|
|
|
|
this->SendSizeEvent();
|
|
|
|
|
}
|
|
|
|
|
|
2009-08-31 23:09:50 +00:00
|
|
|
|
// Enable and disable the log window
|
|
|
|
|
void CFrame::OnToggleLogWindow(wxCommandEvent& event)
|
|
|
|
|
{
|
2009-09-01 14:33:16 +00:00
|
|
|
|
SConfig::GetInstance().m_InterfaceLogWindow = event.IsChecked();
|
2009-08-31 23:09:50 +00:00
|
|
|
|
DoToggleWindow(event.GetId(), event.IsChecked());
|
|
|
|
|
}
|
|
|
|
|
void CFrame::ToggleLogWindow(bool Show, int i)
|
2009-09-01 14:33:16 +00:00
|
|
|
|
{
|
2009-08-31 23:09:50 +00:00
|
|
|
|
if (Show)
|
|
|
|
|
{
|
|
|
|
|
if (!m_LogWindow) m_LogWindow = new CLogWindow(this);
|
2009-09-01 02:41:48 +00:00
|
|
|
|
#ifdef _WIN32
|
2009-08-31 23:09:50 +00:00
|
|
|
|
DoAddPage(m_LogWindow, i, "Log");
|
2009-09-01 02:41:48 +00:00
|
|
|
|
#else
|
|
|
|
|
m_LogWindow->Show();
|
|
|
|
|
#endif
|
2009-08-31 23:09:50 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2009-09-01 02:41:48 +00:00
|
|
|
|
#ifdef _WIN32
|
2009-08-31 23:09:50 +00:00
|
|
|
|
DoRemovePage(m_LogWindow);
|
2009-09-01 02:41:48 +00:00
|
|
|
|
#else
|
|
|
|
|
if (m_LogWindow) m_LogWindow->Show();
|
|
|
|
|
#endif
|
2009-08-31 23:09:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Hide pane
|
|
|
|
|
if (!UseDebugger) HidePane();
|
|
|
|
|
|
|
|
|
|
// Make sure the check is updated (if wxw isn't calling this func)
|
|
|
|
|
//GetMenuBar()->FindItem(IDM_LOGWINDOW)->Check(Show);
|
|
|
|
|
}
|
|
|
|
|
// Enable and disable the console
|
2009-03-20 18:25:36 +00:00
|
|
|
|
void CFrame::OnToggleConsole(wxCommandEvent& event)
|
|
|
|
|
{
|
2009-09-01 14:33:16 +00:00
|
|
|
|
SConfig::GetInstance().m_InterfaceConsole = event.IsChecked();
|
2009-08-27 19:38:35 +00:00
|
|
|
|
DoToggleWindow(event.GetId(), event.IsChecked());
|
2009-03-20 18:25:36 +00:00
|
|
|
|
}
|
2009-08-27 15:53:19 +00:00
|
|
|
|
void CFrame::ToggleConsole(bool Show, int i)
|
2009-03-20 18:25:36 +00:00
|
|
|
|
{
|
2009-09-01 14:33:16 +00:00
|
|
|
|
ConsoleListener *Console = LogManager::GetInstance()->getConsoleListener();
|
2009-08-27 19:38:35 +00:00
|
|
|
|
|
|
|
|
|
if (Show)
|
|
|
|
|
{
|
2009-09-01 12:44:02 +00:00
|
|
|
|
//Console->Log(LogTypes::LCUSTOM, StringFromFormat(" >>> Show\n").c_str());
|
|
|
|
|
|
2009-08-30 22:04:30 +00:00
|
|
|
|
if (GetNotebookCount() == 0) return;
|
|
|
|
|
if (i < 0 || i > GetNotebookCount()-1) i = 0;
|
|
|
|
|
|
2009-08-27 19:38:35 +00:00
|
|
|
|
#ifdef _WIN32
|
|
|
|
|
wxWindow *Win = GetWxWindowHwnd(GetConsoleWindow());
|
2009-08-30 22:04:30 +00:00
|
|
|
|
if (Win && GetNotebook(i)->GetPageIndex(Win) != wxNOT_FOUND) return;
|
2009-08-27 19:38:35 +00:00
|
|
|
|
{
|
2009-08-30 10:01:45 +00:00
|
|
|
|
#else
|
|
|
|
|
Console->Open();
|
|
|
|
|
#endif
|
2009-08-27 19:38:35 +00:00
|
|
|
|
|
2009-08-30 10:01:45 +00:00
|
|
|
|
#ifdef _WIN32
|
|
|
|
|
if(!GetConsoleWindow()) Console->Open(); else ShowWindow(GetConsoleWindow(),SW_SHOW);
|
2009-08-27 19:38:35 +00:00
|
|
|
|
}
|
|
|
|
|
Win = GetWxWindowHwnd(GetConsoleWindow());
|
|
|
|
|
// Can we remove the border?
|
|
|
|
|
//Win->SetWindowStyleFlag(wxNO_BORDER);
|
|
|
|
|
//SetWindowLong(GetConsoleWindow(), GWL_STYLE, WS_VISIBLE);
|
2009-08-30 08:22:05 +00:00
|
|
|
|
// Create parent window
|
2009-08-30 10:01:45 +00:00
|
|
|
|
wxPanel * ConsoleParent = CreateEmptyPanel();
|
2009-08-30 08:22:05 +00:00
|
|
|
|
::SetParent(GetConsoleWindow(), (HWND)ConsoleParent->GetHWND());
|
|
|
|
|
//Win->SetParent(ConsoleParent);
|
2009-08-30 22:04:30 +00:00
|
|
|
|
//if (Win) m_Mgr->GetAllPanes().Item(i)->AddPage(Win, wxT("Console"), true, aNormalFile );
|
|
|
|
|
if (Win) GetNotebook(i)->AddPage(ConsoleParent, wxT("Console"), true, aNormalFile );
|
2009-08-27 19:38:35 +00:00
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
else // hide
|
|
|
|
|
{
|
2009-09-01 12:44:02 +00:00
|
|
|
|
//Console->Log(LogTypes::LCUSTOM, StringFromFormat(" >>> Show\n").c_str());
|
|
|
|
|
|
2009-08-27 19:38:35 +00:00
|
|
|
|
#ifdef _WIN32
|
2009-09-01 12:44:02 +00:00
|
|
|
|
// Hide
|
2009-08-31 21:46:29 +00:00
|
|
|
|
if(GetConsoleWindow()) ShowWindow(GetConsoleWindow(),SW_HIDE);
|
2009-09-01 12:44:02 +00:00
|
|
|
|
// Release the console to Windows
|
|
|
|
|
::SetParent(GetConsoleWindow(), NULL);
|
|
|
|
|
// Destroy the empty parent of the console
|
|
|
|
|
DoRemovePageString(wxT("Console"), true, true);
|
2009-08-31 21:46:29 +00:00
|
|
|
|
|
2009-08-27 19:38:35 +00:00
|
|
|
|
#else
|
2009-08-27 10:10:07 +00:00
|
|
|
|
Console->Close();
|
2009-08-27 19:38:35 +00:00
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Hide pane
|
|
|
|
|
if (!UseDebugger) HidePane();
|
2009-03-20 18:25:36 +00:00
|
|
|
|
|
|
|
|
|
// Make sure the check is updated (if wxw isn't calling this func)
|
2009-08-27 19:38:35 +00:00
|
|
|
|
//GetMenuBar()->FindItem(IDM_CONSOLEWINDOW)->Check(Show);
|
2009-08-27 10:10:07 +00:00
|
|
|
|
}
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
2009-08-27 19:38:35 +00:00
|
|
|
|
|
2009-08-27 10:10:07 +00:00
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
// GUI
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2009-08-29 06:08:14 +00:00
|
|
|
|
void CFrame::OnManagerResize(wxAuiManagerEvent& event)
|
|
|
|
|
{
|
|
|
|
|
event.Skip();
|
|
|
|
|
ResizeConsole();
|
|
|
|
|
}
|
2009-08-27 10:10:07 +00:00
|
|
|
|
void CFrame::OnResize(wxSizeEvent& event)
|
|
|
|
|
{
|
2009-08-29 06:08:14 +00:00
|
|
|
|
event.Skip();
|
2009-08-27 10:10:07 +00:00
|
|
|
|
// fit frame content, not needed right now
|
|
|
|
|
//FitInside();
|
|
|
|
|
DoMoveIcons(); // In FrameWiimote.cpp
|
2009-03-20 18:25:36 +00:00
|
|
|
|
}
|
2009-02-23 06:15:48 +00:00
|
|
|
|
|
|
|
|
|
// Update the enabled/disabled status
|
|
|
|
|
void CFrame::UpdateGUI()
|
|
|
|
|
{
|
2009-09-01 12:44:02 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2009-02-23 06:15:48 +00:00
|
|
|
|
// Save status
|
2009-06-26 22:36:44 +00:00
|
|
|
|
bool initialized = Core::isRunning();
|
2009-02-23 06:15:48 +00:00
|
|
|
|
bool running = Core::GetState() == Core::CORE_RUN;
|
|
|
|
|
bool paused = Core::GetState() == Core::CORE_PAUSE;
|
|
|
|
|
|
|
|
|
|
// Make sure that we have a toolbar
|
2009-08-25 10:58:13 +00:00
|
|
|
|
if (m_ToolBar != NULL)
|
2009-02-23 06:15:48 +00:00
|
|
|
|
{
|
|
|
|
|
// Enable/disable the Config and Stop buttons
|
|
|
|
|
//GetToolBar()->EnableTool(IDM_CONFIG_MAIN, !initialized);
|
2009-08-25 10:58:13 +00:00
|
|
|
|
m_ToolBar->EnableTool(wxID_OPEN, !initialized);
|
|
|
|
|
m_ToolBar->EnableTool(wxID_REFRESH, !initialized); // Don't allow refresh when we don't show the list
|
|
|
|
|
m_ToolBar->EnableTool(IDM_STOP, running || paused);
|
|
|
|
|
m_ToolBar->EnableTool(IDM_SCREENSHOT, running || paused);
|
2009-02-23 06:15:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// File
|
2009-04-16 02:32:21 +00:00
|
|
|
|
GetMenuBar()->FindItem(wxID_OPEN)->Enable(!initialized);
|
|
|
|
|
m_pSubMenuDrive->Enable(!initialized);
|
|
|
|
|
GetMenuBar()->FindItem(wxID_REFRESH)->Enable(!initialized);
|
2009-04-16 05:29:45 +00:00
|
|
|
|
GetMenuBar()->FindItem(IDM_BROWSE)->Enable(!initialized);
|
2009-02-23 06:15:48 +00:00
|
|
|
|
|
|
|
|
|
// Emulation
|
2009-04-16 02:32:21 +00:00
|
|
|
|
GetMenuBar()->FindItem(IDM_STOP)->Enable(running || paused);
|
2009-08-21 19:55:03 +00:00
|
|
|
|
GetMenuBar()->FindItem(IDM_RECORD)->Enable(!initialized);
|
|
|
|
|
GetMenuBar()->FindItem(IDM_PLAYRECORD)->Enable(!initialized);
|
2009-08-22 02:05:02 +00:00
|
|
|
|
GetMenuBar()->FindItem(IDM_FRAMESTEP)->Enable(running || paused);
|
2009-06-29 09:24:39 +00:00
|
|
|
|
GetMenuBar()->FindItem(IDM_SCREENSHOT)->Enable(running || paused);
|
2009-04-16 02:32:21 +00:00
|
|
|
|
m_pSubMenuLoad->Enable(initialized);
|
|
|
|
|
m_pSubMenuSave->Enable(initialized);
|
2009-08-08 05:47:08 +00:00
|
|
|
|
|
|
|
|
|
// Let's enable it by default.
|
|
|
|
|
//m_pSubMenuFrameSkipping->Enable(initialized);
|
2009-02-23 06:15:48 +00:00
|
|
|
|
|
|
|
|
|
// Misc
|
2009-04-16 02:32:21 +00:00
|
|
|
|
GetMenuBar()->FindItem(IDM_CHANGEDISC)->Enable(initialized);
|
2009-04-15 22:25:07 +00:00
|
|
|
|
if (DiscIO::CNANDContentManager::Access().GetNANDLoader(FULL_WII_MENU_DIR).IsValid())
|
2009-04-16 02:32:21 +00:00
|
|
|
|
GetMenuBar()->FindItem(IDM_LOAD_WII_MENU)->Enable(!initialized);
|
2009-02-23 06:15:48 +00:00
|
|
|
|
|
|
|
|
|
if (running)
|
|
|
|
|
{
|
2009-08-25 10:58:13 +00:00
|
|
|
|
if (m_ToolBar != NULL)
|
2009-02-23 06:15:48 +00:00
|
|
|
|
{
|
2009-08-25 10:58:13 +00:00
|
|
|
|
m_ToolBar->SetToolBitmap(IDM_PLAY, m_Bitmaps[Toolbar_Pause]);
|
|
|
|
|
m_ToolBar->SetToolShortHelp(IDM_PLAY, _("Pause"));
|
|
|
|
|
m_ToolBar->SetToolLabel(IDM_PLAY, _("Pause"));
|
2009-02-23 06:15:48 +00:00
|
|
|
|
}
|
2009-06-29 09:24:39 +00:00
|
|
|
|
GetMenuBar()->FindItem(IDM_PLAY)->SetText(_("&Pause\tF10"));
|
2009-02-23 06:15:48 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2009-08-25 10:58:13 +00:00
|
|
|
|
if (m_ToolBar != NULL)
|
2009-02-23 06:15:48 +00:00
|
|
|
|
{
|
2009-08-25 10:58:13 +00:00
|
|
|
|
m_ToolBar->SetToolBitmap(IDM_PLAY, m_Bitmaps[Toolbar_Play]);
|
|
|
|
|
m_ToolBar->SetToolShortHelp(IDM_PLAY, _("Play"));
|
2009-08-27 00:54:44 +00:00
|
|
|
|
m_ToolBar->SetToolLabel(IDM_PLAY, wxT(" Play "));
|
2009-02-23 06:15:48 +00:00
|
|
|
|
}
|
2009-06-29 09:24:39 +00:00
|
|
|
|
GetMenuBar()->FindItem(IDM_PLAY)->SetText(_("&Play\tF10"));
|
2009-02-23 06:15:48 +00:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!initialized)
|
|
|
|
|
{
|
2009-09-01 12:44:02 +00:00
|
|
|
|
if (m_GameListCtrl)
|
2009-02-23 06:15:48 +00:00
|
|
|
|
{
|
2009-09-01 12:44:02 +00:00
|
|
|
|
if (!m_GameListCtrl->IsShown())
|
|
|
|
|
{
|
|
|
|
|
m_GameListCtrl->Enable();
|
|
|
|
|
m_GameListCtrl->Show();
|
|
|
|
|
sizerPanel->FitInside(m_Panel);
|
|
|
|
|
}
|
2009-02-23 06:15:48 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2009-09-01 12:44:02 +00:00
|
|
|
|
if (m_GameListCtrl)
|
2009-02-23 06:15:48 +00:00
|
|
|
|
{
|
2009-09-01 12:44:02 +00:00
|
|
|
|
if (m_GameListCtrl->IsShown())
|
|
|
|
|
{
|
|
|
|
|
m_GameListCtrl->Disable();
|
|
|
|
|
m_GameListCtrl->Hide();
|
|
|
|
|
}
|
2009-02-23 06:15:48 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2009-08-27 00:54:44 +00:00
|
|
|
|
|
|
|
|
|
// Commit changes to toolbar
|
|
|
|
|
if (m_ToolBar != NULL) m_ToolBar->Realize();
|
|
|
|
|
if (UseDebugger) g_pCodeWindow->Update();
|
|
|
|
|
// Commit changes to manager
|
|
|
|
|
m_Mgr->Update();
|
2009-02-23 06:15:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2009-04-28 02:30:50 +00:00
|
|
|
|
void CFrame::GameListChanged(wxCommandEvent& event)
|
|
|
|
|
{
|
|
|
|
|
switch (event.GetId())
|
|
|
|
|
{
|
|
|
|
|
case IDM_LISTWII:
|
|
|
|
|
SConfig::GetInstance().m_ListWii = event.IsChecked();
|
|
|
|
|
break;
|
|
|
|
|
case IDM_LISTGC:
|
|
|
|
|
SConfig::GetInstance().m_ListGC = event.IsChecked();
|
|
|
|
|
break;
|
2009-06-07 02:27:36 +00:00
|
|
|
|
case IDM_LISTWAD:
|
|
|
|
|
SConfig::GetInstance().m_ListWad = event.IsChecked();
|
|
|
|
|
break;
|
2009-04-28 02:30:50 +00:00
|
|
|
|
case IDM_LISTJAP:
|
|
|
|
|
SConfig::GetInstance().m_ListJap = event.IsChecked();
|
|
|
|
|
break;
|
|
|
|
|
case IDM_LISTPAL:
|
|
|
|
|
SConfig::GetInstance().m_ListPal = event.IsChecked();
|
|
|
|
|
break;
|
|
|
|
|
case IDM_LISTUSA:
|
|
|
|
|
SConfig::GetInstance().m_ListUsa = event.IsChecked();
|
|
|
|
|
break;
|
|
|
|
|
case IDM_LISTDRIVES:
|
|
|
|
|
SConfig::GetInstance().m_ListDrives = event.IsChecked();
|
|
|
|
|
break;
|
2009-06-06 07:36:22 +00:00
|
|
|
|
case IDM_PURGECACHE:
|
|
|
|
|
CFileSearch::XStringVector Directories;
|
|
|
|
|
Directories.push_back(FULL_CACHE_DIR);
|
|
|
|
|
CFileSearch::XStringVector Extensions;
|
|
|
|
|
Extensions.push_back("*.cache");
|
|
|
|
|
|
|
|
|
|
CFileSearch FileSearch(Extensions, Directories);
|
|
|
|
|
const CFileSearch::XStringVector& rFilenames = FileSearch.GetFileNames();
|
|
|
|
|
|
|
|
|
|
for (u32 i = 0; i < rFilenames.size(); i++)
|
|
|
|
|
{
|
|
|
|
|
File::Delete(rFilenames[i].c_str());
|
|
|
|
|
}
|
|
|
|
|
break;
|
2009-04-28 02:30:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (m_GameListCtrl)
|
|
|
|
|
{
|
|
|
|
|
m_GameListCtrl->Update();
|
|
|
|
|
}
|
|
|
|
|
}
|
2009-08-31 21:46:29 +00:00
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|