|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r51376 - in sandbox/guigl: boost/guigl/view libs/guigl/example
From: stipe_at_[hidden]
Date: 2009-02-21 16:14:03
Author: srajko
Date: 2009-02-21 16:14:03 EST (Sat, 21 Feb 2009)
New Revision: 51376
URL: http://svn.boost.org/trac/boost/changeset/51376
Log:
added set_draw_prologue and set_draw_epilogue
Text files modified:
sandbox/guigl/boost/guigl/view/custom_drawable.hpp | 8 +++++++-
sandbox/guigl/libs/guigl/example/custom_example.cpp | 16 +++++++++++++++-
2 files changed, 22 insertions(+), 2 deletions(-)
Modified: sandbox/guigl/boost/guigl/view/custom_drawable.hpp
==============================================================================
--- sandbox/guigl/boost/guigl/view/custom_drawable.hpp (original)
+++ sandbox/guigl/boost/guigl/view/custom_drawable.hpp 2009-02-21 16:14:03 EST (Sat, 21 Feb 2009)
@@ -30,7 +30,13 @@
, m_draw_prologue(rhs.m_draw_prologue)
, m_draw_epilogue(rhs.m_draw_epilogue)
{}
-
+ template<typename T>
+ void set_draw_prologue(const T &t)
+ { m_draw_prologue = t; }
+ template<typename T>
+ void set_draw_epilogue(const T &t)
+ { m_draw_epilogue = t; }
+
protected:
void draw_prologue()
{
Modified: sandbox/guigl/libs/guigl/example/custom_example.cpp
==============================================================================
--- sandbox/guigl/libs/guigl/example/custom_example.cpp (original)
+++ sandbox/guigl/libs/guigl/example/custom_example.cpp 2009-02-21 16:14:03 EST (Sat, 21 Feb 2009)
@@ -21,14 +21,28 @@
glRectd(0.0, 0.0, 50.0, 50.0);
}
+void draw_stuff2()
+{
+ glColor3d(1.0, 0.0, 0.0);
+ glRectd(0.0, 0.0, 150.0, 150.0);
+}
+
int main()
{
window test_window1(( _label = "custom example", _size=size_type(300,300) ));
test_window1 << new widget::custom((
- _size=size_type(300,300),
+ _size=size_type(300,150),
_draw_prologue=draw_stuff
));
+ widget::custom *set = new widget::custom((
+ _size=size_type(300,150), _position=position_type(0, 150)
+ ));
+
+ set->set_draw_prologue(&draw_stuff2);
+
+ test_window1 << set;
+
application::run();
}
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk