Recent

Author Topic: grids.pas and horz scroll  (Read 2842 times)

bytebites

  • Hero Member
  • *****
  • Posts: 640
grids.pas and horz scroll
« on: November 22, 2016, 01:56:52 pm »
Code: Pascal  [Select][+][-]
  1. procedure TCustomGrid.WMHScroll(var message: TLMHScroll);
  2. var
  3.   SP: TPoint;
  4. begin
  5.   SP := GetPxTopLeft;
  6.  
  7.   case message.ScrollCode of
  8.     SB_THUMBPOSITION,
  9.     SB_THUMBTRACK: begin
  10.       if (message.ScrollCode=SB_THUMBPOSITION) or (goThumbTracking in Options) then
  11.         TrySmoothScrollBy(message.Pos-SP.x, 0);
  12.       message.Result := 0;
  13.     end;
  14.     SB_PAGEUP: TrySmoothScrollBy(-(ClientHeight-FGCache.FixedHeight), 0);
  15.     SB_PAGEDOWN: TrySmoothScrollBy(ClientHeight-FGCache.FixedHeight, 0);
  16.     SB_LINEUP: TrySmoothScrollBy(-DefaultRowHeight, 0);
  17.     SB_LINEDOWN: TrySmoothScrollBy(DefaultRowHeight, 0);
  18.   end;
  19.  
  20.   if EditorMode then
  21.     EditorPos;
  22. end;
  23.  

Am I missed something but shouldn't horizontal scroll use width and not height, ClientWidth and FixedWidth etc. This is from trunk version of grids.pas.


tk

  • Sr. Member
  • ****
  • Posts: 361
Re: grids.pas and horz scroll
« Reply #1 on: November 29, 2016, 10:05:05 am »
Shortly looked into the source and it has substantially changed since stable 1.6.
At first look it seems to me a bug.
If something does not work it clearly is (I use trunk as well but not this grid).

wp

  • Hero Member
  • *****
  • Posts: 11916
Re: grids.pas and horz scroll
« Reply #2 on: November 29, 2016, 11:12:21 am »
I also wonder why horizontal scrolling should occur with PgUp, PgDown, LineUp and LineDown keys. Probably a copy and paste error.

Ondrej Pokorny

  • Full Member
  • ***
  • Posts: 220
Re: grids.pas and horz scroll
« Reply #3 on: November 29, 2016, 12:08:49 pm »
Fixed in r53476.

 

TinyPortal © 2005-2018