Merge pull request #1338 from turtleli/breakpoint-windows-fix

debugger:windows: Fix vanishing breakpoints when scrollbar disappears
This commit is contained in:
Jonathan Li 2016-05-04 11:17:20 +01:00
commit f4566acfa5
2 changed files with 9 additions and 2 deletions

View File

@ -31,6 +31,7 @@ GenericListView::GenericListView(wxWindow* parent, GenericListViewColumn* column
: wxListView(parent,wxID_ANY,wxDefaultPosition,wxDefaultSize,wxLC_VIRTUAL|wxLC_REPORT|wxLC_SINGLE_SEL|wxNO_BORDER)
{
m_isInResizeColumn = false;
dontResizeColumnsInSizeEventHandler = false;
insertColumns(columns, columnCount);
}
@ -72,7 +73,12 @@ void GenericListView::resizeColumns(int totalWidth)
void GenericListView::sizeEvent(wxSizeEvent& evt)
{
resizeColumns(GetClientSize().x);
// HACK: On Windows, it seems that if you resize the columns in the size
// event handler when the scrollbar disappears, the listview contents may
// decide to disappear as well. So let's avoid the resize for this case.
if (!dontResizeColumnsInSizeEventHandler)
resizeColumns(GetClientSize().x);
dontResizeColumnsInSizeEventHandler = false;
evt.Skip();
}
@ -110,7 +116,7 @@ void GenericListView::update()
// make the scrollbar go away, so let's make it recalculate if it needs it
SetItemCount(newRows);
}
dontResizeColumnsInSizeEventHandler = true;
Refresh();
}

View File

@ -65,6 +65,7 @@ private:
GenericListViewColumn* columns;
wxPoint clickPos;
bool dontResizeColumnsInSizeEventHandler;
};
class BreakpointList: public GenericListView