How to right-align TextGadgets in Form Designer?

You need some new stunning features ? Tell us here.
RobertSF
User
User
Posts: 61
Joined: Thu May 03, 2018 4:24 pm

How to right-align TextGadgets in Form Designer?

Post by RobertSF »

The designer doesn't use actual controls but instead draws the gadgets on the screen. I understand the design decision -- PureBasic is multi-platform, but each platform has its own controls. However, since the designer's font and the actual control font when running are not the same font, this makes gadget alignment difficult. It's not a problem with gadgets that are aligned on their left side, but it's an issue with field labels, which are often aligned on the right, like this:

Image

I realized that if you adjust the gadget positions by hand until they line up, that only means they will line up under the platform you're working on (Windows in this case). On a different platform, they will again be out of alignment.

I suppose one option is not to align fields labels on the right. Any other ideas?
Last edited by RobertSF on Tue May 15, 2018 2:54 am, edited 1 time in total.
User avatar
TI-994A
Addict
Addict
Posts: 2512
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

Re: How do you handle this quirk in the designer?

Post by TI-994A »

RobertSF wrote:...it's an issue with field labels, which are often aligned on the right...
One workaround would be to create the labels with equal widths, align them, then use the #PB_Text_Right flag to align the text to the right.
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel :D
RobertSF
User
User
Posts: 61
Joined: Thu May 03, 2018 4:24 pm

How to right-align TextGadgets in Form Designer?

Post by RobertSF »

OMG, that was so easy! I must have had a brain burp. Anyway, in case it helps someone else, here's the full how-to.

You can't align gadgets on their right side, but if you need some right-justified field labels, start by making them all as large as the largest one. Align them on their left sides. Then check the box for #PB_Text_Right Constant on each gadget. It's at the bottom of the list of gadget properties. Now they will be nicely right-aligned!
Post Reply