[lazarus] Dynamic GUI

A.J. Venter ajventer at direqlearn.org
Tue May 6 10:29:16 EDT 2003


I am afraid none of those options would work here.

I want to deliberately prevent the use of hints in this program.
The reason is that it is intended to be part of a system to create a
Linux Application menu for new users. If a user chooses say "Graphics"
from the main menu, a window should come up informing him of the
installed Graphics Programs and explaining what each is, and the
strengths and weaknesses.
For example, Gimp if you want to edit graphics, FLphoto to view large
collections of images etc.

I tend to agree that Tbitbutton would be ideal for the icon and the
name, but can tbitbuttons be loaded from file paths ?
Remember I do not know until runtime what entries will need to be
displayed, and at that time must basically generate the GUI dynamically
based on the database for this category.

Obviously that rules out RAD and the GUI will need to be coded by hand.
Lets asume that a procedure to show each entry is saved in some unit.
The main program would have to do something like this:

While mysql_row = mysql_fetch_row(mysql_result) do
	ShowEntry(mysql_row[1],mysql_row[2],mysql_row[3],mysql_row[4]);


What do you think ?

A.J.
On Tue, 2003-05-06 at 16:35, Shane Miller wrote:
> A.J.
> 
>   One option you could do is create a TBitbtn for each using the Icon as
> the glyph and the NAME as the text.  Then on a mouseover display the
> Description as a hint.  This would allow you to put many "commands" in a
> small area because the buttons would be pretty small.
> 
> Otherwise you could use a Listview with the Icon and Text displayed and
> the Description again being the hint.
> 
> A TTreeView would work too.  Expanding the item would display the
> description.
> 
> If you categorized the commands then you could list them by category on
> separate tabs which would allow you to break them into smaller parts and
> make them easier to display.
> 
> Just some thoughts
> Shane
> 
> 
> -----Original Message-----
> From: A.J. Venter [mailto:ajventer at direqlearn.org] 
> Sent: Tuesday, May 06, 2003 8:12 AM
> To: lazarus
> Subject: [lazarus] Dynamic GUI
> 
> Hi,
> A program I am working on, will need to generate most of it's GUI based
> on a commandline argument.
> With this argument, a search will be done inside an SQL database
> returning records with three fields:
> Command, Name, Description, Icon
> 
> Command, Name and Icon are single line text, the others are multiline
> text.
> 
> What the program then needs to do is to take all the results and display
> A tabular structure:
> _________________________
> |     |Name		 |
> |Icon |Description       |
> |     |            [Run] |
> -------------------------
> 
> In the above example, Icon must be replaced with an image. The path to
> this image will be the text from the icon field. Name and description
> need merely be displayed.
> 
> [Run] Is a button, which, when executed, will execute command, and close
> the window.
> If possible, clicking on Icon should perform the same function as [Run].
> 
> I am curious as to the best way to implement Icon, and the display of
> Name and Description. Keeping in mind that there may well be several of
> these tables to display, vertically. The implication being that the
> window should resize itself according to the size of the contents, and
> scroll if it can no longer fit them all.
> 
> I have not yet started coding, so I can still change anything (this is
> still pure theory) according to suggestions. 
> 
> I would appreciate any help.
> 
> A.J.
-- 
Story of my life: "Semper in excretum, set alta variant"
A.J. Venter
DireqLearn Linux Guru






More information about the Lazarus mailing list