Fix an issue using render to main in combination with the log window or console window, in which the renderer was not resized when the panes were resized.

Also refresh the log window at that time so artifacts are cleared.
A little more code cleanup of the debugger windows.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5983 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Glenn Rice 2010-07-27 02:39:12 +00:00
parent 99ffecd675
commit 586f24645a
11 changed files with 53 additions and 46 deletions

View File

@ -30,7 +30,9 @@ BEGIN_EVENT_TABLE(CBreakPointWindow, wxPanel)
EVT_LIST_ITEM_SELECTED(ID_TOOLBAR, CBreakPointWindow::OnSelectItem) EVT_LIST_ITEM_SELECTED(ID_TOOLBAR, CBreakPointWindow::OnSelectItem)
END_EVENT_TABLE() END_EVENT_TABLE()
CBreakPointWindow::CBreakPointWindow(CCodeWindow* _pCodeWindow, wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& position, const wxSize& size, long style) CBreakPointWindow::CBreakPointWindow(CCodeWindow* _pCodeWindow, wxWindow* parent,
wxWindowID id, const wxString& title, const wxPoint& position,
const wxSize& size, long style)
: wxPanel(parent, id, position, size, style, title) : wxPanel(parent, id, position, size, style, title)
, m_BreakPointListView(NULL) , m_BreakPointListView(NULL)
, m_pCodeWindow(_pCodeWindow) , m_pCodeWindow(_pCodeWindow)

View File

@ -45,9 +45,13 @@ class CBreakPointWindow
public: public:
CBreakPointWindow(CCodeWindow* _pCodeWindow, wxWindow* parent, wxWindowID id = 1, const wxString& title = wxT("Breakpoints"), CBreakPointWindow(CCodeWindow* _pCodeWindow,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(400, 250), wxWindow* parent,
long style = wxNO_BORDER); wxWindowID id = wxID_ANY,
const wxString& title = wxT("Breakpoints"),
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTAB_TRAVERSAL | wxBORDER_NONE);
void NotifyUpdate(); void NotifyUpdate();
void OnDelete(); void OnDelete();

View File

@ -48,7 +48,7 @@ class CCodeWindow
wxWindowID id = wxID_ANY, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxTAB_TRAVERSAL, long style = wxTAB_TRAVERSAL | wxBORDER_NONE,
const wxString& name = wxT("Code") const wxString& name = wxT("Code")
); );

View File

@ -107,7 +107,7 @@ void CCodeWindow::Load()
// Get notebook affiliation // Get notebook affiliation
std::string _Section = "P - " + std::string _Section = "P - " +
((Parent->ActivePerspective < Parent->Perspectives.size()) ((Parent->ActivePerspective < Parent->Perspectives.size())
? Parent->Perspectives.at(Parent->ActivePerspective).Name : "Perspective 1"); ? Parent->Perspectives[Parent->ActivePerspective].Name : "Perspective 1");
for (int i = 0; i <= IDM_CODEWINDOW - IDM_LOGWINDOW; i++) for (int i = 0; i <= IDM_CODEWINDOW - IDM_LOGWINDOW; i++)
ini.Get(_Section.c_str(), SettingName[i], &iNbAffiliation[i], 0); ini.Get(_Section.c_str(), SettingName[i], &iNbAffiliation[i], 0);
@ -146,7 +146,7 @@ void CCodeWindow::Save()
ini.Set("ShowOnStart", SettingName[i - IDM_LOGWINDOW], GetMenuBar()->IsChecked(i)); ini.Set("ShowOnStart", SettingName[i - IDM_LOGWINDOW], GetMenuBar()->IsChecked(i));
// Save notebook affiliations // Save notebook affiliations
std::string _Section = "P - " + Parent->Perspectives.at(Parent->ActivePerspective).Name; std::string _Section = "P - " + Parent->Perspectives[Parent->ActivePerspective].Name;
for (int i = 0; i <= IDM_CODEWINDOW - IDM_LOGWINDOW; i++) for (int i = 0; i <= IDM_CODEWINDOW - IDM_LOGWINDOW; i++)
ini.Set(_Section.c_str(), SettingName[i], iNbAffiliation[i]); ini.Set(_Section.c_str(), SettingName[i], iNbAffiliation[i]);

View File

@ -46,8 +46,8 @@ public:
wxWindowID id = wxID_ANY, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxTAB_TRAVERSAL, long style = wxTAB_TRAVERSAL | wxBORDER_NONE,
const wxString& title = _T("JIT block viewer")); const wxString& name = _T("JIT block viewer"));
static void ViewAddr(u32 em_address); static void ViewAddr(u32 em_address);
void Update(); void Update();

View File

@ -40,7 +40,7 @@ class CMemoryWindow
wxWindowID id = wxID_ANY, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxNO_BORDER, long style = wxTAB_TRAVERSAL | wxBORDER_NONE,
const wxString& name = _T("Memory")); const wxString& name = _T("Memory"));
wxCheckBox* chk8; wxCheckBox* chk8;

View File

@ -26,8 +26,10 @@ BEGIN_EVENT_TABLE(CRegisterWindow, wxPanel)
END_EVENT_TABLE() END_EVENT_TABLE()
CRegisterWindow::CRegisterWindow(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& position, const wxSize& size, long style) CRegisterWindow::CRegisterWindow(wxWindow* parent, wxWindowID id,
: wxPanel(parent, id, position, size, style, title) const wxPoint& position, const wxSize& size,
long style, const wxString& name)
: wxPanel(parent, id, position, size, style, name)
, m_GPRGridView(NULL) , m_GPRGridView(NULL)
{ {
CreateGUIControls(); CreateGUIControls();

View File

@ -27,11 +27,10 @@ class CRegisterWindow
public: public:
CRegisterWindow(wxWindow* parent, CRegisterWindow(wxWindow* parent,
wxWindowID id = wxID_ANY, wxWindowID id = wxID_ANY,
const wxString& name = wxT("Registers"),
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxTAB_TRAVERSAL | wxNO_BORDER long style = wxTAB_TRAVERSAL | wxNO_BORDER,
); const wxString& name = wxT("Registers"));
void NotifyUpdate(); void NotifyUpdate();

View File

@ -317,8 +317,8 @@ EVT_AUINOTEBOOK_PAGE_CHANGED(wxID_ANY, CFrame::OnNotebookPageChanged)
EVT_AUINOTEBOOK_TAB_RIGHT_UP(wxID_ANY, CFrame::OnTab) EVT_AUINOTEBOOK_TAB_RIGHT_UP(wxID_ANY, CFrame::OnTab)
// Post events to child panels // Post events to child panels
EVT_MENU(wxID_ANY, CFrame::PostEvent) EVT_MENU_RANGE(IDM_INTERPRETER, IDM_ADDRBOX, CFrame::PostEvent)
EVT_TEXT(wxID_ANY, CFrame::PostEvent) EVT_TEXT(IDM_ADDRBOX, CFrame::PostEvent)
END_EVENT_TABLE() END_EVENT_TABLE()
@ -513,10 +513,6 @@ CFrame::~CFrame()
delete m_XRRConfig; delete m_XRRConfig;
#endif #endif
// Close the log window now so that its settings are saved
if (!g_pCodeWindow)
m_LogWindow->Close();
ClosePages(); ClosePages();
delete m_Mgr; delete m_Mgr;
@ -572,6 +568,11 @@ void CFrame::OnClose(wxCloseEvent& event)
event.Skip(); event.Skip();
// Save GUI settings // Save GUI settings
if (g_pCodeWindow) SaveIniPerspectives(); if (g_pCodeWindow) SaveIniPerspectives();
// Close the log window now so that its settings are saved
if (!g_pCodeWindow)
m_LogWindow->Close();
// Uninit // Uninit
m_Mgr->UnInit(); m_Mgr->UnInit();
@ -587,10 +588,9 @@ void CFrame::OnClose(wxCloseEvent& event)
// Warning: This may cause an endless loop if the event is propagated back to its parent // Warning: This may cause an endless loop if the event is propagated back to its parent
void CFrame::PostEvent(wxCommandEvent& event) void CFrame::PostEvent(wxCommandEvent& event)
{ {
if (g_pCodeWindow if (g_pCodeWindow &&
&& event.GetId() >= IDM_INTERPRETER && event.GetId() <= IDM_ADDRBOX event.GetId() >= IDM_INTERPRETER &&
//&& event.GetId() != IDM_JITUNLIMITED event.GetId() <= IDM_ADDRBOX)
)
{ {
event.StopPropagation(); event.StopPropagation();
g_pCodeWindow->GetEventHandler()->AddPendingEvent(event); g_pCodeWindow->GetEventHandler()->AddPendingEvent(event);

View File

@ -374,7 +374,8 @@ void CFrame::TogglePane()
if (m_Mgr->GetAllPanes().Item(i).window->IsKindOf(CLASSINFO(wxAuiNotebook))) if (m_Mgr->GetAllPanes().Item(i).window->IsKindOf(CLASSINFO(wxAuiNotebook)))
NB = (wxAuiNotebook*)m_Mgr->GetAllPanes().Item(i).window; NB = (wxAuiNotebook*)m_Mgr->GetAllPanes().Item(i).window;
} }
if (NB) { if (NB)
{
if (NB->GetPageCount() == 0) if (NB->GetPageCount() == 0)
m_Mgr->GetPane(wxT("Pane 1")).Hide(); m_Mgr->GetPane(wxT("Pane 1")).Hide();
else else
@ -492,7 +493,7 @@ void CFrame::OnDropDownToolbarItem(wxAuiToolBarEvent& event)
for (u32 i = 0; i < Perspectives.size(); i++) for (u32 i = 0; i < Perspectives.size(); i++)
{ {
wxMenuItem* mItem = new wxMenuItem(menuPopup, IDM_PERSPECTIVES_0 + i, wxMenuItem* mItem = new wxMenuItem(menuPopup, IDM_PERSPECTIVES_0 + i,
wxString::FromAscii(Perspectives.at(i).Name.c_str()), wxT(""), wxITEM_CHECK); wxString::FromAscii(Perspectives[i].Name.c_str()), wxT(""), wxITEM_CHECK);
menuPopup->Append(mItem); menuPopup->Append(mItem);
if (i == ActivePerspective) mItem->Check(true); if (i == ActivePerspective) mItem->Check(true);
} }
@ -524,7 +525,7 @@ void CFrame::OnToolBar(wxCommandEvent& event)
} }
SaveIniPerspectives(); SaveIniPerspectives();
GetStatusBar()->SetStatusText(wxString::FromAscii(std::string GetStatusBar()->SetStatusText(wxString::FromAscii(std::string
("Saved " + Perspectives.at(ActivePerspective).Name).c_str()), 0); ("Saved " + Perspectives[ActivePerspective].Name).c_str()), 0);
break; break;
case IDM_PERSPECTIVES_ADD_PANE: case IDM_PERSPECTIVES_ADD_PANE:
AddPane(); AddPane();
@ -733,13 +734,9 @@ void CFrame::SetSimplePaneSize()
ini.Get("LogWindow", "y", &y, Size); ini.Get("LogWindow", "y", &y, Size);
// Update size // Update size
m_Mgr->GetPane(wxT("Pane 0")).BestSize(x, y).MinSize(x, y).MaxSize(x, y); m_Mgr->GetPane(wxT("Pane 0")).BestSize(x, y);
m_Mgr->GetPane(wxT("Pane 1")).BestSize(x, y).MinSize(x, y).MaxSize(x, y); m_Mgr->GetPane(wxT("Pane 1")).BestSize(x, y);
m_Mgr->Update(); m_Mgr->Update();
// Set the position of the Pane
m_Mgr->GetPane(wxT("Pane 1")).MinSize(-1, -1).MaxSize(-1, -1);
m_Mgr->GetPane(wxT("Pane 0")).MinSize(-1, -1).MaxSize(-1, -1);
} }
void CFrame::SetPaneSize() void CFrame::SetPaneSize()
@ -752,11 +749,11 @@ void CFrame::SetPaneSize()
if (!m_Mgr->GetAllPanes().Item(i).window->IsKindOf(CLASSINFO(wxAuiToolBar))) if (!m_Mgr->GetAllPanes().Item(i).window->IsKindOf(CLASSINFO(wxAuiToolBar)))
{ {
if (!m_Mgr->GetAllPanes().Item(i).IsOk()) return; if (!m_Mgr->GetAllPanes().Item(i).IsOk()) return;
if (Perspectives.at(ActivePerspective).Width.size() <= j || if (Perspectives[ActivePerspective].Width.size() <= j ||
Perspectives.at(ActivePerspective).Height.size() <= j) Perspectives[ActivePerspective].Height.size() <= j)
continue; continue;
u32 W = Perspectives.at(ActivePerspective).Width.at(j), u32 W = Perspectives[ActivePerspective].Width[j],
H = Perspectives.at(ActivePerspective).Height.at(j); H = Perspectives[ActivePerspective].Height[j];
// Check limits // Check limits
W = Limit(W, 5, 95); H = Limit(H, 5, 95); W = Limit(W, 5, 95); H = Limit(H, 5, 95);
// Produce pixel width from percentage width // Produce pixel width from percentage width
@ -787,7 +784,7 @@ void CFrame::ReloadPanes()
CloseAllNotebooks(); CloseAllNotebooks();
// Create new panes with notebooks // Create new panes with notebooks
for (u32 i = 0; i < Perspectives.at(ActivePerspective).Width.size() - 1; i++) for (u32 i = 0; i < Perspectives[ActivePerspective].Width.size() - 1; i++)
{ {
wxString PaneName = wxString::Format(wxT("Pane %i"), i + 1); wxString PaneName = wxString::Format(wxT("Pane %i"), i + 1);
m_Mgr->AddPane(CreateEmptyNotebook(), wxAuiPaneInfo().Hide() m_Mgr->AddPane(CreateEmptyNotebook(), wxAuiPaneInfo().Hide()
@ -797,7 +794,7 @@ void CFrame::ReloadPanes()
HideAllNotebooks(true); HideAllNotebooks(true);
// Perspectives // Perspectives
m_Mgr->LoadPerspective(Perspectives.at(ActivePerspective).Perspective, false); m_Mgr->LoadPerspective(Perspectives[ActivePerspective].Perspective, false);
// Reset toolbars // Reset toolbars
ResetToolbarStyle(); ResetToolbarStyle();
// Restore settings // Restore settings
@ -807,6 +804,7 @@ void CFrame::ReloadPanes()
// Load GUI settings // Load GUI settings
g_pCodeWindow->Load(); g_pCodeWindow->Load();
// Open notebook pages // Open notebook pages
AddRemoveBlankPage();
g_pCodeWindow->OpenPages(); g_pCodeWindow->OpenPages();
if (g_pCodeWindow->bShowOnStart[0]) ToggleLogWindow(true); if (g_pCodeWindow->bShowOnStart[0]) ToggleLogWindow(true);
if (g_pCodeWindow->bShowOnStart[1]) ToggleConsole(true); if (g_pCodeWindow->bShowOnStart[1]) ToggleConsole(true);
@ -839,7 +837,7 @@ void CFrame::LoadIniPerspectives()
SPerspectives Tmp; SPerspectives Tmp;
std::string _Section, _Perspective, _Width, _Height; std::string _Section, _Perspective, _Width, _Height;
std::vector<std::string> _SWidth, _SHeight; std::vector<std::string> _SWidth, _SHeight;
Tmp.Name = VPerspectives.at(i); Tmp.Name = VPerspectives[i];
// Don't save a blank perspective // Don't save a blank perspective
if (Tmp.Name.empty()) continue; if (Tmp.Name.empty()) continue;
@ -859,12 +857,12 @@ void CFrame::LoadIniPerspectives()
for (u32 j = 0; j < _SWidth.size(); j++) for (u32 j = 0; j < _SWidth.size(); j++)
{ {
int _Tmp; int _Tmp;
if (TryParseInt(_SWidth.at(j).c_str(), &_Tmp)) Tmp.Width.push_back(_Tmp); if (TryParseInt(_SWidth[j].c_str(), &_Tmp)) Tmp.Width.push_back(_Tmp);
} }
for (u32 j = 0; j < _SHeight.size(); j++) for (u32 j = 0; j < _SHeight.size(); j++)
{ {
int _Tmp; int _Tmp;
if (TryParseInt(_SHeight.at(j).c_str(), &_Tmp)) Tmp.Height.push_back(_Tmp); if (TryParseInt(_SHeight[j].c_str(), &_Tmp)) Tmp.Height.push_back(_Tmp);
} }
Perspectives.push_back(Tmp); Perspectives.push_back(Tmp);
} }
@ -911,7 +909,7 @@ void CFrame::SaveIniPerspectives()
std::string STmp = ""; std::string STmp = "";
for (u32 i = 0; i < Perspectives.size(); i++) for (u32 i = 0; i < Perspectives.size(); i++)
{ {
STmp += Perspectives.at(i).Name + ","; STmp += Perspectives[i].Name + ",";
} }
STmp = STmp.substr(0, STmp.length()-1); STmp = STmp.substr(0, STmp.length()-1);
ini.Set("Perspectives", "Perspectives", STmp.c_str()); ini.Set("Perspectives", "Perspectives", STmp.c_str());

View File

@ -724,6 +724,8 @@ void CFrame::OnRenderParentResize(wxSizeEvent& event)
X11Utils::SendClientEvent(X11Utils::XDisplayFromHandle(GetHandle()), X11Utils::SendClientEvent(X11Utils::XDisplayFromHandle(GetHandle()),
"RESIZE", x, y, width, height); "RESIZE", x, y, width, height);
#endif #endif
m_LogWindow->Refresh();
m_LogWindow->Update();
} }
event.Skip(); event.Skip();
} }
@ -820,7 +822,7 @@ void CFrame::StartGame(const std::string& filename)
wxTheApp->Connect(wxID_ANY, wxEVT_KEY_UP, wxTheApp->Connect(wxID_ANY, wxEVT_KEY_UP,
wxKeyEventHandler(CFrame::OnKeyUp), wxKeyEventHandler(CFrame::OnKeyUp),
(wxObject*)0, this); (wxObject*)0, this);
m_RenderFrame->Connect(wxID_ANY, wxEVT_SIZE, m_RenderParent->Connect(wxID_ANY, wxEVT_SIZE,
wxSizeEventHandler(CFrame::OnRenderParentResize), wxSizeEventHandler(CFrame::OnRenderParentResize),
(wxObject*)0, this); (wxObject*)0, this);
} }
@ -912,7 +914,7 @@ void CFrame::DoStop()
Core::Stop(); Core::Stop();
// Destroy the renderer frame when not rendering to main // Destroy the renderer frame when not rendering to main
m_RenderFrame->Disconnect(wxID_ANY, wxEVT_SIZE, m_RenderParent->Disconnect(wxID_ANY, wxEVT_SIZE,
wxSizeEventHandler(CFrame::OnRenderParentResize), wxSizeEventHandler(CFrame::OnRenderParentResize),
(wxObject*)0, this); (wxObject*)0, this);
wxTheApp->Disconnect(wxID_ANY, wxEVT_KEY_DOWN, // Keyboard wxTheApp->Disconnect(wxID_ANY, wxEVT_KEY_DOWN, // Keyboard