Page 1 of 2

Property Finder

Posted: Sat Apr 28, 2007 03:04
by Rackle
I've Wikied a utility to display the properties associated with the widgets of a particular scheme: Property Finder. Let me know how it works...

The list of properties for the TaharezLook and the WindowsLook widgets have been wikied.
Jump to the post on How to integrate non-Cegui widgets

Posted: Sat Apr 28, 2007 09:40
by scriptkid
Very nice one :)

Seems to work good, i only had to change the default resource paths from '../samples/datafiles' to '../datafiles'. No big deal of course but i wonder what you changed to your directory structure.

We good quit easily show a difference (colour wise) between default- and falagard properties by checking if the 'getHelp()' contains "falagard". But maybe not start hacking at day 2 already ;)

Posted: Sat Apr 28, 2007 12:18
by Rackle
I put my executable in CEGUI_head\bin rather than CEGUI_head\Samples\bin. I'll "standardize" to the samples directory.

Posted: Sat Apr 28, 2007 14:08
by scriptkid
Don't worry! :) I was just wondering.

Posted: Tue May 01, 2007 01:36
by Rackle
Added an export button and coded the Wiki format. The result of that export is Wikied.

Posted: Wed May 02, 2007 16:24
by Rackle
The table of properties under each widget shows Falagard properties in a different color. However I can't seem to figure out how to put colors in the Properties section of the Wiki.

Posted: Wed May 02, 2007 17:13
by Levia
Thats just..stunning. Awesome job done there mate!

Posted: Wed May 02, 2007 21:40
by Pompei2
haha man, you're incredible, that's just great ! This will help people a lot !

Edit: maybe you should link both wiki-pages together ? I mean the property finder page and the set property page ?

Posted: Thu May 03, 2007 16:53
by Rackle
Figured out how to put colors in the Properties section of the Wiki:

Code: Select all

<font COLOR=\"#FFBF00\">Falagard</font>

Posted: Thu May 03, 2007 21:58
by Pompei2
oh, by the way, I added links to both of your wiki entries into the FAQ, Section 3.6

Posted: Fri May 04, 2007 02:35
by Rackle
Good move.

Posted: Fri May 04, 2007 19:45
by daves
This seems quite useful. I will look into using it.

Posted: Wed May 09, 2007 17:06
by Rackle
How to integrate non-Cegui widgets

This is based on Levia's How to create a CheckListboxItem.

I've modified Taharezlook.looknfeel such that

Code: Select all

<?xml version="1.0" ?>
<Falagard>
    <!--
    ***************************************************
        TaharezLook/Button
    ***************************************************
    -->
    <WidgetLook name="TaharezLook/Button">


becomes

Code: Select all

<?xml version="1.0" ?>
<Falagard>
<WidgetLook name="TaharezLook/CheckListboxItem">
    <PropertyDefinition name="TextColour" initialValue="FFFF0000" redrawOnWrite="true" />
    <PropertyDefinition name="SelectedTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
    <PropertyDefinition name="SelectionBrush" initialValue="set:TaharezLook image:Background" redrawOnWrite="true" />
    <PropertyDefinition name="SelectionColour" initialValue="FF3030FF" redrawOnWrite="true" />
    <Property name="Selectable" value="True" />
    <NamedArea name="ContentSize">
        <Area>
            <Dim type="LeftEdge" >
                <AbsoluteDim value="0" />
            </Dim>
            <Dim type="TopEdge" >
                <AbsoluteDim value="0" />
            </Dim>
            <Dim type="Width" >
                <FontDim type="HorzExtent" padding="6" />
            </Dim>
            <Dim type="Height" >
                <FontDim type="LineSpacing" />
            </Dim>
        </Area>
    </NamedArea>
    <Child type ="TaharezLook/Checkbox" nameSuffix="__auto__checkbox">
        <Area>
            <Dim type="LeftEdge">
                <UnifiedDim scale="0" type="LeftEdge" />
                <AbsoluteDim value="3" />
            </Dim>
            <Dim type="TopEdge">
                <UnifiedDim scale="0" type="TopEdge" />
            </Dim>
            <Dim type="Width">
                <UnifiedDim scale="0.45" type="Width" />
            </Dim>
            <Dim type="Height">
                <UnifiedDim scale="1" type="Height"/>
            </Dim>
        </Area>
    </Child>
    <Child type ="TaharezLook/Button" nameSuffix="__auto__button1">
        <Area>
            <Dim type="LeftEdge">
                <UnifiedDim scale="0.5" type="LeftEdge" />
            </Dim>
            <Dim type="TopEdge">
                <UnifiedDim scale="0" type="TopEdge" />
            </Dim>
            <Dim type="Width">
                <UnifiedDim scale="0.45" type="Width" />
            </Dim>
            <Dim type="Height">
                <UnifiedDim scale="0.45" type="Height"/>
            </Dim>
        </Area>
    </Child>
    <Child type ="TaharezLook/Button" nameSuffix="__auto__button2">
        <Area>
            <Dim type="LeftEdge">
                <UnifiedDim scale="0.5" type="LeftEdge" />
            </Dim>
            <Dim type="TopEdge">
                <UnifiedDim scale="0.50" type="TopEdge" />
            </Dim>
            <Dim type="Width">
                <UnifiedDim scale="0.45" type="Width" />
            </Dim>
            <Dim type="Height">
                <UnifiedDim scale="0.45" type="Height"/>
            </Dim>
        </Area>
    </Child>
    <ImagerySection name="label">
        <TextComponent>
            <Area>
                <Dim type="TopEdge">
                    <AbsoluteDim value="0" />
                </Dim>
                <Dim type="LeftEdge">
                    <AbsoluteDim value="18" />
                </Dim>
                <Dim type="RightEdge">
                    <UnifiedDim scale="1" offset="-3" type="RightEdge" />
                </Dim>
                <Dim type="BottomEdge">
                    <UnifiedDim scale="1" type="BottomEdge" />
                </Dim>
            </Area>
        </TextComponent>
    </ImagerySection>
    <ImagerySection name="selection">
        <ImageryComponent>
            <Area>
                <Dim type="TopEdge">
                    <AbsoluteDim value="0" />
                </Dim>
                <Dim type="LeftEdge">
                    <AbsoluteDim value="0" />
                </Dim>
                <Dim type="RightEdge">
                    <UnifiedDim scale="1" type="RightEdge" />
                </Dim>
                <Dim type="BottomEdge">
                    <UnifiedDim scale="1" type="BottomEdge" />
                </Dim>
            </Area>
            <ImageProperty name="SelectionBrush" />
            <ColourProperty name="SelectionColour" />
            <VertFormat type="Stretched" />
            <HorzFormat type="Stretched" />
        </ImageryComponent>
    </ImagerySection>
    <StateImagery name="Enabled">
         <Layer>
              <Section section="label">
                  <ColourProperty name="TextColour" />
              </Section>
         </Layer>
    </StateImagery>
    <StateImagery name="Disabled">
         <Layer>
              <Section section="label">
                  <ColourProperty name="TextColour" />
              </Section>
         </Layer>
    </StateImagery>
    <StateImagery name="SelectedEnabled">
        <Layer>
            <Section section="selection" />
            <Section section="label">
                 <ColourProperty name="SelectedTextColour" />
            </Section>
        </Layer>
    </StateImagery>
    <StateImagery name="SelectedDisabled">
        <Layer>
            <Section section="selection" />
            <Section section="label">
                <ColourProperty name="SelectedTextColour" />
            </Section>
        </Layer>
    </StateImagery>
</WidgetLook>


    <!--
    ***************************************************
        TaharezLook/Button
    ***************************************************
    -->
    <WidgetLook name="TaharezLook/Button">


Then I inserted the following into PropertyFinder.h, just before the class DemoSample : public CEGuiSample:

Code: Select all

namespace CEGUI
{
    class CheckListboxItem : public ItemEntry
    {
    public:
        CheckListboxItem(const String &type, const String &name);
        virtual ~CheckListboxItem();
        static const String WidgetTypeName;
      static void Register();
   };
   CEGUI_DECLARE_WINDOW_FACTORY(CheckListboxItem)
}

namespace CEGUI
{
   CEGUI_DEFINE_WINDOW_FACTORY(CheckListboxItem)
   const String CheckListboxItem::WidgetTypeName("CEGUI/CheckListboxItem");
   CheckListboxItem::CheckListboxItem(const String &type, const String &name) :
      ItemEntry(type, name)
   {
   }
   CheckListboxItem::~CheckListboxItem()
   {
   }
   void CheckListboxItem::Register()
   {
      WindowFactoryManager& wfMgr = CEGUI::WindowFactoryManager::getSingleton();
      wfMgr.addFactory(&CEGUI_WINDOW_FACTORY(CheckListboxItem));
      wfMgr.addFalagardWindowMapping("TaharezLook/CheckListboxItem", "CEGUI/ItemEntry", "TaharezLook/CheckListboxItem", "Falagard/ItemEntry");
   }
}


Then within the initialiseSample() function I inserted

Code: Select all

CheckListboxItem::Register();


Then I recompiled and ran PropertyFinder and lo and behold Levia's CheckListboxItem appears! Wicked.

Posted: Wed May 23, 2007 00:53
by daves
Having given this thread a quick read, I'm excited about the potential of creating my own widgets. Now looking at the Levia examples I see that the custom widgets are all created in the CEGUI namespace. Is this required? I would think that we can create custom widgets within our application tier and "plug them in to cegui" as shown through the window manager registry.

Is this true? Am I interpreting this capability correctly and can we indeed begin to create our own custom widgets that conform to the cegui/falagard paradigm?

One widget that we are looking at implementing is a multi-state switch. The switch would allow you to clear on any one of the allowable states and the resulting "state changed callback" would be invoked with the correct state. This kind of thing could be constructed from several cegui widgets, but I'm thinking it would be cool to create a custom widget.

Posted: Wed May 23, 2007 10:58
by Rackle
The best answer I can give is "I don't know". Try a simple case and see how that works. If there are problems post about it. Well, also post about it if there aren't any problems :D