]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/panel.cpp
Add icon support to Button
[libs/gltk.git] / source / panel.cpp
index 3123db41bccd2dc6036a7fd89a1facfdea593e06..a708873edbeb4a7df6e2a2a1b097dfb057df6ced 100644 (file)
@@ -156,12 +156,18 @@ void Panel::child_hidden(Widget &wdg)
 {
        if(&wdg==pointer_focus)
                set_pointer_focus(0, 0);
+       if(&wdg==input_focus)
+               set_input_focus(0);
 }
 
 void Panel::grab_pointer(Widget &wdg)
 {
        if(pointer_grab==0 || pointer_focus==&wdg)
+       {
                set_pointer_focus(&wdg, 255);
+               if(parent)
+                       parent->grab_pointer(*this);
+       }
        else
                throw InvalidState("Pointer is already grabbed");
 }
@@ -169,7 +175,11 @@ void Panel::grab_pointer(Widget &wdg)
 void Panel::ungrab_pointer(Widget &wdg)
 {
        if(pointer_focus==&wdg)
+       {
                set_pointer_focus(0, 0);
+               if(parent)
+                       parent->ungrab_pointer(*this);
+       }
        else if(pointer_grab>0)
                throw Exception("Someone is trying to steal the pointer!");
 }