Label offset

Hi TMS
It would be really useful to have a label offset on components that have an attached label (e.g. TAdvEdit) in X and Y.
You already have the LabelPosition and LabelMargin properties. But sometimes it is useful to put something in front of the component (like a panel containing a prefix in a different background colour for example).
If you set the label position to be above center, it is in the correct position to the edit box (in this example case) but not in the correct position for the panel/edit box combo.
It is great to have the label property so that the label moves with the component. Perect. But would be even better if it then had an X and Y 'tweak' offset so that you could tweak the position so that it still moved but was in a position that looked better with the combined components.
I can do this by putting spaces before and after the label text but that is messy and only works in X not Y.
I can supply example of what I mean as I appreciate this might not make too much sense without something visual.
Thanks
Trevor (trevor@buckingham-nurseries.co.uk)

Hi David,
i think that the position is fixed (there's a list) and the margin it's works in different way: if the label is top/bottom it works as vertical spaces, if is rigth/left the margin works as horizontal spaces.
I'm agree with you about the possibility to adjust vertical/horizontal label position at any position the label is.
In the end, the controls label is related to the it's control. When i need particular label position i use common label with Tadvedit; In your example if you have a panel with an edit and you want the label centered to the panel with the edit aligned to the left panel's margin, the only way is put a label in the panel align it to top with centered text, after add a TAdvEdit where you want under this label.
(if i understand the problem....)

Regards
Daniele

Hi Daniele

Thank you for the reply.

I agree with what you have said. It can still be done with a seperate label. But it is a really nice feature to be able to add the label to an edit (for example) or other components, so that when you move them, you don't have to reposition the label to, it is anchored to the control.

I just think it would be a nice feature to have an additional offset in X and Y.

Maybe this will image will explain what I think would be a nice feature:

tmslabelpos

The top edit is just standard, with a top centre label.

Then the second is with a panel added to prefix the input. This is something I often do. But when the label still has top centre, it is in the wrong place in comparison to the edit and panel.

In the last edit, this is how I think it looks nicer. If the label had an X and Y adjustment, then in the example it could say have a -50 (guessing!) in X and that would do the desired effect while still keeping the label anchored to the the edit if it is moved. To achieve this effect at present, I have to pad the label with spaces, which isn't the greatest way.

It is not a huge problem. But on several occasions when I have used the label with a control I have thought "wouldn't it be nice if.......". So thought I would create a feature request in case others thought it might be useful too and was something that the clever people at TMS could easily implement.

Trevor

Good morning Trevor,
in order to get something that is closest to tour result, attached you can find a small project with a frame. Nothing special but can be a good starting point in order to get a quick solution.

TestEdit_2024-05-29.zip (8.2 KB)

Hope you can find this useful.

Regards
Daniele

PS : last frame line is

if CenterStyle=[csFrameCenter] then

Hi Daniele
Thank you for the example.
I can see where you are coming from with that. Good solution.
There are several ways to do this I agree, I also have my own ways.
I just think it would be nice if there was an X and Y offset just to tweak the label position, it would make the soultion to this a whole lot neater and less 'messy'.
But maybe this isn't something that would be a priority for TMS at the moment.
Thanks again for the example, appreciated.
Trevor

We've added it on the list for consideration.