Text alignment in MultiLineEditbox ?

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

Moderators: CEGUI MVP, CEGUI Team

orlay
Just popping in
Just popping in
Posts: 6
Joined: Thu Feb 19, 2009 21:47

Text alignment in MultiLineEditbox ?

Postby orlay » Wed Jan 20, 2010 22:33

Where should I paste:

Code: Select all

<HorzFormat type="CentreAligned" />

in TaharezLook/MultiLineEditbox in TaharezLook.looknfeel file to align text in a MultiLineEditbox?

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

Re: Text alignment in MultiLineEditbox ?

Postby CrazyEddie » Thu Jan 21, 2010 09:33

Hi,

Currently the Editbox type widgets do not support alignment options for the text. We have an open ticket for this already, so hopefully it will get added some time soon.

CE.

orlay
Just popping in
Just popping in
Posts: 6
Joined: Thu Feb 19, 2009 21:47

Re: Text alignment in MultiLineEditbox ?

Postby orlay » Thu Jan 21, 2010 17:32

What component do you advise me to use for display multi line and aligned text ?

I tried with static text, I could align it but I can only display the text that fits on the screen because the VertScrollbar did not work.

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

Re: Text alignment in MultiLineEditbox ?

Postby CrazyEddie » Thu Jan 21, 2010 19:16

orlay wrote:What component do you advise me to use for display multi line and aligned text ?

StaticText

orlay wrote:I tried with static text, I could align it but I can only display the text that fits on the screen because the VertScrollbar did not work.

What do you mean it did not work? Do you mean it did not show up automatically? Do you mean you enabled it and it did not show up? Do you mean it shows up but does not function?

In case you did not enable it, you have to enable it by setting the "VertScrollbar" property to "True".

If you already did this, then all the usual questions we end up asking apply here, and you'll need to post some more information - especially the bit we always ask for but almost nobody provides ;) Yes, I refuse to ask for it by name! :lol:

CE.

orlay
Just popping in
Just popping in
Posts: 6
Joined: Thu Feb 19, 2009 21:47

Re: Text alignment in MultiLineEditbox ?

Postby orlay » Mon Jan 25, 2010 14:04

ok, sorry.

It show the vertical scrollbar but when I try:

Code: Select all

static_cast<CEGUI::StaticText *> (myStaticText)->getVertScrollbar()

My IDE show ( error: ‘StaticText’ is not a member of ‘CEGUI’) as is logic.

My actual solution:

Code: Select all

static_cast<CEGUI::MultiLineEditbox *> (myStaticText)->getVertScrollbar()

myStaticText is an static text but I used it as MultiLineEditbox.

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

Re: Text alignment in MultiLineEditbox ?

Postby CrazyEddie » Tue Jan 26, 2010 09:46

The key thing to understand is that there is no StaticText class within the library. When you create a 'StaticText' of some description, you're actually creating a CEGUI::DefaultWindow, which is adapted by way of a CEGUI::WindowRenderer object to supply some of the additional function of what you see visually as a StaticText (in this case, management of rendering areas depending upon some settings, and the scrollbar functionality).

To access this 'additional' functionality via the CEGUI::Window pointer you have, it is necessary to use the properties interface using the Window::setProperty and Window::getProperty functions. So to enable the scrollbar:

Code: Select all

myStaticText->setProperty("VertScrollbar", "True");


To reiterate; the specific window type used for StaticText is CEGUI::DefaultWindow - this class is not compatible with CEGUI:: MultiLineEditbox. You should never ever cast a Window pointer to a type that it does not actually represent.

CE.


Return to “Offtopic Discussion”

Who is online

Users browsing this forum: No registered users and 9 guests