[Lazarus] UI Design Question

michael.vancanneyt at wisa.be michael.vancanneyt at wisa.be
Wed Dec 15 10:15:53 CET 2010

On Tue, 14 Dec 2010, Leonardo M. Ramé wrote:

> Hi, this is more an application design question than a Lazarus related
> one, but, since I'm developing with Lazarus, I'll ask here :-).
> My app has different ways to show medical data, I call each a VIEW, that
> let the user do different things with the data. Deppending on the
> selected VIEW, the user will see different toolbars letting him to
> interact with the data. Each view is implemented by using the "abstract
> factory" design pattern.
> Now, I'm looking for some ideas on how to implement the toolbars or
> toolboxes for each view.
> Currently I have three toolbars that I show/hide for each selected VIEW,
> but I don't like this approach, the more toolbars I add, the more messed
> my UI gets. To solve this, I'm thinking on creating many TFrames containing one
> toolbar each (and one TActionList also), and create an instance of the needed
> one when a VIEW is activated.
> How would you architect this?

If you are using the factory pattern, why not create your toolbars on the fly
at runtime ?
I do so. I register all actions, in groups, and each group represents a "toolbar".
In your case, each group would be a view. When a view is selected, you
create the buttons on the toolbar.


More information about the Lazarus mailing list