GUI: make some elements such as memory jit and breakpoint windows into

wxpanels. It should now work in linux as well. I had to remove the bar 
off the breakpoint panel though, so we need to decide what to do with 
it.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4227 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
nakeee 2009-09-07 20:51:02 +00:00
parent 24d68da653
commit 5a99432f1b
8 changed files with 29 additions and 74 deletions

View File

@ -50,15 +50,12 @@ void BreakPointDlg::CreateGUIControls()
SetSize(8,8,279,121);
Center();
wxStaticText* WxStaticText1 = new wxStaticText(this, ID_WXSTATICTEXT1, wxT("Address"), wxPoint(8,24), wxDefaultSize, 0, wxT("WxStaticText1"));
m_pButtonOK = new wxButton(this, ID_OK, wxT("OK"), wxPoint(192,64), wxSize(73,25), 0, wxDefaultValidator, wxT("OK"));
m_pButtonCancel = new wxButton(this, ID_CANCEL, wxT("Cancel"), wxPoint(112,64), wxSize(73,25), 0, wxDefaultValidator, wxT("Cancel"));
m_pEditAddress = new wxTextCtrl(this, ID_ADDRESS, wxT("80000000"), wxPoint(56,24), wxSize(197,20), 0, wxDefaultValidator, wxT("WxEdit1"));
wxStaticBox* WxStaticBox1 = new wxStaticBox(this, ID_WXSTATICBOX1, wxT("Address"), wxPoint(0,0), wxSize(265,57));
}

View File

@ -33,7 +33,7 @@ extern "C" {
#include "../resources/toolbar_delete.c"
}
BEGIN_EVENT_TABLE(CBreakPointWindow, wxFrame)
BEGIN_EVENT_TABLE(CBreakPointWindow, wxPanel)
EVT_CLOSE(CBreakPointWindow::OnClose)
EVT_MENU(IDM_DELETE, CBreakPointWindow::OnDelete)
EVT_MENU(IDM_CLEAR, CBreakPointWindow::OnClear)
@ -45,7 +45,7 @@ BEGIN_EVENT_TABLE(CBreakPointWindow, wxFrame)
END_EVENT_TABLE()
CBreakPointWindow::CBreakPointWindow(CCodeWindow* _pCodeWindow, wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& position, const wxSize& size, long style)
: wxFrame(parent, id, title, position, size, style)
: wxPanel(parent, id, position, size, style, title)
, m_BreakPointListView(NULL)
, m_pCodeWindow(_pCodeWindow)
{
@ -78,8 +78,8 @@ void CBreakPointWindow::Load(IniFile& _IniFile)
void CBreakPointWindow::CreateGUIControls()
{
SetTitle(wxT("Breakpoints"));
SetIcon(wxNullIcon);
// SetTitle(wxT("Breakpoints"));
// SetIcon(wxNullIcon);
SetSize(8, 8, 400, 370);
Center();
@ -117,18 +117,19 @@ void CBreakPointWindow::PopulateToolbar(wxToolBar* toolBar)
void CBreakPointWindow::RecreateToolbar()
{
// FIXME: what do we do with this?
// delete and recreate the toolbar
wxToolBarBase* toolBar = GetToolBar();
long style = toolBar ? toolBar->GetWindowStyle() : wxTB_FLAT | wxTB_DOCKABLE | wxTB_TEXT;
// wxToolBarBase* toolBar = GetToolBar();
// long style = toolBar ? toolBar->GetWindowStyle() : wxTB_FLAT | wxTB_DOCKABLE | wxTB_TEXT;
delete toolBar;
SetToolBar(NULL);
// delete toolBar;
// SetToolBar(NULL);
style &= ~(wxTB_HORIZONTAL | wxTB_VERTICAL | wxTB_BOTTOM | wxTB_RIGHT | wxTB_HORZ_LAYOUT | wxTB_TOP);
wxToolBar* theToolBar = CreateToolBar(style, ID_TOOLBAR);
// style &= ~(wxTB_HORIZONTAL | wxTB_VERTICAL | wxTB_BOTTOM | wxTB_RIGHT | wxTB_HORZ_LAYOUT | wxTB_TOP);
// wxToolBar* theToolBar = CreateToolBar(style, ID_TOOLBAR);
PopulateToolbar(theToolBar);
SetToolBar(theToolBar);
// PopulateToolbar(theToolBar);
// SetToolBar(theToolBar);
}
void CBreakPointWindow::InitBitmaps()

View File

@ -24,7 +24,7 @@ class wxListEvent;
class IniFile;
class CBreakPointWindow
: public wxFrame
: public wxPanel
{
private:
@ -34,11 +34,7 @@ class CBreakPointWindow
CBreakPointWindow(CCodeWindow* _pCodeWindow, wxWindow* parent, wxWindowID id = 1, const wxString& title = wxT("Breakpoints"),
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(400, 250),
#ifdef _WIN32
long style = wxNO_BORDER);
#else
long style = wxDEFAULT_FRAME_STYLE | wxCLIP_CHILDREN | wxNO_FULL_REPAINT_ON_RESIZE);
#endif
virtual ~CBreakPointWindow();

View File

@ -412,7 +412,7 @@ void CCodeWindow::OnSymbolListChange(wxCommandEvent& event)
{
if(pSymbol->type == Symbol::SYMBOL_DATA)
{
if(m_MemoryWindow && m_MemoryWindow->IsVisible())
if(m_MemoryWindow)// && m_MemoryWindow->IsVisible())
m_MemoryWindow->JumpToAddress(pSymbol->address);
}
else
@ -485,18 +485,10 @@ void CCodeWindow::OnToggleBreakPointWindow(bool _Show, int i)
if (_Show)
{
if (!m_BreakpointWindow) m_BreakpointWindow = new CBreakPointWindow(this, Parent, IDM_BREAKPOINTWINDOW);
#ifdef _WIN32
Parent->DoAddPage(m_BreakpointWindow, i, wxT("Breakpoints"), bFloatBreakpointWindow);
#else
m_BreakpointWindow->Show();
#endif
}
else // hide
#ifdef _WIN32
Parent->DoRemovePage(m_BreakpointWindow);
#else
if (m_BreakpointWindow) m_BreakpointWindow->Hide();
#endif
}
@ -505,18 +497,10 @@ void CCodeWindow::OnToggleMemoryWindow(bool _Show, int i)
if (_Show)
{
if (!m_MemoryWindow) m_MemoryWindow = new CMemoryWindow(Parent, IDM_MEMORYWINDOW);
#ifdef _WIN32
Parent->DoAddPage(m_MemoryWindow, i, wxT("Memory"), bFloatMemoryWindow);
#else
m_MemoryWindow->Show();
#endif
}
else // hide
#ifdef _WIN32
Parent->DoRemovePage(m_MemoryWindow);
#else
if (m_MemoryWindow) m_MemoryWindow->Hide();
#endif
}
@ -525,18 +509,10 @@ void CCodeWindow::OnToggleJitWindow(bool _Show, int i)
if (_Show)
{
if (!m_JitWindow) m_JitWindow = new CJitWindow(Parent, IDM_JITWINDOW);
#ifdef _WIN32
Parent->DoAddPage(m_JitWindow, i, wxT("JIT"), bFloatJitWindow);
#else
m_JitWindow->Show();
#endif
}
else // hide
#ifdef _WIN32
Parent->DoRemovePage(m_JitWindow);
#else
if (m_JitWindow) m_JitWindow->Hide();
#endif
}
@ -555,9 +531,6 @@ Notice: This windows docking for plugin windows will produce several wx debuggin
// Toggle Sound Debugging Window
void CCodeWindow::OnToggleDLLWindow(int Id, bool _Show, int i)
{
#ifdef _WIN32
// ConsoleListener* Console = LogManager::GetInstance()->getConsoleListener();
std::string DLLName;
wxString Title;
int PLUGINTYPE;
@ -616,7 +589,4 @@ void CCodeWindow::OnToggleDLLWindow(int Id, bool _Show, int i)
}
}
#else
CPluginManager::GetInstance().OpenDebug(Parent->GetHandle(), DLLName.c_str(), (PLUGIN_TYPE)PLUGINTYPE, _Show);
#endif
}

View File

@ -63,7 +63,7 @@ enum
IDM_BLOCKLIST,
};
BEGIN_EVENT_TABLE(CJitWindow, wxFrame)
BEGIN_EVENT_TABLE(CJitWindow, wxPanel)
// EVT_TEXT(IDM_ADDRBOX, CJitWindow::OnAddrBoxChange)
// EVT_LISTBOX(IDM_SYMBOLLIST, CJitWindow::OnSymbolListChange)
//EVT_HOST_COMMAND(wxID_ANY, CJitWindow::OnHostMessage)
@ -73,7 +73,7 @@ END_EVENT_TABLE()
CJitWindow::CJitWindow(wxWindow* parent, wxWindowID id,
const wxString& title, const wxPoint& pos, const wxSize& size, long style)
: wxFrame(parent, id, title, pos, size, style)
: wxPanel(parent, id, pos, size, style)
{
the_jit_window = this;
wxBoxSizer* sizerBig = new wxBoxSizer(wxVERTICAL);

View File

@ -41,7 +41,7 @@ public:
};
class CJitWindow : public wxFrame
class CJitWindow : public wxPanel
{
public:
CJitWindow(wxWindow* parent,
@ -49,12 +49,7 @@ public:
const wxString& title = _T("JIT block viewer"),
const wxPoint& pos = wxPoint(950, 100),
const wxSize& size = wxSize(400, 500),
#ifdef _WIN32
long style = wxNO_BORDER);
#else
long style = wxDEFAULT_FRAME_STYLE | wxCLIP_CHILDREN | wxNO_FULL_REPAINT_ON_RESIZE);
#endif
~CJitWindow();
void Save(IniFile& _IniFile) const;

View File

@ -50,7 +50,7 @@ enum
IDM_VALBOX,
};
BEGIN_EVENT_TABLE(CMemoryWindow, wxFrame)
BEGIN_EVENT_TABLE(CMemoryWindow, wxPanel)
EVT_TEXT(IDM_MEM_ADDRBOX, CMemoryWindow::OnAddrBoxChange)
EVT_LISTBOX(IDM_SYMBOLLIST, CMemoryWindow::OnSymbolListChange)
EVT_HOST_COMMAND(wxID_ANY, CMemoryWindow::OnHostMessage)
@ -60,7 +60,7 @@ END_EVENT_TABLE()
CMemoryWindow::CMemoryWindow(wxWindow* parent, wxWindowID id,
const wxString& title, const wxPoint& pos, const wxSize& size, long style)
: wxFrame(parent, id, title, pos, size, style)
: wxPanel(parent, id, pos, size, style)
{
wxBoxSizer* sizerBig = new wxBoxSizer(wxHORIZONTAL);
wxBoxSizer* sizerRight = new wxBoxSizer(wxVERTICAL);

View File

@ -32,7 +32,7 @@ class CRegisterWindow;
class CBreakPointWindow;
class CMemoryWindow
: public wxFrame
: public wxPanel
{
public:
@ -41,11 +41,7 @@ class CMemoryWindow
const wxString& title = _T("Dolphin-Memory"),
const wxPoint& pos = wxPoint(950, 100),
const wxSize& size = wxSize(400, 500),
#ifdef _WIN32
long style = wxNO_BORDER);
#else
long style = wxDEFAULT_FRAME_STYLE | wxCLIP_CHILDREN | wxNO_FULL_REPAINT_ON_RESIZE);
#endif
~CMemoryWindow();