SystemButton and StaticText skinning problems...

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

User avatar
prager
Just popping in
Just popping in
Posts: 12
Joined: Fri Mar 14, 2008 19:02
Contact:

SystemButton and StaticText skinning problems...

Postby prager » Sun Mar 16, 2008 16:32

Hi,

another few skinning questions...

What is the connection between SystemButton and the Button type? I was trying to change the skin of SystemButton, but still get the Button image drawn below it and also the height for hover image gets changed to the value of Button. Is it a bug or is it my fault?

Other thing is the color of text for StaticText - according to this http://www.cegui.org.uk/phpBB2/viewtopic.php?p=12814&sid=93883bb100f118cc51750eb1f2bdda0d I tried to change the TextColours property of StaticText, but it does not have any effect. Also in TaharezLook (which is the base I started with) there is no text component definition for StaticText, so where did the white text came from? Maybe its a silly question...

Just to show what I am working on and why I am stealing your time... :) I am trying to create a MacOS X Tiger look-and-feel, because we need a "professional-looking" gui for our application we are working on. So this is how it looks like for now: http://www.mprazak.info/AquaLook.png , when it gets some shape, I'll make it LGPL available...

Many thanks...

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

Postby CrazyEddie » Sun Mar 16, 2008 21:02

Hi,

SystemButton is not a window type as such, but rather is a combination of a normal PushButton base class and a specialised WindowRenderer type intended for use with buttons added to the FrameWindow type windows to enable us to have buttons that appear in the title bar area. Effectively what it does is escape the clipping of the immediate parent window (but still clips to the grand parent window).

I'm not sure why you're seeing what you are, I don't think there are any bugs related to this. You'd need to post the skin xml and the mapping from the scheme.

I'm also not sure about the StaticText issue. You should easily be able to add the TextComponent and a reference to it in the StateImagery sections.

If I had to make a guess, it would be related to what you said before about the files coming with Ogre being out dated - this definitely appears to be the case here.

That skin screen shot looks truly awesome :) It'd be great to have this out there as an example of what is possible.

CE.

User avatar
prager
Just popping in
Just popping in
Posts: 12
Joined: Fri Mar 14, 2008 19:02
Contact:

Postby prager » Mon Mar 17, 2008 16:29

Hi,

thanks a lot for the reply.... So, on http://www.mprazak.info/aqua.zip is a set of what I have so far, and you can see there the problem with the SystemButton. I solved the incorrect size problem, but the normal button still gets rendered under the systembutton. I am using alpha quite much in the skin, because without it its really hard to create nice looking elements of GUI, but if I didn't use it on the systembutton, everything would be ok...

Thanks for help with the statictext problem, I'll try to add it today to see if it works.

And I found another problem - in the zip above are also sources of a little bit changed demo from CEGUI, which I wanted to use for preview of the skin. The problem I found there is that for Slider element the thumb does not get displayed after loading the layout file for some reason. When I change the window size, the thumb appears and everything is ok. Please, where is the problem?

Many thanks... (again) :)

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

Postby CrazyEddie » Mon Mar 17, 2008 17:46

Hi,

I have had a look and see what the issue is. Basically it's due to applying the standard button skin to the system button. There are a couple of alternative solutions. You could make a new skin section specifically for the SystemButton and map that in your scheme, or alternatively make the standard button skin a bit more smart. Since I like showing off Falagard abilities, the patch does just that ;)

First some info about what we're doing here:
First we define a new property to control whether to draw the 'standard imagery' of the frame.
Next we split out the rendering of the assigned images into their own imagery sections.
Now we use the newly defined property as a control boolean that states whether to draw certain parts of the imagery in the StateImagery sections.
We also add section specifications for the newly defined *_image sections we defined above.
Finally, we add a property setter to the System button definition in FrameWindow to disable drawing of the standard imagery.

You might need to extent it slightly to conditionally draw the label too, but since no label is defined for those it does not really matter.

Just need to reiterate that this looks awesome - even better when it's possible to play around with it :D

Code: Select all

--- AquaLook.looknfeel.org   2008-03-16 18:44:36.000000000 +0000
+++ AquaLook.looknfeel   2008-03-17 17:28:53.000000000 +0000
@@ -6,6 +6,7 @@
     ***************************************************
     -->
     <WidgetLook name="AquaLook/Button">
+        <PropertyDefinition name="DrawStandardImagery" initialValue="True" redrawOnWrite="true" />
         <PropertyDefinition name="NormalTextColour" initialValue="FF000000" redrawOnWrite="true" />
         <PropertyDefinition name="HoverTextColour" initialValue="FF000000" redrawOnWrite="true" />
         <PropertyDefinition name="PushedTextColour" initialValue="FF000000" redrawOnWrite="true" />
@@ -42,6 +43,8 @@
                 <Image type="RightEdge" imageset="AquaLook" image="ButtonRightNormal" />
                 <Image type="Background" imageset="AquaLook" image="ButtonMiddleNormal" />
             </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="normal_image">
             <ImageryComponent>
                 <Area>
                     <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
@@ -66,6 +69,8 @@
                 <Image type="RightEdge" imageset="AquaLook" image="ButtonRightHighlight" />
                 <Image type="Background" imageset="AquaLook" image="ButtonMiddleHighlight" />
             </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="hover_image">
             <ImageryComponent>
                 <Area>
                     <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
@@ -90,6 +95,8 @@
                 <Image type="RightEdge" imageset="AquaLook" image="ButtonRightPushed" />
                 <Image type="Background" imageset="AquaLook" image="ButtonMiddlePushed" />
             </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="pushed_image">
             <ImageryComponent>
                 <Area>
                     <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
@@ -104,7 +111,8 @@
         </ImagerySection>
         <StateImagery name="Normal">
             <Layer>
-                <Section section="normal" />
+                <Section section="normal" controlProperty="DrawStandardImagery" />
+                <Section section="normal_image" />
                 <Section section="label">
                     <ColourProperty name="NormalTextColour" />
                 </Section>
@@ -112,7 +120,8 @@
         </StateImagery>
         <StateImagery name="Hover">
             <Layer>
-                <Section section="hover" />
+                <Section section="hover" controlProperty="DrawStandardImagery" />
+                <Section section="hover_image" />
                 <Section section="label">
                     <ColourProperty name="HoverTextColour" />
                 </Section>
@@ -120,7 +129,8 @@
         </StateImagery>
         <StateImagery name="Pushed">
             <Layer>
-                <Section section="pushed" />
+                <Section section="pushed" controlProperty="DrawStandardImagery" />
+                <Section section="pushed_image" />
                 <Section section="label">
                     <ColourProperty name="PushedTextColour" />
                 </Section>
@@ -128,7 +138,8 @@
         </StateImagery>
         <StateImagery name="PushedOff">
             <Layer>
-                <Section section="hover" />
+                <Section section="hover" controlProperty="DrawStandardImagery" />
+                <Section section="hover_image" />
                 <Section section="label">
                     <ColourProperty name="HoverTextColour" />
                 </Section>
@@ -136,7 +147,10 @@
         </StateImagery>
         <StateImagery name="Disabled">
             <Layer>
-                <Section section="normal">
+                <Section section="normal" controlProperty="DrawStandardImagery" >
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="normal_image" >
                     <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
                 </Section>
                 <Section section="label">
@@ -705,7 +719,7 @@
                 <Dim type="Width" ><ImageDim imageset="AquaLook" image="CloseNormal" dimension="Width" /></Dim>
                 <Dim type="Height" ><ImageDim imageset="AquaLook" image="CloseNormal" dimension="Height" /></Dim>
             </Area>
-           
+            <Property name="DrawStandardImagery" value="False" />
             <Property name="AlwaysOnTop" value="True" />
             <Property name="NormalImage" value="set:AquaLook image:CloseNormal" />
             <Property name="HoverImage" value="set:AquaLook image:CloseHover" />

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

Postby CrazyEddie » Mon Mar 17, 2008 17:49

prager wrote:And I found another problem - in the zip above are also sources of a little bit changed demo from CEGUI, which I wanted to use for preview of the skin. The problem I found there is that for Slider element the thumb does not get displayed after loading the layout file for some reason. When I change the window size, the thumb appears and everything is ok. Please, where is the problem?

Nuts. Missed this in the original reply. This was a bug and has been fixed in the latest code. Not entirely sure of a workaround - did you try setting the size a couple of times (to different values) to simulate the user drag-size?

CE

User avatar
prager
Just popping in
Just popping in
Posts: 12
Joined: Fri Mar 14, 2008 19:02
Contact:

Postby prager » Mon Mar 17, 2008 20:16

Whow, thanks a lot... Thats... magic... :) My understanding of these files is still quite limited...

According to the statictext problem - sorry, my fault (as usual) :) ... the CELayoutEditor sets the textcolour property directly, so the changes in the looknfeel file won't have any effect...

The size and slider problem - this solved it:

Code: Select all

  FrameWindow* win = (FrameWindow*)WindowManager::getSingleton().getWindow("Root/Frame");
  UVector2 size = win->getSize();
  win->setSize(UVector2(UDim(0,10),UDim(0,10)));
  win->setSize(size);


Thanks a lot... :)

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

Postby CrazyEddie » Tue Mar 18, 2008 10:43

Just to follow up on the static text issue a little, and to correct something I said previously...

It seems you do not need those ImagerySection definitions for the text as the text is drawn by code (this is due to the scrollbar support being added).

Glad you have found the cause of the issue though :)

CE.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 10 guests