Button Text Alignment

Well I made my first Declare all by myself. It allows one to set the text alignment on a button. Probably no big deal.

Here’s my question. I though I’d make the value of the parameter passed in something that made sense. It seems, however, that there is little consistency:

Align Apple Xojo My First Thought
Left 1 0 -1
Center 0 1 0
Right 2 2 1

So, should I go with Apple’s (this is for iOS, after all), Xojo’s (so it will be consistent), or mine (which, if one doesn’t use the constant, at least the number provides a clue as to the direction).

I’ll post the declare later.

-Bob

I would suggest use XOJO’s to be consistent, then would argue that XOJO should have aligned theirs (pun) with Apple in the first place. But then I can’t believe XOJO left such a mundane property out of a simple button (but then then left dozens of others out as well)

Note that regular Desktop Xojo buttons are always centered.

BevelButtons have the CaptionAlign property, with the values :

0 Flush left 1 Flush right 2 Sys direction 3 Center

I would use Xojo’s way to ensure consistency. Xojo users have enough on their plate with the new framework, I would try to spare them more grief.

Thanks for the feedback. I’m not sure I can get Sys direction meaning in an iOS app.

But, I will make things use Xojo values (as far as possible). Code will follow (must go to caucus this evening).

-Bob

[quote=250497:@Bob Gordon]Thanks for the feedback. I’m not sure I can get Sys direction meaning in an iOS app.

But, I will make things use Xojo values (as far as possible). Code will follow (must go to caucus this evening).
[/quote]

You could simply assign center instead for 2. After all, that is the default.

[quote=250436:@Michel Bujardet]Note that regular Desktop Xojo buttons are always centered.

BevelButtons have the CaptionAlign property, with the values :

0 Flush left 1 Flush right 2 Sys direction 3 Center

I would use Xojo’s way to ensure consistency. Xojo users have enough on their plate with the new framework, I would try to spare them more grief.[/quote]
I need this…can you by any chance tell me exactly how to code a bevel button with “flush left” as the setting. Thank you very much.

found it, but I have 2016R3…so I guess I need to get 2019R2

Me.CaptionAlignment = BevelButton.CaptionAlignments.Right