Hopefully fixed the grid scrolling bug

Originally committed to SVN as r422.
This commit is contained in:
Rodrigo Braz Monteiro 2006-06-20 23:32:01 +00:00
parent 1fa1d75211
commit b77543f179
2 changed files with 9 additions and 1 deletions

View file

@ -590,8 +590,10 @@ void BaseGrid::OnMouseEvent(wxMouseEvent &event) {
} }
// Click type // Click type
bool startedHolding = false;
if (click && !holding && validRow) { if (click && !holding && validRow) {
holding = true; holding = true;
startedHolding = true;
CaptureMouse(); CaptureMouse();
} }
if (!event.ButtonIsDown(wxMOUSE_BTN_LEFT) && holding) { if (!event.ButtonIsDown(wxMOUSE_BTN_LEFT) && holding) {
@ -609,7 +611,13 @@ void BaseGrid::OnMouseEvent(wxMouseEvent &event) {
if (row > maxVis) delta = +1; if (row > maxVis) delta = +1;
// Scroll // Scroll
ScrollTo(yPos+delta*3); if (delta) {
ScrollTo(yPos+delta*3);
if (startedHolding) {
holding = false;
ReleaseMouse();
}
}
} }
// Click // Click

Binary file not shown.