mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-15 16:59:18 +01:00
GUI: Bugfixes
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4105 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
1e8fabe521
commit
44847c2ee3
@ -478,7 +478,7 @@ void CCodeWindow::Save()
|
|||||||
ini.Set("ShowOnStart", "BootToPause", GetMenuBar()->IsChecked(IDM_BOOTTOPAUSE));
|
ini.Set("ShowOnStart", "BootToPause", GetMenuBar()->IsChecked(IDM_BOOTTOPAUSE));
|
||||||
|
|
||||||
// Save windows settings
|
// Save windows settings
|
||||||
ini.Set("ShowOnStart", "Code", GetMenuBar()->IsChecked(IDM_CODEWINDOW));
|
//ini.Set("ShowOnStart", "Code", GetMenuBar()->IsChecked(IDM_CODEWINDOW));
|
||||||
ini.Set("ShowOnStart", "Registers", GetMenuBar()->IsChecked(IDM_REGISTERWINDOW));
|
ini.Set("ShowOnStart", "Registers", GetMenuBar()->IsChecked(IDM_REGISTERWINDOW));
|
||||||
ini.Set("ShowOnStart", "Breakpoints", GetMenuBar()->IsChecked(IDM_BREAKPOINTWINDOW));
|
ini.Set("ShowOnStart", "Breakpoints", GetMenuBar()->IsChecked(IDM_BREAKPOINTWINDOW));
|
||||||
ini.Set("ShowOnStart", "Memory", GetMenuBar()->IsChecked(IDM_MEMORYWINDOW));
|
ini.Set("ShowOnStart", "Memory", GetMenuBar()->IsChecked(IDM_MEMORYWINDOW));
|
||||||
|
@ -102,8 +102,8 @@ class CCodeWindow
|
|||||||
|
|
||||||
// Settings
|
// Settings
|
||||||
bool bAutomaticStart; bool bBootToPause;
|
bool bAutomaticStart; bool bBootToPause;
|
||||||
bool bLogWindow; bool iLogWindow;
|
bool bLogWindow; int iLogWindow;
|
||||||
bool bConsoleWindow; bool iConsoleWindow;
|
bool bConsoleWindow; int iConsoleWindow;
|
||||||
bool bCodeWindow; int iCodeWindow;
|
bool bCodeWindow; int iCodeWindow;
|
||||||
bool bRegisterWindow; int iRegisterWindow;
|
bool bRegisterWindow; int iRegisterWindow;
|
||||||
bool bBreakpointWindow; int iBreakpointWindow;
|
bool bBreakpointWindow; int iBreakpointWindow;
|
||||||
|
@ -82,22 +82,6 @@ extern "C" {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Empty wxPanel
|
|
||||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
|
||||||
BEGIN_EVENT_TABLE(CEmptyPanel, wxPanel)
|
|
||||||
END_EVENT_TABLE()
|
|
||||||
|
|
||||||
CEmptyPanel::CEmptyPanel(
|
|
||||||
wxWindow *parent,
|
|
||||||
wxWindowID id
|
|
||||||
)
|
|
||||||
: wxPanel(parent, id)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
/* Windows functions. Setting the cursor with wxSetCursor() did not work in this instance.
|
/* Windows functions. Setting the cursor with wxSetCursor() did not work in this instance.
|
||||||
Probably because it's somehow reset from the WndProc() in the child window */
|
Probably because it's somehow reset from the WndProc() in the child window */
|
||||||
@ -513,9 +497,10 @@ CFrame::CFrame(bool showLogWindow,
|
|||||||
CPluginManager::GetInstance().ScanForPlugins();
|
CPluginManager::GetInstance().ScanForPlugins();
|
||||||
|
|
||||||
// Open notebook pages
|
// Open notebook pages
|
||||||
|
//if (UseDebugger) AddBlankPage();
|
||||||
if (UseDebugger) g_pCodeWindow->OpenPages();
|
if (UseDebugger) g_pCodeWindow->OpenPages();
|
||||||
if (m_bLogWindow) ToggleLogWindow(true, UseDebugger ? 1 : 0);
|
if (m_bLogWindow) DoToggleWindow(IDM_LOGWINDOW, true);
|
||||||
if (SConfig::GetInstance().m_InterfaceConsole) ToggleConsole(true, UseDebugger ? 1 : 0);
|
if (SConfig::GetInstance().m_InterfaceConsole) DoToggleWindow(IDM_CONSOLEWINDOW, true);
|
||||||
if (!UseDebugger) SetSimplePaneSize();
|
if (!UseDebugger) SetSimplePaneSize();
|
||||||
|
|
||||||
//if we are ever going back to optional iso caching:
|
//if we are ever going back to optional iso caching:
|
||||||
@ -596,6 +581,12 @@ void CFrame::OnClose(wxCloseEvent& event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxPanel* CFrame::CreateEmptyPanel()
|
||||||
|
{
|
||||||
|
wxPanel* Panel = new wxPanel(this, wxID_ANY);
|
||||||
|
return Panel;
|
||||||
|
}
|
||||||
|
|
||||||
void CFrame::DoFullscreen(bool _F)
|
void CFrame::DoFullscreen(bool _F)
|
||||||
{
|
{
|
||||||
ShowFullScreen(_F);
|
ShowFullScreen(_F);
|
||||||
|
@ -110,6 +110,7 @@ class CFrame : public wxFrame
|
|||||||
wxWindow * GetWxWindowHwnd(HWND);
|
wxWindow * GetWxWindowHwnd(HWND);
|
||||||
#endif
|
#endif
|
||||||
wxWindow * GetNootebookPage(wxString);
|
wxWindow * GetNootebookPage(wxString);
|
||||||
|
void AddRemoveBlankPage();
|
||||||
void OnNotebookPageClose(wxAuiNotebookEvent& event);
|
void OnNotebookPageClose(wxAuiNotebookEvent& event);
|
||||||
void OnAllowNotebookDnD(wxAuiNotebookEvent& event);
|
void OnAllowNotebookDnD(wxAuiNotebookEvent& event);
|
||||||
void OnNotebookPageChanged(wxAuiNotebookEvent& event);
|
void OnNotebookPageChanged(wxAuiNotebookEvent& event);
|
||||||
@ -181,6 +182,7 @@ class CFrame : public wxFrame
|
|||||||
void PopulateToolbarAui(wxAuiToolBar* toolBar);
|
void PopulateToolbarAui(wxAuiToolBar* toolBar);
|
||||||
void RecreateToolbar();
|
void RecreateToolbar();
|
||||||
void CreateMenu();
|
void CreateMenu();
|
||||||
|
wxPanel *CreateEmptyPanel();
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
// Override window proc for tricks like screensaver disabling
|
// Override window proc for tricks like screensaver disabling
|
||||||
@ -277,16 +279,4 @@ class CFrame : public wxFrame
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class CEmptyPanel : public wxPanel
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
CEmptyPanel(
|
|
||||||
wxWindow* parent,
|
|
||||||
wxWindowID id = wxID_ANY
|
|
||||||
);
|
|
||||||
|
|
||||||
private:
|
|
||||||
DECLARE_EVENT_TABLE();
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // __FRAME_H_
|
#endif // __FRAME_H_
|
||||||
|
@ -936,18 +936,6 @@ void CFrame::OnFrameSkip(wxCommandEvent& event)
|
|||||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Notebooks
|
// Notebooks
|
||||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||||
wxWindow * CFrame::GetNootebookPage(wxString Name)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < m_NB.size(); i++)
|
|
||||||
{
|
|
||||||
if (!m_NB[i]) return NULL;
|
|
||||||
for(u32 j = 0; j <= m_NB[j]->GetPageCount(); j++)
|
|
||||||
{
|
|
||||||
if (m_NB[i]->GetPageText(j).IsSameAs(Name)) return m_NB[i]->GetPage(j);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
wxWindow * CFrame::GetWxWindowHwnd(HWND hWnd)
|
wxWindow * CFrame::GetWxWindowHwnd(HWND hWnd)
|
||||||
{
|
{
|
||||||
@ -985,12 +973,36 @@ wxWindow * CFrame::GetWxWindow(wxString Name)
|
|||||||
else
|
else
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
wxWindow * CFrame::GetNootebookPage(wxString Name)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < m_NB.size(); i++)
|
||||||
|
{
|
||||||
|
if (!m_NB[i]) continue;
|
||||||
|
for(u32 j = 0; j < m_NB[j]->GetPageCount(); j++)
|
||||||
|
{
|
||||||
|
if (m_NB[i]->GetPageText(j).IsSameAs(Name)) return m_NB[i]->GetPage(j);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
void CFrame::AddRemoveBlankPage()
|
||||||
|
{
|
||||||
|
for (int i = 0; i < m_NB.size(); i++)
|
||||||
|
{
|
||||||
|
if (!m_NB[i]) continue;
|
||||||
|
for(u32 j = 0; j < m_NB[i]->GetPageCount(); j++)
|
||||||
|
{
|
||||||
|
if (m_NB[i]->GetPageText(j).IsSameAs(wxT("<>")) && m_NB[i]->GetPageCount() > 1) m_NB[i]->DeletePage(j);
|
||||||
|
}
|
||||||
|
if (m_NB[i]->GetPageCount() == 0) m_NB[i]->AddPage(CreateEmptyPanel(), wxT("<>"), true);
|
||||||
|
}
|
||||||
|
}
|
||||||
int CFrame::GetNootebookAffiliation(wxString Name)
|
int CFrame::GetNootebookAffiliation(wxString Name)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < m_NB.size(); i++)
|
for (int i = 0; i < m_NB.size(); i++)
|
||||||
{
|
{
|
||||||
if (!m_NB[i]) continue;
|
if (!m_NB[i]) continue;
|
||||||
for(u32 j = 0; j <= m_NB[i]->GetPageCount(); j++)
|
for(u32 j = 0; j < m_NB[i]->GetPageCount(); j++)
|
||||||
{
|
{
|
||||||
if (m_NB[i]->GetPageText(j).IsSameAs(Name)) return i;
|
if (m_NB[i]->GetPageText(j).IsSameAs(Name)) return i;
|
||||||
}
|
}
|
||||||
@ -999,6 +1011,7 @@ int CFrame::GetNootebookAffiliation(wxString Name)
|
|||||||
}
|
}
|
||||||
void CFrame::DoToggleWindow(int Id, bool Show)
|
void CFrame::DoToggleWindow(int Id, bool Show)
|
||||||
{
|
{
|
||||||
|
|
||||||
switch (Id)
|
switch (Id)
|
||||||
{
|
{
|
||||||
case IDM_LOGWINDOW: ToggleLogWindow(Show, UseDebugger ? g_pCodeWindow->iLogWindow : 0); break;
|
case IDM_LOGWINDOW: ToggleLogWindow(Show, UseDebugger ? g_pCodeWindow->iLogWindow : 0); break;
|
||||||
@ -1016,9 +1029,12 @@ void CFrame::OnNotebookPageChanged(wxAuiNotebookEvent& event)
|
|||||||
event.Skip();
|
event.Skip();
|
||||||
if (!UseDebugger) return;
|
if (!UseDebugger) return;
|
||||||
|
|
||||||
|
// Remove the blank page if any
|
||||||
|
AddRemoveBlankPage();
|
||||||
|
|
||||||
// Update the notebook affiliation
|
// Update the notebook affiliation
|
||||||
if(GetNootebookAffiliation(wxT("Log")) >= 0) g_pCodeWindow->iLogWindow = GetNootebookAffiliation(wxT("Log"));
|
if(GetNootebookAffiliation(wxT("Log")) >= 0) g_pCodeWindow->iLogWindow = GetNootebookAffiliation(wxT("Log"));
|
||||||
if(GetNootebookAffiliation(wxT("Console")) >= 0) g_pCodeWindow->iLogWindow = GetNootebookAffiliation(wxT("Console"));
|
if(GetNootebookAffiliation(wxT("Console")) >= 0) g_pCodeWindow->iConsoleWindow = GetNootebookAffiliation(wxT("Console"));
|
||||||
if(GetNootebookAffiliation(wxT("Code")) >= 0) g_pCodeWindow->iCodeWindow = GetNootebookAffiliation(wxT("Code"));
|
if(GetNootebookAffiliation(wxT("Code")) >= 0) g_pCodeWindow->iCodeWindow = GetNootebookAffiliation(wxT("Code"));
|
||||||
if(GetNootebookAffiliation(wxT("Registers")) >= 0) g_pCodeWindow->iRegisterWindow = GetNootebookAffiliation(wxT("Registers"));
|
if(GetNootebookAffiliation(wxT("Registers")) >= 0) g_pCodeWindow->iRegisterWindow = GetNootebookAffiliation(wxT("Registers"));
|
||||||
if(GetNootebookAffiliation(wxT("Breakpoints")) >= 0) g_pCodeWindow->iBreakpointWindow = GetNootebookAffiliation(wxT("Breakpoints"));
|
if(GetNootebookAffiliation(wxT("Breakpoints")) >= 0) g_pCodeWindow->iBreakpointWindow = GetNootebookAffiliation(wxT("Breakpoints"));
|
||||||
@ -1046,9 +1062,10 @@ void CFrame::OnNotebookPageClose(wxAuiNotebookEvent& event)
|
|||||||
void CFrame::OnAllowNotebookDnD(wxAuiNotebookEvent& event)
|
void CFrame::OnAllowNotebookDnD(wxAuiNotebookEvent& event)
|
||||||
{
|
{
|
||||||
event.Skip();
|
event.Skip();
|
||||||
wxAuiNotebook* Ctrl = (wxAuiNotebook*)event.GetEventObject();
|
event.Allow();
|
||||||
|
wxAuiNotebook* Ctrl = (wxAuiNotebook*)event.GetEventObject();
|
||||||
// If we drag away the last one the tab bar goes away and we can't add any panes to it
|
// If we drag away the last one the tab bar goes away and we can't add any panes to it
|
||||||
if (Ctrl->GetPageCount() > 1) event.Allow();
|
//if (Ctrl->GetPageCount() == 1) Ctrl->AddPage(CreateEmptyPanel(), wxT("<>"), true);
|
||||||
}
|
}
|
||||||
void CFrame::HidePane()
|
void CFrame::HidePane()
|
||||||
{
|
{
|
||||||
@ -1161,7 +1178,6 @@ void CFrame::ToggleLogWindow(bool Show, int i)
|
|||||||
void CFrame::OnToggleConsole(wxCommandEvent& event)
|
void CFrame::OnToggleConsole(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
DoToggleWindow(event.GetId(), event.IsChecked());
|
DoToggleWindow(event.GetId(), event.IsChecked());
|
||||||
//ToggleConsole(event.IsChecked());
|
|
||||||
}
|
}
|
||||||
void CFrame::ToggleConsole(bool Show, int i)
|
void CFrame::ToggleConsole(bool Show, int i)
|
||||||
{
|
{
|
||||||
@ -1175,20 +1191,19 @@ void CFrame::ToggleConsole(bool Show, int i)
|
|||||||
wxWindow *Win = GetWxWindowHwnd(GetConsoleWindow());
|
wxWindow *Win = GetWxWindowHwnd(GetConsoleWindow());
|
||||||
if (Win && m_NB[i]->GetPageIndex(Win) != wxNOT_FOUND) return;
|
if (Win && m_NB[i]->GetPageIndex(Win) != wxNOT_FOUND) return;
|
||||||
{
|
{
|
||||||
#else
|
#else
|
||||||
Console->Open();
|
Console->Open();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(!GetConsoleWindow()) Console->Open();
|
#ifdef _WIN32
|
||||||
|
if(!GetConsoleWindow()) Console->Open(); else ShowWindow(GetConsoleWindow(),SW_SHOW);
|
||||||
#ifdef _WIN32
|
|
||||||
}
|
}
|
||||||
Win = GetWxWindowHwnd(GetConsoleWindow());
|
Win = GetWxWindowHwnd(GetConsoleWindow());
|
||||||
// Can we remove the border?
|
// Can we remove the border?
|
||||||
//Win->SetWindowStyleFlag(wxNO_BORDER);
|
//Win->SetWindowStyleFlag(wxNO_BORDER);
|
||||||
//SetWindowLong(GetConsoleWindow(), GWL_STYLE, WS_VISIBLE);
|
//SetWindowLong(GetConsoleWindow(), GWL_STYLE, WS_VISIBLE);
|
||||||
// Create parent window
|
// Create parent window
|
||||||
CEmptyPanel * ConsoleParent = new CEmptyPanel(this);
|
wxPanel * ConsoleParent = CreateEmptyPanel();
|
||||||
::SetParent(GetConsoleWindow(), (HWND)ConsoleParent->GetHWND());
|
::SetParent(GetConsoleWindow(), (HWND)ConsoleParent->GetHWND());
|
||||||
//Win->SetParent(ConsoleParent);
|
//Win->SetParent(ConsoleParent);
|
||||||
//if (Win) m_NB[i]->AddPage(Win, wxT("Console"), true, aNormalFile );
|
//if (Win) m_NB[i]->AddPage(Win, wxT("Console"), true, aNormalFile );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user