diff options
Diffstat (limited to '')
-rw-r--r-- | src/menu/container.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/menu/container.cpp b/src/menu/container.cpp index 31155e3c..fb13d398 100644 --- a/src/menu/container.cpp +++ b/src/menu/container.cpp @@ -144,4 +144,25 @@ namespace usdx DrawableControl::set_size(width, height); recalculate_window_coords(); } + + DrawableControl* Container::get_component_at(const Point<int>& p) + { + if (!get_absolut_rect().is_in(p)) + return NULL; + + for (std::list<DrawableControl*>::iterator next = controls.begin(), it = next++; + it != controls.end(); it = next++) { + + DrawableControl* c = (*it)->get_component_at(p); + if (c != NULL) { + return c; + } + } + + if (frame) { + return frame->get_component_at(p); + } + + return this; + } }; |