X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fpanel.cpp;h=0ecdf1077ca0a7ae05abaa957dad2fb327493c5c;hb=2bdaf4955fdb94e73704adcdcf0adc2b353f0ff0;hp=59553b45de0122136a4c410ebf06a50ed378f6e4;hpb=0af3c2393bd00f39db3bfaf5b78a7a44f0fd5ff1;p=libs%2Fgltk.git diff --git a/source/panel.cpp b/source/panel.cpp index 59553b4..0ecdf10 100644 --- a/source/panel.cpp +++ b/source/panel.cpp @@ -1,7 +1,7 @@ /* $Id$ This file is part of libmspgltk -Copyright © 2007-2009 Mikko Rasa, Mikkosoft Productions +Copyright © 2007-2011 Mikko Rasa, Mikkosoft Productions Distributed under the LGPL */ @@ -25,14 +25,15 @@ using namespace std; namespace Msp { namespace GLtk { -Panel::Panel(const Resources &r): - Widget(r), - Container(r), +Panel::Panel(): pointer_focus(0), pointer_grabbed(false), input_focus(0) +{ } + +Panel::Child *Panel::create_child(Widget *wdg) { - update_style(); + return new Child(*this, wdg); } void Panel::raise(Widget &wdg) @@ -58,6 +59,16 @@ Widget *Panel::get_final_input_focus() const return input_focus; } +void Panel::render_special(const Part &part) const +{ + if(part.get_name()=="children") + { + for(list::const_iterator i=children.begin(); i!=children.end(); ++i) + if((*i)->widget->is_visible()) + (*i)->widget->render(); + } +} + void Panel::button_press(int x, int y, unsigned btn) { if(pointer_grabbed) @@ -125,21 +136,6 @@ void Panel::focus_out() set_input_focus(0); } -void Panel::render_special(const Part &part) const -{ - if(part.get_name()=="children") - { - for(list::const_iterator i=children.begin(); i!=children.end(); ++i) - if((*i)->widget->is_visible()) - (*i)->widget->render(); - } -} - -Panel::Child *Panel::create_child(Widget *wdg) -{ - return new Child(*this, wdg); -} - void Panel::set_pointer_focus(Widget *wdg) { if(wdg!=pointer_focus) @@ -193,7 +189,7 @@ Panel::Loader::Loader(Panel &p, map &m): template void Panel::Loader::child(const string &n) { - RefPtr chl = new T(pnl.res); + RefPtr chl = new T(); load_sub(*chl); pnl.add(*chl.get()); wdg_map[n] = chl.release(); @@ -201,7 +197,7 @@ void Panel::Loader::child(const string &n) void Panel::Loader::panel(const string &n) { - RefPtr p = new Panel(pnl.res); + RefPtr p = new Panel(); load_sub(*p, wdg_map); pnl.add(*p.get()); wdg_map[n] = p.release();