Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-02

Custom panel-like TListBox list item

6 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Charl van Jaarsveldt

Hi All,
It's been a while, so forgive me if I am ignorant. :-) I want to have a listbox where the items are not just plain lines of text, but instead panels with two or three controls on. Is there something out there that can do this? Do I have to create my own custom control, or can I somehow create a frame for the panel and draw the frame in the list. That would be nice.

Thank you.

"See first, think later, then test. But always see first. Otherwise you will only see what you were expecting. Most scientists forget that." - Douglas Adams -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20100223/f8095dce/attachment.html>
Mattias Gaertner
to Charl van Jaarsveldt
Show quoted text 7 lines
Hi All, It's been a while, so forgive me if I am ignorant. :-) I want to have a listbox where the items are not just plain lines of text, but instead panels with two or three controls on. Is there something out there that can do this? Do I have to create my own custom control, or can I somehow create a frame for the panel and draw the frame in the list. That would be nice.

Why not use a TPanel and put some panels with Align=alTop into it?

Mattias

Charl van Jaarsveldt
to Mattias Gaertner

I guess I can do that, but I really want the capabilities of a list - I am representing a list of data after all. If I didn't want to be fancy I would probably just use a grid to display the various bits of information of each record I want to show. :-)

On Thu, Feb 25, 2010 at 1:28 PM, Mattias Gaertner <

Show quoted text 26 lines
wrote: On Tue, 23 Feb 2010 21:03:33 -0500 Charl van Jaarsveldt wrote: > Hi All, > It's been a while, so forgive me if I am ignorant. :-) > I want to have a listbox where the items are not just plain lines of text, > but instead panels with two or three controls on. Is there something out > there that can do this? Do I have to create my own custom control, or can I > somehow create a frame for the panel and draw the frame in the list. That > would be nice. Why not use a TPanel and put some panels with Align=alTop into it? Mattias -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
"See first, think later, then test. But always see first. Otherwise you will only see what you were expecting. Most scientists forget that." - Douglas Adams -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20100225/1ca95e1b/attachment.html>
Charl van Jaarsveldt
to Mattias Gaertner

For example the list of emails in Outlook when you have the side-by-side layout. It will show you who its from and the date at the top of the line - left-aligned and right-aligned respectively, and the subject at the bottom of the line. I find it a nifty idea to save some horizontal space. Here is another example in a nice personal finance program called Buddi: http://buddi.digitalcave.ca/images/screenshots/Transactions%20%28OS%20X%29.png

In Java Swing it is relatively easy: you create a cell renderer and tell the list to use it to render the cells, so you create the renderer as a panel with its own controls and layout, but Swing is much more model-view-controller based. I was thinking the OnCustomDraw event (something like that) can be used, but I have never used it before.

Charl

On Fri, Feb 26, 2010 at 3:56 AM, Mattias Gaertner <

Show quoted text 17 lines
wrote: On Thu, 25 Feb 2010 20:38:36 -0500 Charl van Jaarsveldt wrote: > I guess I can do that, but I really want the capabilities of a list - For example? Mattias -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
"See first, think later, then test. But always see first. Otherwise you will only see what you were expecting. Most scientists forget that." - Douglas Adams -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20100228/805e42e0/attachment.html>
Mattias Gaertner
to Charl van Jaarsveldt
Show quoted text 12 lines
For example the list of emails in Outlook when you have the side-by-side layout. It will show you who its from and the date at the top of the line - left-aligned and right-aligned respectively, and the subject at the bottom of the line. I find it a nifty idea to save some horizontal space. Here is another example in a nice personal finance program called Buddi: http://buddi.digitalcave.ca/images/screenshots/Transactions%20%28OS%20X%29.png In Java Swing it is relatively easy: you create a cell renderer and tell the list to use it to render the cells, so you create the renderer as a panel with its own controls and layout, but Swing is much more model-view-controller based. I was thinking the OnCustomDraw event (something like that) can be used, but I have never used it before.

Yes, I guess that would be the easiest way.

Mattias