mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
GUI: Custom pane management, almost complete
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4109 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -161,9 +161,6 @@ CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter
|
||||
, m_MemoryWindow(NULL)
|
||||
, m_JitWindow(NULL)
|
||||
{
|
||||
// Load ini settings
|
||||
this->Load();
|
||||
|
||||
InitBitmaps();
|
||||
|
||||
CreateGUIControls(_LocalCoreStartupParameter);
|
||||
@ -442,25 +439,22 @@ void CCodeWindow::Load()
|
||||
ini.Get("ShowOnStart", "Sound", &bSoundWindow, false);
|
||||
ini.Get("ShowOnStart", "Video", &bVideoWindow, false);
|
||||
// Get notebook affiliation
|
||||
ini.Get("Notebook", "Log", &iLogWindow, 1);
|
||||
ini.Get("Notebook", "Console", &iConsoleWindow, 1);
|
||||
ini.Get("Notebook", "Code", &iCodeWindow, 1);
|
||||
ini.Get("Notebook", "Registers", &iRegisterWindow, 1);
|
||||
ini.Get("Notebook", "Breakpoints", &iBreakpointWindow, 0);
|
||||
ini.Get("Notebook", "Memory", &iMemoryWindow, 1);
|
||||
ini.Get("Notebook", "JIT", &iJitWindow, 1);
|
||||
ini.Get("Notebook", "Sound", &iSoundWindow, 0);
|
||||
ini.Get("Notebook", "Video", &iVideoWindow, 0);
|
||||
// Remove bad values
|
||||
iLogWindow = Limit(iLogWindow, 0, Parent->m_NB.size()-1);
|
||||
iConsoleWindow = Limit(iConsoleWindow, 0, Parent->m_NB.size()-1);
|
||||
iCodeWindow = Limit(iCodeWindow, 0, Parent->m_NB.size()-1);
|
||||
iRegisterWindow = Limit(iRegisterWindow, 0, Parent->m_NB.size()-1);
|
||||
iBreakpointWindow = Limit(iBreakpointWindow, 0, Parent->m_NB.size()-1);
|
||||
iMemoryWindow = Limit(iMemoryWindow, 0, Parent->m_NB.size()-1);
|
||||
iJitWindow = Limit(iJitWindow, 0, Parent->m_NB.size()-1);
|
||||
iSoundWindow = Limit(iSoundWindow, 0, Parent->m_NB.size()-1);
|
||||
iVideoWindow = Limit(iVideoWindow, 0, Parent->m_NB.size()-1);
|
||||
std::string _Section = StringFromFormat("P - %s",
|
||||
(Parent->ActivePerspective < Parent->Perspectives.size())
|
||||
? Parent->Perspectives.at(Parent->ActivePerspective).Name.c_str() : "");
|
||||
ini.Get(_Section.c_str(), "Log", &iLogWindow, 1);
|
||||
ini.Get(_Section.c_str(), "Console", &iConsoleWindow, 1);
|
||||
ini.Get(_Section.c_str(), "Code", &iCodeWindow, 1);
|
||||
ini.Get(_Section.c_str(), "Registers", &iRegisterWindow, 1);
|
||||
ini.Get(_Section.c_str(), "Breakpoints", &iBreakpointWindow, 0);
|
||||
ini.Get(_Section.c_str(), "Memory", &iMemoryWindow, 1);
|
||||
ini.Get(_Section.c_str(), "JIT", &iJitWindow, 1);
|
||||
ini.Get(_Section.c_str(), "Sound", &iSoundWindow, 0);
|
||||
ini.Get(_Section.c_str(), "Video", &iVideoWindow, 0);
|
||||
|
||||
ConsoleListener* Console = LogManager::GetInstance()->getConsoleListener();
|
||||
Console->Log(LogTypes::LCUSTOM, StringFromFormat(
|
||||
"Load: %i\n", iRegisterWindow).c_str());
|
||||
|
||||
// Boot to pause or not
|
||||
ini.Get("ShowOnStart", "AutomaticStart", &bAutomaticStart, false);
|
||||
@ -485,16 +479,18 @@ void CCodeWindow::Save()
|
||||
ini.Set("ShowOnStart", "JIT", GetMenuBar()->IsChecked(IDM_JITWINDOW));
|
||||
ini.Set("ShowOnStart", "Sound", GetMenuBar()->IsChecked(IDM_SOUNDWINDOW));
|
||||
ini.Set("ShowOnStart", "Video", GetMenuBar()->IsChecked(IDM_VIDEOWINDOW));
|
||||
|
||||
ini.Set("Notebook", "Log", iLogWindow);
|
||||
ini.Set("Notebook", "Console", iConsoleWindow);
|
||||
ini.Set("Notebook", "Code", iCodeWindow);
|
||||
ini.Set("Notebook", "Registers", iRegisterWindow);
|
||||
ini.Set("Notebook", "Breakpoints", iBreakpointWindow);
|
||||
ini.Set("Notebook", "Memory", iMemoryWindow);
|
||||
ini.Set("Notebook", "JIT", iJitWindow);
|
||||
ini.Set("Notebook", "Sound", iSoundWindow);
|
||||
ini.Set("Notebook", "Video", iVideoWindow);
|
||||
std::string _Section = StringFromFormat("P - %s",
|
||||
(Parent->ActivePerspective < Parent->Perspectives.size())
|
||||
? Parent->Perspectives.at(Parent->ActivePerspective).Name.c_str() : "");
|
||||
ini.Set(_Section.c_str(), "Log", iLogWindow);
|
||||
ini.Set(_Section.c_str(), "Console", iConsoleWindow);
|
||||
ini.Set(_Section.c_str(), "Code", iCodeWindow);
|
||||
ini.Set(_Section.c_str(), "Registers", iRegisterWindow);
|
||||
ini.Set(_Section.c_str(), "Breakpoints", iBreakpointWindow);
|
||||
ini.Set(_Section.c_str(), "Memory", iMemoryWindow);
|
||||
ini.Set(_Section.c_str(), "JIT", iJitWindow);
|
||||
ini.Set(_Section.c_str(), "Sound", iSoundWindow);
|
||||
ini.Set(_Section.c_str(), "Video", iVideoWindow);
|
||||
|
||||
// Save window settings
|
||||
/*
|
||||
|
@ -85,6 +85,7 @@ class CCodeWindow
|
||||
void UpdateManager();
|
||||
|
||||
void OnToggleWindow(wxCommandEvent& event);
|
||||
void OnToggleCodeWindow(bool,int);
|
||||
void OnToggleRegisterWindow(bool,int);
|
||||
void OnToggleBreakPointWindow(bool,int);
|
||||
void OnToggleMemoryWindow(bool,int);
|
||||
|
@ -333,6 +333,7 @@ int CCodeWindow::Limit(int i, int Low, int High)
|
||||
}
|
||||
void CCodeWindow::OpenPages()
|
||||
{
|
||||
Parent->DoToggleWindow(IDM_CODEWINDOW, true);
|
||||
if (bRegisterWindow) Parent->DoToggleWindow(IDM_REGISTERWINDOW, true);
|
||||
if (bBreakpointWindow) Parent->DoToggleWindow(IDM_BREAKPOINTWINDOW, true);
|
||||
if (bMemoryWindow) Parent->DoToggleWindow(IDM_MEMORYWINDOW, true);
|
||||
@ -344,14 +345,21 @@ void CCodeWindow::OnToggleWindow(wxCommandEvent& event)
|
||||
{
|
||||
Parent->DoToggleWindow(event.GetId(), GetMenuBar()->IsChecked(event.GetId()));
|
||||
}
|
||||
void CCodeWindow::OnToggleCodeWindow(bool Show, int i)
|
||||
{
|
||||
if (Show)
|
||||
{
|
||||
Parent->DoAddPage(this, i, "Code");
|
||||
}
|
||||
else // hide
|
||||
Parent->DoRemovePage (this);
|
||||
}
|
||||
void CCodeWindow::OnToggleRegisterWindow(bool Show, int i)
|
||||
{
|
||||
if (Show)
|
||||
{
|
||||
if (i < 0 || i > Parent->m_NB.size()-1) return;
|
||||
if (m_RegisterWindow && Parent->m_NB[i]->GetPageIndex(m_RegisterWindow) != wxNOT_FOUND) return;
|
||||
if (!m_RegisterWindow) m_RegisterWindow = new CRegisterWindow(Parent);
|
||||
Parent->m_NB[i]->AddPage(m_RegisterWindow, wxT("Registers"), true, Parent->aNormalFile );
|
||||
if (!m_RegisterWindow) m_RegisterWindow = new CRegisterWindow(Parent);
|
||||
Parent->DoAddPage(m_RegisterWindow, i, "Registers");
|
||||
}
|
||||
else // hide
|
||||
Parent->DoRemovePage (m_RegisterWindow);
|
||||
@ -361,10 +369,8 @@ void CCodeWindow::OnToggleBreakPointWindow(bool Show, int i)
|
||||
{
|
||||
if (Show)
|
||||
{
|
||||
if (i < 0 || i > Parent->m_NB.size()-1) return;
|
||||
if (m_BreakpointWindow && Parent->m_NB[i]->GetPageIndex(m_BreakpointWindow) != wxNOT_FOUND) return;
|
||||
if (!m_BreakpointWindow) m_BreakpointWindow = new CBreakPointWindow(this, Parent);
|
||||
Parent->m_NB[i]->AddPage(m_BreakpointWindow, wxT("Breakpoints"), true, Parent->aNormalFile );
|
||||
if (!m_RegisterWindow) m_BreakpointWindow = new CBreakPointWindow(this, Parent);
|
||||
Parent->DoAddPage(m_BreakpointWindow, i, "Breakpoints");
|
||||
}
|
||||
else // hide
|
||||
Parent->DoRemovePage(m_BreakpointWindow);
|
||||
@ -374,10 +380,8 @@ void CCodeWindow::OnToggleJitWindow(bool Show, int i)
|
||||
{
|
||||
if (Show)
|
||||
{
|
||||
if (i < 0 || i > Parent->m_NB.size()-1) return;
|
||||
if (m_JitWindow && Parent->m_NB[i]->GetPageIndex(m_JitWindow) != wxNOT_FOUND) return;
|
||||
if (!m_JitWindow) m_JitWindow = new CJitWindow(Parent);
|
||||
Parent->m_NB[i]->AddPage(m_JitWindow, wxT("JIT"), true, Parent->aNormalFile );
|
||||
Parent->DoAddPage(m_JitWindow, i, "JIT");
|
||||
}
|
||||
else // hide
|
||||
Parent->DoRemovePage(m_JitWindow);
|
||||
@ -388,10 +392,8 @@ void CCodeWindow::OnToggleMemoryWindow(bool Show, int i)
|
||||
{
|
||||
if (Show)
|
||||
{
|
||||
if (i < 0 || i > Parent->m_NB.size()-1) return;
|
||||
if (m_MemoryWindow && Parent->m_NB[i]->GetPageIndex(m_MemoryWindow) != wxNOT_FOUND) return;
|
||||
if (!m_MemoryWindow) m_MemoryWindow = new CMemoryWindow(Parent);
|
||||
Parent->m_NB[i]->AddPage(m_MemoryWindow, wxT("Memory"), true, Parent->aNormalFile );
|
||||
Parent->DoAddPage(m_MemoryWindow, i, "Memory");
|
||||
}
|
||||
else // hide
|
||||
Parent->DoRemovePage(m_MemoryWindow);
|
||||
@ -404,7 +406,8 @@ void CCodeWindow::OnToggleSoundWindow(bool Show, int i)
|
||||
|
||||
if (Show)
|
||||
{
|
||||
if (i < 0 || i > Parent->m_NB.size()-1) return;
|
||||
if (Parent->m_NB.size() == 0) return;
|
||||
if (i < 0 || i > Parent->m_NB.size()-1) i = 0;
|
||||
#ifdef _WIN32
|
||||
wxWindow *Win = Parent->GetWxWindow(wxT("Sound"));
|
||||
if (Win && Parent->m_NB[i]->GetPageIndex(Win) != wxNOT_FOUND) return;
|
||||
|
Reference in New Issue
Block a user