card view lazarus / 21-General ---------------------------------------------------------------------- alaa123456789 · 2022-06-12 13:14 hi all how could we do such this views in lazarus ? thanks ---------------------------------------------------------------------- Handoko · 2022-06-12 13:40 If performance is not a priority, I would use TPanel and its Align feature. Not exactly what you're looking for but the demo Colorful Panels in the User Interface section in the link below should give you the basic idea: https://wiki.freepascal.org/Portal:HowTo_Demos#User_Interface You can combine TPanels. By puting panels inside panels, you can have grouping effect similar to the picture you showed. But if you want to have more features maybe interactive drag and drop, or maybe performance is important, you have to write your own component from scratch using a good graphics library. ---------------------------------------------------------------------- alaa123456789 · 2022-06-12 14:46 thanks handoko for quick reply yes i want this cards to loaded in runtime not in design time and each card has to have button to do functions thanks ---------------------------------------------------------------------- wp · 2022-06-12 15:33 I don't think that there is a reay-made component for this, and you have to do some programming yourself. Your design consists of repeating elements: the white boxes ("cards"), and the gray vertical stripes constaining the white boxes ("card stacks"). they always have the same structure. Therefore I'd recommend to used a frame for each of them. This way you already have pinned the layout of each element and do not have to play with dozens of pictures and labels in the main form. Have a look at the attached demo. It is neither complete nor optimized in any way but it should give you an idea how the concept of frames could help you to separate the parts of the layout. ---------------------------------------------------------------------- MarkMLl · 2022-06-12 15:47 Quote from: alaa123456789 on June 12, 2022, 04:46:37 pmthanks handoko for quick reply yes i want this cards to loaded in runtime not in design time and each card has to have button to do functions I think you can do that without wandering too far from the standard Lazarus IDE and LCL facilities. Design the prototype card as a TFrame, with the various fields populated from an XML or JSON etc. file, or from a database, or from a scripting language which would put you half-way to having a Lotus Notes replacement. At runtime, instantiate multiple cards with appropriate parentage and position. The major gotcha when using frames is that you should only set properties/events in the frame you're designing, not in an instance that you've placed manually on a form while developing. I've not done quite the sort of thing that you're looking at, but I have used dynamically-created frame instances on notebook pages to set up a sequence of rules for filtering data so I know that the basic concept works. MarkMLl ---------------------------------------------------------------------- jamie · 2022-06-12 16:25 I noticed there is some variations of sizes here and I have done such reporting tools using TListBox in Variable owner list boxes where the height of the items are variable and background color is common.  The items of each can be obtained from another list elsewhere that contains the complete details for each item to be displayed.  The stgringList that is housed in the TListbox can be used to point to the object and header titles etc..  The Tlistbox can be resized as needed of course..  Also, you have the TVirtualstringTree that is also another option which is a very powerful option, Too!.  Lots of options before thinking of a TFrame. ---------------------------------------------------------------------- alaa123456789 · 2022-06-12 18:29 Quote from: wp on June 12, 2022, 05:33:33 pmHave a look at the attached demo. It is neither complete nor optimized in any way but it should give you an idea how the concept of frames could help you to separate the parts of the layout. thanks so much wp , very useful example , is it possible to have this frame in scrollbox and each card has buttons with function for each button? thanks ---------------------------------------------------------------------- MarkMLl · 2022-06-12 20:13 Quote from: alaa123456789 on June 12, 2022, 08:29:23 pmthanks so much wp , very useful example , is it possible to have this frame in scrollbox and each card has buttons with function for each button? thanks Broadly speaking, a frame can go anywhere a panel can. I'm sure you're aware of this, but Jamie makes the valid point that you need an appropriate underlying data structure. Happens ;-) MarkMLl ---------------------------------------------------------------------- alaa123456789 · 2022-06-14 17:38 Quote from: MarkMLl on June 12, 2022, 10:13:20 pm Broadly speaking, a frame can go anywhere a panel can. I'm sure you're aware of this, but Jamie makes the valid point that you need an appropriate underlying data structure. Happens ;-) MarkMLl could we have something in code thanks