BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Layout Managers

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OO design
View previous topic :: View next topic  
Author Message
Bryan Crotaz
Guest





PostPosted: Mon Dec 18, 2006 10:04 pm    Post subject: Layout Managers Reply with quote



Has anyone seen a Delphi implementation of a Java style Layout Manager? I'm
looking for an OO library to save having to write one from scratch. Ideally
it'll have classes for containers, grids, tables etc with padding and
collapsible margin support.

Bryan
Back to top
Peter Below (TeamB)
Guest





PostPosted: Tue Dec 19, 2006 12:38 am    Post subject: Re: Layout Managers Reply with quote



Bryan Crotaz wrote:

Quote:
Has anyone seen a Delphi implementation of a Java style Layout
Manager? I'm looking for an OO library to save having to write one
from scratch. Ideally it'll have classes for containers, grids,
tables etc with padding and collapsible margin support.

Bryan

BDS 4.0 goes a large part of the way, since it introduced a Padding
(extra margin between border and client area) property for all
containers (panels, forms, frames) and a Margin property for a
controls, as well as AlignWithMargin and the classic Align for nearly
ever control type. It also has a TFlowPanel and TGridPanel class for
semiautomatic layout. The two classes have a few problems, but they are
servicable.

--
Peter Below (TeamB)
Don't be a vampire (http://slash7.com/pages/vampires),
use the newsgroup archives :
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be
Back to top
Bryan Crotaz
Guest





PostPosted: Tue Dec 19, 2006 5:56 am    Post subject: Re: Layout Managers Reply with quote



"Peter Below (TeamB)" <none> wrote in message
news:xn0ev4f5o2feum004 (AT) newsgroups (DOT) borland.com...
Quote:
Bryan Crotaz wrote:

Has anyone seen a Delphi implementation of a Java style Layout
Manager? I'm looking for an OO library to save having to write one
from scratch. Ideally it'll have classes for containers, grids,
tables etc with padding and collapsible margin support.

Bryan

BDS 4.0 goes a large part of the way, since it introduced a Padding
(extra margin between border and client area) property for all
containers (panels, forms, frames) and a Margin property for a
controls, as well as AlignWithMargin and the classic Align for nearly
ever control type. It also has a TFlowPanel and TGridPanel class for
semiautomatic layout. The two classes have a few problems, but they are
servicable.

I have my own rendering system. Do you know how easy it would be to split
the layout management code from the TWinControl descendants? I can
sometimes have several thousand of these on screen, and I don't want the
overhead of window handles.

I haven't done any VCL work in BDS 4.0 - is the layout code inside the win
control class, or is it separated into its own class heirachy a la Java?

Bryan
Back to top
Jarle Stabell
Guest





PostPosted: Tue Dec 19, 2006 6:41 am    Post subject: Re: Layout Managers Reply with quote

Bryan Crotaz wrote:
Quote:
"Peter Below (TeamB)" <none> wrote in message
news:xn0ev4f5o2feum004 (AT) newsgroups (DOT) borland.com...
Bryan Crotaz wrote:

Has anyone seen a Delphi implementation of a Java style Layout
Manager? I'm looking for an OO library to save having to write one
from scratch. Ideally it'll have classes for containers, grids,
tables etc with padding and collapsible margin support.

Bryan

BDS 4.0 goes a large part of the way, since it introduced a Padding
(extra margin between border and client area) property for all
containers (panels, forms, frames) and a Margin property for a
controls, as well as AlignWithMargin and the classic Align for nearly
ever control type. It also has a TFlowPanel and TGridPanel class for
semiautomatic layout. The two classes have a few problems, but they
are servicable.

I have my own rendering system. Do you know how easy it would be to
split the layout management code from the TWinControl descendants? I
can sometimes have several thousand of these on screen, and I don't
want the overhead of window handles.

I haven't done any VCL work in BDS 4.0 - is the layout code inside
the win control class, or is it separated into its own class heirachy
a la Java?

The layout code is inside the win control classes. TGridPanel and TFlowPanel
are TCustomPanel descendants.
I haven't really investigated alternatives even though I'm in a somewhat
similar situation. I would be surprised if you were able to find something
you can use directly with your own custom system, at least if you want
maximum performance.

Cheers,
Jarle
Back to top
Peter Below (TeamB)
Guest





PostPosted: Tue Dec 19, 2006 9:08 pm    Post subject: Re: Layout Managers Reply with quote

Bryan Crotaz wrote:

Quote:
I have my own rendering system. Do you know how easy it would be to
split the layout management code from the TWinControl descendants?

Difficult, I would say.

Quote:
can sometimes have several thousand of these on screen, and I don't
want the overhead of window handles.

Then use TGraphicControl descendents, they don't use window handles.

Quote:
I haven't done any VCL work in BDS 4.0 - is the layout code inside
the win control class, or is it separated into its own class heirachy
a la Java?

It's integrated into TControl and TWinControl.



--
Peter Below (TeamB)
Don't be a vampire (http://slash7.com/pages/vampires),
use the newsgroup archives :
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be
Back to top
Bryan Crotaz
Guest





PostPosted: Wed Dec 20, 2006 1:19 am    Post subject: Re: Layout Managers Reply with quote

Decided in the end after investigating Gecko ( the Firefox layout engine) to
write our own.

Thanks for your help everyone.

Bryan
Back to top
Heiko Tappe
Guest





PostPosted: Wed Dec 20, 2006 9:13 am    Post subject: Re: Layout Managers Reply with quote

Hi Peter,

Quote:
It also has a TFlowPanel and TGridPanel class for
semiautomatic layout. The two classes have a few problems, but they are
servicable.

Can you explain in more detail, please? What are these problems you are
talking about?
And what do I have to do to avoid them?
Thanks.

--Heiko
Back to top
Peter Below (TeamB)
Guest





PostPosted: Thu Dec 21, 2006 1:42 am    Post subject: Re: Layout Managers Reply with quote

Heiko Tappe wrote:

Quote:
Hi Peter,

It also has a TFlowPanel and TGridPanel class for
semiautomatic layout. The two classes have a few problems, but they
are servicable.

Can you explain in more detail, please? What are these problems you
are talking about? And what do I have to do to avoid them?

What you need to avoid at all cost is to drop a control on one of these
grids that is a composite of more than one control internally. The
prime example is TLabeledEdit. The grid splits the label and the edit
part into two cells, and the result will crash the IDE rather quickly.

You can also get ugly crashes if you have set the grid to not grow
automatically and then drop more components on it than it has cells.

Otherwise the only really annoying issue I have run into is the way the
sizing of columns and rows is handled. Using percentages of the grid
width and height can drive you bonkers <g>. Each time you try to change
the size of a cell by changing the percentage value the @@#!!&& thing
recalculates the size of the other cells. Why that may make sense
mathematically it also makes this completely unusable. The only way I
have found to get, for example, three columns to have 33.3 % of the
client width each is to edit the DFM file in text mode.

--
Peter Below (TeamB)
Don't be a vampire (http://slash7.com/pages/vampires),
use the newsgroup archives :
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be
Back to top
Graeme Geldenhuys
Guest





PostPosted: Thu Dec 21, 2006 4:27 am    Post subject: Re: Layout Managers Reply with quote

Hi Bryan,

I have implemented just that. Beats me why Borland never thought of this
in the first place. I actually went a few steps further and implemented
a complete widget set (GUI components) and graphics system (Low level
drawing library so widgets just request what they need drawn) in Object
Pascal to solve my biggest requirement. A complete cross-platform
widgets set, that works and look identical under Windows and Linux. It
has Style support as well, to give them a native look if needed.

I have used a mix of Qt and Java's layout manager ideas. I currently
support Box, Grid, Fixed and Docking layout managers.

They do more that just position component though. They handle the
sizing of components, which is very important for applications using
multiple languages and different screen sizes (dpi settings). This
removes a major burden from the developer. No component will ever get
cropped, a maximum and minimum size gets calculated and applied to the
Form and it's widgets (components).

The project is called fpGUI and I have recently moved it to SourceForge,
so you should be able to checkout the code from there. All code is
written for the Free Pascal compiler (I need cross platform support),
but the code is standard Object Pascal (aka Delphi), so should be pretty
easy to reused in Borland Delphi. I also use OOP wherever it makes sense.

As I mentioned, the code lives in SourceForge. The project website and
screenshots (to see the layout managers in action) can be found at:
http://opensoft.homeip.net/fpgui/


Regards,
- Graeme -


Bryan Crotaz wrote:
Quote:
Has anyone seen a Delphi implementation of a Java style Layout Manager? I'm
looking for an OO library to save having to write one from scratch. Ideally
it'll have classes for containers, grids, tables etc with padding and
collapsible margin support.

Bryan




--
Graeme Geldenhuys
There is no place like S34° 03.168' E018° 49.342'
Back to top
David Novo
Guest





PostPosted: Wed Jan 10, 2007 1:08 pm    Post subject: Re: Layout Managers Reply with quote

I have never used it, but developer express has something for that. Its
called Express Layout Control
(http://www.devexpress.com/Products/VCL/ExLayoutControl/)


Bryan Crotaz wrote:

Quote:
Has anyone seen a Delphi implementation of a Java style Layout
Manager? I'm looking for an OO library to save having to write one
from scratch. Ideally it'll have classes for containers, grids,
tables etc with padding and collapsible margin support.

Bryan



--
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OO design All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.