+/* $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;
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);
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)