Merge pull request #761 from archshift/better-toolbar
Changed main toolbar to be flush with the rest of the window.
This commit is contained in:
commit
0b27e0f3f0
|
@ -20,6 +20,7 @@
|
||||||
#include <wx/textctrl.h>
|
#include <wx/textctrl.h>
|
||||||
#include <wx/textdlg.h>
|
#include <wx/textdlg.h>
|
||||||
#include <wx/thread.h>
|
#include <wx/thread.h>
|
||||||
|
#include <wx/toolbar.h>
|
||||||
#include <wx/translation.h>
|
#include <wx/translation.h>
|
||||||
#include <wx/window.h>
|
#include <wx/window.h>
|
||||||
#include <wx/windowid.h>
|
#include <wx/windowid.h>
|
||||||
|
@ -128,9 +129,9 @@ wxMenuBar *CCodeWindow::GetMenuBar()
|
||||||
return Parent->GetMenuBar();
|
return Parent->GetMenuBar();
|
||||||
}
|
}
|
||||||
|
|
||||||
wxAuiToolBar *CCodeWindow::GetToolBar()
|
wxToolBar *CCodeWindow::GetToolBar()
|
||||||
{
|
{
|
||||||
return Parent->m_ToolBarDebug;
|
return Parent->m_ToolBar;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------
|
// ----------
|
||||||
|
@ -435,6 +436,22 @@ void CCodeWindow::CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParam
|
||||||
pDebugMenu->Append(IDM_STEP, _("Step &Into\tF11"));
|
pDebugMenu->Append(IDM_STEP, _("Step &Into\tF11"));
|
||||||
pDebugMenu->Append(IDM_STEPOVER, _("Step &Over\tF10"));
|
pDebugMenu->Append(IDM_STEPOVER, _("Step &Over\tF10"));
|
||||||
pDebugMenu->Append(IDM_TOGGLE_BREAKPOINT, _("Toggle &Breakpoint\tF9"));
|
pDebugMenu->Append(IDM_TOGGLE_BREAKPOINT, _("Toggle &Breakpoint\tF9"));
|
||||||
|
pDebugMenu->AppendSeparator();
|
||||||
|
|
||||||
|
wxMenu* pPerspectives = new wxMenu;
|
||||||
|
Parent->m_SavedPerspectives = new wxMenu;
|
||||||
|
pDebugMenu->AppendSubMenu(pPerspectives, _("Perspectives"), _("Edit Perspectives"));
|
||||||
|
pPerspectives->Append(IDM_SAVE_PERSPECTIVE, _("Save perspectives"), _("Save currently-toggled perspectives"));
|
||||||
|
pPerspectives->Append(IDM_EDIT_PERSPECTIVES, _("Edit perspectives"), _("Toggle editing of perspectives"), wxITEM_CHECK);
|
||||||
|
pPerspectives->AppendSeparator();
|
||||||
|
pPerspectives->Append(IDM_ADD_PERSPECTIVE, _("Create new perspective"));
|
||||||
|
pPerspectives->AppendSubMenu(Parent->m_SavedPerspectives, _("Saved perspectives"));
|
||||||
|
Parent->PopulateSavedPerspectives();
|
||||||
|
pPerspectives->AppendSeparator();
|
||||||
|
pPerspectives->Append(IDM_PERSPECTIVES_ADD_PANE, _("Add new pane"));
|
||||||
|
pPerspectives->Append(IDM_TAB_SPLIT, _("Tab split"), "", wxITEM_CHECK);
|
||||||
|
pPerspectives->Append(IDM_NO_DOCKING, _("Disable docking"), "Disable docking of perspective panes to main window", wxITEM_CHECK);
|
||||||
|
|
||||||
|
|
||||||
pMenuBar->Append(pDebugMenu, _("&Debug"));
|
pMenuBar->Append(pDebugMenu, _("&Debug"));
|
||||||
|
|
||||||
|
@ -587,7 +604,7 @@ void CCodeWindow::InitBitmaps()
|
||||||
bitmap = wxBitmap(bitmap.ConvertToImage().Scale(24, 24));
|
bitmap = wxBitmap(bitmap.ConvertToImage().Scale(24, 24));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCodeWindow::PopulateToolbar(wxAuiToolBar* toolBar)
|
void CCodeWindow::PopulateToolbar(wxToolBar* toolBar)
|
||||||
{
|
{
|
||||||
int w = m_Bitmaps[0].GetWidth(),
|
int w = m_Bitmaps[0].GetWidth(),
|
||||||
h = m_Bitmaps[0].GetHeight();
|
h = m_Bitmaps[0].GetHeight();
|
||||||
|
@ -624,7 +641,7 @@ void CCodeWindow::UpdateButtonStates()
|
||||||
bool Initialized = (Core::GetState() != Core::CORE_UNINITIALIZED);
|
bool Initialized = (Core::GetState() != Core::CORE_UNINITIALIZED);
|
||||||
bool Pause = (Core::GetState() == Core::CORE_PAUSE);
|
bool Pause = (Core::GetState() == Core::CORE_PAUSE);
|
||||||
bool Stepping = CCPU::IsStepping();
|
bool Stepping = CCPU::IsStepping();
|
||||||
wxAuiToolBar* ToolBar = GetToolBar();
|
wxToolBar* ToolBar = GetToolBar();
|
||||||
|
|
||||||
// Toolbar
|
// Toolbar
|
||||||
if (!ToolBar)
|
if (!ToolBar)
|
||||||
|
|
|
@ -27,7 +27,7 @@ class DSPDebuggerLLE;
|
||||||
class GFXDebuggerPanel;
|
class GFXDebuggerPanel;
|
||||||
struct SCoreStartupParameter;
|
struct SCoreStartupParameter;
|
||||||
|
|
||||||
class wxAuiToolBar;
|
class wxToolBar;
|
||||||
class wxListBox;
|
class wxListBox;
|
||||||
class wxMenu;
|
class wxMenu;
|
||||||
class wxMenuBar;
|
class wxMenuBar;
|
||||||
|
@ -52,7 +52,7 @@ class CCodeWindow
|
||||||
// Parent interaction
|
// Parent interaction
|
||||||
CFrame *Parent;
|
CFrame *Parent;
|
||||||
wxMenuBar * GetMenuBar();
|
wxMenuBar * GetMenuBar();
|
||||||
wxAuiToolBar * GetToolBar();
|
wxToolBar * GetToolBar();
|
||||||
wxBitmap m_Bitmaps[ToolbarDebugBitmapMax];
|
wxBitmap m_Bitmaps[ToolbarDebugBitmapMax];
|
||||||
|
|
||||||
bool UseInterpreter();
|
bool UseInterpreter();
|
||||||
|
@ -67,8 +67,8 @@ class CCodeWindow
|
||||||
void CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParameter, wxMenuBar *pMenuBar);
|
void CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParameter, wxMenuBar *pMenuBar);
|
||||||
void CreateMenuOptions(wxMenu *pMenu);
|
void CreateMenuOptions(wxMenu *pMenu);
|
||||||
void CreateMenuSymbols(wxMenuBar *pMenuBar);
|
void CreateMenuSymbols(wxMenuBar *pMenuBar);
|
||||||
void RecreateToolbar(wxAuiToolBar*);
|
void RecreateToolbar(wxToolBar*);
|
||||||
void PopulateToolbar(wxAuiToolBar* toolBar);
|
void PopulateToolbar(wxToolBar* toolBar);
|
||||||
void UpdateButtonStates();
|
void UpdateButtonStates();
|
||||||
void OpenPages();
|
void OpenPages();
|
||||||
void UpdateManager();
|
void UpdateManager();
|
||||||
|
|
|
@ -41,7 +41,6 @@
|
||||||
#include <wx/translation.h>
|
#include <wx/translation.h>
|
||||||
#include <wx/window.h>
|
#include <wx/window.h>
|
||||||
#include <wx/windowid.h>
|
#include <wx/windowid.h>
|
||||||
#include <wx/aui/auibar.h>
|
|
||||||
#include <wx/aui/auibook.h>
|
#include <wx/aui/auibook.h>
|
||||||
#include <wx/aui/framemanager.h>
|
#include <wx/aui/framemanager.h>
|
||||||
|
|
||||||
|
@ -227,16 +226,14 @@ EVT_MENU(IDM_CONFIG_PAD_PLUGIN, CFrame::OnConfigPAD)
|
||||||
EVT_MENU(IDM_CONFIG_WIIMOTE_PLUGIN, CFrame::OnConfigWiimote)
|
EVT_MENU(IDM_CONFIG_WIIMOTE_PLUGIN, CFrame::OnConfigWiimote)
|
||||||
EVT_MENU(IDM_CONFIG_HOTKEYS, CFrame::OnConfigHotkey)
|
EVT_MENU(IDM_CONFIG_HOTKEYS, CFrame::OnConfigHotkey)
|
||||||
|
|
||||||
EVT_MENU(IDM_SAVE_PERSPECTIVE, CFrame::OnToolBar)
|
EVT_MENU(IDM_SAVE_PERSPECTIVE, CFrame::OnPerspectiveMenu)
|
||||||
EVT_AUITOOLBAR_TOOL_DROPDOWN(IDM_SAVE_PERSPECTIVE, CFrame::OnDropDownToolbarItem)
|
EVT_MENU(IDM_EDIT_PERSPECTIVES, CFrame::OnPerspectiveMenu)
|
||||||
EVT_MENU(IDM_EDIT_PERSPECTIVES, CFrame::OnToolBar)
|
|
||||||
EVT_AUITOOLBAR_TOOL_DROPDOWN(IDM_EDIT_PERSPECTIVES, CFrame::OnDropDownSettingsToolbar)
|
|
||||||
// Drop down
|
// Drop down
|
||||||
EVT_MENU(IDM_PERSPECTIVES_ADD_PANE, CFrame::OnToolBar)
|
EVT_MENU(IDM_PERSPECTIVES_ADD_PANE, CFrame::OnPerspectiveMenu)
|
||||||
EVT_MENU_RANGE(IDM_PERSPECTIVES_0, IDM_PERSPECTIVES_100, CFrame::OnSelectPerspective)
|
EVT_MENU_RANGE(IDM_PERSPECTIVES_0, IDM_PERSPECTIVES_100, CFrame::OnSelectPerspective)
|
||||||
EVT_MENU(IDM_ADD_PERSPECTIVE, CFrame::OnDropDownToolbarSelect)
|
EVT_MENU(IDM_ADD_PERSPECTIVE, CFrame::OnPerspectiveMenu)
|
||||||
EVT_MENU(IDM_TAB_SPLIT, CFrame::OnDropDownToolbarSelect)
|
EVT_MENU(IDM_TAB_SPLIT, CFrame::OnPerspectiveMenu)
|
||||||
EVT_MENU(IDM_NO_DOCKING, CFrame::OnDropDownToolbarSelect)
|
EVT_MENU(IDM_NO_DOCKING, CFrame::OnPerspectiveMenu)
|
||||||
// Drop down float
|
// Drop down float
|
||||||
EVT_MENU_RANGE(IDM_FLOAT_LOGWINDOW, IDM_FLOAT_CODEWINDOW, CFrame::OnFloatWindow)
|
EVT_MENU_RANGE(IDM_FLOAT_LOGWINDOW, IDM_FLOAT_CODEWINDOW, CFrame::OnFloatWindow)
|
||||||
|
|
||||||
|
@ -310,7 +307,7 @@ CFrame::CFrame(wxFrame* parent,
|
||||||
long style)
|
long style)
|
||||||
: CRenderFrame(parent, id, title, pos, size, style)
|
: CRenderFrame(parent, id, title, pos, size, style)
|
||||||
, g_pCodeWindow(nullptr), g_NetPlaySetupDiag(nullptr), g_CheatsWindow(nullptr)
|
, g_pCodeWindow(nullptr), g_NetPlaySetupDiag(nullptr), g_CheatsWindow(nullptr)
|
||||||
, m_ToolBar(nullptr), m_ToolBarDebug(nullptr), m_ToolBarAui(nullptr)
|
, m_SavedPerspectives(nullptr), m_ToolBar(nullptr)
|
||||||
, m_GameListCtrl(nullptr), m_Panel(nullptr)
|
, m_GameListCtrl(nullptr), m_Panel(nullptr)
|
||||||
, m_RenderFrame(nullptr), m_RenderParent(nullptr)
|
, m_RenderFrame(nullptr), m_RenderParent(nullptr)
|
||||||
, m_LogWindow(nullptr), m_LogConfigWindow(nullptr)
|
, m_LogWindow(nullptr), m_LogConfigWindow(nullptr)
|
||||||
|
|
|
@ -44,8 +44,6 @@ class wxAuiManager;
|
||||||
class wxAuiManagerEvent;
|
class wxAuiManagerEvent;
|
||||||
class wxAuiNotebook;
|
class wxAuiNotebook;
|
||||||
class wxAuiNotebookEvent;
|
class wxAuiNotebookEvent;
|
||||||
class wxAuiToolBar;
|
|
||||||
class wxAuiToolBarEvent;
|
|
||||||
class wxListEvent;
|
class wxListEvent;
|
||||||
class wxMenuItem;
|
class wxMenuItem;
|
||||||
class wxWindow;
|
class wxWindow;
|
||||||
|
@ -124,6 +122,7 @@ public:
|
||||||
void DoFullscreen(bool bF);
|
void DoFullscreen(bool bF);
|
||||||
void ToggleDisplayMode (bool bFullscreen);
|
void ToggleDisplayMode (bool bFullscreen);
|
||||||
void UpdateWiiMenuChoice(wxMenuItem *WiiMenuItem=nullptr);
|
void UpdateWiiMenuChoice(wxMenuItem *WiiMenuItem=nullptr);
|
||||||
|
void PopulateSavedPerspectives();
|
||||||
static void ConnectWiimote(int wm_idx, bool connect);
|
static void ConnectWiimote(int wm_idx, bool connect);
|
||||||
|
|
||||||
const CGameListCtrl *GetGameListCtrl() const;
|
const CGameListCtrl *GetGameListCtrl() const;
|
||||||
|
@ -138,9 +137,11 @@ public:
|
||||||
X11Utils::XRRConfiguration *m_XRRConfig;
|
X11Utils::XRRConfiguration *m_XRRConfig;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
wxMenu* m_SavedPerspectives;
|
||||||
|
|
||||||
|
wxToolBar *m_ToolBar;
|
||||||
// AUI
|
// AUI
|
||||||
wxAuiManager *m_Mgr;
|
wxAuiManager *m_Mgr;
|
||||||
wxAuiToolBar *m_ToolBar, *m_ToolBarDebug, *m_ToolBarAui;
|
|
||||||
bool bFloatWindow[IDM_CODEWINDOW - IDM_LOGWINDOW + 1];
|
bool bFloatWindow[IDM_CODEWINDOW - IDM_LOGWINDOW + 1];
|
||||||
|
|
||||||
// Perspectives (Should find a way to make all of this private)
|
// Perspectives (Should find a way to make all of this private)
|
||||||
|
@ -195,8 +196,7 @@ private:
|
||||||
wxBitmap m_Bitmaps[EToolbar_Max];
|
wxBitmap m_Bitmaps[EToolbar_Max];
|
||||||
wxBitmap m_BitmapsMenu[EToolbar_Max];
|
wxBitmap m_BitmapsMenu[EToolbar_Max];
|
||||||
|
|
||||||
void PopulateToolbar(wxAuiToolBar* toolBar);
|
void PopulateToolbar(wxToolBar* toolBar);
|
||||||
void PopulateToolbarAui(wxAuiToolBar* toolBar);
|
|
||||||
void RecreateToolbar();
|
void RecreateToolbar();
|
||||||
void CreateMenu();
|
void CreateMenu();
|
||||||
|
|
||||||
|
@ -221,7 +221,6 @@ private:
|
||||||
void ShowResizePane();
|
void ShowResizePane();
|
||||||
void TogglePane();
|
void TogglePane();
|
||||||
void SetPaneSize();
|
void SetPaneSize();
|
||||||
void ResetToolbarStyle();
|
|
||||||
void TogglePaneStyle(bool On, int EventId);
|
void TogglePaneStyle(bool On, int EventId);
|
||||||
void ToggleNotebookStyle(bool On, long Style);
|
void ToggleNotebookStyle(bool On, long Style);
|
||||||
// Float window
|
// Float window
|
||||||
|
@ -240,9 +239,7 @@ private:
|
||||||
void OnPaneClose(wxAuiManagerEvent& evt);
|
void OnPaneClose(wxAuiManagerEvent& evt);
|
||||||
void ReloadPanes();
|
void ReloadPanes();
|
||||||
void DoLoadPerspective();
|
void DoLoadPerspective();
|
||||||
void OnDropDownToolbarSelect(wxCommandEvent& event);
|
void OnPerspectiveMenu(wxCommandEvent& event);
|
||||||
void OnDropDownSettingsToolbar(wxAuiToolBarEvent& event);
|
|
||||||
void OnDropDownToolbarItem(wxAuiToolBarEvent& event);
|
|
||||||
void OnSelectPerspective(wxCommandEvent& event);
|
void OnSelectPerspective(wxCommandEvent& event);
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
@ -252,8 +249,6 @@ private:
|
||||||
// Event functions
|
// Event functions
|
||||||
void OnQuit(wxCommandEvent& event);
|
void OnQuit(wxCommandEvent& event);
|
||||||
void OnHelp(wxCommandEvent& event);
|
void OnHelp(wxCommandEvent& event);
|
||||||
void OnToolBar(wxCommandEvent& event);
|
|
||||||
void OnAuiToolBar(wxAuiToolBarEvent& event);
|
|
||||||
|
|
||||||
void OnOpen(wxCommandEvent& event); // File menu
|
void OnOpen(wxCommandEvent& event); // File menu
|
||||||
void DoOpen(bool Boot);
|
void DoOpen(bool Boot);
|
||||||
|
|
|
@ -475,72 +475,26 @@ void CFrame::DoAddPage(wxWindow *Win, int i, bool Float)
|
||||||
Win->GetName(), Win);
|
Win->GetName(), Win);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Toolbar
|
void CFrame::PopulateSavedPerspectives()
|
||||||
void CFrame::OnDropDownSettingsToolbar(wxAuiToolBarEvent& event)
|
|
||||||
{
|
{
|
||||||
event.Skip();
|
// If the perspective submenu hasn't been created yet, return
|
||||||
ClearStatusBar();
|
if (!m_SavedPerspectives) return;
|
||||||
|
|
||||||
if (event.IsDropDownClicked())
|
// Delete all saved perspective menu items
|
||||||
|
while (m_SavedPerspectives->GetMenuItemCount() != 0)
|
||||||
{
|
{
|
||||||
wxAuiToolBar* Tb = static_cast<wxAuiToolBar*>(event.GetEventObject());
|
// Delete the first menu item in the list (while there are menu items)
|
||||||
Tb->SetToolSticky(event.GetId(), true);
|
m_SavedPerspectives->Delete(m_SavedPerspectives->FindItemByPosition(0));
|
||||||
|
|
||||||
// Create the popup menu
|
|
||||||
wxMenu* menuPopup = new wxMenu;
|
|
||||||
|
|
||||||
wxMenuItem* Item = new wxMenuItem(menuPopup, IDM_PERSPECTIVES_ADD_PANE,
|
|
||||||
_("Add new pane"));
|
|
||||||
menuPopup->Append(Item);
|
|
||||||
menuPopup->Append(new wxMenuItem(menuPopup));
|
|
||||||
Item = new wxMenuItem(menuPopup, IDM_TAB_SPLIT, _("Tab split"), "", wxITEM_CHECK);
|
|
||||||
menuPopup->Append(Item);
|
|
||||||
Item->Check(m_bTabSplit);
|
|
||||||
Item = new wxMenuItem(menuPopup, IDM_NO_DOCKING, _("No docking"), "", wxITEM_CHECK);
|
|
||||||
menuPopup->Append(Item);
|
|
||||||
Item->Check(m_bNoDocking);
|
|
||||||
|
|
||||||
// Line up our menu with the button
|
|
||||||
wxRect rect = Tb->GetToolRect(event.GetId());
|
|
||||||
wxPoint Pt = Tb->ClientToScreen(rect.GetBottomLeft());
|
|
||||||
Pt = ScreenToClient(Pt);
|
|
||||||
|
|
||||||
// Show
|
|
||||||
PopupMenu(menuPopup, Pt);
|
|
||||||
|
|
||||||
// Make the button un-stuck again
|
|
||||||
if (!m_bEdit)
|
|
||||||
{
|
|
||||||
Tb->SetToolSticky(event.GetId(), false);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void CFrame::OnDropDownToolbarItem(wxAuiToolBarEvent& event)
|
|
||||||
{
|
|
||||||
event.Skip();
|
|
||||||
ClearStatusBar();
|
|
||||||
|
|
||||||
if (event.IsDropDownClicked())
|
|
||||||
{
|
|
||||||
wxAuiToolBar* tb = static_cast<wxAuiToolBar*>(event.GetEventObject());
|
|
||||||
tb->SetToolSticky(event.GetId(), true);
|
|
||||||
|
|
||||||
// create the popup menu
|
|
||||||
wxMenu* menuPopup = new wxMenu;
|
|
||||||
wxMenuItem* Item = new wxMenuItem(menuPopup, IDM_ADD_PERSPECTIVE,
|
|
||||||
_("Create new perspective"));
|
|
||||||
menuPopup->Append(Item);
|
|
||||||
|
|
||||||
if (Perspectives.size() > 0)
|
if (Perspectives.size() > 0)
|
||||||
{
|
{
|
||||||
menuPopup->Append(new wxMenuItem(menuPopup));
|
|
||||||
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(m_SavedPerspectives, IDM_PERSPECTIVES_0 + i,
|
||||||
StrToWxStr(Perspectives[i].Name), "", wxITEM_CHECK);
|
StrToWxStr(Perspectives[i].Name), "", wxITEM_CHECK);
|
||||||
|
|
||||||
menuPopup->Append(mItem);
|
m_SavedPerspectives->Append(mItem);
|
||||||
|
|
||||||
if (i == ActivePerspective)
|
if (i == ActivePerspective)
|
||||||
{
|
{
|
||||||
|
@ -548,21 +502,9 @@ void CFrame::OnDropDownToolbarItem(wxAuiToolBarEvent& event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// line up our menu with the button
|
|
||||||
wxRect rect = tb->GetToolRect(event.GetId());
|
|
||||||
wxPoint pt = tb->ClientToScreen(rect.GetBottomLeft());
|
|
||||||
pt = ScreenToClient(pt);
|
|
||||||
|
|
||||||
// show
|
|
||||||
PopupMenu(menuPopup, pt);
|
|
||||||
|
|
||||||
// make sure the button is "un-stuck"
|
|
||||||
tb->SetToolSticky(event.GetId(), false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CFrame::OnToolBar(wxCommandEvent& event)
|
void CFrame::OnPerspectiveMenu(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
ClearStatusBar();
|
ClearStatusBar();
|
||||||
|
|
||||||
|
@ -583,26 +525,15 @@ void CFrame::OnToolBar(wxCommandEvent& event)
|
||||||
AddPane();
|
AddPane();
|
||||||
break;
|
break;
|
||||||
case IDM_EDIT_PERSPECTIVES:
|
case IDM_EDIT_PERSPECTIVES:
|
||||||
m_bEdit = !m_bEdit;
|
m_bEdit = event.IsChecked();
|
||||||
m_ToolBarAui->SetToolSticky(IDM_EDIT_PERSPECTIVES, m_bEdit);
|
|
||||||
TogglePaneStyle(m_bEdit, IDM_EDIT_PERSPECTIVES);
|
TogglePaneStyle(m_bEdit, IDM_EDIT_PERSPECTIVES);
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void CFrame::OnDropDownToolbarSelect(wxCommandEvent& event)
|
|
||||||
{
|
|
||||||
ClearStatusBar();
|
|
||||||
|
|
||||||
switch (event.GetId())
|
|
||||||
{
|
|
||||||
case IDM_ADD_PERSPECTIVE:
|
case IDM_ADD_PERSPECTIVE:
|
||||||
{
|
{
|
||||||
wxTextEntryDialog dlg(this,
|
wxTextEntryDialog dlg(this,
|
||||||
_("Enter a name for the new perspective:"),
|
_("Enter a name for the new perspective:"),
|
||||||
_("Create new perspective"));
|
_("Create new perspective"));
|
||||||
wxString DefaultValue = wxString::Format(_("Perspective %d"),
|
wxString DefaultValue = wxString::Format(_("Perspective %d"), (int)(Perspectives.size() + 1));
|
||||||
Perspectives.size() + 1);
|
|
||||||
dlg.SetValue(DefaultValue);
|
dlg.SetValue(DefaultValue);
|
||||||
|
|
||||||
int Return = 0;
|
int Return = 0;
|
||||||
|
@ -643,6 +574,7 @@ void CFrame::OnDropDownToolbarSelect(wxCommandEvent& event)
|
||||||
Perspectives.push_back(Tmp);
|
Perspectives.push_back(Tmp);
|
||||||
|
|
||||||
UpdateCurrentPerspective();
|
UpdateCurrentPerspective();
|
||||||
|
PopulateSavedPerspectives();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case IDM_TAB_SPLIT:
|
case IDM_TAB_SPLIT:
|
||||||
|
@ -656,26 +588,6 @@ void CFrame::OnDropDownToolbarSelect(wxCommandEvent& event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CFrame::ResetToolbarStyle()
|
|
||||||
{
|
|
||||||
wxAuiPaneInfoArray& AllPanes = m_Mgr->GetAllPanes();
|
|
||||||
for (int i = 0, Count = (int)AllPanes.GetCount(); i < Count; ++i)
|
|
||||||
{
|
|
||||||
wxAuiPaneInfo& Pane = AllPanes[i];
|
|
||||||
if (Pane.window->IsKindOf(CLASSINFO(wxAuiToolBar)))
|
|
||||||
{
|
|
||||||
Pane.Show();
|
|
||||||
|
|
||||||
// Show all of it
|
|
||||||
if (Pane.rect.GetLeft() > GetClientSize().GetX() - 50)
|
|
||||||
{
|
|
||||||
Pane.Position(GetClientSize().GetX() - Pane.window->GetClientSize().GetX());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
m_Mgr->Update();
|
|
||||||
}
|
|
||||||
|
|
||||||
void CFrame::TogglePaneStyle(bool On, int EventId)
|
void CFrame::TogglePaneStyle(bool On, int EventId)
|
||||||
{
|
{
|
||||||
wxAuiPaneInfoArray& AllPanes = m_Mgr->GetAllPanes();
|
wxAuiPaneInfoArray& AllPanes = m_Mgr->GetAllPanes();
|
||||||
|
@ -798,8 +710,6 @@ void CFrame::ReloadPanes()
|
||||||
|
|
||||||
// Perspectives
|
// Perspectives
|
||||||
m_Mgr->LoadPerspective(Perspectives[ActivePerspective].Perspective, false);
|
m_Mgr->LoadPerspective(Perspectives[ActivePerspective].Perspective, false);
|
||||||
// Reset toolbars
|
|
||||||
ResetToolbarStyle();
|
|
||||||
// Restore settings
|
// Restore settings
|
||||||
TogglePaneStyle(m_bNoDocking, IDM_NO_DOCKING);
|
TogglePaneStyle(m_bNoDocking, IDM_NO_DOCKING);
|
||||||
TogglePaneStyle(m_bEdit, IDM_EDIT_PERSPECTIVES);
|
TogglePaneStyle(m_bEdit, IDM_EDIT_PERSPECTIVES);
|
||||||
|
@ -809,6 +719,9 @@ void CFrame::ReloadPanes()
|
||||||
// Open notebook pages
|
// Open notebook pages
|
||||||
AddRemoveBlankPage();
|
AddRemoveBlankPage();
|
||||||
g_pCodeWindow->OpenPages();
|
g_pCodeWindow->OpenPages();
|
||||||
|
|
||||||
|
// Repopulate perspectives
|
||||||
|
PopulateSavedPerspectives();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CFrame::DoLoadPerspective()
|
void CFrame::DoLoadPerspective()
|
||||||
|
|
|
@ -36,11 +36,11 @@ Core::GetWindowHandle().
|
||||||
#include <wx/strconv.h>
|
#include <wx/strconv.h>
|
||||||
#include <wx/string.h>
|
#include <wx/string.h>
|
||||||
#include <wx/thread.h>
|
#include <wx/thread.h>
|
||||||
|
#include <wx/toolbar.h>
|
||||||
#include <wx/toplevel.h>
|
#include <wx/toplevel.h>
|
||||||
#include <wx/translation.h>
|
#include <wx/translation.h>
|
||||||
#include <wx/utils.h>
|
#include <wx/utils.h>
|
||||||
#include <wx/window.h>
|
#include <wx/window.h>
|
||||||
#include <wx/aui/auibar.h>
|
|
||||||
#include <wx/aui/framemanager.h>
|
#include <wx/aui/framemanager.h>
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
|
@ -501,7 +501,7 @@ wxString CFrame::GetMenuLabel(int Id)
|
||||||
|
|
||||||
// Create toolbar items
|
// Create toolbar items
|
||||||
// ---------------------
|
// ---------------------
|
||||||
void CFrame::PopulateToolbar(wxAuiToolBar* ToolBar)
|
void CFrame::PopulateToolbar(wxToolBar* ToolBar)
|
||||||
{
|
{
|
||||||
int w = m_Bitmaps[Toolbar_FileOpen].GetWidth(),
|
int w = m_Bitmaps[Toolbar_FileOpen].GetWidth(),
|
||||||
h = m_Bitmaps[Toolbar_FileOpen].GetHeight();
|
h = m_Bitmaps[Toolbar_FileOpen].GetHeight();
|
||||||
|
@ -528,21 +528,6 @@ void CFrame::PopulateToolbar(wxAuiToolBar* ToolBar)
|
||||||
ToolBar->Realize();
|
ToolBar->Realize();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CFrame::PopulateToolbarAui(wxAuiToolBar* ToolBar)
|
|
||||||
{
|
|
||||||
int w = m_Bitmaps[Toolbar_FileOpen].GetWidth(),
|
|
||||||
h = m_Bitmaps[Toolbar_FileOpen].GetHeight();
|
|
||||||
ToolBar->SetToolBitmapSize(wxSize(w, h));
|
|
||||||
|
|
||||||
ToolBar->AddTool(IDM_SAVE_PERSPECTIVE, _("Save"), g_pCodeWindow->m_Bitmaps[Toolbar_GotoPC], _("Save current perspective"));
|
|
||||||
ToolBar->AddTool(IDM_EDIT_PERSPECTIVES, _("Edit"), g_pCodeWindow->m_Bitmaps[Toolbar_GotoPC], _("Edit current perspective"));
|
|
||||||
|
|
||||||
ToolBar->SetToolDropDown(IDM_SAVE_PERSPECTIVE, true);
|
|
||||||
ToolBar->SetToolDropDown(IDM_EDIT_PERSPECTIVES, true);
|
|
||||||
|
|
||||||
ToolBar->Realize();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Delete and recreate the toolbar
|
// Delete and recreate the toolbar
|
||||||
void CFrame::RecreateToolbar()
|
void CFrame::RecreateToolbar()
|
||||||
|
@ -553,32 +538,19 @@ void CFrame::RecreateToolbar()
|
||||||
m_ToolBar->Destroy();
|
m_ToolBar->Destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
long TOOLBAR_STYLE = wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_TEXT /*wxAUI_TB_OVERFLOW overflow visible*/;
|
long TOOLBAR_STYLE = wxTB_DEFAULT_STYLE | wxTB_TEXT;
|
||||||
m_ToolBar = new wxAuiToolBar(this, ID_TOOLBAR, wxDefaultPosition, wxDefaultSize, TOOLBAR_STYLE);
|
|
||||||
|
if (!m_ToolBar)
|
||||||
|
{
|
||||||
|
m_ToolBar = CreateToolBar(TOOLBAR_STYLE, wxID_ANY, "TBMain");
|
||||||
|
|
||||||
|
if (g_pCodeWindow)
|
||||||
|
{
|
||||||
|
g_pCodeWindow->PopulateToolbar(m_ToolBar);
|
||||||
|
m_ToolBar->AddSeparator();
|
||||||
|
}
|
||||||
|
|
||||||
PopulateToolbar(m_ToolBar);
|
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);
|
|
||||||
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().
|
|
||||||
Name("TBAui").Caption("TBAui").
|
|
||||||
ToolbarPane().Top().
|
|
||||||
LeftDockable(false).RightDockable(false).Floatable(false));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateGUI();
|
UpdateGUI();
|
||||||
|
@ -1721,22 +1693,25 @@ void CFrame::UpdateGUI()
|
||||||
AccessWiiMote(0x0104)->IsConnected());
|
AccessWiiMote(0x0104)->IsConnected());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Running)
|
|
||||||
{
|
|
||||||
if (m_ToolBar)
|
if (m_ToolBar)
|
||||||
{
|
{
|
||||||
m_ToolBar->SetToolBitmap(IDM_PLAY, m_Bitmaps[Toolbar_Pause]);
|
// Get the tool that controls pausing/playing
|
||||||
m_ToolBar->SetToolShortHelp(IDM_PLAY, _("Pause"));
|
wxToolBarToolBase * PlayTool = m_ToolBar->FindById(IDM_PLAY);
|
||||||
m_ToolBar->SetToolLabel(IDM_PLAY, _("Pause"));
|
|
||||||
}
|
if (PlayTool)
|
||||||
|
{
|
||||||
|
if (Running)
|
||||||
|
{
|
||||||
|
PlayTool->SetLabel(_("Pause"));
|
||||||
|
PlayTool->SetShortHelp(_("Pause"));
|
||||||
|
m_ToolBar->SetToolNormalBitmap(IDM_PLAY, m_Bitmaps[Toolbar_Pause]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (m_ToolBar)
|
PlayTool->SetLabel(_("Play"));
|
||||||
{
|
PlayTool->SetShortHelp(_("Play"));
|
||||||
m_ToolBar->SetToolBitmap(IDM_PLAY, m_Bitmaps[Toolbar_Play]);
|
m_ToolBar->SetToolNormalBitmap(IDM_PLAY, m_Bitmaps[Toolbar_Play]);
|
||||||
m_ToolBar->SetToolShortHelp(IDM_PLAY, _("Play"));
|
}
|
||||||
m_ToolBar->SetToolLabel(IDM_PLAY, _("Play"));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1898,26 +1873,7 @@ void CFrame::OnToggleToolbar(wxCommandEvent& event)
|
||||||
}
|
}
|
||||||
void CFrame::DoToggleToolbar(bool _show)
|
void CFrame::DoToggleToolbar(bool _show)
|
||||||
{
|
{
|
||||||
if (_show)
|
GetToolBar()->Show(_show);
|
||||||
{
|
|
||||||
m_Mgr->GetPane("TBMain").Show();
|
|
||||||
if (g_pCodeWindow)
|
|
||||||
{
|
|
||||||
m_Mgr->GetPane("TBDebug").Show();
|
|
||||||
m_Mgr->GetPane("TBAui").Show();
|
|
||||||
}
|
|
||||||
m_Mgr->Update();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_Mgr->GetPane("TBMain").Hide();
|
|
||||||
if (g_pCodeWindow)
|
|
||||||
{
|
|
||||||
m_Mgr->GetPane("TBDebug").Hide();
|
|
||||||
m_Mgr->GetPane("TBAui").Hide();
|
|
||||||
}
|
|
||||||
m_Mgr->Update();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enable and disable the status bar
|
// Enable and disable the status bar
|
||||||
|
|
Loading…
Reference in New Issue