diff options
| author | Marcus Wanners <marcus@wanners.net> | 2009-04-24 18:04:50 +0000 |
|---|---|---|
| committer | Marcus Wanners <marcus@wanners.net> | 2009-04-24 18:04:50 +0000 |
| commit | f39af5f9a528b3441c4d43737fc337a19fabe299 (patch) | |
| tree | aef87065e90b0e744f6ee2a02b92b42fc1c3259a /Source/Core | |
| parent | c25346773d339af06e6ea191515c3c03e3106e98 (diff) | |
The start of the InfoWindow (issue 722). By death2droid.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3066 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/DolphinWX/DolphinWX.vcproj | 8 | ||||
| -rw-r--r-- | Source/Core/DolphinWX/Src/Frame.cpp | 3 | ||||
| -rw-r--r-- | Source/Core/DolphinWX/Src/Frame.h | 3 | ||||
| -rw-r--r-- | Source/Core/DolphinWX/Src/FrameTools.cpp | 8 | ||||
| -rw-r--r-- | Source/Core/DolphinWX/Src/Globals.h | 2 | ||||
| -rw-r--r-- | Source/Core/DolphinWX/Src/InfoWindow.cpp | 124 | ||||
| -rw-r--r-- | Source/Core/DolphinWX/Src/InfoWindow.h | 101 | ||||
| -rw-r--r-- | Source/Core/DolphinWX/Src/SConscript | 1 |
8 files changed, 248 insertions, 2 deletions
diff --git a/Source/Core/DolphinWX/DolphinWX.vcproj b/Source/Core/DolphinWX/DolphinWX.vcproj index 2daebbdff1..937f047955 100644 --- a/Source/Core/DolphinWX/DolphinWX.vcproj +++ b/Source/Core/DolphinWX/DolphinWX.vcproj @@ -1117,6 +1117,14 @@ >
</File>
<File
+ RelativePath=".\Src\InfoWindow.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\Src\InfoWindow.h"
+ >
+ </File>
+ <File
RelativePath=".\src\LogWindow.cpp"
>
</File>
diff --git a/Source/Core/DolphinWX/Src/Frame.cpp b/Source/Core/DolphinWX/Src/Frame.cpp index 9a726dd079..bec7b524a8 100644 --- a/Source/Core/DolphinWX/Src/Frame.cpp +++ b/Source/Core/DolphinWX/Src/Frame.cpp @@ -264,6 +264,7 @@ EVT_MENU(IDT_LOG, CFrame::MM_OnLog) EVT_MENU(IDM_BROWSE, CFrame::OnBrowse) EVT_MENU(IDM_MEMCARD, CFrame::OnMemcard) EVT_MENU(IDM_CHEATS, CFrame::OnShow_CheatsWindow) +EVT_MENU(IDM_INFO, CFrame::OnShow_InfoWindow) EVT_MENU(IDM_CHANGEDISC, CFrame::OnChangeDisc) EVT_MENU(IDM_LOAD_WII_MENU, CFrame::OnLoadWiiMenu) EVT_MENU(IDM_TOGGLE_FULLSCREEN, CFrame::OnToggleFullscreen) @@ -496,7 +497,7 @@ void CFrame::OnKeyDown(wxKeyEvent& event) UpdateGUI(); } #ifdef _WIN32 - if(event.GetKeyCode() == 'E') // Send this to the video plugin WndProc + if(event.GetKeyCode() == 'E','M') // Send this to the video plugin WndProc { PostMessage((HWND)Core::GetWindowHandle(), WM_KEYDOWN, event.GetKeyCode(), 0); event.Skip(); // Don't block the E key diff --git a/Source/Core/DolphinWX/Src/Frame.h b/Source/Core/DolphinWX/Src/Frame.h index 42d3f49ff2..aa0a524b43 100644 --- a/Source/Core/DolphinWX/Src/Frame.h +++ b/Source/Core/DolphinWX/Src/Frame.h @@ -217,7 +217,8 @@ class CFrame : public wxFrame void OnMemcard(wxCommandEvent& event); // Misc void OnShow_CheatsWindow(wxCommandEvent& event); - void OnLoadWiiMenu(wxCommandEvent& event); + void OnShow_InfoWindow(wxCommandEvent& event); + void OnLoadWiiMenu(wxCommandEvent& event); void OnGameListCtrl_ItemActivated(wxListEvent& event); diff --git a/Source/Core/DolphinWX/Src/FrameTools.cpp b/Source/Core/DolphinWX/Src/FrameTools.cpp index 83302c2c67..fe61f9469c 100644 --- a/Source/Core/DolphinWX/Src/FrameTools.cpp +++ b/Source/Core/DolphinWX/Src/FrameTools.cpp @@ -40,6 +40,7 @@ be accessed from Core::GetWindowHandle(). #include "PluginManager.h" #include "MemcardManager.h" #include "CheatsWindow.h" +#include "InfoWindow.h" #include "AboutDolphin.h" #include "GameListCtrl.h" #include "BootManager.h" @@ -91,6 +92,7 @@ static const long TOOLBAR_STYLE = wxTB_FLAT | wxTB_DOCKABLE | wxTB_TEXT; // Other Windows wxCheatsWindow* CheatsWindow; +wxInfoWindow* InfoWindow; // Create menu items void CFrame::CreateMenu() @@ -164,6 +166,7 @@ void CFrame::CreateMenu() toolsMenu->AppendSeparator(); toolsMenu->Append(IDM_MEMCARD, _T("&Memcard Manager")); toolsMenu->Append(IDM_CHEATS, _T("Action &Replay Manager")); + toolsMenu->Append(IDM_INFO, _T("System Information")); // toolsMenu->Append(IDM_SDCARD, _T("Mount &SDCard")); // Disable for now if (DiscIO::CNANDContentManager::Access().GetNANDLoader(FULL_WII_MENU_DIR).IsValid()) @@ -684,6 +687,11 @@ void CFrame::OnShow_CheatsWindow(wxCommandEvent& WXUNUSED (event)) CheatsWindow = new wxCheatsWindow(this, wxDefaultPosition, wxSize(600, 390)); } +void CFrame::OnShow_InfoWindow(wxCommandEvent& WXUNUSED (event)) +{ + InfoWindow = new wxInfoWindow(this, wxDefaultPosition, wxSize(600, 390)); +} + void CFrame::OnLoadWiiMenu(wxCommandEvent& WXUNUSED (event)) { diff --git a/Source/Core/DolphinWX/Src/Globals.h b/Source/Core/DolphinWX/Src/Globals.h index 102947443b..8fd73e0c46 100644 --- a/Source/Core/DolphinWX/Src/Globals.h +++ b/Source/Core/DolphinWX/Src/Globals.h @@ -22,6 +22,7 @@ #define _GLOBALS_H #include "Common.h" +#include "svnrev.h" // Constant Colors const unsigned long COLOR_GRAY = 0xDCDCDC; @@ -59,6 +60,7 @@ enum IDM_MEMCARD, // Misc menu IDM_CHEATS, + IDM_INFO, IDM_CHANGEDISC, IDM_PROPERTIES, IDM_LOAD_WII_MENU, diff --git a/Source/Core/DolphinWX/Src/InfoWindow.cpp b/Source/Core/DolphinWX/Src/InfoWindow.cpp new file mode 100644 index 0000000000..84d296d481 --- /dev/null +++ b/Source/Core/DolphinWX/Src/InfoWindow.cpp @@ -0,0 +1,124 @@ +// Copyright (C) 2003-2009 Dolphin Project.
+
+// 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/
+
+#include "Globals.h"
+#include "InfoWindow.h"
+#include "ActionReplay.h"
+#include "CPUDetect.h"
+#include "Core.h"
+#include "ConfigManager.h"
+#include "CDUtils.h"
+
+using namespace ActionReplay;
+
+
+BEGIN_EVENT_TABLE(wxInfoWindow, wxWindow)
+ EVT_SIZE( wxInfoWindow::OnEvent_Window_Resize)
+ EVT_CLOSE( wxInfoWindow::OnEvent_Window_Close)
+ EVT_BUTTON(ID_BUTTON_CLOSE, wxInfoWindow::OnEvent_ButtonClose_Press)
+END_EVENT_TABLE()
+
+wxInfoWindow::wxInfoWindow(wxFrame* parent, const wxPoint& pos, const wxSize& size) :
+ wxFrame(parent, wxID_ANY, _T("System Information"), pos, size, wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE)
+{
+ // Create the GUI controls
+ Init_ChildControls();
+
+ // Setup Window
+ SetBackgroundColour(wxColour(COLOR_GRAY));
+ SetSize(size);
+ SetPosition(pos);
+
+
+
+ Layout();
+ Show();
+}
+
+wxInfoWindow::~wxInfoWindow()
+{
+ // On Disposal
+}
+
+void wxInfoWindow::Init_ChildControls()
+{
+
+ // Main Notebook
+ m_Notebook_Main = new wxNotebook(this, ID_NOTEBOOK_MAIN, wxDefaultPosition, wxDefaultSize);
+ // --- Tabs ---
+
+ // $ Log Tab
+ m_Tab_Log = new wxPanel(m_Notebook_Main, ID_TAB_LOG, wxDefaultPosition, wxDefaultSize);
+ m_TextCtrl_Log = new wxTextCtrl(m_Tab_Log,
+ ID_TEXTCTRL_LOG,
+ wxT(
+ //Dolphin revision number
+
+ std::string("Dolphin Revision: ") + SVN_REV_STR +"\n"+
+ std::string("CD/DVD Drive: ") + **cdio_get_devices() +"\n"+
+ //Plugin Information
+ "Plugin Information\n\n"+
+ std::string("Default GFX plugin: ") + SConfig::GetInstance().m_DefaultGFXPlugin +"\n"+
+ std::string("Default DSP plugin: ") + SConfig::GetInstance().m_DefaultDSPPlugin +"\n"+
+ std::string("Default PAD plugin: ") + SConfig::GetInstance().m_DefaultPADPlugin +"\n"+
+ std::string("Default WiiMote plugin: ") + SConfig::GetInstance().m_DefaultWiiMotePlugin +"\n\n"+
+
+ //CPU Info
+ std::string("Processor Information:\n")+cpu_info.Summarize()+"\n\n"
+
+ ),
+ wxDefaultPosition, wxSize(100, 600),
+ wxTE_MULTILINE | wxTE_READONLY | wxTE_DONTWRAP);
+
+ wxBoxSizer *HStrip1 = new wxBoxSizer(wxHORIZONTAL);
+ wxBoxSizer *sTabLog = new wxBoxSizer(wxVERTICAL);
+ sTabLog->Add(HStrip1, 0, wxALL, 5);
+ sTabLog->Add(m_TextCtrl_Log, 1, wxALL|wxEXPAND, 5);
+
+ m_Tab_Log->SetSizer(sTabLog);
+ m_Tab_Log->Layout();
+
+ // Add Tabs to Notebook
+ m_Notebook_Main->AddPage(m_Tab_Log, _T("System Information"));
+
+ // Button Strip
+ m_Button_Close = new wxButton(this, ID_BUTTON_CLOSE, _T("Close"), wxDefaultPosition, wxDefaultSize);
+ wxBoxSizer* sButtons = new wxBoxSizer(wxHORIZONTAL);
+ sButtons->Add(m_Button_Close, 0, wxALL, 5);
+
+ wxBoxSizer* sMain = new wxBoxSizer(wxVERTICAL);
+ sMain->Add(m_Notebook_Main, 1, wxEXPAND|wxALL, 5);
+ sMain->Add(sButtons, 0, wxALL, 5);
+ SetSizer(sMain);
+ Layout();
+
+ Fit();
+}
+void wxInfoWindow::OnEvent_Window_Resize(wxSizeEvent& WXUNUSED (event))
+{
+ Layout();
+}
+void wxInfoWindow::OnEvent_ButtonClose_Press(wxCommandEvent& WXUNUSED (event))
+{
+ Destroy();
+}
+void wxInfoWindow::OnEvent_Window_Close(wxCloseEvent& WXUNUSED (event))
+{
+ Destroy();
+}
+
+
diff --git a/Source/Core/DolphinWX/Src/InfoWindow.h b/Source/Core/DolphinWX/Src/InfoWindow.h new file mode 100644 index 0000000000..9111679de0 --- /dev/null +++ b/Source/Core/DolphinWX/Src/InfoWindow.h @@ -0,0 +1,101 @@ +// Copyright (C) 2003-2008 Dolphin Project.
+
+// 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/
+
+#ifndef __INFOWINDOW_H__
+#define __INFOWINDOW_H__
+
+#include <wx/wx.h>
+#include <wx/sizer.h>
+#include <wx/filepicker.h>
+#include <wx/statbmp.h>
+#include <wx/imaglist.h>
+#include <wx/treectrl.h>
+#include <wx/gbsizer.h>
+#include <wx/notebook.h>
+#include <wx/mimetype.h>
+#include <wx/colour.h>
+#include <wx/listbox.h>
+#include <string>
+
+#include "ActionReplay.h"
+
+#include "Filesystem.h"
+#include "IniFile.h"
+
+class wxInfoWindow : public wxFrame
+{
+ public:
+
+ wxInfoWindow(wxFrame* parent, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize);
+
+ virtual ~wxInfoWindow();
+
+ protected:
+
+ struct ARCodeIndex {
+ u32 uiIndex;
+ size_t index;
+ };
+
+ // Event Table
+ DECLARE_EVENT_TABLE();
+
+ // --- GUI Controls ---
+ wxGridBagSizer* m_Sizer_TabCheats;
+
+ wxNotebook *m_Notebook_Main;
+
+ wxPanel *m_Tab_Log;
+
+ wxButton *m_Button_Close;
+
+ wxTextCtrl *m_TextCtrl_Log;
+
+ std::vector<ARCodeIndex> indexList;
+
+ // GUI IDs
+ enum
+ {
+ ID_NOTEBOOK_MAIN,
+ ID_TAB_CHEATS,
+ ID_TAB_LOG,
+ ID_BUTTON_CLOSE,
+ ID_LABEL_CODENAME,
+ ID_GROUPBOX_INFO,
+ ID_BUTTON_APPLYCODES,
+ ID_LABEL_NUMCODES,
+ ID_CHECKBOX_LOGAR,
+ ID_TEXTCTRL_LOG
+ };
+
+ void Init_ChildControls();
+
+ void Load_ARCodes();
+
+ // --- Wx Events Handlers ---
+ // $ Window
+ void OnEvent_Window_Resize(wxSizeEvent& event);
+ void OnEvent_Window_Close(wxCloseEvent& event);
+
+ // $ Close Button
+ void OnEvent_ButtonClose_Press(wxCommandEvent& event);
+
+
+};
+
+#endif
+
diff --git a/Source/Core/DolphinWX/Src/SConscript b/Source/Core/DolphinWX/Src/SConscript index 94bedc4e97..a6c98d75c8 100644 --- a/Source/Core/DolphinWX/Src/SConscript +++ b/Source/Core/DolphinWX/Src/SConscript @@ -31,6 +31,7 @@ if wxenv['HAVE_WX']: 'MemoryCards/GCMemcard.cpp', 'PatchAddEdit.cpp', 'CheatsWindow.cpp', + 'InfoWindow.cpp', 'stdafx.cpp', 'FrameWiimote.cpp', 'WxUtils.cpp', |
