X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fpanel.cpp;h=91e30cdcbafadd63b98714c6cd1a8f3969fb1f07;hb=e291dcf478052c771d85089409f9bc22a4c8ab93;hp=b44004ff129c63b90cfb2b4aa5b8b2039e2aabe1;hpb=2b70e8801c43875ed3f4135bdd0141265cff0312;p=libs%2Fgltk.git diff --git a/source/panel.cpp b/source/panel.cpp index b44004f..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); @@ -53,7 +59,7 @@ void Panel::raise(Widget &wdg) return; } - throw InvalidState("That Widget is not in this Panel"); + throw hierarchy_error("widget not in panel"); } Widget *Panel::get_final_input_focus() const @@ -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)