addCharValidator
addCharValidator: (ChatboxTextInput, any) -> ChatboxTextInputAlso require validator(c) (c a character's code point) of every character typed, pasted or set; returns the panel.
chatboxPanelManager:openTextInput(…)
ChatboxTextInput.new(…)| Method | Returns | Description |
|---|---|---|
addCharValidator(any) | ChatboxTextInput | Also require validator(c) (c a character's code point) of every character typed, pasted or set; returns the panel. |
charValidator(any) | ChatboxTextInput | Replace the validator (nil: printable ASCII); returns the panel. |
lines(number) | ChatboxTextInput | Wrap the text over at most lines lines (0: as many as it takes); returns the panel. |
prompt(string) | ChatboxTextInput | Set the prompt; returns the panel. |
value(string) | ChatboxTextInput | Set the text (characters the validator refuses left out), the cursor at its end; returns the panel. |
cursorAt(number, number?) | ChatboxTextInput | Put the cursor at indexA, or select indexA..indexB; returns the panel. |
getValue() | string | The text. |
onClose(() -> ()) | ChatboxTextInput | What runs when the panel closes, however it closes; returns the panel. |
onDone((string) -> boolean?) | ChatboxTextInput | What runs with the text on Enter; only an explicit false keeps the panel open. Returns the panel. |
onChanged((string) -> ()) | ChatboxTextInput | What runs with the text each time an edit changes it; returns the panel. |
fontID(number) | ChatboxTextInput | The font (FontID, QUILL_8 unless set); returns the panel. |
getPrompt() | string? | The prompt. |
getLines() | number | What lines set. |
getCursorStart() | number | The cursor, or the selection's start. |
getCursorEnd() | number | The cursor, or the selection's end. |
getCharValidator() | any | The validator. |
getOnClose() | any | What onClose set. |
getOnDone() | any | What onDone set. |
getOnChanged() | any | What onChanged set. |
getFontID() | number | The font. |
isBuilt() | boolean | Whether the panel has been opened. |
update() | () | Redraw the panel: the prompt, then buildEdit(0, 50, width, 0). A subclass overrides it to draw its own. |
buildEdit(number, number, number, number) | () | Draw the text, its selection and the cursor at (x, y) over w (centred when w > 0), each line h high (0: the font's baseline). |
build() | ChatboxTextInput | Open the panel (a prompt first, else IllegalStateException); returns it. |
keyTyped(AwtKeyEvent) | () | Insert the character typed, over the selection. |
keyPressed(AwtKeyEvent) | () | The editing keys: Ctrl+X/C/V/A, Delete, Backspace, the arrows (Shift selects), Home, End, Enter (onDone, then close) and Escape. |
keyReleased(AwtKeyEvent) | () | Nothing. |
mousePressed(AwtMouseEvent) | AwtMouseEvent | A left press on the text moves the cursor there (Shift extends the selection); the event goes on. |
mouseDragged(AwtMouseEvent) | AwtMouseEvent | A left drag selects; the event goes on. |
new(ChatboxPanelManager?, ClientThread?) | ChatboxTextInput | Builds a text input: ChatboxTextInput.new(chatboxPanelManager, clientThread). |
| Method | Returns | Description |
|---|---|---|
ChatboxPanelManager.openTextInput | ChatboxTextInput | A new text input panel prompting prompt, to set up and open with build. |
ChatboxTextInputClass.new | ChatboxTextInput | Builds a text input: ChatboxTextInput.new(chatboxPanelManager, clientThread). |
addCharValidatoraddCharValidator: (ChatboxTextInput, any) -> ChatboxTextInputAlso require validator(c) (c a character's code point) of every character typed, pasted or set; returns the panel.
charValidatorcharValidator: (ChatboxTextInput, any) -> ChatboxTextInputReplace the validator (nil: printable ASCII); returns the panel.
lineslines: (ChatboxTextInput, number) -> ChatboxTextInputWrap the text over at most lines lines (0: as many as it takes); returns the panel.
promptprompt: (ChatboxTextInput, string) -> ChatboxTextInputSet the prompt; returns the panel.
valuevalue: (ChatboxTextInput, string) -> ChatboxTextInputSet the text (characters the validator refuses left out), the cursor at its end; returns the panel.
cursorAtcursorAt: (ChatboxTextInput, number, number?) -> ChatboxTextInputPut the cursor at indexA, or select indexA..indexB; returns the panel.
getValuegetValue: (ChatboxTextInput) -> stringThe text.
onCloseonClose: (ChatboxTextInput, () -> ()) -> ChatboxTextInputWhat runs when the panel closes, however it closes; returns the panel.
onDoneonDone: (ChatboxTextInput, (string) -> boolean?) -> ChatboxTextInputWhat runs with the text on Enter; only an explicit false keeps the panel open. Returns the panel.
onChangedonChanged: (ChatboxTextInput, (string) -> ()) -> ChatboxTextInputWhat runs with the text each time an edit changes it; returns the panel.
fontIDfontID: (ChatboxTextInput, number) -> ChatboxTextInputThe font (FontID, QUILL_8 unless set); returns the panel.
getPromptgetPrompt: (ChatboxTextInput) -> string?The prompt.
getLinesgetLines: (ChatboxTextInput) -> numberWhat lines set.
getCursorStartgetCursorStart: (ChatboxTextInput) -> numberThe cursor, or the selection's start.
getCursorEndgetCursorEnd: (ChatboxTextInput) -> numberThe cursor, or the selection's end.
getCharValidatorgetCharValidator: (ChatboxTextInput) -> anyThe validator.
getOnClosegetOnClose: (ChatboxTextInput) -> anyWhat onClose set.
getOnDonegetOnDone: (ChatboxTextInput) -> anyWhat onDone set.
getOnChangedgetOnChanged: (ChatboxTextInput) -> anyWhat onChanged set.
getFontIDgetFontID: (ChatboxTextInput) -> numberThe font.
isBuiltisBuilt: (ChatboxTextInput) -> booleanWhether the panel has been opened.
updateupdate: (ChatboxTextInput) -> ()Redraw the panel: the prompt, then buildEdit(0, 50, width, 0). A subclass overrides it to draw its own.
buildEditbuildEdit: (ChatboxTextInput, number, number, number, number) -> ()Draw the text, its selection and the cursor at (x, y) over w (centred when w > 0), each line h high (0: the font's baseline).
buildbuild: (ChatboxTextInput) -> ChatboxTextInputOpen the panel (a prompt first, else IllegalStateException); returns it.
keyTypedkeyTyped: (ChatboxTextInput, AwtKeyEvent) -> ()Insert the character typed, over the selection.
keyPressedkeyPressed: (ChatboxTextInput, AwtKeyEvent) -> ()The editing keys: Ctrl+X/C/V/A, Delete, Backspace, the arrows (Shift selects), Home, End, Enter (onDone, then close) and Escape.
keyReleasedkeyReleased: (ChatboxTextInput, AwtKeyEvent) -> ()Nothing.
mousePressedmousePressed: (ChatboxTextInput, AwtMouseEvent) -> AwtMouseEventA left press on the text moves the cursor there (Shift extends the selection); the event goes on.
mouseDraggedmouseDragged: (ChatboxTextInput, AwtMouseEvent) -> AwtMouseEventA left drag selects; the event goes on.
newnew: (ChatboxPanelManager?, ClientThread?) -> ChatboxTextInputBuilds a text input: ChatboxTextInput.new(chatboxPanelManager, clientThread).