mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-26 12:35:27 +00:00
Changed toolbar to be static, increasing UI integration
This commit is contained in:
parent
b38022df43
commit
019d5aee49
@ -128,7 +128,7 @@ wxMenuBar *CCodeWindow::GetMenuBar()
|
||||
return Parent->GetMenuBar();
|
||||
}
|
||||
|
||||
wxAuiToolBar *CCodeWindow::GetToolBar()
|
||||
wxToolBar *CCodeWindow::GetToolBar()
|
||||
{
|
||||
return Parent->m_ToolBarDebug;
|
||||
}
|
||||
@ -588,7 +588,7 @@ void CCodeWindow::InitBitmaps()
|
||||
bitmap = wxBitmap(bitmap.ConvertToImage().Scale(24, 24));
|
||||
}
|
||||
|
||||
void CCodeWindow::PopulateToolbar(wxAuiToolBar* toolBar)
|
||||
void CCodeWindow::PopulateToolbar(wxToolBar* toolBar)
|
||||
{
|
||||
int w = m_Bitmaps[0].GetWidth(),
|
||||
h = m_Bitmaps[0].GetHeight();
|
||||
@ -625,7 +625,7 @@ void CCodeWindow::UpdateButtonStates()
|
||||
bool Initialized = (Core::GetState() != Core::CORE_UNINITIALIZED);
|
||||
bool Pause = (Core::GetState() == Core::CORE_PAUSE);
|
||||
bool Stepping = CCPU::IsStepping();
|
||||
wxAuiToolBar* ToolBar = GetToolBar();
|
||||
wxToolBar* ToolBar = GetToolBar();
|
||||
|
||||
// Toolbar
|
||||
if (!ToolBar)
|
||||
|
@ -27,7 +27,7 @@ class DSPDebuggerLLE;
|
||||
class GFXDebuggerPanel;
|
||||
struct SCoreStartupParameter;
|
||||
|
||||
class wxAuiToolBar;
|
||||
class wxToolBar;
|
||||
class wxListBox;
|
||||
class wxMenu;
|
||||
class wxMenuBar;
|
||||
@ -52,7 +52,7 @@ class CCodeWindow
|
||||
// Parent interaction
|
||||
CFrame *Parent;
|
||||
wxMenuBar * GetMenuBar();
|
||||
wxAuiToolBar * GetToolBar();
|
||||
wxToolBar * GetToolBar();
|
||||
wxBitmap m_Bitmaps[ToolbarDebugBitmapMax];
|
||||
|
||||
bool UseInterpreter();
|
||||
@ -67,8 +67,8 @@ class CCodeWindow
|
||||
void CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParameter, wxMenuBar *pMenuBar);
|
||||
void CreateMenuOptions(wxMenu *pMenu);
|
||||
void CreateMenuSymbols(wxMenuBar *pMenuBar);
|
||||
void RecreateToolbar(wxAuiToolBar*);
|
||||
void PopulateToolbar(wxAuiToolBar* toolBar);
|
||||
void RecreateToolbar(wxToolBar*);
|
||||
void PopulateToolbar(wxToolBar* toolBar);
|
||||
void UpdateButtonStates();
|
||||
void OpenPages();
|
||||
void UpdateManager();
|
||||
|
@ -138,9 +138,10 @@ public:
|
||||
X11Utils::XRRConfiguration *m_XRRConfig;
|
||||
#endif
|
||||
|
||||
wxToolBar *m_ToolBar, *m_ToolBarDebug;
|
||||
// AUI
|
||||
wxAuiManager *m_Mgr;
|
||||
wxAuiToolBar *m_ToolBar, *m_ToolBarDebug, *m_ToolBarAui;
|
||||
wxAuiToolBar *m_ToolBarAui;
|
||||
bool bFloatWindow[IDM_CODEWINDOW - IDM_LOGWINDOW + 1];
|
||||
|
||||
// Perspectives (Should find a way to make all of this private)
|
||||
@ -195,7 +196,7 @@ private:
|
||||
wxBitmap m_Bitmaps[EToolbar_Max];
|
||||
wxBitmap m_BitmapsMenu[EToolbar_Max];
|
||||
|
||||
void PopulateToolbar(wxAuiToolBar* toolBar);
|
||||
void PopulateToolbar(wxToolBar* toolBar);
|
||||
void PopulateToolbarAui(wxAuiToolBar* toolBar);
|
||||
void RecreateToolbar();
|
||||
void CreateMenu();
|
||||
|
@ -584,7 +584,7 @@ void CFrame::OnToolBar(wxCommandEvent& event)
|
||||
break;
|
||||
case IDM_EDIT_PERSPECTIVES:
|
||||
m_bEdit = !m_bEdit;
|
||||
m_ToolBarAui->SetToolSticky(IDM_EDIT_PERSPECTIVES, m_bEdit);
|
||||
//m_ToolBarAui->SetToolSticky(IDM_EDIT_PERSPECTIVES, m_bEdit);
|
||||
TogglePaneStyle(m_bEdit, IDM_EDIT_PERSPECTIVES);
|
||||
break;
|
||||
}
|
||||
|
@ -501,7 +501,7 @@ wxString CFrame::GetMenuLabel(int Id)
|
||||
|
||||
// Create toolbar items
|
||||
// ---------------------
|
||||
void CFrame::PopulateToolbar(wxAuiToolBar* ToolBar)
|
||||
void CFrame::PopulateToolbar(wxToolBar* ToolBar)
|
||||
{
|
||||
int w = m_Bitmaps[Toolbar_FileOpen].GetWidth(),
|
||||
h = m_Bitmaps[Toolbar_FileOpen].GetHeight();
|
||||
@ -553,26 +553,16 @@ void CFrame::RecreateToolbar()
|
||||
m_ToolBar->Destroy();
|
||||
}
|
||||
|
||||
long TOOLBAR_STYLE = wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_TEXT /*wxAUI_TB_OVERFLOW overflow visible*/;
|
||||
m_ToolBar = new wxAuiToolBar(this, ID_TOOLBAR, wxDefaultPosition, wxDefaultSize, TOOLBAR_STYLE);
|
||||
long TOOLBAR_STYLE = wxAUI_TB_PLAIN_BACKGROUND | wxAUI_TB_TEXT /*wxAUI_TB_OVERFLOW overflow visible*/;
|
||||
|
||||
m_ToolBar = CreateToolBar(TOOLBAR_STYLE, wxID_ANY, "TBMain");
|
||||
PopulateToolbar(m_ToolBar);
|
||||
|
||||
m_Mgr->AddPane(m_ToolBar, wxAuiPaneInfo().
|
||||
Name("TBMain").Caption("TBMain").
|
||||
ToolbarPane().Top().
|
||||
LeftDockable(false).RightDockable(false).Floatable(false));
|
||||
|
||||
if (g_pCodeWindow && !m_ToolBarDebug)
|
||||
{
|
||||
m_ToolBarDebug = new wxAuiToolBar(this, ID_TOOLBAR_DEBUG, wxDefaultPosition, wxDefaultSize, TOOLBAR_STYLE);
|
||||
m_ToolBarDebug = CreateToolBar(TOOLBAR_STYLE, wxID_ANY, "TBDebug");
|
||||
g_pCodeWindow->PopulateToolbar(m_ToolBarDebug);
|
||||
|
||||
m_Mgr->AddPane(m_ToolBarDebug, wxAuiPaneInfo().
|
||||
Name("TBDebug").Caption("TBDebug").
|
||||
ToolbarPane().Top().
|
||||
LeftDockable(false).RightDockable(false).Floatable(false));
|
||||
|
||||
m_ToolBarAui = new wxAuiToolBar(this, ID_TOOLBAR_AUI, wxDefaultPosition, wxDefaultSize, TOOLBAR_STYLE);
|
||||
PopulateToolbarAui(m_ToolBarAui);
|
||||
m_Mgr->AddPane(m_ToolBarAui, wxAuiPaneInfo().
|
||||
@ -1721,22 +1711,27 @@ void CFrame::UpdateGUI()
|
||||
AccessWiiMote(0x0104)->IsConnected());
|
||||
}
|
||||
|
||||
if (Running)
|
||||
if (m_ToolBar)
|
||||
{
|
||||
if (m_ToolBar)
|
||||
// Get the tool that controls pausing/playing
|
||||
wxToolBarToolBase * PlayTool = m_ToolBar->FindById(IDM_PLAY);
|
||||
|
||||
if (PlayTool)
|
||||
{
|
||||
m_ToolBar->SetToolBitmap(IDM_PLAY, m_Bitmaps[Toolbar_Pause]);
|
||||
m_ToolBar->SetToolShortHelp(IDM_PLAY, _("Pause"));
|
||||
m_ToolBar->SetToolLabel(IDM_PLAY, _("Pause"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_ToolBar)
|
||||
{
|
||||
m_ToolBar->SetToolBitmap(IDM_PLAY, m_Bitmaps[Toolbar_Play]);
|
||||
m_ToolBar->SetToolShortHelp(IDM_PLAY, _("Play"));
|
||||
m_ToolBar->SetToolLabel(IDM_PLAY, _("Play"));
|
||||
if (Running)
|
||||
{
|
||||
PlayTool->SetLabel(_("Pause"));
|
||||
PlayTool->SetShortHelp(_("Pause"));
|
||||
// TODO: Change icon
|
||||
// m_ToolBar->SetToolBitmap(IDM_PLAY, m_Bitmaps[Toolbar_Pause]);
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayTool->SetLabel(_("Play"));
|
||||
PlayTool->SetShortHelp(_("Play"));
|
||||
// TODO: Change icon
|
||||
// m_ToolBar->SetToolBitmap(IDM_PLAY, m_Bitmaps[Toolbar_Play]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user