+ /**
+ * Handle mouse button presses.
+ *
+ * @param mouse mouse button press event
+ */
+ @Override
+ public void onMouseDown(final TMouseEvent mouse) {
+ if ((mouseOnRadioButton(mouse)) && (mouse.isMouse1())) {
+ // Switch state
+ selected = true;
+ ((TRadioGroup) getParent()).setSelected(this);
+ }
+ }
+
+ /**
+ * Handle keystrokes.
+ *
+ * @param keypress keystroke event
+ */
+ @Override
+ public void onKeypress(final TKeypressEvent keypress) {
+
+ if (keypress.equals(kbSpace)) {
+ selected = true;
+ ((TRadioGroup) getParent()).setSelected(this);
+ return;
+ }
+
+ if (keypress.equals(kbEsc)) {
+ TRadioGroup parent = (TRadioGroup) getParent();
+ if (parent.requiresSelection == false) {
+ selected = false;
+ parent.setSelected(0);
+ }
+ return;
+ }
+
+ // Pass to parent for the things we don't care about.
+ super.onKeypress(keypress);
+ }
+
+ // ------------------------------------------------------------------------
+ // TWidget ----------------------------------------------------------------
+ // ------------------------------------------------------------------------
+
+ /**
+ * Override TWidget's width: we can only set width at construction time.
+ *
+ * @param width new widget width (ignored)
+ */
+ @Override
+ public void setWidth(final int width) {
+ // Do nothing
+ }
+
+ /**
+ * 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
+ }
+