debugger:windows: Fix vanishing breakpoints when scrollbar disappears

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.
This commit is contained in:
Jonathan Li 2016-05-03 00:39:31 +01:00
parent 90af611fdb
commit ad652706d6
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