Sign in Join

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

Mailing lists / lazarus / 2010-12

UI Design Question

9 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

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

Leonardo M. Ramé

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?

Reply by email

Paul Ishenin
to Leonardo M. Ramé
Leonardo M. Ram? wrote 6 lines
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?

We do so.

Best regards,
Paul Ishenin

Reply by email

Birger Jansen
to Paul Ishenin
Show quoted text 5 lines
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?

I would register the possible actions for each VIEW in the same unit as where the view is defined. When the view is activated / opened the list containing the possible actions (you could use an actionlist for that) is parsed and in the main toolbar the right buttons are added (after the old buttons are deleted). I would do as much as possible in code instead of using designers so it is easier to maintain in SVN.

No need for a separate frame.

This is what we do in Delphi, it should also be possible with Lazarus.

Groet,
Birger

Reply by email

Unknown author
to Leonardo M. Ramé: Hi, this is more an application design question than a Lazarus related one, but, since…
Leonardo M. Ram? wrote 19 lines
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.

Michael.

Reply by email

Leonardo M. Ramé
to Birger Jansen: I would register the possible actions for each VIEW in the same unit as where the view is…
Birger Jansen wrote 21 lines
>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? I would register the possible actions for each VIEW in the same unit as where the view is defined. When the view is activated / opened the list containing the possible actions (you could use an actionlist for that) is parsed and in the main toolbar the right buttons are added (after the old buttons are deleted). I would do as much as possible in code instead of using designers so it is easier to maintain in SVN. No need for a separate frame. This is what we do in Delphi, it should also be possible with Lazarus. Groet, Birger -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

I like the idea, the only drawback I see is that I'll have to write by hand the code I should create with the designer, but I like it.

Reply by email

Birger Jansen
to Leonardo M. Ramé
I like the idea, the only drawback I see is that I'll have to write by hand the code I should create with the designer, but I like it.

Yes, you will need to write (create?) some more code by hand. But you know you will never ever miss something because it was set in some far-far-away 3-levels deep property of a control. Which we find especially usefull when working with >1 person on a project!

Kind regards,
Birger Jansen

Reply by email

Leonardo M. Ramé
to Felipe Monteiro de Carvalho: If your views don't share any components I would use the new TNotebook which will appear…
Felipe Monteiro de Carvalho wrote 14 lines
On Tue, Dec 14, 2010 at 6:49 PM, Leonardo M. Ram? wrote: > How would you architect this? If your views don't share any components I would use the new TNotebook which will appear after the next release. That's what I use. -- Felipe Monteiro de Carvalho -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Really? I thought that TNotebook was more or less like TPageControl.

Reply by email

Piffle the Cat
to Leonardo M. Ramé

Hi All,

Leonardo M. Ram? wrote 6 lines
On 2010-12-15 10:22:35 +0100, Felipe Monteiro de Carvalho wrote: > On Tue, Dec 14, 2010 at 6:49 PM, Leonardo M. Ram? wrote: > > How would you architect this? > > If your views don't share any components I would use the new TNotebook > which will appear after the next release. That's what I use.

I would love to see multiple solutions for this, as sample applications.

Could someone please upload some zipped solutions to http://HotFile.com ?

PEW
http://pewink.info

Show quoted text 12 lines
> > -- > Felipe Monteiro de Carvalho > > -- > _______________________________________________ > Lazarus mailing list > > http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus Really? I thought that TNotebook was more or less like TPageControl.

Reply by email