X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fpanel.cpp;h=91e30cdcbafadd63b98714c6cd1a8f3969fb1f07;hb=2accd84fb2f8cc96efea8b3f27e381c2d2749160;hp=4b44370343c47bcbe8fae960ad0d6827881bb234;hpb=c1faa54a3218b53757b8b55de0ff8aa64412253b;p=libs%2Fgltk.git diff --git a/source/panel.cpp b/source/panel.cpp index 4b44370..91e30cd 100644 --- a/source/panel.cpp +++ b/source/panel.cpp @@ -39,6 +39,12 @@ void Panel::set_layout(Layout *l) layout = l; } +void Panel::autosize() +{ + if(layout) + layout->autosize(); +} + Panel::Child *Panel::create_child(Widget *wdg) { return new Child(*this, wdg); @@ -127,10 +133,10 @@ void Panel::pointer_leave() set_pointer_focus(0); } -void Panel::key_press(unsigned key, unsigned mod, wchar_t ch) +void Panel::key_press(unsigned key, unsigned mod) { if(input_focus) - input_focus->key_press(key, mod, ch); + input_focus->key_press(key, mod); } void Panel::key_release(unsigned key, unsigned mod) @@ -139,22 +145,40 @@ void Panel::key_release(unsigned key, unsigned mod) input_focus->key_release(key, mod); } +void Panel::character(wchar_t ch) +{ + if(input_focus) + input_focus->character(ch); +} + void Panel::focus_out() { set_input_focus(0); Widget::focus_out(); } +void Panel::on_geometry_change() +{ + if(layout) + layout->update(); +} + void Panel::on_child_added(Widget &wdg) { if(layout) + { layout->add_widget(wdg); + signal_autosize_changed.emit(); + } } void Panel::on_child_removed(Widget &wdg) { if(layout) + { layout->remove_widget(wdg); + signal_autosize_changed.emit(); + } } void Panel::set_pointer_focus(Widget *wdg)