Automatic control size and alignment (like matisse for netbeans)

Hi all,

Does anybody know of a way (e.g. a paid component suite) to automatically size the controls of a form, like the matisse project in netbeans for java?
(http://www.netbeans.org/products/ide/features.html#NetBeans_Swing_GUI_Builder_forme)

The purpose of this question is to see if something like this exists for Delphi, and if not, I'd like to make an open source project for this.

Desired behaviour:
1) At design time, suppose I have a TEdit (actually any TControl). I should be able to define that
a) I want its Left property to be the same as, say, aTLabel.Left (some TLabel that is above the TEdit).
b) I want its Top property to be the same as aTLabel.Bottom. This way the TEdit would be positioned exactly under the TLabel. The TControl.Margins public property should be used to declare the desired spacing.
c) I want its Right property to be the same as ParentForm.Right.
d) I want its Height property calculated automatically based on the TEdit.Font.Size.

2) At run time, I should be able to
a) Resize the form and the controls should be automatically aligned and sized.
b) Change ANY font, either the form font or the control fonts, and again everything should be automatically sized and aligned.
c) Change ANY control text (e.g. a TLabel.Caption), and again everything should be automatically sized and aligned.

I think that this way works much better and COULD REPLACE ALL of Delphi similar constructs, such as anchors, alignment, autosize, gridpanels etc. E.g. align=bottom would be translated to Left=Form.Left, Right=Form.Right, Bottom=Form.Bottom.
I guess you know the usual problems that come with the Delphi control alignment strategy, I won't go into details in this. Just an example, if someone wants to localize a form OR increase at runtime the form font size, he'll get into trouble! :-)
Anchors and alignment are just not good enough.
LVL 9
alkisgAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

lopemCommented:
In torry.ru you can find few resizer components with source code and freeware. Also I found a paid component for that job...Try

   http://www.componentsource.com/products/newtone-resizekit-activex-vcl/summary.html

Hope this helps.
regards,
lopem (Manuel Lopez)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
alkisgAuthor Commented:
Hi,

I haven't tried all of these components, but the ones I've tried rely on percentages and font scaling to handle the form resizing. This, well, to put it simply, sucks! If a form is translated, a TLabel should be (e.g.) wider, not resized based on percentage. If the user increases the windows font size, all controls are clipped.

I downloaded and tested the resizekit you've linked to. Here's a screenshot that demonstrates that it doesn't work (many controls are clipped). I just changed the font size.
https://filedb.experts-exchange.com/incoming/ee-stuff/3143-resizekit.png
0
lopemCommented:
I guess then you have to start your open source project! Good luck

Manuel Lopez (lopem)
0
Exploring SQL Server 2016: Fundamentals

Learn the fundamentals of Microsoft SQL Server, a relational database management system that stores and retrieves data when requested by other software applications.

TheRealLokiSenior DeveloperCommented:
Good idea. I made a set of routines to automatically squeeze the components into the client area if the area was resized, but it did not allow you to ensure edit1 was under label1 unless you had them in their own group (panel/groupbox, etc), so i would also be interested if you find something that can achieve this in Delphi.
0
alkisgAuthor Commented:
Automatic alignment is easy enough, and (from what I've searched so far) I think it can easily be implemented for all TControl descendants on D2006+ using ISelectionPropertyFilter and maybe class helpers. See my Q_22504055 for details.

I think it'll take me about a week of coding to replace Anchors and Align properties with the more generic approach of "control - edge - anchors".
Anchoring based on the middle of a control can also be supported, so it'll be possible to align the right side of a TButton 10px left of the form's center.

I did some tests, everything works OK and resizing is smother than when panels are used.

What troubles me is auto-sizing, based on the form or control Font property. E.g. if you enable TLabel.AutoSize, it scales according to the font size. Also TEdit works OK.
But TCheckBox, TButton etc don't behave well for different fonts, so specific code is required for each control class...

If I don't find anything similar, I'll give it a go on the summer and I'll let you know of the results! :)
0
tnhphuongCommented:
please refer this component: http://www.sicomponents.com
this is useful component for multi language app, of course, include what you want.
0
alkisgAuthor Commented:
It's a nice suite of components for multi language applications, but I saw NOTHING about control positioning and autosizing there!

I tried the TsiLang Components Suite Trial version, did I miss something?
0
alkisgAuthor Commented:
I guess it's time to close this one.
I've made most of the controls I use autosizing / autopositioning, but with no designer support yet. Works great. If/when I finish it, I'll upload it to e.g. sourceforge and post the link here.

Thanks.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.