Recent

Author Topic: EC Accordion  (Read 1244 times)

pcurtis

  • Hero Member
  • *****
  • Posts: 951
EC Accordion
« on: August 03, 2020, 12:26:29 am »
Hi All,

How to handle the situation when I have too many items to display?
Windows 10 20H2
Laz 2.2.0
FPC 3.2.2

Blaazen

  • Hero Member
  • *****
  • Posts: 3237
  • POKE 54296,15
    • Eye-Candy Controls
Re: EC Accordion
« Reply #1 on: August 03, 2020, 01:37:52 am »
It's quite simple component without scrollbars so you cannot do much. You can increase parent Form.Height or decrease Accordion.ItemHeight.
If you need so many items with multiple nesting then you should consider to use TTreeView.

Your last chance is to put ECAccordion on TScrollBox but I have no clue if it will work (I never tried it).
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/

dsiders

  • Hero Member
  • *****
  • Posts: 1052
Re: EC Accordion
« Reply #2 on: August 03, 2020, 01:43:32 am »
Hi All,

How to handle the situation when I have too many items to display?

You need to place a container on the accordion item which provides a scrollable work area, and align it to the client area in the accordion item. Which one depends entirely on the content you intend to put there. TListBox, TScrollBox, TFrame, TStringGrid, TDBGrid, TVirtualTree, etc.

[EDIT]

Blaazen was faster.
Preview Lazarus 3.99 documentation at: https://dsiders.gitlab.io/lazdocsnext

pcurtis

  • Hero Member
  • *****
  • Posts: 951
Re: EC Accordion
« Reply #3 on: August 03, 2020, 04:49:27 am »
OK, I have decided to page the number of item displayed. It seems the easiest solution.

The next problem is the visible property.

When I add my items the control flickers. I thought I could do something like

Code: Pascal  [Select][+][-]
  1. ECAccordion1.ClearItems;
  2. ECAccordion1.BeginUpdate;
  3. .... Make my changes
  4. ECAccordion1.EndUpdate;
  5.  

but that doesn't work as expected.
So then I would try this

Code: Pascal  [Select][+][-]
  1. ECAccordion1.Visible:=false;
  2. ECAccordion1.ClearItems;
  3. .... Make my changes
  4. ECAccordion1.Visible:=true;
  5.  

but the control automatically becomes visible when I programmatically add an item.

Am I missing something? Whar am I doing wrong?
« Last Edit: August 03, 2020, 09:51:38 am by pcurtis »
Windows 10 20H2
Laz 2.2.0
FPC 3.2.2

pcurtis

  • Hero Member
  • *****
  • Posts: 951
Re: EC Accordion
« Reply #4 on: August 03, 2020, 07:15:43 am »
And one last thing

How to collapse all items?

Thanks for your help.
Windows 10 20H2
Laz 2.2.0
FPC 3.2.2

dsiders

  • Hero Member
  • *****
  • Posts: 1052
Re: EC Accordion
« Reply #5 on: August 03, 2020, 09:17:37 am »
And one last thing

How to collapse all items?

Thanks for your help.

Code: Pascal  [Select][+][-]
  1. TECAccordion.ItemIndex := -1;
Preview Lazarus 3.99 documentation at: https://dsiders.gitlab.io/lazdocsnext

pcurtis

  • Hero Member
  • *****
  • Posts: 951
Re: EC Accordion
« Reply #6 on: August 03, 2020, 09:40:36 am »
@dsiders Cheers
Windows 10 20H2
Laz 2.2.0
FPC 3.2.2

 

TinyPortal © 2005-2018