]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/widget.cpp
Reorder class members
[libs/gltk.git] / source / widget.cpp
index e1538dec221bedc9a190c5904421ce6e1d16d87c..e20ea82b56fcf085a2cab9a8eb7a1e0e96aaad19 100644 (file)
@@ -1,14 +1,27 @@
+/* $Id$
+
+This file is part of libmspgltk
+Copyright © 2007  Mikko Rasa, Mikkosoft Productions
+Distributed under the LGPL
+*/
+
 #include <msp/gl/matrix.h>
 #include <msp/gl/transform.h>
 #include "resources.h"
 #include "widget.h"
 
-#include <iostream>
 using namespace std;
 
 namespace Msp {
 namespace GLtk {
 
+Widget::Widget(const Resources &r):
+       res(r),
+       style(0),
+       state(NORMAL),
+       visible(true)
+{ }
+
 void Widget::set_position(int x, int y)
 {
        geom.x=x;
@@ -44,24 +57,6 @@ void Widget::render() const
        GL::pop_matrix();
 }
 
-Widget::Widget(const Resources &r):
-       res(r),
-       style(0),
-       state(NORMAL),
-       visible(true)
-{ }
-
-void Widget::update_style()
-{
-       string sname=get_class();
-       if(!style_name.empty())
-       {
-               sname+='-';
-               sname+=style_name;
-       }
-       style=res.get<Style>(sname);
-}
-
 void Widget::render_part(const Part &part) const
 {
        render_graphic(part);
@@ -94,6 +89,17 @@ void Widget::render_text(const Part &part, const string &text) const
        GL::pop_matrix();
 }
 
+void Widget::update_style()
+{
+       string sname=get_class();
+       if(!style_name.empty())
+       {
+               sname+='-';
+               sname+=style_name;
+       }
+       style=res.get<Style>(sname);
+}
+
 
 Widget::Loader::Loader(Widget &w):
        wdg(w)