GUI: Float notebook pages, unfinished (will save setting and other the other windows)

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4204 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
John Peterson
2009-09-05 04:50:45 +00:00
parent 6f5abbdfa3
commit 0f58b17c71
6 changed files with 535 additions and 313 deletions
+7 -8
View File
@@ -80,10 +80,11 @@ class CPluginManager;
BEGIN_EVENT_TABLE(CCodeWindow, wxPanel)
// Menu bar
EVT_MENU(IDM_INTERPRETER, CCodeWindow::OnCPUMode) // CPU Mode
EVT_MENU(IDM_AUTOMATICSTART, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_AUTOMATICSTART, CCodeWindow::OnCPUMode) // Options
EVT_MENU(IDM_BOOTTOPAUSE, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_FONTPICKER, CCodeWindow::OnChangeFont)
EVT_MENU(IDM_INTERPRETER, CCodeWindow::OnCPUMode) // Jit
EVT_MENU(IDM_JITUNLIMITED, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_JITOFF, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_JITLSOFF, CCodeWindow::OnCPUMode)
@@ -96,14 +97,16 @@ EVT_MENU(IDM_JITFPOFF, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_JITIOFF, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_JITPOFF, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_JITSROFF, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_CLEARCODECACHE, CCodeWindow::OnJitMenu)
EVT_MENU(IDM_LOGINSTRUCTIONS, CCodeWindow::OnJitMenu)
EVT_MENU(IDM_SEARCHINSTRUCTION, CCodeWindow::OnJitMenu)
EVT_MENU(IDM_REGISTERWINDOW, CCodeWindow::OnToggleWindow) //views
EVT_MENU(IDM_REGISTERWINDOW, CCodeWindow::OnToggleWindow) // View
EVT_MENU(IDM_BREAKPOINTWINDOW, CCodeWindow::OnToggleWindow)
EVT_MENU(IDM_MEMORYWINDOW, CCodeWindow::OnToggleWindow)
EVT_MENU(IDM_JITWINDOW, CCodeWindow::OnToggleWindow)
EVT_MENU(IDM_SOUNDWINDOW, CCodeWindow::OnToggleWindow)
EVT_MENU(IDM_VIDEOWINDOW, CCodeWindow::OnToggleWindow)
EVT_MENU(IDM_FONTPICKER, CCodeWindow::OnChangeFont)
EVT_MENU(IDM_CLEARSYMBOLS, CCodeWindow::OnSymbolsMenu)
EVT_MENU(IDM_LOADMAPFILE, CCodeWindow::OnSymbolsMenu)
@@ -115,10 +118,6 @@ EVT_MENU(IDM_USESIGNATUREFILE, CCodeWindow::OnSymbolsMenu)
EVT_MENU(IDM_PATCHHLEFUNCTIONS, CCodeWindow::OnSymbolsMenu)
EVT_MENU(IDM_RENAME_SYMBOLS, CCodeWindow::OnSymbolsMenu)
EVT_MENU(IDM_CLEARCODECACHE, CCodeWindow::OnJitMenu)
EVT_MENU(IDM_LOGINSTRUCTIONS, CCodeWindow::OnJitMenu)
EVT_MENU(IDM_SEARCHINSTRUCTION, CCodeWindow::OnJitMenu)
EVT_MENU(IDM_PROFILEBLOCKS, CCodeWindow::OnProfilerMenu)
EVT_MENU(IDM_WRITEPROFILE, CCodeWindow::OnProfilerMenu)
@@ -441,7 +441,7 @@ void CCodeWindow::OnToggleCodeWindow(bool _Show, int i)
{
if (_Show)
{
Parent->DoAddPage(this, i, "Code");
Parent->DoAddPage(this, i, wxT("Code"));
}
else // hide
Parent->DoRemovePage (this);
@@ -450,8 +450,8 @@ void CCodeWindow::OnToggleRegisterWindow(bool _Show, int i)
{
if (_Show)
{
if (!m_RegisterWindow) m_RegisterWindow = new CRegisterWindow(Parent);
Parent->DoAddPage(m_RegisterWindow, i, "Registers");
if (!m_RegisterWindow) m_RegisterWindow = new CRegisterWindow(Parent, IDM_REGISTERWINDOW);
Parent->DoAddPage(m_RegisterWindow, i, wxT("Registers"));
}
else // hide
Parent->DoRemovePage (m_RegisterWindow);
@@ -461,9 +461,9 @@ void CCodeWindow::OnToggleBreakPointWindow(bool _Show, int i)
{
if (_Show)
{
if (!m_BreakpointWindow) m_BreakpointWindow = new CBreakPointWindow(this, Parent);
if (!m_BreakpointWindow) m_BreakpointWindow = new CBreakPointWindow(this, Parent, IDM_BREAKPOINTWINDOW);
#ifdef _WIN32
Parent->DoAddPage(m_BreakpointWindow, i, "Breakpoints");
Parent->DoAddPage(m_BreakpointWindow, i, wxT("Breakpoints"));
#else
m_BreakpointWindow->Show();
#endif
@@ -476,33 +476,14 @@ void CCodeWindow::OnToggleBreakPointWindow(bool _Show, int i)
#endif
}
void CCodeWindow::OnToggleJitWindow(bool _Show, int i)
{
if (_Show)
{
if (!m_JitWindow) m_JitWindow = new CJitWindow(Parent);
#ifdef _WIN32
Parent->DoAddPage(m_JitWindow, i, "JIT");
#else
m_JitWindow->Show();
#endif
}
else // hide
#ifdef _WIN32
Parent->DoRemovePage(m_JitWindow);
#else
if (m_JitWindow) m_JitWindow->Hide();
#endif
}
void CCodeWindow::OnToggleMemoryWindow(bool _Show, int i)
{
if (_Show)
{
if (!m_MemoryWindow) m_MemoryWindow = new CMemoryWindow(Parent);
if (!m_MemoryWindow) m_MemoryWindow = new CMemoryWindow(Parent, IDM_MEMORYWINDOW);
#ifdef _WIN32
Parent->DoAddPage(m_MemoryWindow, i, "Memory");
Parent->DoAddPage(m_MemoryWindow, i, wxT("Memory"));
#else
m_MemoryWindow->Show();
#endif
@@ -516,6 +497,25 @@ void CCodeWindow::OnToggleMemoryWindow(bool _Show, int i)
}
void CCodeWindow::OnToggleJitWindow(bool _Show, int i)
{
if (_Show)
{
if (!m_JitWindow) m_JitWindow = new CJitWindow(Parent, IDM_JITWINDOW);
#ifdef _WIN32
Parent->DoAddPage(m_JitWindow, i, wxT("JIT"));
#else
m_JitWindow->Show();
#endif
}
else // hide
#ifdef _WIN32
Parent->DoRemovePage(m_JitWindow);
#else
if (m_JitWindow) m_JitWindow->Hide();
#endif
}
/*
@@ -540,7 +540,7 @@ void CCodeWindow::OnToggleSoundWindow(bool _Show, int i)
if (i < 0 || i > Parent->GetNotebookCount()-1) i = 0;
#ifdef _WIN32
wxWindow *Win = Parent->GetWxWindow(wxT("Sound"));
if (Win && Parent->GetNotebook(i)->GetPageIndex(Win) != wxNOT_FOUND) return;
if (Win && Parent->GetNotebookFromId(i)->GetPageIndex(Win) != wxNOT_FOUND) return;
{
#endif
@@ -559,7 +559,7 @@ void CCodeWindow::OnToggleSoundWindow(bool _Show, int i)
{
Win->SetName(wxT("Sound"));
Win->Reparent(Parent);
Parent->GetNotebook(i)->AddPage(Win, wxT("Sound"), true, Parent->aNormalFile );
Parent->GetNotebookFromId(i)->AddPage(Win, wxT("Sound"), true, Parent->aNormalFile );
//Console->Log(LogTypes::LNOTICE, StringFromFormat("AddPage\n").c_str());
//Parent->ListChildren();
//Console->Log(LogTypes::LNOTICE, StringFromFormat("OpenDebug: Win %i\n", FindWindowByName(wxT("Sound"))).c_str());
@@ -604,7 +604,7 @@ void CCodeWindow::OnToggleVideoWindow(bool _Show, int i)
if (i < 0 || i > Parent->GetNotebookCount()-1) i = 0;
#ifdef _WIN32
wxWindow *Win = Parent->GetWxWindow(wxT("Video"));
if (Win && Parent->GetNotebook(i)->GetPageIndex(Win) != wxNOT_FOUND) return;
if (Win && Parent->GetNotebookFromId(i)->GetPageIndex(Win) != wxNOT_FOUND) return;
{
#endif
@@ -618,7 +618,7 @@ void CCodeWindow::OnToggleVideoWindow(bool _Show, int i)
}
Win = Parent->GetWxWindow(wxT("Video"));
if (Win) Parent->GetNotebook(i)->AddPage(Win, wxT("Video"), true, Parent->aNormalFile );
if (Win) Parent->GetNotebookFromId(i)->AddPage(Win, wxT("Video"), true, Parent->aNormalFile );
#endif
}
else // hide
+90 -10
View File
@@ -238,6 +238,17 @@ EVT_MENU_RANGE(IDM_PERSPECTIVES_0, IDM_PERSPECTIVES_100, CFrame::OnSelectPerspec
EVT_MENU(IDM_ADD_PERSPECTIVE, CFrame::OnDropDownToolbarSelect)
EVT_MENU(IDM_TAB_SPLIT, CFrame::OnDropDownToolbarSelect)
EVT_MENU(IDM_NO_DOCKING, CFrame::OnDropDownToolbarSelect)
// Drop down float
EVT_MENU(IDM_FLOAT_LOGWINDOW, CFrame::OnFloatWindow)
EVT_MENU(IDM_FLOAT_CONSOLEWINDOW, CFrame::OnFloatWindow)
EVT_MENU(IDM_FLOAT_CODEWINDOW, CFrame::OnFloatWindow)
EVT_MENU(IDM_FLOAT_REGISTERWINDOW, CFrame::OnFloatWindow)
EVT_MENU(IDM_FLOAT_BREAKPOINTWINDOW, CFrame::OnFloatWindow)
EVT_MENU(IDM_FLOAT_MEMORYWINDOW, CFrame::OnFloatWindow)
EVT_MENU(IDM_FLOAT_JITWINDOW, CFrame::OnFloatWindow)
EVT_MENU(IDM_FLOAT_SOUNDWINDOW, CFrame::OnFloatWindow)
EVT_MENU(IDM_FLOAT_VIDEOWINDOW, CFrame::OnFloatWindow)
#if defined(HAVE_SFML) && HAVE_SFML
EVT_MENU(IDM_NETPLAY, CFrame::OnNetPlay)
@@ -291,6 +302,7 @@ EVT_AUI_PANE_CLOSE(CFrame::OnPaneClose)
EVT_AUINOTEBOOK_PAGE_CLOSE(wxID_ANY, CFrame::OnNotebookPageClose)
EVT_AUINOTEBOOK_ALLOW_DND(wxID_ANY, CFrame::OnAllowNotebookDnD)
EVT_AUINOTEBOOK_PAGE_CHANGED(wxID_ANY, CFrame::OnNotebookPageChanged)
EVT_AUINOTEBOOK_TAB_RIGHT_UP(wxID_ANY, CFrame::OnTab)
// Post events to child panels
EVT_MENU(wxID_ANY, CFrame::PostEvent)
@@ -327,14 +339,14 @@ CFrame::CFrame(wxFrame* parent,
// Give it a console early to show potential messages from this onward
ConsoleListener *Console = LogManager::GetInstance()->getConsoleListener();
if (SConfig::GetInstance().m_InterfaceConsole) Console->Open();
if (SConfig::GetInstance().m_InterfaceLogWindow) m_LogWindow = new CLogWindow(this);
if (SConfig::GetInstance().m_InterfaceLogWindow) m_LogWindow = new CLogWindow(this, IDM_LOGWINDOW);
// Start debugging mazimized
if (UseDebugger) this->Maximize(true);
// Debugger class
if (UseDebugger)
{
g_pCodeWindow = new CCodeWindow(SConfig::GetInstance().m_LocalCoreStartupParameter, this, this);
g_pCodeWindow = new CCodeWindow(SConfig::GetInstance().m_LocalCoreStartupParameter, this, this, IDM_CODEWINDOW);
g_pCodeWindow->Hide();
g_pCodeWindow->Load();
}
@@ -457,12 +469,12 @@ CFrame::CFrame(wxFrame* parent,
wxAuiManagerEventHandler(CFrame::OnManagerResize),
(wxObject*)0, this);
wxTheApp->Connect(wxID_ANY, wxEVT_LEFT_DOWN,
wxMouseEventHandler(CFrame::OnDoubleClick),
(wxObject*)0, this);
wxTheApp->Connect(wxID_ANY, wxEVT_MOTION,
wxMouseEventHandler(CFrame::OnMotion),
(wxObject*)0, this);
wxTheApp->Connect(wxID_ANY, wxEVT_LEFT_DOWN,
wxMouseEventHandler(CFrame::OnDoubleClick),
(wxObject*)0, this);
wxTheApp->Connect(wxID_ANY, wxEVT_MOTION,
wxMouseEventHandler(CFrame::OnMotion),
(wxObject*)0, this);
// ----------
// Update controls
@@ -818,9 +830,9 @@ void CFrame::Update()
// --------
// Functions
wxPanel* CFrame::CreateEmptyPanel()
wxPanel* CFrame::CreateEmptyPanel(wxWindowID Id)
{
wxPanel* Panel = new wxPanel(this, wxID_ANY);
wxPanel* Panel = new wxPanel(this, Id);
return Panel;
}
wxAuiNotebook* CFrame::CreateEmptyNotebook()
@@ -844,4 +856,72 @@ void CFrame::DoFullscreen(bool _F)
// Restore saved perspective
m_Mgr->LoadPerspective(AuiCurrent, true);
}
}
// Debugging, show loose windows
void CFrame::ListChildren()
{
ConsoleListener* Console = LogManager::GetInstance()->getConsoleListener();
wxAuiNotebook * NB = NULL;
Console->Log(LogTypes::LNOTICE, "--------------------------------------------------------------------\n");
for (u32 i = 0; i < this->GetChildren().size(); i++)
{
wxWindow * Win = this->GetChildren().Item(i)->GetData();
Console->Log(LogTypes::LNOTICE, StringFromFormat(
"%i: %s (%s) :: %s", i,
(const char*)Win->GetName().mb_str(), (const char*)Win->GetLabel().mb_str(), (const char*)Win->GetParent()->GetName().mb_str()).c_str());
//if (Win->GetName().IsSameAs(wxT("control")))
if (Win->IsKindOf(CLASSINFO(wxAuiNotebook)))
{
NB = (wxAuiNotebook*)Win;
Console->Log(LogTypes::LNOTICE, StringFromFormat(" :: NB", (const char*)NB->GetName().mb_str()).c_str());
}
else
{
NB = NULL;
}
Console->Log(LogTypes::LNOTICE, StringFromFormat("\n").c_str());
Win = this->GetChildren().Item(i)->GetData();
for (u32 j = 0; j < Win->GetChildren().size(); j++)
{
Console->Log(LogTypes::LNOTICE, StringFromFormat(
" %i.%i: %s (%s) :: %s", i, j,
(const char*)Win->GetName().mb_str(), (const char*)Win->GetLabel().mb_str(), (const char*)Win->GetParent()->GetName().mb_str()).c_str());
if (NB)
{
if (j < NB->GetPageCount())
Console->Log(LogTypes::LNOTICE, StringFromFormat(" :: %s", (const char*)NB->GetPage(j)->GetName().mb_str()).c_str());
}
Console->Log(LogTypes::LNOTICE, StringFromFormat("\n").c_str());
/*
Win = this->GetChildren().Item(j)->GetData();
for (int k = 0; k < Win->GetChildren().size(); k++)
{
Console->Log(LogTypes::LNOTICE, StringFromFormat(
" %i.%i.%i: %s (%s) :: %s\n", i, j, k,
Win->GetName().mb_str(), Win->GetLabel().mb_str(), Win->GetParent()->GetName().mb_str()).c_str());
}
*/
}
}
Console->Log(LogTypes::LNOTICE, "--------------------------------------------------------------------\n");
for (u32 i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++)
{
if (!m_Mgr->GetAllPanes().Item(i).window->IsKindOf(CLASSINFO(wxAuiNotebook))) continue;
wxAuiNotebook * _NB = (wxAuiNotebook*)m_Mgr->GetAllPanes().Item(i).window;
Console->Log(LogTypes::LNOTICE, StringFromFormat("%i: %s\n", i, (const char *)m_Mgr->GetAllPanes().Item(i).name.mb_str()).c_str());
for (u32 j = 0; j < _NB->GetPageCount(); j++)
{
Console->Log(LogTypes::LNOTICE, StringFromFormat("%i.%i: %s\n", i, j, (const char *)_NB->GetPageText(j).mb_str()).c_str());
}
}
Console->Log(LogTypes::LNOTICE, "--------------------------------------------------------------------\n");
}
+20 -8
View File
@@ -104,17 +104,29 @@ class CFrame : public wxFrame
wxAuiToolBar *m_ToolBar, *m_ToolBarDebug, *m_ToolBarAui;
long NOTEBOOK_STYLE, TOOLBAR_STYLE;
int iLeftWidth[2], iMidWidth[2];
// Perspectives
// Utility
wxWindow * GetWxWindow(wxString);
#ifdef _WIN32
wxWindow * GetWxWindowHwnd(HWND);
#endif
wxWindow * GetFloatingPage(int Id);
wxWindow * GetNootebookPage(wxString);
wxAuiNotebook * GetNotebook(u32);
wxWindow * GetNootebookPageFromId(wxWindowID Id);
wxAuiNotebook * GetNotebookFromId(u32);
wxString WindowNameFromId(int Id);
int GetNotebookCount();
int Limit(int,int,int);
int PercentageToPixels(int,int);
int PixelsToPercentage(int,int);
// Perspectives
void AddRemoveBlankPage();
void OnNotebookPageClose(wxAuiNotebookEvent& event);
void OnAllowNotebookDnD(wxAuiNotebookEvent& event);
void OnNotebookPageChanged(wxAuiNotebookEvent& event);
void OnFloatWindow(wxCommandEvent& event);
void OnTab(wxAuiNotebookEvent& event);
int GetNootebookAffiliation(wxString Name);
void ListChildren();
void ClosePages();
@@ -122,10 +134,13 @@ class CFrame : public wxFrame
void ShowAllNotebooks(bool Window = false);
void HideAllNotebooks(bool Window = false);
void CloseAllNotebooks();
int GetNotebookCount();
void DoAddPage(wxWindow *, int, std::string);
void DoAddPage(wxWindow *, int, wxString);
void DoRemovePage(wxWindow *, bool Hide = true);
void DoRemovePageString(wxString, bool Hide = true, bool Destroy = false);
void DoUnfloatPage(int Id);
void OnFloatingPageClosed(wxCloseEvent& event);
void DoFloatPage(wxWindow * Win);
wxFrame * CreateParentFrame(wxWindowID Id = wxID_ANY, const wxString& title = wxT(""), wxWindow * = NULL);
void HidePane();
void SetSimplePaneSize();
void SetPaneSize();
@@ -144,11 +159,8 @@ class CFrame : public wxFrame
wxString AuiFullscreen, AuiCurrent;
wxArrayString AuiPerspective;
u32 ActivePerspective;
int PercentageToPixels(int,int);
int PixelsToPercentage(int,int);
void NamePanes();
void AddPane();
int Limit(int,int,int);
void Save();
void SaveLocal();
void OnPaneClose(wxAuiManagerEvent& evt);
@@ -218,7 +230,7 @@ class CFrame : public wxFrame
void PopulateToolbarAui(wxAuiToolBar* toolBar);
void RecreateToolbar();
void CreateMenu();
wxPanel *CreateEmptyPanel();
wxPanel *CreateEmptyPanel(wxWindowID Id = wxID_ANY);
wxAuiNotebook *CreateEmptyNotebook();
#ifdef _WIN32
File diff suppressed because it is too large Load Diff
+12 -2
View File
@@ -130,9 +130,9 @@ enum
IDM_JITFPOFF,
IDM_JITPOFF,
IDM_JITSROFF,
// Views
IDM_FONTPICKER,
// Views
IDM_LOGWINDOW,
IDM_CONSOLEWINDOW,
IDM_CODEWINDOW,
@@ -177,6 +177,16 @@ enum
IDM_GOTOPC,
IDM_ADDRBOX,
IDM_FLOAT_LOGWINDOW,
IDM_FLOAT_CONSOLEWINDOW,
IDM_FLOAT_CODEWINDOW,
IDM_FLOAT_REGISTERWINDOW,
IDM_FLOAT_BREAKPOINTWINDOW,
IDM_FLOAT_MEMORYWINDOW,
IDM_FLOAT_JITWINDOW,
IDM_FLOAT_SOUNDWINDOW,
IDM_FLOAT_VIDEOWINDOW,
ID_TOOLBAR_AUI,
IDM_SAVE_PERSPECTIVE,
IDM_ADD_PERSPECTIVE,