return new TRadioGroup(this, x, y, label);
}
+ /**
+ * Convenience function to add a text field to this container/window.
+ *
+ * @param x column relative to parent
+ * @param y row relative to parent
+ * @param width visible text width
+ * @param fixed if true, the text cannot exceed the display width
+ * @return the new text field
+ */
+ public final TField addField(final int x, final int y,
+ final int width, final boolean fixed) {
+
+ return new TField(this, x, y, width, fixed);
+ }
+
+ /**
+ * Convenience function to add a text field to this container/window.
+ *
+ * @param x column relative to parent
+ * @param y row relative to parent
+ * @param width visible text width
+ * @param fixed if true, the text cannot exceed the display width
+ * @param text initial text, default is empty string
+ * @return the new text field
+ */
+ public final TField addField(final int x, final int y,
+ final int width, final boolean fixed, final String text) {
+
+ return new TField(this, x, y, width, fixed, text);
+ }
+
+ /**
+ * Convenience function to add a text field to this container/window.
+ *
+ * @param x column relative to parent
+ * @param y row relative to parent
+ * @param width visible text width
+ * @param fixed if true, the text cannot exceed the display width
+ * @param text initial text, default is empty string
+ * @param enterAction function to call when enter key is pressed
+ * @param updateAction function to call when the text is updated
+ * @return the new text field
+ */
+ public final TField addField(final int x, final int y,
+ final int width, final boolean fixed, final String text,
+ final TAction enterAction, final TAction updateAction) {
+
+ return new TField(this, x, y, width, fixed, text, enterAction,
+ updateAction);
+ }
+
+ /**
+ * Convenience function to add a scrollable text box to this
+ * container/window.
+ *
+ * @param text text on the screen
+ * @param x column relative to parent
+ * @param y row relative to parent
+ * @param width width of text area
+ * @param height height of text area
+ * @param colorKey ColorTheme key color to use for foreground text
+ * @return the new text box
+ */
+ public final TText addText(final String text, final int x,
+ final int y, final int width, final int height, final String colorKey) {
+
+ return new TText(this, text, x, y, width, height, colorKey);
+ }
+
+ /**
+ * Convenience function to add a scrollable text box to this
+ * container/window.
+ *
+ * @param text text on the screen
+ * @param x column relative to parent
+ * @param y row relative to parent
+ * @param width width of text area
+ * @param height height of text area
+ * @return the new text box
+ */
+ public final TText addText(final String text, final int x, final int y,
+ final int width, final int height) {
+
+ return new TText(this, text, x, y, width, height, "ttext");
+ }
+
+ /**
+ * Convenience function to spawn a message box.
+ *
+ * @param title window title, will be centered along the top border
+ * @param caption message to display. Use embedded newlines to get a
+ * multi-line box.
+ * @return the new message box
+ */
+ public final TMessageBox messageBox(final String title,
+ final String caption) {
+
+ return getApplication().messageBox(title, caption, TMessageBox.Type.OK);
+ }
+
+ /**
+ * Convenience function to spawn a message box.
+ *
+ * @param title window title, will be centered along the top border
+ * @param caption message to display. Use embedded newlines to get a
+ * multi-line box.
+ * @param type one of the TMessageBox.Type constants. Default is
+ * Type.OK.
+ * @return the new message box
+ */
+ public final TMessageBox messageBox(final String title,
+ final String caption, final TMessageBox.Type type) {
+
+ return getApplication().messageBox(title, caption, type);
+ }
+
+ /**
+ * Convenience function to spawn an input box.
+ *
+ * @param title window title, will be centered along the top border
+ * @param caption message to display. Use embedded newlines to get a
+ * multi-line box.
+ * @return the new input box
+ */
+ public final TInputBox inputBox(final String title, final String caption) {
+
+ return getApplication().inputBox(title, caption);
+ }
+
+ /**
+ * Convenience function to spawn an input box.
+ *
+ * @param title window title, will be centered along the top border
+ * @param caption message to display. Use embedded newlines to get a
+ * multi-line box.
+ * @param text initial text to seed the field with
+ * @return the new input box
+ */
+ public final TInputBox inputBox(final String title, final String caption,
+ final String text) {
+
+ return getApplication().inputBox(title, caption, text);
+ }
}