AlignCenter Removed in 2015r4

Hey guys,

I’m noticing in 2015R4 that AlignCenter no longer exists as an alignment option for controls.

So if I have a WebImageView and I do:

mImage.AlignVertical = AlignCenter

or

mImage.AlignVertical = WebImageView.AlignCenter

I get a compiler error. It’s been removed as a class constant.

Bug or intentional? It’s broken my code…

We are purposefully moving those alignment constants down to each control where they make sense and away from WebControl, as people sometimes got confused by them being present and thought they applied in places they did not. Looks like we missed them on WebImageView, where they should be present.

For now- you can either use the value, make your own constants (AlignCenter = 2), or use the same class constants that are on WebTextControl.

They aren’t in WebTextControl either.

In 2015r4, WebTextControl.AlignCenter etc are there.

If you say so. I want to say I tried it and it wasn’t there. Maybe I’m mistaken.

Also this sort of thing should be well publicized. Doing stuff like this breaks code. Not sure why you feel it necessary to remove it from the object or even control level and put it at the level of each control. But then again, I’m not paid the big bucks to write code for Xojo! :wink:

OK. So it’s in WebTextControl. But I’m still not sure why a class constant that should be available to all controls (i.e.: WebControls) is now moved to each individual subclass. Now my code looks funny…

WebImageView.AlignHorizontal = WebTextControl.AlignCenter

:open_mouth:

As I said above- it is was an oversight that it is missing on WebImageView, and that will be fixed in the next release.

[quote=236491:@Jon Ogden]OK. So it’s in WebTextControl. But I’m still not sure why a class constant that should be available to all controls (i.e.: WebControls) is now moved to each individual subclass. Now my code looks funny…
:O[/quote]

a class constant that works for all subclasses should be available at that level.

But if it doesn’t work (or logically apply, or whatever) for all subclasses, then it will just cause confusion, bug reports, etc.

[quote=236491:@Jon Ogden]OK. So it’s in WebTextControl. But I’m still not sure why a class constant that should be available to all controls (i.e.: WebControls) is now moved to each individual subclass. Now my code looks funny…

WebImageView.AlignHorizontal = WebTextControl.AlignCenter
[/quote]
Well, it was an oversight that they were moved. We’ve added them back on the WebImageView class where they should have been in the first place.