this.x = x;
this.y = y;
- this.width = width;
- this.height = height;
+ // Call the functions so that subclasses can choose how to handle it.
+ setWidth(width);
+ setHeight(height);
if (layout != null) {
layout.onResize(new TResizeEvent(TResizeEvent.Type.WIDGET,
width, height));
}
}
+ /**
+ * Make this widget, all of its parents, the active child.
+ */
+ public final void activateAll() {
+ activate();
+ if (parent == this) {
+ return;
+ }
+ if (parent != null) {
+ parent.activateAll();
+ }
+ }
+
/**
* Switch the active widget with the next in the tab order.
*
splitPane.setLeft(this);
splitPane.setRight(newWidget);
}
- splitPane.activate();
if (newWidget != null) {
- newWidget.activate();
+ newWidget.activateAll();
} else {
- activate();
+ activateAll();
}
assert (parent != null);
splitPane.setTop(this);
splitPane.setBottom(newWidget);
}
- splitPane.activate();
if (newWidget != null) {
- newWidget.activate();
+ newWidget.activateAll();
} else {
- activate();
+ activateAll();
}
assert (parent != null);