Left Align Button Text?

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
arkos
Quite a regular
Quite a regular
Posts: 49
Joined: Thu Apr 27, 2006 21:45

Left Align Button Text?

Postby arkos » Tue Oct 10, 2006 19:53

Hey guys,

I am trying to left align the text on a bunch of buttons. I found the function setTextXOffset() but it doesn't seem to do squat.

Also when I call this function is it supposed to kill the centered alignment and make it left aligned with the offset or is the offset taken from the center?

Why doesn't it do anything?



Please let me know.

Code: Select all

((CEGUI::PushButton*)getWindow("facility_btn12"))->setsetTextXOffset(5.5);


Note that I shifted the text an extreme 5.5 and it has no effect. I am using windows look if it matters

Pompei2
Home away from home
Home away from home
Posts: 489
Joined: Tue May 23, 2006 16:31

Postby Pompei2 » Thu Oct 12, 2006 15:41

For the StaticTexts, there is the property named "HorzFormatting" with and an enum with the same name IIRC where you can choose the alignment. Maybe there is the same in the PushButtons, I don't know, but you should look for this.

User avatar
arkos
Quite a regular
Quite a regular
Posts: 49
Joined: Thu Apr 27, 2006 21:45

Postby arkos » Fri Oct 13, 2006 17:07

Hey pompei2,

thanks for the reply. I know about the StaticText alignment and I often use the HorzFormatting to center the text from the default left alignment. Unfortunately, push button doesn't seem to have anything like this.

The offset X looks like it has promise, but doesn't seem to work as advertised.

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Postby lindquist » Sat Oct 14, 2006 19:20

You can add this functionality yourself by modifying the pushbutton looknfeel

User avatar
arkos
Quite a regular
Quite a regular
Posts: 49
Joined: Thu Apr 27, 2006 21:45

Postby arkos » Sun Oct 15, 2006 20:37

hey lindquist,

thanks for the reply. That looks like it would solve the problem, however, that would alter ALL of the buttons rather than a select few.

To work around this I am assuming I would have to define a look and feel of a special "L_button" which would be the same as the regular button except for the vert alignment. Then I would change the look n feel in the layout editor as well, so that I could create the left aligned buttons there. Is this what you were thinking?


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 6 guests