Recent

Author Topic: LCL Component for grouped information  (Read 5184 times)

dubst3pp4

  • Jr. Member
  • **
  • Posts: 86
  • Retro computing ~ GNU/Linux
    • me on Mastodon
LCL Component for grouped information
« on: December 12, 2017, 09:01:13 am »
Hello,
I'm not very experienced with the use of the LCL components, but I want to realize a list of grouped informations like in the screenshot attached (this is from VirtualBox). Is this possible with some of the LCL components? Maybe with the TListView?

Is there somewhere a graphical overview of the LCL components, to get a first impression of what components are possible?

Thanks for any hints :-)
Marc
Jabber: xmpp:marc.hanisch@member.fsf.org -- Support the Free Software Foundation: https://my.fsf.org/donate

Handoko

  • Hero Member
  • *****
  • Posts: 5129
  • My goal: build my own game engine using Lazarus
Re: LCL Component for grouped information
« Reply #1 on: December 12, 2017, 09:08:45 am »
« Last Edit: December 12, 2017, 09:10:57 am by Handoko »

dubst3pp4

  • Jr. Member
  • **
  • Posts: 86
  • Retro computing ~ GNU/Linux
    • me on Mastodon
Re: LCL Component for grouped information
« Reply #2 on: December 12, 2017, 09:16:52 am »
Thanks Handoko, TECAccordion looks very interesting, but I need something that can be displayed in list. It is possible that I have more than 20 of such grouped items in the list. I've attached another example, but the first screenshot is more of the type I'm searching for...
Jabber: xmpp:marc.hanisch@member.fsf.org -- Support the Free Software Foundation: https://my.fsf.org/donate

Handoko

  • Hero Member
  • *****
  • Posts: 5129
  • My goal: build my own game engine using Lazarus
Re: LCL Component for grouped information
« Reply #3 on: December 12, 2017, 09:33:12 am »
Maybe VirtualTreeView, it looks good:
http://wiki.freepascal.org/VirtualTreeview

dubst3pp4

  • Jr. Member
  • **
  • Posts: 86
  • Retro computing ~ GNU/Linux
    • me on Mastodon
Re: LCL Component for grouped information
« Reply #4 on: December 12, 2017, 09:37:43 am »
Thanks, VirtualTreeView looks very promising! :D
Jabber: xmpp:marc.hanisch@member.fsf.org -- Support the Free Software Foundation: https://my.fsf.org/donate

wp

  • Hero Member
  • *****
  • Posts: 11853
Re: LCL Component for grouped information
« Reply #5 on: December 12, 2017, 06:11:51 pm »
Why not use a plain old scrollbox to which you add frames? The master frame can be designed visually.
« Last Edit: December 12, 2017, 06:13:52 pm by wp »

jamie

  • Hero Member
  • *****
  • Posts: 6090
Re: LCL Component for grouped information
« Reply #6 on: December 13, 2017, 01:00:08 am »
I would use a OwnerDraw List box... Variable type to customize the heights

The only true wisdom is knowing you know nothing

dubst3pp4

  • Jr. Member
  • **
  • Posts: 86
  • Retro computing ~ GNU/Linux
    • me on Mastodon
Re: LCL Component for grouped information
« Reply #7 on: December 13, 2017, 05:56:42 am »
@wp wow, that really looks nice! When you build the list out of the data, do you add an instance of the masterframe for each item to the scrollbox? Sorry I never worked with frames...
« Last Edit: December 13, 2017, 06:03:28 am by dubst3pp4 »
Jabber: xmpp:marc.hanisch@member.fsf.org -- Support the Free Software Foundation: https://my.fsf.org/donate

wp

  • Hero Member
  • *****
  • Posts: 11853
Re: LCL Component for grouped information
« Reply #8 on: December 13, 2017, 10:20:22 am »
Look at the code of the demo. It adds copies of the "master frame" at run-time and sets its properties as needed. The "master frame" itself is designed like a form after selecting "File"> "New" > "Module" > "Frame"

dubst3pp4

  • Jr. Member
  • **
  • Posts: 86
  • Retro computing ~ GNU/Linux
    • me on Mastodon
Re: LCL Component for grouped information
« Reply #9 on: December 13, 2017, 10:29:44 am »
@wp oh sorry, did not see the attached project files! Many thanks! :-)
Jabber: xmpp:marc.hanisch@member.fsf.org -- Support the Free Software Foundation: https://my.fsf.org/donate

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: LCL Component for grouped information
« Reply #10 on: December 13, 2017, 11:52:40 am »
Note that you can write wp's excellent scheme using a less verbose and repetitive syntax for the setup code.
See the attached adapted project.

tudi_x

  • Hero Member
  • *****
  • Posts: 532
Re: LCL Component for grouped information
« Reply #11 on: December 18, 2017, 04:16:34 pm »
thank you for the example.
i am just using it and would need to open an update form with fields on the button click.

still cannot seem to show it in front of form, it is embedded in frame.
please advise how i could create a modal form by pressing the button in frame that is in front of main form.
(or should i just send an event to main form and open it from there?)
« Last Edit: December 18, 2017, 04:22:00 pm by tudi_x »
Lazarus 2.0.2 64b on Debian LXDE 10

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: LCL Component for grouped information
« Reply #12 on: December 18, 2017, 07:09:29 pm »
Attached is a skeleton example you can adapt to your needs.

 

TinyPortal © 2005-2018