|
wavelength 1.0.0
|
Field the player types text into from a USB keyboard or the on-screen keyboard. More...
#include <uitextentry.h>


Public Member Functions | |
| UITextEntry (DataArray *pData, const char *pszPanel) | |
| Construct a text entry from its script description. | |
| ~UITextEntry () override | |
| Destroy the text entry. | |
| bool | DispatchPriv (Message *pMsg) override |
| Handle a keyboard key, or pass any other message to UIComponent. | |
| const char * | Text () const override |
| Report the text the player has entered. | |
| void | SetText (const char *pszText) override |
| Replace the text and put the caret after it. | |
| void | SetState (int nState, bool bForce) override |
| Change the state, showing the material and the font of the highlight style. | |
| void | Poll (float fTime) override |
| Blink the caret while the entry edits, and hide it otherwise. | |
| void | Print (PrnStream &stream) override |
| Write the entry's name. | |
| String | MaskText (const char *pszText) const |
| Report a copy of a text with every character replaced by an asterisk. | |
| float | CharWidth (int nIndex) |
| Report the width one character of the text takes, including the font's tracking. | |
| void | SetEditing (bool bEditing) |
| Start or stop editing. | |
| bool | HandleKey (int nKey) |
| Act on a key as if it were typed. | |
| void | ToggleCaret () |
| Show the caret when it is hidden, and hide it when it shows. | |
| void | Layout () |
| Show the part of the text that fits, and place the caret. | |
| void | UpdateCaret () |
| Move the caret object to mCaretPos. | |
| bool | ProcessKey (int nKey) |
| Edit the text for a key. | |
| bool | HandleKeyMsg (KeyboardKeyMsg *pMsg) |
| Edit the text for a keyboard message. | |
| float | GetMaxEntryWidth () const |
| void | SetMaxEntryWidth (float fMaxEntryWidth) |
| void | SetMaxNumChars (int nMaxNumChars) |
| void | SetScroll (int nScroll) |
| void | SetNumLines (int nNumLines) |
| void | SetPassword (int nPassword) |
| void | SetInvalidChars (DataArray *pInvalidChars) |
| int | GetWordWrapLines () const |
| Public Member Functions inherited from UIComponent | |
| UIComponent (DataArray *pData) | |
| Construct a showing component in the normal state. | |
| bool | Dispatch (Message *pMsg) override |
| Offer a message to the focused panel of the current screen, then handle it here. | |
| virtual bool | IsShowing () const |
| Report whether the component is showing. | |
| virtual void | SetShowing (bool bShowing) |
| Show or hide the component. | |
| virtual int | GetState () const |
| Report the state the component shows. | |
| virtual void | Focus () |
| React to the panel giving the component the focus. | |
| virtual void | Unfocus () |
| React to the panel taking the focus away. | |
| const char * | GetName () const |
| int | GetShowing () const |
| Public Member Functions inherited from MsgSink | |
| void * | operator new (size_t nSize) |
| Allocate a sink from the pool heaps under the tag "MsgSink". | |
| void | operator delete (void *pBlock) |
| Return a sink to the pool heaps. | |
| virtual | ~MsgSink () |
| void * | operator new (size_t size) |
| Allocate from the main heap under the name MsgSink. | |
| void | operator delete (void *mem) |
| Return memory to its heap. | |
| virtual | ~MsgSink () |
| Destroy the sink. | |
Static Public Member Functions | |
| static UIComponent * | New (DataArray *pData, const char *pszPanel) |
| Create a text entry from its script description. | |
| Static Public Member Functions inherited from UIComponent | |
| static void | Init (DataArray *pConfig) |
| Read the parameters of the flash a button shows when it is chosen. | |
Additional Inherited Members | |
| Public Types inherited from UIComponent | |
| enum | State { kStateNormal = 0 , kStateSelected = 1 , kStateDisabled = 2 } |
| The state a component shows, the values of mState and the index UIStyle selects with. More... | |
| Protected Attributes inherited from UIComponent | |
| const char * | mName |
| int | mShowing |
| int | mState |
| Static Protected Attributes inherited from UIComponent | |
| static int | sNumFlashes |
| Number of times a chosen button flashes before it reports the choice. | |
| static float | sSelectedMs |
| Milliseconds of each flash a chosen button spends in the selected state. | |
| static float | sNormalMs |
| Milliseconds of each flash a chosen button spends in the normal state. | |
Field the player types text into from a USB keyboard or the on-screen keyboard.
The RTTI records the class as deriving from UIComponent. The object is 0xb0 bytes, and the vtable is at 0x003d21f0. The panel's file provides the text object <panel>_<name>.txt, the caret <panel>_<name>_cursor.txt, the marker of the field's right edge <panel>_<name>_lastcursor.txt, and optionally the highlight mesh <panel>_<name>.mesh. The description may set scroll, num_lines, word_wrap_lines, max_entry_width, max_num_chars, password, invalid_chars, and, with a mesh, hilight_style.
A character that is refused sends a UITextEntryInvalidMsg, and the return key sends a UITextEntryCompleteMsg, both through the entry's own Dispatch(). While the entry edits, the caret blinks.
| UITextEntry::UITextEntry | ( | DataArray * | pData, |
| const char * | pszPanel ) |
Construct a text entry from its script description.
| pData | The script description. |
| pszPanel | The name of the panel the entry belongs to. |
|
override |
Destroy the text entry.
|
inlinestatic |
Create a text entry from its script description.
UIManager::Init() registers the routine for the entry type text_entry_comp.
| pData | The script description. |
| pszPanel | The name of the panel the entry belongs to. |
|
overridevirtual |
Handle a keyboard key, or pass any other message to UIComponent.
| pMsg | The message. |
Reimplemented from UIComponent.
|
overridevirtual |
Report the text the player has entered.
Reimplemented from UIComponent.
|
overridevirtual |
Replace the text and put the caret after it.
| pszText | The text. |
Reimplemented from UIComponent.
|
overridevirtual |
Change the state, showing the material and the font of the highlight style.
| nState | One of UIComponent::State. |
| bForce | Apply the state even when it does not change. |
Reimplemented from UIComponent.
|
overridevirtual |
Blink the caret while the entry edits, and hide it otherwise.
| fTime | The front-end time in milliseconds. |
Reimplemented from UIComponent.
|
overridevirtual |
Write the entry's name.
| stream | The stream to write to. |
Implements UIComponent.
| String UITextEntry::MaskText | ( | const char * | pszText | ) | const |
Report a copy of a text with every character replaced by an asterisk.
| pszText | The text. |
| float UITextEntry::CharWidth | ( | int | nIndex | ) |
Report the width one character of the text takes, including the font's tracking.
A password entry measures an asterisk instead.
| nIndex | The character's position in mText. |
| void UITextEntry::SetEditing | ( | bool | bEditing | ) |
Start or stop editing.
Editing blinks the caret from the current front-end time. Stopping hides it.
| bEditing | Whether the entry edits. |
| bool UITextEntry::HandleKey | ( | int | nKey | ) |
Act on a key as if it were typed.
| nKey | The key. |
| void UITextEntry::ToggleCaret | ( | ) |
Show the caret when it is hidden, and hide it when it shows.
| void UITextEntry::Layout | ( | ) |
Show the part of the text that fits, and place the caret.
A scrolling entry moves its first visible character to keep the caret inside the field.
| void UITextEntry::UpdateCaret | ( | ) |
Move the caret object to mCaretPos.
| bool UITextEntry::ProcessKey | ( | int | nKey | ) |
Edit the text for a key.
Return completes the entry, backspace and delete remove a character, the left and right arrows move the caret, and a printable character is inserted at the caret when it is allowed and fits.
| nKey | The key. |
| bool UITextEntry::HandleKeyMsg | ( | KeyboardKeyMsg * | pMsg | ) |
Edit the text for a keyboard message.
| pMsg | The message. |
|
inline |
|
inline |
| fMaxEntryWidth | The max_entry_width setting, or -1 for no limit. |
|
inline |
| nMaxNumChars | The max_num_chars setting, or -1 for no limit. |
|
inline |
| nScroll | The scroll setting. |
|
inline |
| nNumLines | The num_lines setting. |
|
inline |
| nPassword | The password setting. It masks the text. |
|
inline |
| pInvalidChars | The invalid_chars array, or null. |
|
inline |