field.setText(list.getSelected());
list.setEnabled(false);
list.setVisible(false);
- TComboBox.this.setHeight(1);
+ TComboBox.super.setHeight(1);
if (TComboBox.this.limitToListValue == false) {
TComboBox.this.activate(field);
}
list.setEnabled(false);
list.setVisible(false);
- setHeight(1);
+ super.setHeight(1);
if (limitToListValue) {
field.setEnabled(false);
} else {
// TWidget ----------------------------------------------------------------
// ------------------------------------------------------------------------
+ /**
+ * Override TWidget's width: we need to set child widget widths.
+ *
+ * @param width new widget width
+ */
+ @Override
+ public void setWidth(final int width) {
+ if (field != null) {
+ field.setWidth(width - 3);
+ }
+ if (list != null) {
+ list.setWidth(width);
+ }
+ super.setWidth(width);
+ }
+
+ /**
+ * Override TWidget's height: we can only set height at construction
+ * time.
+ *
+ * @param height new widget height (ignored)
+ */
+ @Override
+ public void setHeight(final int height) {
+ // Do nothing
+ }
+
/**
* Draw the combobox down arrow.
*/
public void hideList() {
list.setEnabled(false);
list.setVisible(false);
- setHeight(1);
+ super.setHeight(1);
if (limitToListValue == false) {
activate(field);
}
public void showList() {
list.setEnabled(true);
list.setVisible(true);
- setHeight(list.getHeight() + 1);
+ super.setHeight(list.getHeight() + 1);
activate(list);
}