wx3.0: various buggy code (wx assertion)

v3: reenable dc.GetSize, I didn't manage to reproduce the assertion failure
This commit is contained in:
Gregory Hainaut 2014-06-29 08:48:32 +02:00
parent 1fda2a611c
commit 01de778831
5 changed files with 12 additions and 9 deletions

View File

@ -77,7 +77,7 @@ inline wxIcon _wxGetIconFromMemory(const unsigned char *data, int length) {
}
CtrlDisassemblyView::CtrlDisassemblyView(wxWindow* parent, DebugInterface* _cpu)
: wxWindow(parent,wxID_ANY,wxDefaultPosition,wxDefaultSize,wxWANTS_CHARS|wxBORDER), cpu(_cpu)
: wxWindow(parent,wxID_ANY,wxDefaultPosition,wxDefaultSize,wxWANTS_CHARS|wxBORDER|wxVSCROLL), cpu(_cpu)
{
manager.setCpu(cpu);
windowStart = 0x100000;
@ -390,7 +390,7 @@ void CtrlDisassemblyView::render(wxDC& dc)
int width,height;
dc.GetSize(&width,&height);
dc.DrawRectangle(0,0,width,height);
dc.DrawRectangle(0, 0, width, height);
if (!cpu->isAlive())
return;

View File

@ -49,7 +49,7 @@ enum MemoryViewMenuIdentifiers
};
CtrlMemView::CtrlMemView(wxWindow* parent, DebugInterface* _cpu)
: wxWindow(parent,wxID_ANY,wxDefaultPosition,wxDefaultSize,wxWANTS_CHARS), cpu(_cpu)
: wxWindow(parent,wxID_ANY,wxDefaultPosition,wxDefaultSize,wxWANTS_CHARS|wxVSCROLL), cpu(_cpu)
{
rowHeight = g_Conf->EmuOptions.Debugger.FontHeight;
charWidth = g_Conf->EmuOptions.Debugger.FontWidth;

View File

@ -34,7 +34,7 @@ void insertListViewColumns(wxListCtrl* list, GenericListViewColumn* columns, int
void resizeListViewColumns(wxListCtrl* list, GenericListViewColumn* columns, int count, int totalWidth)
{
for (int i = 0; i < count; i++)
for (int i = 0; i < std::min(list->GetColumnCount(), count); i++)
{
list->SetColumnWidth(i,totalWidth*columns[i].size);
}

View File

@ -217,11 +217,13 @@ void FileMemoryCard::Close()
{
for( int slot=0; slot<8; ++slot )
{
// Store checksum
if(!m_ispsx[slot] && !!m_file[slot].Seek( m_chkaddr ))
m_file[slot].Write( &m_chksum[slot], 8 );
if (m_file[slot].IsOpened()) {
// Store checksum
if(!m_ispsx[slot] && !!m_file[slot].Seek( m_chkaddr ))
m_file[slot].Write( &m_chksum[slot], 8 );
m_file[slot].Close();
m_file[slot].Close();
}
}
}

View File

@ -330,7 +330,8 @@ void Panels::PluginSelectorPanel::StatusPanel::SetGaugeLength( int len )
void Panels::PluginSelectorPanel::StatusPanel::AdvanceProgress( const wxString& msg )
{
m_label.SetLabel( msg );
m_gauge.SetValue( ++m_progress );
if (m_progress < m_gauge.GetRange())
m_gauge.SetValue( ++m_progress );
}
void Panels::PluginSelectorPanel::StatusPanel::Reset()