SdkTrays setting a caption?

Problems building or running the engine, queries about how to use features etc.
Post Reply
pighead10
Gremlin
Posts: 180
Joined: Fri Jan 07, 2011 8:58 pm
Location: That way
x 2
Contact:

SdkTrays setting a caption?

Post by pighead10 »

It says on the SdkTrays that you can get/set a caption of a widget. I cannot find how to do this. Help?
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: SdkTrays setting a caption?

Post by jacmoe »

Known problem. Please search.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
omniter
OGRE Contributor
OGRE Contributor
Posts: 424
Joined: Thu Mar 19, 2009 8:08 am
Location: Canada
x 44

Re: SdkTrays setting a caption?

Post by omniter »

pighead10 wrote:It says on the SdkTrays that you can get/set a caption of a widget. I cannot find how to do this. Help?
I'm not sure where it says that you can do this. Not all widgets have a caption anyway. If there is a page that says you can set/get the caption on any widget, please point us to it, and we will correct it.
pighead10
Gremlin
Posts: 180
Joined: Fri Jan 07, 2011 8:58 pm
Location: That way
x 2
Contact:

Re: SdkTrays setting a caption?

Post by pighead10 »

jacmoe wrote:Known problem. Please search.
"I cannot find how to do this." I did search for a long time >.>
omniter wrote:
pighead10 wrote:It says on the SdkTrays that you can get/set a caption of a widget. I cannot find how to do this. Help?
I'm not sure where it says that you can do this. Not all widgets have a caption anyway. If there is a page that says you can set/get the caption on any widget, please point us to it, and we will correct it.
It doesn't say any caption, but it says you can "get/set the caption" here: http://www.ogre3d.org/tikiwiki/SdkTrays
User avatar
omniter
OGRE Contributor
OGRE Contributor
Posts: 424
Joined: Thu Mar 19, 2009 8:08 am
Location: Canada
x 44

Re: SdkTrays setting a caption?

Post by omniter »

It says that for the Slider widget only... :S
pighead10
Gremlin
Posts: 180
Joined: Fri Jan 07, 2011 8:58 pm
Location: That way
x 2
Contact:

Re: SdkTrays setting a caption?

Post by pighead10 »

TextBox

This widget consists of a bold caption bar and a text area that can be scrolled vertically. In addition to a tray location and a name, SdkTrayManager::createTextBox takes a caption, width, and height. You can set/get the caption, the text area contents, text padding, text alignment, manually change the scroll bar position, among other things.
User avatar
omniter
OGRE Contributor
OGRE Contributor
Posts: 424
Joined: Thu Mar 19, 2009 8:08 am
Location: Canada
x 44

Re: SdkTrays setting a caption?

Post by omniter »

Ah, missed that one. I was searching for "get/set", not "set/get", haha. In any case, you can only set the caption for widgets that have a caption. e.g., Slider, TextBox, Label, etc. These widget classes should have setCaption / getCaption methods. Also, their constructors allow you to pass in the caption. Have a look through SdkTrays.h. SdkTrays was never meant to be a full GUI system, and not all the methods are fully documented. Technically, we're not even supposed to provide support for SdkTrays, since it was only meant for the team to create samples, and is not part of the OGRE core.
pighead10
Gremlin
Posts: 180
Joined: Fri Jan 07, 2011 8:58 pm
Location: That way
x 2
Contact:

Re: SdkTrays setting a caption?

Post by pighead10 »

I only used sdktrays because I entered a ludum dare, and was almost out of time so quickly added sdktrays and remade all the images. It's over now, but I'm trying ot get a health displayed but I can't get the caption to change once it's already been created - I couldn't find the set/getCaption method.
Post Reply