diff options
author | drewski207 <drewski207@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-03-22 21:05:38 +0000 |
---|---|---|
committer | drewski207 <drewski207@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-03-22 21:05:38 +0000 |
commit | 49e51459783e1de062551fe86ae7030582c81aa7 (patch) | |
tree | 3d68f87d9942df98799b8eb28df53c63bba67896 /src/gui | |
parent | bba6d008d8b9bb7a8129fa23d0edea0bfde2e059 (diff) | |
download | fpGUI-49e51459783e1de062551fe86ae7030582c81aa7.tar.xz |
* Increased double buffer on x11 efficiency
* Fixed a bug on listbox that allowed Item 0 to be selected with the mouse
* Fixed a possible bug for TfpgTimer that possibly could allow
timers to be skipped if timer(s) were destroyed during the callback
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/gui_listbox.pas | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gui/gui_listbox.pas b/src/gui/gui_listbox.pas index d3164176..219ced11 100644 --- a/src/gui/gui_listbox.pas +++ b/src/gui/gui_listbox.pas @@ -450,6 +450,8 @@ begin end; procedure TfpgBaseListBox.HandleMouseMove(x, y: integer; btnstate: word; shiftstate: TShiftState); +var + NewFocus: Integer; begin inherited HandleMouseMove(x, y, btnstate, shiftstate); @@ -459,7 +461,11 @@ begin if ((not FMouseDragging) or (btnstate and 1 = 0)) and (not HotTrack) then Exit; //==> - FocusItem := FFirstItem + Trunc((y - FMargin) / RowHeight); + NewFocus := FFirstItem + Trunc((y - FMargin) / RowHeight); + if NewFocus < 1 then + NewFocus := 1; + + FocusItem := NewFocus; end; procedure TfpgBaseListBox.HandleMouseScroll(x, y: integer; shiftstate: TShiftState; delta: smallint); |