GUI Coding Syntax
Posted: Sun Nov 16, 2008 7:10 pm
To stop derailing this thread here: http://www.ogre3d.org/phpBB2/viewtopic.php?t=44833
On the topic of interesting GUI syntax, here's my contribution once again:
It's actually very intuitive to program with, there's no widget casting or anything like that. Creating custom widgets is extremely simple, too, and defining their custom behaviour is as simple as overriding an update() function (and possible the companion 'getter' attrib() function). Thoughts?
On the topic of interesting GUI syntax, here's my contribution once again:
Code: Select all
(*_sheet)
("size", vec2(_renderer->width(), _renderer->height()))
// debug panels
(widget_(window, "debug")
(widget_(panel, "0")
("texture", string("renderer_gbuffer_0"))
("size", vec2(128, 128))
("draggable", false)
,widget_(panel, "1")
("texture", string("renderer_gbuffer_1"))
("size", vec2(128, 128))
("draggable", false)
,widget_(panel, "2")
("texture", string("renderer_gbuffer_2"))
("size", vec2(128, 128))
("draggable", false)
,widget_(panel, "3")
("texture", string("renderer_gbuffer_3"))
("size", vec2(128, 128))
("draggable", false)
,widget_(panel, "4")
("texture", string("renderer_shade_texture"))
("size", vec2(128, 128))
("draggable", false)
)
("size", vec2(5 * 128, 128))
("autoArrange")
["titlebar"]
["text"]
("text", string("debug"))
.up()
.up()
// add in scrollbar for time control
,widget_(window, "timeSpeedScrollbarWin")
("size", vec2(128, 16))
("closable", false)
("resizable", false)
(widget_(scrollbar, "timeSpeedScrollbar")
("points", vec4(0, 0, 112, 0))
("position", vec2(112, 0))
(EVT_SCROLL, gui::bind(&editorState::_timeSpeedScroll, this, _1))
)
["titlebar"]
["text"]
("text", string("time speed"))
.up()
.up()
);