Forum > Databases

DBGrid - MinWidth,MaxWidth,SetPriority how it works?

(1/1)

hamacker:
Hi ALL,
I am Delphi dev, and I test Lazarus with 2.3(non-stable), and just testing.
But I found MinWidth,MaxWidth,SetPriority in DBGrid Columns in Lazarus 2.3 and I resolv to test setting min, max e priority for columns and ajust dbgrid options with dgAutoSizeColumns, 5 columns in DBGrid and only 1 (description field) to enlarge when I resize screen and all others column stay in maxwidth column property. It's fantastic!

And now I resolv to create a Project, but of curse, I download Lazarus 2.0.12.
Setting dbgrid columns min/max widths and setpriority and....not running, all columns are growing at the same width, Why?
What I doing wrong?
I put correct dbgrid lazarus 2.3, and my try in lazarus 2.0.12 and 2.2.

jesusr:

--- Quote from: hamacker on November 05, 2021, 03:33:23 am ---And now I resolv to create a Project, but of curse, I download Lazarus 2.0.12.
Setting dbgrid columns min/max widths and setpriority and....not running, all columns are growing at the same width, Why?
What I doing wrong?
I put correct dbgrid lazarus 2.3, and my try in lazarus 2.0.12 and 2.2.

--- End quote ---

There is nothing wrong, MinWidth and MaxWidth were only recently implemented in Lazarus development version. This is a new feature (although perhaps some will say it's a bug fix :) that needs a bit testing in order to be included in the final 2.2 release.

2.2 RC2 (once released) is the recommended version as it will be closer to the next 2.2 release, but If you really need this feature in some other versions, try to apply the patches: 7b9589dc613fafd4cabc4298bdb23bc2749afbd3 and 239be664c020ee38ab3747c94df5afed6eb09280 (and if you are using fpc 3.0.4 976c56ef7cfd1ceacbb39d445a2bf7a793f42bfa and 19530e05481edb66fca27f6e417b98442dce694a) and it should work.

hamacker:
Please litte patience with a newbie like me, how can I apply this patch?
This hash is familiar like git, but I know that Lazarus/FPC use svn, and I am not famiiiar with svn.
I but I really really really want this feature, it´s feature killer!

jesusr:
The given hashes are to be used with the lazarus gitlab repository (lazarus is using git now) this way:

If you are using a FPC version higher than 3.0.4 you need the following two patches:

https://gitlab.com/freepascal.org/lazarus/lazarus/-/7b9589dc613fafd4cabc4298bdb23bc2749afbd3
https://gitlab.com/freepascal.org/lazarus/lazarus/-/239be664c020ee38ab3747c94df5afed6eb09280

with a FPC 3.0.4 you need the following additional patches, if you want to be sure, apply all.

https://gitlab.com/freepascal.org/lazarus/lazarus/-/976c56ef7cfd1ceacbb39d445a2bf7a793f42bfa
https://gitlab.com/freepascal.org/lazarus/lazarus/-/19530e05481edb66fca27f6e417b98442dce694a


You need to apply those patches in the given order, follow the next instructions:
(it doesn't matter if you downloaded Lazarus from git, SVN, Fpcupdeluxe or some installer)

1. Make a copy of your lcl/grids.pas file for backup
2. Download the patch by going to the commit url given above.
  * Once in the commit page, choose: Options->Plain Diff
    a file hash.diff will be downloaded
3. Copy/move the hash.diff file to your lazarus root directory (there you will find the lcl directory)
4. Apply the patch:
   in a terminal window type: patch --dry-run -p1 < hash.diff
   if this command succeed, repeat without the --dry-run parameter.
   
   you need the patch executable correspoding to you platform, I have it since decades, forgot from
   where I got it
   
5. Repeat from step 2 for each patch that you need.

hamacker:
Thanks for your complete help, You´re a nice guy ;-)
But error 404 when download this patches.
but I hope not need this patch in 2.2 final.
It´s nice that FPC/Lzarus  to be use git now.

Navigation

[0] Message Index

Go to full version