Jump to content

My Layout Example with Anchors

Recommended Posts



I just want to share my attempt to implement anchors to the UI, in order to be able to create easier web application. My approche is not perfect and has some workarounds, since it needs some changes in the underlying RTL/SmartCL classes. But it's good starting point. And mybe it can be adapted to the RTL/SmartCL classes.


It's build with v2.1.2




Share this post

Link to post
Share on other sites

I would love to see this added to the layout management.




1.) Have you made any improvements to the Anchors since your post?

2.)  Would you mind sharing your changes to the RTL to get these to work?




I would also love to see a layering mechanism for nested layouts

Share this post

Link to post
Share on other sites

One of our team members, Primoz, made a fantastic layout library en-par with Linux GTK and C#'s GTK#.

You will find this under $RTL\SmartCL\SmartCL.Layout.pas.

Sadly he has been unable to document it, so I cant even tell you how to use it properly. But there are a couple of demos in the demo folder demonstrating it.

This really is a library we want to create a designer for. It will make creating display agnostic layouts so easy.

It will automatically scale and position controls according to size, no need for anchors or anything as such.


You can regard it as horizontal panels that always fit to the total width, but who in turn have cells (like a spreadsheet) that can be set to an absolute size or a percentage. Inside each cell you can have components and they are always stretched to fit the cell size.


Its a brilliant piece of enginering and primoz deserves praise for his work on this. Shame that we havent had time/resources to really create an easy to use editor for it. It makes perfect sense for mobile and web design, much more than absolute positioning like we are traditionally used to.


Well worth looking into!

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now