Sheet documentation?

Piko

11-06-2009 19:34:02

I want to use QuickGUI, but I can't seem to find any documentation, or examples of the sheet files. I've tried to use the Gui Editor, but when I go to save the sheet, it doesn't save anything, maybe a bug with it running in Linux.

So is there any detailed documentation on the sheet file format?

kungfoomasta

11-06-2009 21:43:57

Sorry, the Editor isn't quite finished yet, I've been slacking on it, the PropertyGrid widget needs more work, as part of the Editor work.

As for documentation the best place is the wiki: http://www.ogre3d.org/wiki/index.php/QuickGUI

"QuickGUI Beginner Tutorial 1" will show how to set up the library and create a Sheet, and the next tutorial shows how widgets are created. All of the tutorials are up to date with the latest release, and they're pretty simple. If there are parts that could be improved, feedback is welcome.

Piko

11-06-2009 22:02:01

Ok, where do I find mySheetFile.sheet?

I'm assuming these sheet files are like templates, so you don't have to hard code the GUI into your program, you could simply load a sheet file, and then QuickGUI loads it into the new sheet class.

Are there any examples of these sheet files?

kungfoomasta

11-06-2009 22:28:02

Until the Editor is complete, programmatically creating the GUI is the easiest route to take. Serialization is supported though, so technically you can create a Sheet file in a text editor and load it up with a line of code. The following is an example of a Sheet:


Sheet Sheet
{
BaseColor 1 1 1 1
BrushFilterMode BRUSHFILTER_LINEAR
ClipChildrenToDimensions true
ClipComponentsToDimensions true
ConsumeKeyboardEvents false
ContextMenuName
Dimensions 0 0 800 600
DisabledSkinType
Dragable false
Enabled true
HorizontalAnchor ANCHOR_HORIZONTAL_LEFT_RIGHT
HorzBarScrollPercent 0.2
HorzButtonScrollPercent 0.1
HoverTime 3
InheritOpacity true
MaxSize 0 0
MinSize 5 5
MoveBaseWidgetOnDrag false
PositionRelativeToParentClientDimensions true
RelativeOpacity 1
ResizeFromBottom false
ResizeFromLeft false
ResizeFromRight false
ResizeFromTop false
ScrollBarThickness 15
Scrollable true
SkinType default
SupportScrolling true
TransparencyPicking true
VertBarScrollPercent 0.2
VertButtonScrollPercent 0.1
VerticalAnchor ANCHOR_VERTICAL_TOP_BOTTOM
Visible true
XScrollOffset 0
YScrollOffset 0

UserDefinedHandlers WidgetEvents
{
}

Child Widgets
{
TabControl TabControl
{
BaseColor 1 1 1 1
BrushFilterMode BRUSHFILTER_LINEAR
ClipChildrenToDimensions true
ClipComponentsToDimensions true
ConsumeKeyboardEvents false
ContextMenuName
Dimensions 275 75 250 250
DisabledSkinType
Dragable false
Enabled true
HorizontalAnchor ANCHOR_HORIZONTAL_LEFT
HorzBarScrollPercent 0.2
HorzButtonScrollPercent 0.1
HoverTime 3
InheritOpacity true
MaxSize 0 0
MinSize 5 5
MoveBaseWidgetOnDrag false
PositionRelativeToParentClientDimensions true
RelativeOpacity 1
ResizeFromBottom false
ResizeFromLeft false
ResizeFromRight false
ResizeFromTop false
ScrollBarThickness 15
Scrollable true
SkinType default
SupportScrolling false
TransparencyPicking false
VertBarScrollPercent 0.2
VertButtonScrollPercent 0.1
VerticalAnchor ANCHOR_VERTICAL_TOP
Visible true
XScrollOffset 0
YScrollOffset 0
tabcontrol_tabHeight 20
tabcontrol_tabOverlap 10
tabcontrol_tabReordering true

UserDefinedHandlers WidgetEvents
{
}

UserDefinedHandlers TabControlEvents
{
}

Child Widgets
{
TabPage TabPage
{
AllottedWidth 0
HorizontalTextAlignment TEXT_ALIGNMENT_HORIZONTAL_LEFT
Index 3
TabFrontWidth 0
TabImageName
TextBrushFilterMode BRUSHFILTER_LINEAR
VerticalLineSpacing 2

Text segments
{
Segment0 micross.20 1 0 0 0 Page 2
}

Child Widgets
{
}

}

TabPage TabPage1
{
AllottedWidth 0
HorizontalTextAlignment TEXT_ALIGNMENT_HORIZONTAL_LEFT
Index 2
TabFrontWidth 0
TabImageName
TextBrushFilterMode BRUSHFILTER_LINEAR
VerticalLineSpacing 2

Text segments
{
Segment0 micross.20 1 0 0 0 Page 1
}

Child Widgets
{
}

}

TabPage TabPage2
{
AllottedWidth 0
HorizontalTextAlignment TEXT_ALIGNMENT_HORIZONTAL_LEFT
Index 1
TabFrontWidth 0
TabImageName qgui.image.png
TextBrushFilterMode BRUSHFILTER_LINEAR
VerticalLineSpacing 2

Text segments
{
Segment0 micross.20 1 0 0 0 Page 3
}

Child Widgets
{
}

}

TabPage TabPage3
{
AllottedWidth 0
HorizontalTextAlignment TEXT_ALIGNMENT_HORIZONTAL_LEFT
Index 0
TabFrontWidth 0
TabImageName qgui.image.png
TextBrushFilterMode BRUSHFILTER_LINEAR
VerticalLineSpacing 2

Text segments
{
Segment0 micross.20 1 0 0 0
}

Child Widgets
{
}

}

}

}

}

Child Windows
{
}

}

Piko

13-06-2009 00:31:46

Well I figured out your problem with the guieditor in linux. You defined the path to save sheets with backslashes instead of forward slashes. So now I can use that instead. =)

kungfoomasta

13-06-2009 00:54:04

Ah thanks, I'll start training myself to use only forward slashes for directory paths from now on. :)

The editor isn't complete yet, but in time it will be! Editors are always a pain to implement, despite my attempt at keeping it simple.

BronzeBeard

29-04-2010 16:03:50

Sorry for necroposting and bumping an old dead thread...

I was wondering if there were any WidgetEvents defined yet in the sheet files? If so could we/I get a little itty bitty list of em? The editor doesn't create any, and so i don't know of any arguments for that section.

kungfoomasta

30-04-2010 23:37:14

Do you have intellisense? :mrgreen:

If not, you'd find them in QuickGUIEventTypes.h:


/**
* All widgets must support these events
*/
enum WidgetEvent
{
// Property type events
WIDGET_EVENT_CLIENTSIZE_CHANGED = 0,
WIDGET_EVENT_ENABLED_CHANGED ,
WIDGET_EVENT_POSITION_CHANGED ,
WIDGET_EVENT_SCROLL_CHANGED ,
WIDGET_EVENT_SIZE_CHANGED ,
WIDGET_EVENT_SKIN_CHANGED ,
WIDGET_EVENT_VISIBLE_CHANGED ,
// Input type events
WIDGET_EVENT_CHARACTER_KEY ,
WIDGET_EVENT_DRAGGED ,
WIDGET_EVENT_DROPPED ,
WIDGET_EVENT_KEY_DOWN ,
WIDGET_EVENT_KEY_UP ,
WIDGET_EVENT_KEYBOARD_INPUT_GAIN ,
WIDGET_EVENT_KEYBOARD_INPUT_LOSE ,
WIDGET_EVENT_MOUSE_BUTTON_DOWN ,
WIDGET_EVENT_MOUSE_BUTTON_UP ,
WIDGET_EVENT_MOUSE_CLICK ,
WIDGET_EVENT_MOUSE_CLICK_DOUBLE ,
WIDGET_EVENT_MOUSE_CLICK_TRIPLE ,
WIDGET_EVENT_MOUSE_ENTER ,
WIDGET_EVENT_MOUSE_LEAVE ,
WIDGET_EVENT_MOUSE_MOVE ,
WIDGET_EVENT_MOUSE_WHEEL ,
WIDGET_EVENT_ON_HOVER ,
// Other type events
WIDGET_EVENT_COUNT
};

BronzeBeard

01-05-2010 01:11:33

No no, sorry, you misunderstood. :D I was asking how to use them in a sheet file.

Child Widgets
{
Label Label_Window_About_About
{
AllottedWidth 350
~blahblahblah~
Visible true

UserDefinedHandlers WidgetEvents
{
WIDGET_EVENT_KEY_DOWN ??????????????? (Do I put the function here?)
}

Text segments
{
Segment0 micross.12 1 1 1 1 RAWr
}

}
}

kungfoomasta

03-05-2010 17:22:05

Sorry for late response. It should look something like:


UserDefinedHandlers WidgetEvents
{
WIDGET_EVENT_KEY_DOWN myFunction
}


And then in the code:

QuickGUI::EventHandlerManager::getSingletonPtr()->registerEventHandler("myFunction",&myClass::myFunction,myClassInstance);


Alternatively you can just not add any user defined handlers in script, and do it solely in code:

myWidget->addWidgetEventHandler(WIDGET_EVENT_KEY_DOWN,&myClass::myFunction,myClassInstance);

BronzeBeard

04-05-2010 03:23:16

Sorry for late response. It should look something like:


UserDefinedHandlers WidgetEvents
{
WIDGET_EVENT_KEY_DOWN myFunction
}


And then in the code:

QuickGUI::EventHandlerManager::getSingletonPtr()->registerEventHandler("myFunction",&myClass::myFunction,myClassInstance);


Alternatively you can just not add any user defined handlers in script, and do it solely in code:

myWidget->addWidgetEventHandler(WIDGET_EVENT_KEY_DOWN,&myClass::myFunction,myClassInstance);



Thanks for the reply. I knew how to set event handlers in hard-code, I was just thinking that setting them in sheet files would be quicker. Perhaps in the future widgets events inside the sheet file will automatically register.Would be a nice option when you get the editor working. As it is now doing them in the sheet file seems to be more work than making them hard coding :)