]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/style.cpp
Enable loading of entry widgets from datafiles
[libs/gltk.git] / source / style.cpp
index 6c116570fe24677fbb9002eb3061d2e3f7f0c9c2..0d6e424e2163b048d65c3c76af46b7792cb87acc 100644 (file)
@@ -13,8 +13,8 @@ using namespace std;
 namespace Msp {
 namespace GLtk {
 
-Style::Style():
-       font(0)
+Style::Style(Resources &r):
+       font(&r.get_default_font())
 { }
 
 
@@ -25,6 +25,7 @@ Style::Loader::Loader(Style &s, Resources &r):
        add("font",       &Style::font);
        add("font_color", &Loader::font_color);
        add("part",       &Loader::part);
+       add("special",    &Loader::special);
 }
 
 void Style::Loader::font_color(float r, float g, float b)
@@ -32,7 +33,14 @@ void Style::Loader::font_color(float r, float g, float b)
        style.font_color=GL::Color(r, g, b);
 }
 
-void Style::Loader::part(const string &n)
+void Style::Loader::part()
+{
+       Part p((string()));
+       load_sub(p, res);
+       style.parts.push_back(p);
+}
+
+void Style::Loader::special(const string &n)
 {
        Part p(n);
        load_sub(p, res);