HorzAlignmentProperty

Forum for general chit-chat or off-topic discussion.

Moderators: CEGUI MVP, CEGUI Team

User avatar
cippyboy
Quite a regular
Quite a regular
Posts: 51
Joined: Wed Jul 30, 2008 13:23

HorzAlignmentProperty

Postby cippyboy » Wed Apr 21, 2010 15:37

This is killing me for some time and I'm either unaware of the correct spelling or such a feature doesn't exist. I'm using CEGUI 0.6.2 and I'm trying to make a definition for a widget that by default is center aligned and has horizontal alignment property, making it either left or right aligned on occasion.
I define a property like this
<PropertyDefinition name="HorzFormatting" initialValue="CenterAligned" redrawOnWrite="true" />

and setting up like this in a text component doesn't work :
<HorzFormatProperty name="HorzFormatting" />

But I then looked at other definitions and saw that there's multiple cases of

<HorzAlignment type="RightAligned" />

so I'm wondering, why isn't there a HorzAlignmentProperty because I'm assuming this is what I need to use to set the alignment ?

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: HorzAlignmentProperty

Postby CrazyEddie » Thu Apr 22, 2010 08:34


User avatar
cippyboy
Quite a regular
Quite a regular
Posts: 51
Joined: Wed Jul 30, 2008 13:23

Re: HorzAlignmentProperty

Postby cippyboy » Thu Apr 22, 2010 13:17

Yeah like that one, although if you were suggesting setting it from code, I was sorta thinking to use it from the layout file. Or are you saying to just rename the value of the property from CenterAligned to Centre ? (saw the difference in spelling in the link you gave me)

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: HorzAlignmentProperty

Postby CrazyEddie » Fri Apr 23, 2010 08:41

You can use it in layouts (or code) like with all other properties, so within a layout:

Code: Select all

...
<Property Name="HorizontalAlignment" Value="Centre" />
...


CE

User avatar
cippyboy
Quite a regular
Quite a regular
Posts: 51
Joined: Wed Jul 30, 2008 13:23

Re: HorzAlignmentProperty

Postby cippyboy » Mon Apr 26, 2010 14:22

Hm, ok this is kinda weird. I'm trying to set the alignment of a piece of text from a tab button to avoid duplicate definitions for just a single property changed. When I used what you gave me it aligned the tab in the center of it's parent window. How do I set the property for the text inside it ?

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: HorzAlignmentProperty

Postby CrazyEddie » Wed Apr 28, 2010 13:43

You didn't mention text in the original post, and it appeared you were referring to window alignment - which is why you got the information you did.

With this new information, the rest of your OP makes a bit more sense now. Looking back at that briefly, it should have worked ok except that the initial value you specified in the PropertyDefinition is spelt incorrectly. The correct spelling is "CentreAligned".

CE.

Jamarr
CEGUI MVP
CEGUI MVP
Posts: 812
Joined: Tue Jun 03, 2008 23:59
Location: USA

Re: HorzAlignmentProperty

Postby Jamarr » Wed Apr 28, 2010 19:03

wtb aliases for property-values so us American-English spellers can stop fumbling over this issue :cry:
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: HorzAlignmentProperty

Postby CrazyEddie » Thu Apr 29, 2010 09:21

While I'm not completely opposed to such a thing for the built in property enumeration strings, I would not, however, be happy to extend that to all property names, xml tag names and such, because doing that puts us on something of a slippery slope (next request becomes event names, then API names and so on...). Because of this situation, we would end up with a lot of inconsistency where American English works in some places and not others - at least right now it generally does not work anywhere, so while not ideal for everyone, it is consistent ;)

CE.


Return to “Offtopic Discussion”

Who is online

Users browsing this forum: No registered users and 17 guests