Page 1 of 1

Text alignment in MultiLineEditbox ?

Posted: Wed Jan 20, 2010 22:33
by orlay
Where should I paste:

Code: Select all

<HorzFormat type="CentreAligned" />

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

Re: Text alignment in MultiLineEditbox ?

Posted: Thu Jan 21, 2010 09:33
by CrazyEddie
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.

Re: Text alignment in MultiLineEditbox ?

Posted: Thu Jan 21, 2010 17:32
by orlay
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.

Re: Text alignment in MultiLineEditbox ?

Posted: Thu Jan 21, 2010 19:16
by CrazyEddie
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.

Re: Text alignment in MultiLineEditbox ?

Posted: Mon Jan 25, 2010 14:04
by orlay
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.

Re: Text alignment in MultiLineEditbox ?

Posted: Tue Jan 26, 2010 09:46
by CrazyEddie
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.