PxPlus User Forum

Main Board => Discussions => Nomads => Topic started by: steezware on November 06, 2024, 06:18:49 PM

Title: Left-Justify BUTTON Text
Post by: steezware on November 06, 2024, 06:18:49 PM
Not sure if this is a Nomads or a Language issue, but...

Is there built-in Pvx logic or maybe a trick to have the 'text on a BUTTON control left-justified?
Title: Re: Left-Justify BUTTON Text
Post by: martinp on November 06, 2024, 07:00:30 PM
I don't think you can with the dynamic properties ' 

you could add btn.ctl'text$=PAD("Ok",10)  some spaces ...

What are you trying to do exactly.
Title: Re: Left-Justify BUTTON Text
Post by: steezware on November 06, 2024, 07:39:12 PM
Yep, expression PAD(" Button Text", 2400) works great ... until you resize the panel, then Nomads (or someone) moves the text over from the left.

What I am trying to do is display button text left-justified, it's that simple.
Title: Re: Left-Justify BUTTON Text
Post by: martinp on November 06, 2024, 07:46:37 PM
So on the nomads panel itself you can set the button to have text left justfied in the font section of button.
Title: Re: Left-Justify BUTTON Text
Post by: Loren Doornek on November 06, 2024, 10:08:30 PM
Check the manual page for the OPT= options for a BUTTON at:

https://manual.pvxplus.com/PXPLUS/directives/button.htm#Mark4

There are some caveats discussed there, such as the need for 3D or 4D if using button images.  In Nomads, there is a radio button on the Font screen, but that might not work if you don't 3D enabled.
Title: Re: Left-Justify BUTTON Text
Post by: steezware on November 07, 2024, 09:40:13 AM
I now see I wasn't clear enough. Of course I can justify an IMAGE to the left, right, top or bottom of the button text, but my button has no image. And regardless of the image-justification setting the text is still centered on the button.

So, what I'm looking for is a way to left-justify text on a button that has no image.
Title: Re: Left-Justify BUTTON Text
Post by: James Zukowski on November 07, 2024, 09:59:08 AM
In NOMADS, on the Font/Clr tab, you can select whether the text is Left/Center/Right justified.
Title: Re: Left-Justify BUTTON Text
Post by: martinp on November 07, 2024, 10:27:21 AM
Do you have these options?
Title: Re: Left-Justify BUTTON Text
Post by: steezware on November 07, 2024, 12:55:01 PM
Got it - thx! :)

My client is on an older version of Pvx/Nomads and those options do not exist.

I checked the online manual and it does, indeed, mention font alignment under the Nomads section, but does not note when that feature was added to  PxPlus...

https://manual.pvxplus.com/PXPLUS/NOMADS%20Graphical%20Application/Creating%20Panel%20Controls/Button%20Control/Overview.htm (https://manual.pvxplus.com/PXPLUS/NOMADS%20Graphical%20Application/Creating%20Panel%20Controls/Button%20Control/Overview.htm)

...and also in the online manual, for button properties there is 'BitmapPosition but nothing about a font-position property...

https://manual.pvxplus.com/PXPLUS/control_object_properties/button_properties.htm (https://manual.pvxplus.com/PXPLUS/control_object_properties/button_properties.htm)

Again, thank you to Martin and James and others for sharing this information with me.


Title: Re: Left-Justify BUTTON Text
Post by: James Zukowski on November 07, 2024, 02:00:22 PM
In the online manual, the entry for the BUTTON directive includes the option for a FNT= specification, with details in the 'FONT' mnemonic. For things to work, it seems you also have to include OPT="A" and use the '4D' mnemonic. E.g.:

print '4D',
B_ID=100
button B_ID,@(10,5,10,3)="Click Here",opt="A",fnt=",,R"

While you can specify the justification when creating the button, it seems you can't change it, though you can retrieve and change other font attributes:

F$=B_ID'Font$
B_ID'Font$="Courier New,-18,B"

Overall, to left-justify the text, all you need to include when manually creating a button is to include the OPT="A". Not sure what you can do with old NOMADS...