Recent

Author Topic: [SOLVED] Grid colcount vs columns.count  (Read 5427 times)

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
[SOLVED] Grid colcount vs columns.count
« on: August 28, 2012, 04:18:42 pm »
I've edited the wiki grids article to be more clear on the difference between colcount and columns.count:
http://wiki.lazarus.freepascal.org/Grids_Reference_Page#property_Columns

However, I think the descriptions must surely be reversed: having Columns.Count represent the number of custom Columns seems to make sense; ColCount presumably only contains the count of normal columns.

Could a Lazarus/grids guru confirm/correct this if necessary?

Thanks,
BigChimp
« Last Edit: August 29, 2012, 08:57:09 am by BigChimp »
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

ludob

  • Hero Member
  • *****
  • Posts: 1173
Re: Grid colcount vs columns.count
« Reply #1 on: August 28, 2012, 04:42:12 pm »
AFAIK when using columns TCustomGrid.ColCount = TCustomGrid.FixedCols + TCustomGrid.Columns.Count

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Grid colcount vs columns.count
« Reply #2 on: August 28, 2012, 04:47:29 pm »
From the article - some selective quoting:
Quote
Lazarus include the property '''columns''' [..] used to add custom columns. Custom columns are fixed column objects that '''replace''' the standard non-fixed grid columns.
So there are the following types of column:
- normal columns: non-fixed
- grid.columns:a sort of fixed column object that is custom
- grid.fixedcols: presumably some other kind of fixed column
Does this seem about right?
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Blaazen

  • Hero Member
  • *****
  • Posts: 3241
  • POKE 54296,15
    • Eye-Candy Controls
Re: Grid colcount vs columns.count
« Reply #3 on: August 28, 2012, 04:53:15 pm »
Quote
So there are the following types of column:
- normal columns: non-fixed
- grid.columns:a sort of fixed column object that is custom
- grid.fixedcols: presumably some other kind of fixed column
Does this seem about right?

Yes, but they are never all three at the same time.
You can have fixed+normal columns
OR fixed + grid.columns
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

ludob

  • Hero Member
  • *****
  • Posts: 1173
Re: Grid colcount vs columns.count
« Reply #4 on: August 28, 2012, 05:01:08 pm »
The easiest representation is:
- fixed cols: cols that can not be scrolled
- scrollable cols:
    - managed by TCustomGrid: number of cols=colcount - fixedcols
    - managed by user with columns: number of cols = columns.count

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Grid colcount vs columns.count
« Reply #5 on: August 28, 2012, 05:05:20 pm »
Thanks guys... pls feel free to update the wiki if you want to.
Edit: actually: could you please have a look and correct where necessary? Thanks.

The depiction of tcustomgrid.column as a "fixed column object" is a bit misleading then... it is a fixed object that represents a column but can be scrollable :)
« Last Edit: August 28, 2012, 05:18:24 pm by BigChimp »
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

jesusr

  • Sr. Member
  • ****
  • Posts: 499
Re: Grid colcount vs columns.count
« Reply #6 on: August 28, 2012, 09:50:37 pm »
I modified the text, please check and comment if anything should be changed.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Grid colcount vs columns.count
« Reply #7 on: August 29, 2012, 08:56:58 am »
Thanks Jesus, at first glance that looks very clear!
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

 

TinyPortal © 2005-2018