mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-31 01:59:52 -06:00
Some work on cleaning up the FrameAui code. Primarily this fixes the debugger windows for the audio and video plugins. They are now all subclasses of a wxPanel, instead of a mix of wxFrames and wxDialogs. This makes them work correctly in linux, windows (they really didn't before), and most likely on MacOSX too!
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5913 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -119,7 +119,7 @@ wxWindow* GetParentedWxWindow(HWND Parent)
|
||||
#endif
|
||||
|
||||
|
||||
void DllDebugger(HWND _hParent, bool Show)
|
||||
void DllDebugger(void *_hParent, bool Show)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@
|
||||
void Host_NotifyMapLoaded() {}
|
||||
void Host_UpdateBreakPointView() {}
|
||||
|
||||
BEGIN_EVENT_TABLE(DSPDebuggerLLE, wxFrame)
|
||||
BEGIN_EVENT_TABLE(DSPDebuggerLLE, wxPanel)
|
||||
EVT_CLOSE(DSPDebuggerLLE::OnClose)
|
||||
EVT_MENU_RANGE(ID_RUNTOOL, ID_STEPTOOL, DSPDebuggerLLE::OnChangeState)
|
||||
EVT_MENU(ID_SHOWPCTOOL, DSPDebuggerLLE::OnShowPC)
|
||||
@ -42,9 +42,8 @@ END_EVENT_TABLE()
|
||||
|
||||
|
||||
DSPDebuggerLLE::DSPDebuggerLLE(wxWindow* parent)
|
||||
: wxFrame(parent, wxID_ANY, _("DSP LLE Debugger"),
|
||||
wxDefaultPosition, wxSize(700, 800),
|
||||
wxDEFAULT_FRAME_STYLE)
|
||||
: wxPanel(parent, wxID_ANY, wxDefaultPosition, wxSize(700, 800),
|
||||
wxTAB_TRAVERSAL, _("Sound"))
|
||||
, m_CachedStepCounter(-1)
|
||||
{
|
||||
// notify wxAUI which frame to use
|
||||
|
@ -48,7 +48,7 @@ class DSPRegisterView;
|
||||
class CCodeView;
|
||||
class CMemoryView;
|
||||
|
||||
class DSPDebuggerLLE : public wxFrame
|
||||
class DSPDebuggerLLE : public wxPanel
|
||||
{
|
||||
public:
|
||||
DSPDebuggerLLE(wxWindow *parent);
|
||||
|
@ -201,16 +201,24 @@ void EmuStateChange(PLUGIN_EMUSTATE newState)
|
||||
DSP_ClearAudioBuffer((newState == PLUGIN_EMUSTATE_PLAY) ? false : true);
|
||||
}
|
||||
|
||||
void DllDebugger(HWND _hParent, bool Show)
|
||||
void DllDebugger(void *_hParent, bool Show)
|
||||
{
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
if (!m_DebuggerFrame)
|
||||
m_DebuggerFrame = new DSPDebuggerLLE(GetParentedWxWindow(_hParent));
|
||||
|
||||
if (Show)
|
||||
{
|
||||
if (!m_DebuggerFrame)
|
||||
m_DebuggerFrame = new DSPDebuggerLLE((wxWindow *)_hParent);
|
||||
m_DebuggerFrame->Show();
|
||||
}
|
||||
else
|
||||
m_DebuggerFrame->Hide();
|
||||
{
|
||||
if (m_DebuggerFrame)
|
||||
{
|
||||
m_DebuggerFrame->Close();
|
||||
m_DebuggerFrame->Destroy();
|
||||
m_DebuggerFrame = NULL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -107,7 +107,7 @@ wxWindow* GetParentedWxWindow(HWND Parent)
|
||||
}
|
||||
#endif
|
||||
|
||||
void DllDebugger(HWND _hParent, bool Show)
|
||||
void DllDebugger(void *_hParent, bool Show)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
||||
|
||||
extern int g_Preset;
|
||||
|
||||
BEGIN_EVENT_TABLE(GFXDebuggerDX9,wxDialog)
|
||||
BEGIN_EVENT_TABLE(GFXDebuggerDX9, wxPanel)
|
||||
EVT_CLOSE(GFXDebuggerDX9::OnClose)
|
||||
EVT_CHECKBOX(ID_SAVETOFILE,GFXDebuggerDX9::GeneralSettings)
|
||||
EVT_CHECKBOX(ID_INFOLOG,GFXDebuggerDX9::GeneralSettings)
|
||||
@ -51,9 +51,9 @@ BEGIN_EVENT_TABLE(GFXDebuggerDX9,wxDialog)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
|
||||
GFXDebuggerDX9::GFXDebuggerDX9(wxWindow *parent, wxWindowID id, const wxString &title,
|
||||
const wxPoint &position, const wxSize& size, long style)
|
||||
: wxDialog(parent, id, title, position, size, style)
|
||||
GFXDebuggerDX9::GFXDebuggerDX9(wxWindow *parent, wxWindowID id, const wxPoint &position,
|
||||
const wxSize& size, long style, const wxString &title)
|
||||
: wxPanel(parent, id, position, size, style, title)
|
||||
{
|
||||
CreateGUIControls();
|
||||
|
||||
@ -167,7 +167,6 @@ void GFXDebuggerDX9::CreateGUIControls()
|
||||
g_pdebugger = this;
|
||||
|
||||
// Basic settings
|
||||
SetIcon(wxNullIcon);
|
||||
CenterOnParent();
|
||||
|
||||
// MainPanel
|
||||
|
@ -25,19 +25,15 @@
|
||||
|
||||
class IniFile;
|
||||
|
||||
class GFXDebuggerDX9 : public wxDialog
|
||||
class GFXDebuggerDX9 : public wxPanel
|
||||
{
|
||||
public:
|
||||
GFXDebuggerDX9(wxWindow *parent,
|
||||
wxWindowID id = 1,
|
||||
const wxString &title = wxT("Video"),
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
#ifdef _WIN32
|
||||
long style = wxNO_BORDER);
|
||||
#else
|
||||
long style = wxDEFAULT_FRAME_STYLE | wxCLIP_CHILDREN | wxNO_FULL_REPAINT_ON_RESIZE);
|
||||
#endif
|
||||
long style = wxTAB_TRAVERSAL,
|
||||
const wxString &title = wxT("Video"));
|
||||
|
||||
virtual ~GFXDebuggerDX9();
|
||||
|
||||
|
@ -97,16 +97,24 @@ wxWindow* GetParentedWxWindow(HWND Parent)
|
||||
}
|
||||
#endif
|
||||
|
||||
void DllDebugger(HWND _hParent, bool Show)
|
||||
void DllDebugger(void *_hParent, bool Show)
|
||||
{
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
if (!m_DebuggerFrame)
|
||||
m_DebuggerFrame = new GFXDebuggerDX9(GetParentedWxWindow(_hParent));
|
||||
|
||||
if (Show)
|
||||
{
|
||||
if (!m_DebuggerFrame)
|
||||
m_DebuggerFrame = new GFXDebuggerDX9((wxWindow *)_hParent);
|
||||
m_DebuggerFrame->Show();
|
||||
}
|
||||
else
|
||||
m_DebuggerFrame->Hide();
|
||||
{
|
||||
if (m_DebuggerFrame)
|
||||
{
|
||||
m_DebuggerFrame->Close();
|
||||
m_DebuggerFrame->Destroy();
|
||||
m_DebuggerFrame = NULL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
extern int g_Preset;
|
||||
|
||||
BEGIN_EVENT_TABLE(GFXDebuggerOGL,wxDialog)
|
||||
BEGIN_EVENT_TABLE(GFXDebuggerOGL,wxPanel)
|
||||
EVT_CLOSE(GFXDebuggerOGL::OnClose)
|
||||
EVT_CHECKBOX(ID_SAVETOFILE,GFXDebuggerOGL::GeneralSettings)
|
||||
EVT_CHECKBOX(ID_INFOLOG,GFXDebuggerOGL::GeneralSettings)
|
||||
@ -35,9 +35,9 @@ BEGIN_EVENT_TABLE(GFXDebuggerOGL,wxDialog)
|
||||
EVT_CHECKBOX(ID_SAVESHADERS,GFXDebuggerOGL::GeneralSettings)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
GFXDebuggerOGL::GFXDebuggerOGL(wxWindow *parent, wxWindowID id, const wxString &title,
|
||||
const wxPoint &position, const wxSize& size, long style)
|
||||
: wxDialog(parent, id, title, position, size, style)
|
||||
GFXDebuggerOGL::GFXDebuggerOGL(wxWindow *parent, wxWindowID id, const wxPoint& pos,
|
||||
const wxSize& size, long style, const wxString &title)
|
||||
: wxPanel(parent, id, pos, size, style, title)
|
||||
{
|
||||
CreateGUIControls();
|
||||
|
||||
@ -46,21 +46,14 @@ GFXDebuggerOGL::GFXDebuggerOGL(wxWindow *parent, wxWindowID id, const wxString &
|
||||
|
||||
GFXDebuggerOGL::~GFXDebuggerOGL()
|
||||
{
|
||||
SaveSettings();
|
||||
m_DebuggerFrame = NULL;
|
||||
NOTICE_LOG(CONSOLE, "Stop [Video Thread]: Closing OpenGL debugging window");
|
||||
}
|
||||
|
||||
void GFXDebuggerOGL::OnClose(wxCloseEvent& event)
|
||||
{
|
||||
// This means wxDialog's Destroy is used
|
||||
//event.Skip();
|
||||
|
||||
// Save the window position
|
||||
SaveSettings();
|
||||
|
||||
// Destroy
|
||||
delete this;
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
void GFXDebuggerOGL::SaveSettings() const
|
||||
@ -122,29 +115,24 @@ void GFXDebuggerOGL::LoadSettings()
|
||||
void GFXDebuggerOGL::CreateGUIControls()
|
||||
{
|
||||
// Basic settings
|
||||
SetIcon(wxNullIcon);
|
||||
CenterOnParent();
|
||||
|
||||
// MainPanel
|
||||
m_MainPanel = new wxPanel(this, ID_MAINPANEL, wxDefaultPosition, wxDefaultSize);
|
||||
|
||||
// Options
|
||||
wxStaticBoxSizer *sOptions = new wxStaticBoxSizer(wxVERTICAL, m_MainPanel, wxT("Options"));
|
||||
m_Check[0] = new wxCheckBox(m_MainPanel, ID_SAVETOFILE, wxT("Save to file"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_Check[1] = new wxCheckBox(m_MainPanel, ID_INFOLOG, wxT("Info log"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_Check[2] = new wxCheckBox(m_MainPanel, ID_PRIMLOG, wxT("Primary log"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_Check[3] = new wxCheckBox(m_MainPanel, ID_SAVETEXTURES, wxT("Save Textures"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_Check[4] = new wxCheckBox(m_MainPanel, ID_SAVETARGETS, wxT("Save Targets"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_Check[5] = new wxCheckBox(m_MainPanel, ID_SAVESHADERS, wxT("Save Shaders"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
wxStaticBoxSizer *sOptions = new wxStaticBoxSizer(wxVERTICAL, this, wxT("Options"));
|
||||
m_Check[0] = new wxCheckBox(this, ID_SAVETOFILE, wxT("Save to file"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_Check[1] = new wxCheckBox(this, ID_INFOLOG, wxT("Info log"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_Check[2] = new wxCheckBox(this, ID_PRIMLOG, wxT("Primary log"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_Check[3] = new wxCheckBox(this, ID_SAVETEXTURES, wxT("Save Textures"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_Check[4] = new wxCheckBox(this, ID_SAVETARGETS, wxT("Save Targets"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
m_Check[5] = new wxCheckBox(this, ID_SAVESHADERS, wxT("Save Shaders"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
|
||||
for (int i = 0; i < NUM_OPTIONS-ID_SAVETOFILE; ++i)
|
||||
sOptions->Add(m_Check[i], 0, 0, 5);
|
||||
|
||||
// Layout everything on m_MainPanel
|
||||
// Layout everything
|
||||
wxBoxSizer *sMain = new wxBoxSizer(wxHORIZONTAL);
|
||||
sMain->Add(sOptions);
|
||||
sMain->Add(100, 0); // Add some width so we can see the window title by default
|
||||
m_MainPanel->SetSizerAndFit(sMain);
|
||||
SetSizerAndFit(sMain);
|
||||
Fit();
|
||||
}
|
||||
|
||||
|
@ -25,19 +25,15 @@
|
||||
|
||||
class IniFile;
|
||||
|
||||
class GFXDebuggerOGL : public wxDialog
|
||||
class GFXDebuggerOGL : public wxPanel
|
||||
{
|
||||
public:
|
||||
GFXDebuggerOGL(wxWindow *parent,
|
||||
wxWindowID id = 1,
|
||||
const wxString &title = wxT("Video"),
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
#ifdef _WIN32
|
||||
long style = wxNO_BORDER);
|
||||
#else
|
||||
long style = wxDEFAULT_FRAME_STYLE | wxCLIP_CHILDREN | wxNO_FULL_REPAINT_ON_RESIZE);
|
||||
#endif
|
||||
long style = wxTAB_TRAVERSAL,
|
||||
const wxString &title = wxT("Video"));
|
||||
|
||||
virtual ~GFXDebuggerOGL();
|
||||
|
||||
@ -53,8 +49,6 @@ public:
|
||||
private:
|
||||
DECLARE_EVENT_TABLE();
|
||||
|
||||
wxPanel* m_MainPanel;
|
||||
|
||||
wxCheckBox* m_Check[6];
|
||||
|
||||
// WARNING: Make sure these are not also elsewhere
|
||||
|
@ -24,12 +24,6 @@
|
||||
#include "VideoCommon.h"
|
||||
#include "pluginspecs_video.h"
|
||||
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
#include "Debugger/Debugger.h"
|
||||
class GFXDebuggerOGL;
|
||||
extern GFXDebuggerOGL *m_DebuggerFrame;
|
||||
#endif
|
||||
|
||||
// A global plugin specification
|
||||
extern PLUGIN_GLOBALS* globals;
|
||||
|
||||
|
@ -64,7 +64,7 @@ Make AA apply instantly during gameplay if possible
|
||||
#include "GUI/ConfigDlg.h"
|
||||
GFXConfigDialogOGL *m_ConfigFrame = NULL;
|
||||
#include "Debugger/Debugger.h"
|
||||
GFXDebuggerOGL *m_DebuggerFrame = NULL;
|
||||
static GFXDebuggerOGL *m_DebuggerFrame = NULL;
|
||||
#endif // HAVE_WX
|
||||
|
||||
#include "VideoConfig.h"
|
||||
@ -152,15 +152,23 @@ wxWindow* GetParentedWxWindow(HWND Parent)
|
||||
}
|
||||
#endif
|
||||
|
||||
void DllDebugger(HWND _hParent, bool Show)
|
||||
void DllDebugger(void *_hParent, bool Show)
|
||||
{
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
if (Show) {
|
||||
if (Show)
|
||||
{
|
||||
if (!m_DebuggerFrame)
|
||||
m_DebuggerFrame = new GFXDebuggerOGL(NULL);
|
||||
m_DebuggerFrame = new GFXDebuggerOGL((wxWindow *)_hParent);
|
||||
m_DebuggerFrame->Show();
|
||||
} else {
|
||||
if (m_DebuggerFrame) m_DebuggerFrame->Hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_DebuggerFrame)
|
||||
{
|
||||
m_DebuggerFrame->Close();
|
||||
m_DebuggerFrame->Destroy();
|
||||
m_DebuggerFrame = NULL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ void SetDllGlobals(PLUGIN_GLOBALS* _pPluginGlobals)
|
||||
LogManager::SetInstance((LogManager *)globals->logManager);
|
||||
}
|
||||
|
||||
void DllDebugger(HWND _hParent, bool Show)
|
||||
void DllDebugger(void *_hParent, bool Show)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -152,7 +152,7 @@ void SetDllGlobals(PLUGIN_GLOBALS* _pPluginGlobals)
|
||||
LogManager::SetInstance((LogManager *)globals->logManager);
|
||||
}
|
||||
|
||||
void DllDebugger(HWND _hParent, bool Show) {}
|
||||
void DllDebugger(void *_hParent, bool Show) {}
|
||||
|
||||
void DllConfig(HWND _hParent)
|
||||
{
|
||||
|
@ -62,7 +62,9 @@ struct SRecordingAll
|
||||
extern u32 g_ISOId;
|
||||
extern bool g_SearchDeviceDone;
|
||||
extern bool g_RealWiiMotePresent;
|
||||
#ifdef _WIN32
|
||||
extern HINSTANCE g_hInstance;
|
||||
#endif
|
||||
|
||||
// Debugging
|
||||
extern bool g_DebugAccelerometer;
|
||||
|
@ -48,10 +48,10 @@ class wxDLLApp : public wxApp
|
||||
};
|
||||
IMPLEMENT_APP_NO_MAIN(wxDLLApp)
|
||||
WXDLLIMPEXP_BASE void wxSetInstance(HINSTANCE hInst);
|
||||
#endif
|
||||
|
||||
// copied from GCPad
|
||||
HINSTANCE g_hInstance;
|
||||
#endif
|
||||
|
||||
// copied from GCPad
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
@ -320,7 +320,7 @@ void DllConfig(HWND _hParent)
|
||||
// input: a handle to the window that calls this function
|
||||
// output: none
|
||||
//
|
||||
void DllDebugger(HWND _hParent, bool Show)
|
||||
void DllDebugger(void *_hParent, bool Show)
|
||||
{
|
||||
// wut?
|
||||
}
|
||||
|
Reference in New Issue
Block a user