Fix a few issues with the size of the logger pane.

Also some other general clean up issues.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7401 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Glenn Rice
2011-03-23 02:06:40 +00:00
parent ae9de182f3
commit c39e3c17e1
8 changed files with 66 additions and 49 deletions

View File

@ -29,6 +29,14 @@
void CFrame::OnManagerResize(wxAuiManagerEvent& event)
{
if (!g_pCodeWindow && m_LogWindow &&
m_Mgr->GetPane(_T("Pane 1")).IsShown() &&
!m_Mgr->GetPane(_T("Pane 1")).IsFloating())
{
m_LogWindow->x = m_Mgr->GetPane(_T("Pane 1")).rect.GetWidth();
m_LogWindow->y = m_Mgr->GetPane(_T("Pane 1")).rect.GetHeight();
m_LogWindow->winpos = m_Mgr->GetPane(_T("Pane 1")).dock_direction;
}
event.Skip();
ResizeConsole();
}
@ -76,6 +84,9 @@ void CFrame::OnPaneClose(wxAuiManagerEvent& event)
void CFrame::ToggleLogWindow(bool bShow)
{
if (!m_LogWindow)
return;
GetMenuBar()->FindItem(IDM_LOGWINDOW)->Check(bShow);
if (bShow)
@ -378,6 +389,32 @@ void CFrame::OnAllowNotebookDnD(wxAuiNotebookEvent& event)
ResizeConsole();
}
void CFrame::ShowResizePane()
{
if (!m_LogWindow) return;
// Make sure the size is sane
if (m_LogWindow->x > GetClientRect().GetWidth())
m_LogWindow->x = GetClientRect().GetWidth() / 2;
if (m_LogWindow->y > GetClientRect().GetHeight())
m_LogWindow->y = GetClientRect().GetHeight() / 2;
wxAuiPaneInfo &pane = m_Mgr->GetPane(wxT("Pane 1"));
// Hide first otherwise a resize doesn't work
pane.Hide();
m_Mgr->Update();
pane.BestSize(m_LogWindow->x, m_LogWindow->y)
.MinSize(m_LogWindow->x, m_LogWindow->y)
.Direction(m_LogWindow->winpos).Show();
m_Mgr->Update();
// Reset the minimum size of the pane
pane.MinSize(-1, -1);
m_Mgr->Update();
}
void CFrame::TogglePane()
{
// Get the first notebook
@ -391,22 +428,11 @@ void CFrame::TogglePane()
{
if (NB->GetPageCount() == 0)
{
m_LogWindow->x = m_Mgr->GetPane(_T("Pane 1")).rect.GetWidth();
m_LogWindow->y = m_Mgr->GetPane(_T("Pane 1")).rect.GetHeight();
m_LogWindow->winpos = m_Mgr->GetPane(_T("Pane 1")).dock_direction;
m_Mgr->GetPane(_T("Pane 1")).Hide();
m_Mgr->Update();
}
else
{
m_Mgr->GetPane(_T("Pane 1")).BestSize(m_LogWindow->x, m_LogWindow->y)
.MinSize(m_LogWindow->x, m_LogWindow->y)
.Direction(m_LogWindow->winpos).Show();
m_Mgr->Update();
// Reset the minimum size of the pane
m_Mgr->GetPane(_T("Pane 1")).MinSize(-1, -1);
}
m_Mgr->Update();
ShowResizePane();
}
}