Widget Galore

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

Moderators: CEGUI MVP, CEGUI Team

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Widget Galore

Postby Rackle » Mon May 01, 2006 07:44

I've Wikied a presentation of every widget and an introduction of their usage. Hopefully it can be useful to others.

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Postby scriptkid » Mon May 01, 2006 08:05

Excellent! I assume you have created this for the cegui "head", right?

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Postby Rackle » Mon May 01, 2006 08:15

No, that was for the current release, the most easily accessible one. I'll update what needs updating once 0.5.0 is out, unless someone else does it first 8)

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Postby Rackle » Wed Jun 28, 2006 01:27

Upgraded to v0.5.0.

The v0.4 StaticText code

Code: Select all

StaticText* staticText = static_cast<StaticText*>(winMgr.getWindow((utf8*) "StaticText"));
staticText->setText("Red StaticText");
staticText->setTextColours( colour(1.0f, 0.0f, 0.0f, 1.0f) ); // Red text
staticText->setFormatting(StaticText::HorzCentred, StaticText::VertCentred); // Center the text

was upgraded to v0.5.0 like this

Code: Select all

DefaultWindow* staticText = static_cast<DefaultWindow*>(winMgr.getWindow("StaticText"));
staticText->setText("Red Static Text");
staticText->setProperty("TextColours", "tl:FFFF0000 tr:FFFF0000 bl:FFFF0000 br:FFFF0000");
staticText->setProperty("VertFormatting", "VertCentred");
staticText->setProperty("HorzFormatting", "HorzCentred");


The v0.4 StaticImage code

Code: Select all

ImagesetManager::getSingleton().createImagesetFromImageFile("ImageForStaticImage", "../datafiles/imagesets/GPN-2000-001437.tga");
StaticImage* staticImage = static_cast<StaticImage*>(winMgr.getWindow("StaticImage"));
staticImage->setImage("ImageForStaticImage", "full_image");

was upgraded to v0.5.0 like this

Code: Select all

ImagesetManager::getSingleton().createImagesetFromImageFile("ImageForStaticImage", "GPN-2000-001437.tga");
DefaultWindow* staticImage = static_cast<DefaultWindow*>(winMgr.getWindow("StaticImage"));
staticImage->setProperty("Image", "set:ImageForStaticImage image:full_image");

Rakkar
Not too shy to talk
Not too shy to talk
Posts: 34
Joined: Tue Aug 15, 2006 02:49

Postby Rakkar » Tue Aug 22, 2006 15:34

So now that you're using strings instead of enumerations how do I convert the string to an enumeration when I need it?

Code: Select all

const CEGUI::String &horizFormatting="WordWrapLeftAligned"


to

Code: Select all

TextFormatting::WordWrapLeftAligned

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

Postby lindquist » Tue Aug 22, 2006 16:29

unfortunately that code is in the property class. there is no helper.

You can grab the snippet from WindowRendererSets/Falagard/src/FalStaticTextProperties.cpp though

Rakkar
Not too shy to talk
Not too shy to talk
Posts: 34
Joined: Tue Aug 15, 2006 02:49

Postby Rakkar » Wed Aug 23, 2006 15:55

I think you mean CEGUIStaticTextProperties.cpp, the set and get functions
void HorzFormatting::set(PropertyReceiver* receiver, const String& value)

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

Postby lindquist » Wed Aug 23, 2006 16:01

so you're using 0.4 ...

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Postby scriptkid » Thu Nov 30, 2006 09:34

This wiki page has been upgraded to the 0.5 release. TabPane is replaced by DefaultWindow and SetWindowPosition, SetWindowWidth and SetWindowHeight have been changed by removing 'Window' from the method names.

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Postby Rackle » Wed May 02, 2007 18:58

menu and popup menu are finally added. Well, not directly in Widget Galore, as there's too much text and code, but still there's a sample available somewhere.

The next step could be to go back to each widget and create a separate Wiki for each, providing more text and code for each.


Return to “Offtopic Discussion”

Who is online

Users browsing this forum: No registered users and 7 guests