Recent

Author Topic: StringGrid scrolling  (Read 3257 times)

taazz

  • Hero Member
  • *****
  • Posts: 5368
StringGrid scrolling
« on: April 12, 2018, 05:30:13 am »
See attached gif. As you can see for some reason the grid's top is scrolled outside the client area and can't be scrolled back in. I tried a couple ways including autsizing columns, resizing the grid it self (using anchors) to no avail. Is this something known a regresion of some sorts?

Tried on lazarus 1.8.2 and I'm of to try it on 1.4 too.

Hmm no animation for some reason try this one
(https://ibb.co/hnqtBc)
« Last Edit: April 12, 2018, 05:36:00 am by taazz »
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

ASerge

  • Hero Member
  • *****
  • Posts: 2222
Re: StringGrid scrolling
« Reply #1 on: April 12, 2018, 05:11:43 pm »
Hmm no animation for some reason try this one
How about a simple project?

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: StringGrid scrolling
« Reply #2 on: April 12, 2018, 05:18:46 pm »
Sure! Find attached the project I used to create the gif above.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

lainz

  • Hero Member
  • *****
  • Posts: 4460
    • https://lainz.github.io/
Re: StringGrid scrolling
« Reply #3 on: April 12, 2018, 05:52:24 pm »
Sure! Find attached the project I used to create the gif above.

Align the toolbar to bottom, as you can see it get's sized and positioned fine, that your code does:

Code: Pascal  [Select][+][-]
  1. aGrid.Left  := 5;
  2.   aGrid.Top   := 5;
  3.   aGrid.Width := 300;
  4.   aGrid.Height:= 120;

Then you need to do (With toolbar at top)

Code: Pascal  [Select][+][-]
  1. aGrid.Top   := form1.ToolBar1.Height + 5;
« Last Edit: April 12, 2018, 05:54:18 pm by lainz »

ASerge

  • Hero Member
  • *****
  • Posts: 2222
Re: StringGrid scrolling
« Reply #4 on: April 12, 2018, 05:55:34 pm »
Toolbar with Align = alTop. Grid Align = alNone.
aGrid.Top  := 5. As a result, grid is located under the ToolBar. Part of the scrollbar is hidden under the ToolBar.

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: StringGrid scrolling
« Reply #5 on: April 12, 2018, 06:04:40 pm »
Yeah I see it now its one of those days I guess  :-[

Thank you everyone for the feedback
 
« Last Edit: April 12, 2018, 06:07:22 pm by taazz »
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

PatBayford

  • Full Member
  • ***
  • Posts: 125
Re: StringGrid scrolling
« Reply #6 on: April 24, 2018, 02:35:27 am »
I believe this to be an artefact caused by the behaviour of TToolBar and TCoolBar components, which appear to NOT fully comply with the general Align rules.
I have had similar problems in the past with other combinations employing these components - never been able to decide if the fault is with the Windows API implementation, or with the Pascal code!
Lazarus 1.8.0 FPC 3.0.2 SVN 56594 Windows 10 64bit (i386-win32-win32/win64)

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1106
Re: StringGrid scrolling
« Reply #7 on: April 24, 2018, 07:21:26 am »
Form this thread, I have searched open bugs about ToolBar, CoolBar, StringGrid, and scrolling and could not find something specific, but found some bugs that might be similiar:

0016014: TStringGrid - ScrollBar is not displayed.
https://bugs.freepascal.org/view.php?id=16014

0031268: StringGrid Painting issue
https://bugs.freepascal.org/view.php?id=31268

0022070: Draw partially visible row in DBGrid
https://bugs.freepascal.org/view.php?id=22070

0031688: lcl: Toolbar AutoSize adjustment works improperly
https://bugs.freepascal.org/view.php?id=31688

0025550: Anchors do not work when hiding TToolBar
https://bugs.freepascal.org/view.php?id=25550

0023051: On Linux every report except 1-st is printed cropped to top left rectangle
https://bugs.freepascal.org/view.php?id=23051

0014428: Patch for changing panels/speedbuttons to toolbars/toolbuttons and objectinspector docking
https://bugs.freepascal.org/view.php?id=14428

If nothing matches, should the information on this thread be transformed in a bug report?

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: StringGrid scrolling
« Reply #8 on: April 24, 2018, 07:26:39 am »
there was no bug. Positioning the grid at top 5 I was placing it behind the toolbar. It was an over-site on my part.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

 

TinyPortal © 2005-2018