aboutsummaryrefslogtreecommitdiffstats
path: root/src/menu/container.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/menu/container.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/menu/container.cpp b/src/menu/container.cpp
index ce73c1c2..3cf8d770 100644
--- a/src/menu/container.cpp
+++ b/src/menu/container.cpp
@@ -91,4 +91,40 @@ namespace usdx
{
return window_coords;
}
+
+ void Container::recalculate_window_coords(void)
+ {
+ if (parent) {
+ assert(parent != NULL);
+ window_coords.set_x(parent->get_width() -
+ (get_left() + get_width()));
+
+ window_coords.set_y(parent->get_height() -
+ (get_top() + get_height()));
+ }
+ }
+
+ void Container::set_position(const Point<int>& position)
+ {
+ DrawableControl::set_position(position);
+ recalculate_window_coords();
+ }
+
+ void Container::set_position(int left, int top)
+ {
+ DrawableControl::set_position(left, top);
+ recalculate_window_coords();
+ }
+
+ void Container::set_size(const Dimension<int>& size)
+ {
+ DrawableControl::set_size(size);
+ recalculate_window_coords();
+ }
+
+ void Container::set_size(int width, int height)
+ {
+ DrawableControl::set_size(width, height);
+ recalculate_window_coords();
+ }
};