Clean up the debugger gui a bit. In general do not call SetSizeHints on a window unless it is a top level window. It isn't supposed to do anything for non top level windows, but it causes glitches on linux. Removing these calls does not affect the end result on windows.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7233 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
1eaad0966c
commit
2f14598687
|
@ -28,8 +28,8 @@ static bool AlertEnabled = true;
|
|||
std::string DefaultStringTranslator(const char* text);
|
||||
static StringTranslator str_translator = DefaultStringTranslator;
|
||||
|
||||
/* Select which of these functions that are used for message boxes. If
|
||||
wxWidgets is enabled we will use wxMsgAlert() that is defined in Main.cpp */
|
||||
// Select which of these functions that are used for message boxes. If
|
||||
// wxWidgets is enabled we will use wxMsgAlert() that is defined in Main.cpp
|
||||
void RegisterMsgAlertHandler(MsgAlertHandler handler)
|
||||
{
|
||||
msg_handler = handler;
|
||||
|
@ -47,8 +47,8 @@ void SetEnableAlert(bool enable)
|
|||
AlertEnabled = enable;
|
||||
}
|
||||
|
||||
/* This is the first stop for gui alerts where the log is updated and the
|
||||
correct windows is shown */
|
||||
// This is the first stop for gui alerts where the log is updated and the
|
||||
// correct window is shown
|
||||
bool MsgAlert(bool yes_no, int Style, const char* format, ...)
|
||||
{
|
||||
// Read message and write it to the log
|
||||
|
@ -93,7 +93,7 @@ bool MsgAlert(bool yes_no, int Style, const char* format, ...)
|
|||
return true;
|
||||
}
|
||||
|
||||
// Default non library depended panic alert
|
||||
// Default non library dependent panic alert
|
||||
bool DefaultMsgHandler(const char* caption, const char* text, bool yes_no, int Style)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
|
|
|
@ -46,7 +46,6 @@ enum
|
|||
IDM_ADDFUNCTION,
|
||||
};
|
||||
|
||||
|
||||
BEGIN_EVENT_TABLE(CCodeView, wxControl)
|
||||
EVT_ERASE_BACKGROUND(CCodeView::OnErase)
|
||||
EVT_PAINT(CCodeView::OnPaint)
|
||||
|
@ -56,13 +55,17 @@ BEGIN_EVENT_TABLE(CCodeView, wxControl)
|
|||
EVT_RIGHT_DOWN(CCodeView::OnMouseDown)
|
||||
EVT_RIGHT_UP(CCodeView::OnMouseUpR)
|
||||
EVT_MENU(-1, CCodeView::OnPopupMenu)
|
||||
EVT_SIZE(CCodeView::OnResize)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
CCodeView::CCodeView(DebugInterface* debuginterface, SymbolDB *symboldb, wxWindow* parent, wxWindowID Id, const wxSize& Size)
|
||||
: wxControl(parent, Id, wxDefaultPosition, Size),
|
||||
CCodeView::CCodeView(DebugInterface* debuginterface, SymbolDB *symboldb,
|
||||
wxWindow* parent, wxWindowID Id)
|
||||
: wxControl(parent, Id),
|
||||
debugger(debuginterface),
|
||||
symbol_db(symboldb),
|
||||
plain(false),
|
||||
curAddress(debuginterface->getPC()),
|
||||
align(debuginterface->getInstructionSize(0)),
|
||||
rowHeight(13),
|
||||
selection(0),
|
||||
oldSelection(0),
|
||||
|
@ -73,31 +76,16 @@ CCodeView::CCodeView(DebugInterface* debuginterface, SymbolDB *symboldb, wxWindo
|
|||
lx(-1),
|
||||
ly(-1)
|
||||
{
|
||||
rowHeight = 13;
|
||||
align = debuginterface->getInstructionSize(0);
|
||||
curAddress = debuginterface->getPC();
|
||||
selection = 0;
|
||||
}
|
||||
|
||||
|
||||
wxSize CCodeView::DoGetBestSize() const
|
||||
{
|
||||
wxSize bestSize;
|
||||
bestSize.x = 400;
|
||||
bestSize.y = 800;
|
||||
return(bestSize);
|
||||
}
|
||||
|
||||
|
||||
int CCodeView::YToAddress(int y)
|
||||
{
|
||||
wxRect rc = GetClientRect();
|
||||
int ydiff = y - rc.height / 2 - rowHeight / 2;
|
||||
ydiff = (int)(floorf((float)ydiff / (float)rowHeight)) + 1;
|
||||
return(curAddress + ydiff * align);
|
||||
return curAddress + ydiff * align;
|
||||
}
|
||||
|
||||
|
||||
void CCodeView::OnMouseDown(wxMouseEvent& event)
|
||||
{
|
||||
int x = event.m_x;
|
||||
|
@ -112,51 +100,40 @@ void CCodeView::OnMouseDown(wxMouseEvent& event)
|
|||
selecting = true;
|
||||
|
||||
if (!oldselecting || (selection != oldSelection))
|
||||
{
|
||||
redraw();
|
||||
}
|
||||
Refresh();
|
||||
}
|
||||
else
|
||||
{
|
||||
ToggleBreakpoint(YToAddress(y));
|
||||
}
|
||||
|
||||
event.Skip(true);
|
||||
}
|
||||
|
||||
|
||||
void CCodeView::ToggleBreakpoint(u32 address)
|
||||
{
|
||||
debugger->toggleBreakpoint(address);
|
||||
redraw();
|
||||
Refresh();
|
||||
Host_UpdateBreakPointView();
|
||||
}
|
||||
|
||||
|
||||
void CCodeView::OnMouseMove(wxMouseEvent& event)
|
||||
{
|
||||
wxRect rc = GetClientRect();
|
||||
|
||||
if (event.m_leftDown)
|
||||
{
|
||||
if (event.m_x > 16)
|
||||
if (event.m_leftDown && event.m_x > 16)
|
||||
{
|
||||
if (event.m_y < 0)
|
||||
{
|
||||
curAddress -= align;
|
||||
redraw();
|
||||
Refresh();
|
||||
}
|
||||
else if (event.m_y > rc.height)
|
||||
{
|
||||
curAddress += align;
|
||||
redraw();
|
||||
Refresh();
|
||||
}
|
||||
else
|
||||
{
|
||||
OnMouseDown(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
event.Skip(true);
|
||||
}
|
||||
|
@ -175,8 +152,7 @@ void CCodeView::OnMouseUpL(wxMouseEvent& event)
|
|||
{
|
||||
curAddress = YToAddress(event.m_y);
|
||||
selecting = false;
|
||||
//ReleaseCapture();
|
||||
redraw();
|
||||
Refresh();
|
||||
}
|
||||
RaiseEvent();
|
||||
event.Skip(true);
|
||||
|
@ -223,7 +199,7 @@ void CCodeView::InsertBlrNop(int Blr)
|
|||
else
|
||||
debugger->insertBLR(selection, 0x60000000);
|
||||
}
|
||||
redraw();
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void CCodeView::OnPopupMenu(wxCommandEvent& event)
|
||||
|
@ -247,7 +223,7 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event)
|
|||
{
|
||||
char disasm[256];
|
||||
debugger->disasm(selection, disasm, 256);
|
||||
wxTheClipboard->SetData(new wxTextDataObject(wxString::FromAscii(disasm))); //Have to manually convert from char* to wxString, don't have to in Windows?
|
||||
wxTheClipboard->SetData(new wxTextDataObject(wxString::FromAscii(disasm)));
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -263,13 +239,15 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event)
|
|||
case IDM_COPYFUNCTION:
|
||||
{
|
||||
Symbol *symbol = symbol_db->GetSymbolFromAddr(selection);
|
||||
if (symbol) {
|
||||
if (symbol)
|
||||
{
|
||||
std::string text;
|
||||
text = text + symbol->name + "\r\n";
|
||||
// we got a function
|
||||
u32 start = symbol->address;
|
||||
u32 end = start + symbol->size;
|
||||
for (u32 addr = start; addr != end; addr += 4) {
|
||||
for (u32 addr = start; addr != end; addr += 4)
|
||||
{
|
||||
char disasm[256];
|
||||
debugger->disasm(addr, disasm, 256);
|
||||
text = text + StringFromFormat("%08x: ", addr) + disasm + "\r\n";
|
||||
|
@ -283,17 +261,17 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event)
|
|||
case IDM_RUNTOHERE:
|
||||
debugger->setBreakpoint(selection);
|
||||
debugger->runToBreakpoint();
|
||||
redraw();
|
||||
Refresh();
|
||||
break;
|
||||
|
||||
// Insert blr or restore old value
|
||||
case IDM_INSERTBLR:
|
||||
InsertBlrNop(0);
|
||||
redraw();
|
||||
Refresh();
|
||||
break;
|
||||
case IDM_INSERTNOP:
|
||||
InsertBlrNop(1);
|
||||
redraw();
|
||||
Refresh();
|
||||
break;
|
||||
|
||||
case IDM_JITRESULTS:
|
||||
|
@ -310,21 +288,22 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event)
|
|||
break;
|
||||
|
||||
case IDM_ADDFUNCTION:
|
||||
{
|
||||
symbol_db->AddFunction(selection);
|
||||
Host_NotifyMapLoaded();
|
||||
}
|
||||
break;
|
||||
|
||||
case IDM_RENAMESYMBOL:
|
||||
{
|
||||
Symbol *symbol = symbol_db->GetSymbolFromAddr(selection);
|
||||
if (symbol) {
|
||||
wxTextEntryDialog input_symbol(this, wxString::FromAscii("Rename symbol:"), wxGetTextFromUserPromptStr,
|
||||
if (symbol)
|
||||
{
|
||||
wxTextEntryDialog input_symbol(this, wxString::FromAscii("Rename symbol:"),
|
||||
wxGetTextFromUserPromptStr,
|
||||
wxString::FromAscii(symbol->name.c_str()));
|
||||
if (input_symbol.ShowModal() == wxID_OK) {
|
||||
if (input_symbol.ShowModal() == wxID_OK)
|
||||
{
|
||||
symbol->name = input_symbol.GetValue().mb_str();
|
||||
redraw(); // Redraw to show the renamed symbol
|
||||
Refresh(); // Redraw to show the renamed symbol
|
||||
}
|
||||
Host_NotifyMapLoaded();
|
||||
}
|
||||
|
@ -332,9 +311,6 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event)
|
|||
break;
|
||||
|
||||
case IDM_PATCHALERT:
|
||||
{
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -344,14 +320,14 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event)
|
|||
event.Skip(true);
|
||||
}
|
||||
|
||||
|
||||
void CCodeView::OnMouseUpR(wxMouseEvent& event)
|
||||
{
|
||||
bool isSymbol = symbol_db->GetSymbolFromAddr(selection) != 0;
|
||||
// popup menu
|
||||
wxMenu* menu = new wxMenu;
|
||||
//menu->Append(IDM_GOTOINMEMVIEW, "&Goto in mem view");
|
||||
menu->Append(IDM_FOLLOWBRANCH, wxString::FromAscii("&Follow branch"))->Enable(AddrToBranch(selection) ? true : false);
|
||||
menu->Append(IDM_FOLLOWBRANCH,
|
||||
wxString::FromAscii("&Follow branch"))->Enable(AddrToBranch(selection) ? true : false);
|
||||
menu->AppendSeparator();
|
||||
#if wxUSE_CLIPBOARD
|
||||
menu->Append(IDM_COPYADDRESS, wxString::FromAscii("Copy &address"));
|
||||
|
@ -372,11 +348,9 @@ void CCodeView::OnMouseUpR(wxMouseEvent& event)
|
|||
event.Skip(true);
|
||||
}
|
||||
|
||||
|
||||
void CCodeView::OnErase(wxEraseEvent& event)
|
||||
{}
|
||||
|
||||
|
||||
void CCodeView::OnPaint(wxPaintEvent& event)
|
||||
{
|
||||
// --------------------------------------------------------------------
|
||||
|
@ -397,10 +371,8 @@ void CCodeView::OnPaint(wxPaintEvent& event)
|
|||
// TODO: Add any drawing code here...
|
||||
int width = rc.width;
|
||||
int numRows = (rc.height / rowHeight) / 2 + 2;
|
||||
//numRows=(numRows&(~1)) + 1;
|
||||
// ------------
|
||||
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
// Colors and brushes
|
||||
// -------------------------
|
||||
|
@ -425,7 +397,6 @@ void CCodeView::OnPaint(wxPaintEvent& event)
|
|||
dc.DrawRectangle(0, 0, rc.width, 5);
|
||||
// ------------
|
||||
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
// Walk through all visible rows
|
||||
// -------------------------
|
||||
|
@ -455,7 +426,8 @@ void CCodeView::OnPaint(wxPaintEvent& event)
|
|||
|
||||
dc.DrawRectangle(16, rowY1, width, rowY2 - rowY1 + 1);
|
||||
dc.SetBrush(currentBrush);
|
||||
if (!plain) {
|
||||
if (!plain)
|
||||
{
|
||||
dc.SetTextForeground(_T("#600000")); // the address text is dark red
|
||||
dc.DrawText(temp, 17, rowY1);
|
||||
dc.SetTextForeground(_T("#000000"));
|
||||
|
@ -546,7 +518,6 @@ void CCodeView::OnPaint(wxPaintEvent& event)
|
|||
} // end of for
|
||||
// ------------
|
||||
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
// Colors and brushes
|
||||
// -------------------------
|
||||
|
@ -584,7 +555,6 @@ void CCodeView::OnPaint(wxPaintEvent& event)
|
|||
// ------------
|
||||
}
|
||||
|
||||
|
||||
void CCodeView::_LineTo(wxPaintDC &dc, int x, int y)
|
||||
{
|
||||
dc.DrawLine(lx, ly, x, y);
|
||||
|
@ -592,3 +562,8 @@ void CCodeView::_LineTo(wxPaintDC &dc, int x, int y)
|
|||
ly = y;
|
||||
}
|
||||
|
||||
void CCodeView::OnResize(wxSizeEvent& event)
|
||||
{
|
||||
Refresh();
|
||||
event.Skip();
|
||||
}
|
||||
|
|
|
@ -35,8 +35,8 @@ class SymbolDB;
|
|||
class CCodeView : public wxControl
|
||||
{
|
||||
public:
|
||||
CCodeView(DebugInterface* debuginterface, SymbolDB *symbol_db, wxWindow* parent, wxWindowID Id = -1, const wxSize& Size = wxDefaultSize);
|
||||
wxSize DoGetBestSize() const;
|
||||
CCodeView(DebugInterface* debuginterface, SymbolDB *symbol_db,
|
||||
wxWindow* parent, wxWindowID Id = wxID_ANY);
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
void OnErase(wxEraseEvent& event);
|
||||
void OnMouseDown(wxMouseEvent& event);
|
||||
|
@ -60,10 +60,11 @@ public:
|
|||
{
|
||||
curAddress = addr;
|
||||
selection = addr;
|
||||
redraw();
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void SetPlain() {
|
||||
void SetPlain()
|
||||
{
|
||||
plain = true;
|
||||
}
|
||||
|
||||
|
@ -72,8 +73,7 @@ private:
|
|||
int YToAddress(int y);
|
||||
|
||||
u32 AddrToBranch(u32 addr);
|
||||
|
||||
void redraw() {Refresh();}
|
||||
void OnResize(wxSizeEvent& event);
|
||||
|
||||
DebugInterface* debugger;
|
||||
SymbolDB* symbol_db;
|
||||
|
|
|
@ -411,9 +411,7 @@ void CCodeWindow::CreateGUIControls(const SCoreStartupParameter& _LocalCoreStart
|
|||
|
||||
SetSizer(sizerBig);
|
||||
|
||||
sizerLeft->SetSizeHints(this);
|
||||
sizerLeft->Fit(this);
|
||||
sizerBig->SetSizeHints(this);
|
||||
sizerBig->Fit(this);
|
||||
|
||||
sync_event.Init();
|
||||
|
|
|
@ -76,7 +76,6 @@ DSPDebuggerLLE::DSPDebuggerLLE(wxWindow* parent, wxWindowID id)
|
|||
m_CodeView->SetPlain();
|
||||
code_sizer->Add(m_CodeView, 1, wxALL | wxEXPAND);
|
||||
code_panel->SetSizer(code_sizer);
|
||||
code_sizer->SetSizeHints(code_panel);
|
||||
m_MainNotebook->AddPage(code_panel, wxT("Disasm"), true);
|
||||
|
||||
wxPanel *mem_panel = new wxPanel(m_MainNotebook, wxID_ANY);
|
||||
|
@ -85,7 +84,6 @@ DSPDebuggerLLE::DSPDebuggerLLE(wxWindow* parent, wxWindowID id)
|
|||
m_MemView = new CMemoryView(&debug_interface, mem_panel);
|
||||
mem_sizer->Add(m_MemView, 1, wxALL | wxEXPAND);
|
||||
mem_panel->SetSizer(mem_sizer);
|
||||
mem_sizer->SetSizeHints(mem_panel);
|
||||
m_MainNotebook->AddPage(mem_panel, wxT("Mem"));
|
||||
|
||||
m_Regs = new DSPRegisterView(this, ID_DSP_REGS);
|
||||
|
|
|
@ -87,9 +87,7 @@ CJitWindow::CJitWindow(wxWindow* parent, wxWindowID id, const wxPoint& pos,
|
|||
|
||||
SetSizer(sizerBig);
|
||||
|
||||
sizerSplit->SetSizeHints(this);
|
||||
sizerSplit->Fit(this);
|
||||
sizerBig->SetSizeHints(this);
|
||||
sizerBig->Fit(this);
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#include <wx/event.h>
|
||||
#include <wx/clipbrd.h>
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
IDM_GOTOINMEMVIEW = 12000,
|
||||
|
@ -40,54 +39,38 @@ enum
|
|||
IDM_VIEWASHEX,
|
||||
};
|
||||
|
||||
|
||||
BEGIN_EVENT_TABLE(CMemoryView, wxControl)
|
||||
EVT_ERASE_BACKGROUND(CMemoryView::OnErase)
|
||||
EVT_PAINT(CMemoryView::OnPaint)
|
||||
EVT_LEFT_DOWN(CMemoryView::OnMouseDownL)
|
||||
EVT_LEFT_UP(CMemoryView::OnMouseUpL)
|
||||
EVT_MOTION(CMemoryView::OnMouseMove)
|
||||
EVT_RIGHT_DOWN(CMemoryView::OnMouseDownR)
|
||||
EVT_MENU(-1, CMemoryView::OnPopupMenu)
|
||||
EVT_SIZE(CMemoryView::OnResize)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
CMemoryView::CMemoryView(DebugInterface* debuginterface, wxWindow* parent, wxWindowID Id, const wxSize& Size)
|
||||
: wxControl(parent, Id, wxDefaultPosition, Size),
|
||||
debugger(debuginterface),
|
||||
rowHeight(13),
|
||||
selection(0),
|
||||
oldSelection(0),
|
||||
selectionChanged(false),
|
||||
selecting(false),
|
||||
hasFocus(false),
|
||||
showHex(false),
|
||||
memory(0),
|
||||
viewAsType(VIEWAS_FP)
|
||||
CMemoryView::CMemoryView(DebugInterface* debuginterface, wxWindow* parent)
|
||||
: wxControl(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize)
|
||||
, curAddress(debuginterface->getPC())
|
||||
, debugger(debuginterface)
|
||||
, align(debuginterface->getInstructionSize(0))
|
||||
, rowHeight(13)
|
||||
, selection(0)
|
||||
, oldSelection(0)
|
||||
, selecting(false)
|
||||
, memory(0)
|
||||
, viewAsType(VIEWAS_FP)
|
||||
{
|
||||
rowHeight = 13;
|
||||
align = debuginterface->getInstructionSize(0);
|
||||
curAddress = debuginterface->getPC();
|
||||
}
|
||||
|
||||
|
||||
wxSize CMemoryView::DoGetBestSize() const
|
||||
{
|
||||
wxSize bestSize;
|
||||
bestSize.x = 300;
|
||||
bestSize.y = 300;
|
||||
return(bestSize);
|
||||
}
|
||||
|
||||
|
||||
int CMemoryView::YToAddress(int y)
|
||||
{
|
||||
wxRect rc = GetClientRect();
|
||||
int ydiff = y - rc.height / 2 - rowHeight / 2;
|
||||
ydiff = (int)(floorf((float)ydiff / (float)rowHeight)) + 1;
|
||||
return(curAddress + ydiff * align);
|
||||
return curAddress + ydiff * align;
|
||||
}
|
||||
|
||||
|
||||
void CMemoryView::OnMouseDownL(wxMouseEvent& event)
|
||||
{
|
||||
int x = event.m_x;
|
||||
|
@ -97,70 +80,58 @@ void CMemoryView::OnMouseDownL(wxMouseEvent& event)
|
|||
{
|
||||
oldSelection = selection;
|
||||
selection = YToAddress(y);
|
||||
// SetCapture(wnd);
|
||||
bool oldselecting = selecting;
|
||||
selecting = true;
|
||||
|
||||
if (!oldselecting || (selection != oldSelection))
|
||||
{
|
||||
redraw();
|
||||
}
|
||||
Refresh();
|
||||
}
|
||||
else
|
||||
{
|
||||
debugger->toggleMemCheck(YToAddress(y));
|
||||
|
||||
redraw();
|
||||
Refresh();
|
||||
Host_UpdateBreakPointView();
|
||||
}
|
||||
|
||||
event.Skip(true);
|
||||
}
|
||||
|
||||
|
||||
void CMemoryView::OnMouseMove(wxMouseEvent& event)
|
||||
{
|
||||
wxRect rc = GetClientRect();
|
||||
|
||||
if (event.m_leftDown)
|
||||
{
|
||||
if (event.m_x > 16)
|
||||
if (event.m_leftDown && event.m_x > 16)
|
||||
{
|
||||
if (event.m_y < 0)
|
||||
{
|
||||
curAddress -= align;
|
||||
redraw();
|
||||
Refresh();
|
||||
}
|
||||
else if (event.m_y > rc.height)
|
||||
{
|
||||
curAddress += align;
|
||||
redraw();
|
||||
Refresh();
|
||||
}
|
||||
else
|
||||
{
|
||||
OnMouseDownL(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
event.Skip(true);
|
||||
}
|
||||
|
||||
|
||||
void CMemoryView::OnMouseUpL(wxMouseEvent& event)
|
||||
{
|
||||
if (event.m_x > 16)
|
||||
{
|
||||
curAddress = YToAddress(event.m_y);
|
||||
selecting = false;
|
||||
//ReleaseCapture();
|
||||
redraw();
|
||||
Refresh();
|
||||
}
|
||||
|
||||
event.Skip(true);
|
||||
}
|
||||
|
||||
|
||||
void CMemoryView::OnPopupMenu(wxCommandEvent& event)
|
||||
{
|
||||
#if wxUSE_CLIPBOARD
|
||||
|
@ -171,9 +142,7 @@ void CMemoryView::OnPopupMenu(wxCommandEvent& event)
|
|||
{
|
||||
#if wxUSE_CLIPBOARD
|
||||
case IDM_COPYADDRESS:
|
||||
{
|
||||
wxTheClipboard->SetData(new wxTextDataObject(wxString::Format(_T("%08x"), selection)));
|
||||
}
|
||||
break;
|
||||
|
||||
case IDM_COPYHEX:
|
||||
|
@ -187,21 +156,21 @@ void CMemoryView::OnPopupMenu(wxCommandEvent& event)
|
|||
|
||||
case IDM_TOGGLEMEMORY:
|
||||
memory ^= 1;
|
||||
redraw();
|
||||
Refresh();
|
||||
break;
|
||||
|
||||
case IDM_VIEWASFP:
|
||||
viewAsType = VIEWAS_FP;
|
||||
redraw();
|
||||
Refresh();
|
||||
break;
|
||||
|
||||
case IDM_VIEWASASCII:
|
||||
viewAsType = VIEWAS_ASCII;
|
||||
redraw();
|
||||
Refresh();
|
||||
break;
|
||||
case IDM_VIEWASHEX:
|
||||
viewAsType = VIEWAS_HEX;
|
||||
redraw();
|
||||
Refresh();
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -211,7 +180,6 @@ void CMemoryView::OnPopupMenu(wxCommandEvent& event)
|
|||
event.Skip(true);
|
||||
}
|
||||
|
||||
|
||||
void CMemoryView::OnMouseDownR(wxMouseEvent& event)
|
||||
{
|
||||
// popup menu
|
||||
|
@ -223,25 +191,15 @@ void CMemoryView::OnMouseDownR(wxMouseEvent& event)
|
|||
#endif
|
||||
menu->Append(IDM_TOGGLEMEMORY, wxString::FromAscii("Toggle &memory"));
|
||||
|
||||
|
||||
|
||||
wxMenu* viewAsSubMenu = new wxMenu;
|
||||
viewAsSubMenu->Append(IDM_VIEWASFP, wxString::FromAscii("FP value"));
|
||||
viewAsSubMenu->Append(IDM_VIEWASASCII, wxString::FromAscii("ASCII"));
|
||||
viewAsSubMenu->Append(IDM_VIEWASHEX, wxString::FromAscii("Hex"));
|
||||
menu->AppendSubMenu(viewAsSubMenu, wxString::FromAscii("View As:"));
|
||||
|
||||
|
||||
PopupMenu(menu);
|
||||
|
||||
//event.Skip(true);
|
||||
}
|
||||
|
||||
|
||||
void CMemoryView::OnErase(wxEraseEvent& event)
|
||||
{}
|
||||
|
||||
|
||||
void CMemoryView::OnPaint(wxPaintEvent& event)
|
||||
{
|
||||
wxPaintDC dc(this);
|
||||
|
@ -254,10 +212,8 @@ void CMemoryView::OnPaint(wxPaintEvent& event)
|
|||
dc.SetFont(hFont);
|
||||
}
|
||||
else
|
||||
{
|
||||
dc.SetFont(DebuggerFont);
|
||||
}
|
||||
//wxFont tempFont(Lucida Console);
|
||||
|
||||
int fontSize = viewAsType == VIEWAS_HEX ? hFont.GetPointSize() : DebuggerFont.GetPointSize();
|
||||
int textPlacement = 77;
|
||||
struct branch
|
||||
|
@ -268,7 +224,6 @@ void CMemoryView::OnPaint(wxPaintEvent& event)
|
|||
// TODO: Add any drawing code here...
|
||||
int width = rc.width;
|
||||
int numRows = (rc.height / rowHeight) / 2 + 2;
|
||||
//numRows=(numRows&(~1)) + 1;
|
||||
dc.SetBackgroundMode(wxTRANSPARENT);
|
||||
const wxChar* bgColor = _T("#ffffff");
|
||||
wxPen nullPen(bgColor);
|
||||
|
@ -304,22 +259,14 @@ void CMemoryView::OnPaint(wxPaintEvent& event)
|
|||
dc.DrawRectangle(0, rowY1, 16, rowY2);
|
||||
|
||||
if (selecting && (address == selection))
|
||||
{
|
||||
dc.SetPen(selPen);
|
||||
}
|
||||
else
|
||||
{
|
||||
dc.SetPen(row == 0 ? currentPen : nullPen);
|
||||
}
|
||||
|
||||
if (address == debugger->getPC())
|
||||
{
|
||||
dc.SetBrush(pcBrush);
|
||||
}
|
||||
else
|
||||
{
|
||||
dc.SetBrush(rowBrush);
|
||||
}
|
||||
|
||||
dc.DrawRectangle(16, rowY1, width, rowY2 - 1);
|
||||
dc.SetBrush(currentBrush);
|
||||
|
@ -403,28 +350,21 @@ void CMemoryView::OnPaint(wxPaintEvent& event)
|
|||
curAddress += 32;
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(dis, "INVALID VIEWAS TYPE");
|
||||
}
|
||||
|
||||
char desc[256] = "";
|
||||
if (viewAsType != VIEWAS_HEX)
|
||||
{
|
||||
dc.DrawText(wxString::FromAscii(dis), textPlacement + fontSize*(8 + 8), rowY1);
|
||||
} else {
|
||||
else
|
||||
dc.DrawText(wxString::FromAscii(dis), textPlacement + 8+16, rowY1);
|
||||
}
|
||||
|
||||
if (desc[0] == 0)
|
||||
{
|
||||
strcpy(desc, debugger->getDescription(address).c_str());
|
||||
}
|
||||
|
||||
dc.SetTextForeground(_T("#0000FF"));
|
||||
|
||||
if (strlen(desc))
|
||||
{
|
||||
dc.DrawText(wxString::FromAscii(desc), 17+fontSize*((8+8+8+30)*2), rowY1);
|
||||
}
|
||||
|
||||
// Show blue memory check dot
|
||||
if (debugger->isMemCheck(address))
|
||||
|
@ -437,3 +377,9 @@ void CMemoryView::OnPaint(wxPaintEvent& event)
|
|||
|
||||
dc.SetPen(currentPen);
|
||||
}
|
||||
|
||||
void CMemoryView::OnResize(wxSizeEvent& event)
|
||||
{
|
||||
Refresh();
|
||||
event.Skip();
|
||||
}
|
||||
|
|
|
@ -25,10 +25,8 @@
|
|||
class CMemoryView : public wxControl
|
||||
{
|
||||
public:
|
||||
CMemoryView(DebugInterface* debuginterface, wxWindow* parent, wxWindowID Id = -1, const wxSize& Size = wxDefaultSize);
|
||||
wxSize DoGetBestSize() const;
|
||||
CMemoryView(DebugInterface* debuginterface, wxWindow* parent);
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
void OnErase(wxEraseEvent& event);
|
||||
void OnMouseDownL(wxMouseEvent& event);
|
||||
void OnMouseMove(wxMouseEvent& event);
|
||||
void OnMouseUpL(wxMouseEvent& event);
|
||||
|
@ -41,27 +39,23 @@ public:
|
|||
void Center(u32 addr)
|
||||
{
|
||||
curAddress = addr;
|
||||
redraw();
|
||||
Refresh();
|
||||
}
|
||||
int dataType; // u8,u16,u32
|
||||
int curAddress; // Will be accessed by parent
|
||||
|
||||
private:
|
||||
int YToAddress(int y);
|
||||
void redraw() {Refresh();}
|
||||
void OnResize(wxSizeEvent& event);
|
||||
|
||||
DebugInterface* debugger;
|
||||
|
||||
|
||||
int align;
|
||||
int rowHeight;
|
||||
|
||||
u32 selection;
|
||||
u32 oldSelection;
|
||||
bool selectionChanged;
|
||||
bool selecting;
|
||||
bool hasFocus;
|
||||
bool showHex;
|
||||
|
||||
int memory;
|
||||
|
||||
|
@ -77,4 +71,4 @@ private:
|
|||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif /*MEMORYVIEW_H_*/
|
||||
#endif // MEMORYVIEW_H_
|
||||
|
|
|
@ -83,7 +83,7 @@ CMemoryWindow::CMemoryWindow(wxWindow* parent, wxWindowID id,
|
|||
//symbols = new wxListBox(this, IDM_SYMBOLLIST, wxDefaultPosition,
|
||||
// wxSize(20, 100), 0, NULL, wxLB_SORT);
|
||||
//sizerLeft->Add(symbols, 1, wxEXPAND);
|
||||
memview = new CMemoryView(di, this, wxID_ANY);
|
||||
memview = new CMemoryView(di, this);
|
||||
memview->dataType = 0;
|
||||
//sizerBig->Add(sizerLeft, 1, wxEXPAND);
|
||||
sizerBig->Add(memview, 20, wxEXPAND);
|
||||
|
@ -113,11 +113,8 @@ CMemoryWindow::CMemoryWindow(wxWindow* parent, wxWindowID id,
|
|||
chkHex->SetValue(1); //Set defaults
|
||||
chk8->SetValue(1);
|
||||
|
||||
//sizerLeft->SetSizeHints(this);
|
||||
//sizerLeft->Fit(this);
|
||||
sizerRight->SetSizeHints(this);
|
||||
sizerRight->Fit(this);
|
||||
sizerBig->SetSizeHints(this);
|
||||
sizerBig->Fit(this);
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,6 @@ void CRegisterWindow::CreateGUIControls()
|
|||
m_GPRGridView = new CRegisterView(this, ID_GPR);
|
||||
sGrid->Add(m_GPRGridView, 1, wxGROW);
|
||||
SetSizer(sGrid);
|
||||
sGrid->SetSizeHints(this);
|
||||
|
||||
NotifyUpdate();
|
||||
}
|
||||
|
@ -50,7 +49,5 @@ void CRegisterWindow::CreateGUIControls()
|
|||
void CRegisterWindow::NotifyUpdate()
|
||||
{
|
||||
if (m_GPRGridView != NULL)
|
||||
{
|
||||
m_GPRGridView->Update();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ const wxString& ConnectedWiimotesString()
|
|||
|
||||
WiimoteConfigPage::WiimoteConfigPage(wxWindow* const parent, const int index)
|
||||
: wxNotebookPage(parent, -1, wxDefaultPosition, wxDefaultSize)
|
||||
, m_index(index), orig_source(g_wiimote_sources[index]), end_source(g_wiimote_sources[index])
|
||||
, m_index(index), orig_source(g_wiimote_sources[index])
|
||||
{
|
||||
// input source
|
||||
const wxString src_choices[] = { _("None"),
|
||||
|
@ -132,12 +132,12 @@ void WiimoteConfigPage::SelectSource(wxCommandEvent& event)
|
|||
{
|
||||
// This needs to be changed now in order for refresh to work right.
|
||||
// Revert if the dialog is canceled.
|
||||
g_wiimote_sources[m_index] = end_source = event.GetInt();
|
||||
g_wiimote_sources[m_index] = event.GetInt();
|
||||
}
|
||||
|
||||
void WiimoteConfigPage::UpdateWiimoteStatus()
|
||||
{
|
||||
if (orig_source != end_source)
|
||||
if (orig_source != g_wiimote_sources[m_index])
|
||||
{
|
||||
// Disconnect first, otherwise the new source doesn't seem to work
|
||||
CFrame::ConnectWiimote(m_index, false);
|
||||
|
|
|
@ -28,7 +28,7 @@ public:
|
|||
|
||||
private:
|
||||
const int m_index;
|
||||
unsigned int orig_source, end_source;
|
||||
unsigned int orig_source;
|
||||
};
|
||||
|
||||
class WiimoteConfigDiag : public wxDialog
|
||||
|
|
Loading…
Reference in New Issue