|
wavelength 1.0.0
|
The front-end keyboard, for typing a name or another text for the screen that opened it. More...
#include <keyboardpanel.h>


Public Types | |
| enum | ShiftMode { kShiftNone = 0 , kShiftOnce = 1 , kShiftCaps = 2 } |
| The shift states of the keys, the values of mShiftMode. More... | |
| Public Types inherited from UIPanel | |
| enum | State { kStateShown = 0 , kStateHidden = 1 , kStateEntering = 2 , kStateExiting = 3 } |
| Where the panel is in its entry and exit, the values of mState. More... | |
Public Member Functions | |
| KeyboardPanel (DataArray *pData, const char *pszDir) | |
| Construct the panel from its script description. | |
| ~KeyboardPanel () override | |
| Destroy the panel. | |
| bool | DispatchPriv (Message *pMsg) override |
| Route keys about to be chosen, controller buttons, keys of an attached keyboard, and refused characters, and pass on every other message. | |
| void | Enter (bool bForce, float fTime) override |
| Start the entry and prepare the text entry from the request. | |
| void | Exit (bool bForce, float fTime) override |
| Start the exit and forget the keys and the animation. | |
| void | Poll (float fTime) override |
| Advance the panel and the animation of the selected key. | |
| void | SetFocus (UIComponent *pComponent, int nButton) override |
| Play the KEYBOARD_LEFT_UP cue and move the focus to a key. | |
| void | SetRequest (const KeyboardRequest &request) |
| Take the request of the screen that opens the keyboard. | |
| bool | HandleSelectStart (UIComponentSelectStartMsg *pMsg) |
| Act on the key about to be chosen. | |
| void | FlashKey (const char *pszKey) |
| Flash the key a controller button stands for. | |
| bool | HandleJoypad (JoypadInputMsg *pMsg) |
| Act on a button of the controller that types. | |
| bool | HandleKey (KeyboardKeyMsg *pMsg) |
| Act on a key of a keyboard attached to the console. | |
| void | SetShiftMode (int nMode) |
| Change the shift state, restyling the shift keys and relabelling every key. | |
| void | Backspace () |
| Erase the character before the caret. | |
| void | MoveLeft () |
| Move the caret left. | |
| void | MoveRight () |
| Move the caret right. | |
| void | TypeTab () |
| Type a tab. | |
| void | TypeSpace () |
| Type a space. | |
| void | Delete () |
| Erase the character after the caret. | |
| void | Commit () |
| Hand the text to the user and return to the screen that opened the keyboard, unless the user moved to another screen. | |
| void | TypeFunctionKey (const char *pszKey) |
| Replace the text with the text fkey_<key> of the locale, or go to kb_fkey_error_screen when the request disallows the function keys. | |
| void | TypeChar (char ch) |
| Type a character, replacing the starting text with the first one typed, and end a shift of one key. | |
| bool | HandleInvalid (UITextEntryInvalidMsg *pMsg) |
| Play the WRONG cue when the text is full, or go to kb_badkey_error_screen for a character the entry does not accept. | |
| Public Member Functions inherited from FreqPanel | |
| FreqPanel (DataArray *pData, const char *pszDir) | |
| Construct a panel from its script description. | |
| ~FreqPanel () override | |
| Destroy the panel. | |
| void | Unload () override |
| Drop a reference to the panel's file, forgetting the meshes and the animation on the last reference. | |
| void | DrawGizmo () override |
| Stretch the gizmo pyramid from the background mesh to the gizmo and draw it. | |
| void | Draw () override |
| Move the panel material animations to the front-end time and draw the panel. | |
| void | SetShowing (bool bShowing) override |
| Show or hide the panel's view and the gizmo pyramid. | |
| void | FinishLoad () override |
| Find the meshes and animations of the panel once its file has loaded. | |
| void | ShowGizmoMesh (bool bShowing) |
| Show or hide the gizmo pyramid. | |
| void | UpdateBgBox () |
| Measure the background mesh into mBgBox. | |
| Public Member Functions inherited from UIPanel | |
| UIPanel (DataArray *pData, const char *pszDir) | |
| Construct a hidden panel from its script description. | |
| ~UIPanel () override | |
| Destroy the panel, its components, and the objects its file loaded. | |
| bool | Dispatch (Message *pMsg) override |
| Offer a message to the current screen, the panel, the navigator, and the component with the focus. | |
| bool | DispatchPriv (Message *pMsg) override |
| Handle a message sent to the panel. | |
| virtual void | Load () |
| Take a reference to the panel's file, queueing the file on the first reference. | |
| virtual void | Focus () |
| React to the screen giving the panel the focus by letting the navigator move the focus. | |
| virtual void | Unfocus () |
| React to the screen taking the focus away. | |
| bool | IsLoaded () |
| Report whether the panel's file has loaded, finishing the load when it has. | |
| void | AddComponent (UIComponent *pComponent) |
| Register a component under its name. | |
| void | SetTextsShowing (bool bShowing) |
| Show or hide every text object of the panel's file. | |
| float | ComputeFrame (float fTime) |
| Report the frame of the entry and exit animation at a time. | |
| UIComponent * | FindComponent (const char *pszName, bool bFail) |
| Find a component by name. | |
| void | LocalizeTexts (const char *pszFile, std::list< RndObject * > &objects) |
| Collect and localise the text objects of the panel's file. | |
| const char * | GetName () const |
| UIComponent * | GetFocus () const |
| int | GetState () const |
| float | GetTransitionStart () const |
| const std::map< const char *, std::unique_ptr< UIComponent >, StrLess > & | GetComponents () 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 UIPanel * | New (DataArray *pData, const char *pszDir) |
| Create a panel from its script description. | |
| Static Public Member Functions inherited from FreqPanel | |
| static UIPanel * | New (DataArray *pData, const char *pszDir) |
| Create a panel from its script description. | |
| static void | Init (DataArray *pConfig) |
| Read the freq_panel section of the metagame configuration. | |
| Static Public Member Functions inherited from UIPanel | |
| static void | Init (DataArray *pConfig) |
| Read the default frames of the entry and exit animation. | |
| static UIPanel * | New (DataArray *pData, const char *pszDir) |
| Create a panel from its script description. | |
Additional Inherited Members | |
| Public Attributes inherited from FreqPanel | |
| Box | mBgBox |
| Static Public Attributes inherited from FreqPanel | |
| static constexpr int | kNumGizmoOffsets = 3 |
| The number of gizmo offsets the configuration provides. | |
| static Vector3 | sGizmoOrigPos |
| The position of the gizmo, the panel_gizmo_orig_pos setting. | |
| static Vector3 | sGizmoOffsets [kNumGizmoOffsets] |
| The points of the gizmo the pyramids reach, the panel_gizmo_offset_1 to _3 settings. | |
| Protected Attributes inherited from UIPanel | |
| float | mFrame |
| float | mIdleFrame |
| const char * | mName |
| String | mFile |
| int | mState |
| RndView * | mView |
| const char * | mFocusName |
| float | mLoopStart |
| RndAnimatable * | mLoopAnim |
| RndAnimatable * | mEnterExitAnim |
| float | mTransitionStart |
| float | mShownFrame |
| float | mHiddenFrame |
| float | mEnterMs |
| float | mExitMs |
| int | mEnterReversed |
| int | mExitReversed |
| float | mEnterStartFrame |
| float | mExitStartFrame |
| int | mLoadRefs |
| int | mLoaded |
| DataArray * | mData |
| std::list< RndText * > | mTexts |
| std::map< const char *, std::unique_ptr< UIComponent >, StrLess > | mComponents |
| std::unique_ptr< UINavigator > | mNavigator |
| UIComponent * | mFocus |
| RndLoader * | mLoader |
| std::unique_ptr< RndLoader > | mOwnedLoader |
| The loader the panel created, or null when it has none or uses a shared one. | |
The front-end keyboard, for typing a name or another text for the screen that opened it.
The RTTI records the class as deriving from FreqPanel. The object is 0x140 bytes and its vtable is at 0x003d0370. The metagame registers the class for the panel type kb_panel, and the front-end description's keyboard panel of the kb_screen screen is one. The entry is the text entry 01. Each key is a KeyboardKey whose text it types, and the keys but_caps, but_lshift, but_rshift, but_back, but_larrow, but_rarrow, but_tab, but_space, but_del, but_enter, and the function keys but_f1 to but_f12 act instead. The controller types as well. Circle is enter, square a space, L1 and R1 move the caret, L2 is backspace, R2 shifts the next key, and triangle returns without the text. A keyboard attached to the console types directly.
| KeyboardPanel::KeyboardPanel | ( | DataArray * | pData, |
| const char * | pszDir ) |
Construct the panel from its script description.
| pData | The script description. |
| pszDir | The directory of the description file. |
|
override |
Destroy the panel.
Create a panel from its script description.
The metagame registers the routine for the entry type kb_panel.
| pData | The script description. |
| pszDir | The directory of the description file. |
|
overridevirtual |
Route keys about to be chosen, controller buttons, keys of an attached keyboard, and refused characters, and pass on every other message.
| pMsg | The message. |
Implements MsgSink.
|
overridevirtual |
Start the entry and prepare the text entry from the request.
| bForce | Whether the panel skips its animation. |
| fTime | The front-end time in milliseconds. |
Reimplemented from FreqPanel.
|
overridevirtual |
Start the exit and forget the keys and the animation.
| bForce | Whether the panel skips its animation. |
| fTime | The front-end time in milliseconds. |
Reimplemented from FreqPanel.
|
overridevirtual |
Advance the panel and the animation of the selected key.
| fTime | The front-end time in milliseconds. |
Reimplemented from FreqPanel.
|
overridevirtual |
Play the KEYBOARD_LEFT_UP cue and move the focus to a key.
| pComponent | The key. |
| nButton | The controller button that moved the focus, or kPadNone. |
Reimplemented from FreqPanel.
| void KeyboardPanel::SetRequest | ( | const KeyboardRequest & | request | ) |
Take the request of the screen that opens the keyboard.
| request | The request. |
| bool KeyboardPanel::HandleSelectStart | ( | UIComponentSelectStartMsg * | pMsg | ) |
Act on the key about to be chosen.
| pMsg | The message. |
| void KeyboardPanel::FlashKey | ( | const char * | pszKey | ) |
Flash the key a controller button stands for.
| pszKey | The key. |
| bool KeyboardPanel::HandleJoypad | ( | JoypadInputMsg * | pMsg | ) |
Act on a button of the controller that types.
| pMsg | The message. |
| bool KeyboardPanel::HandleKey | ( | KeyboardKeyMsg * | pMsg | ) |
Act on a key of a keyboard attached to the console.
| pMsg | The message. |
| void KeyboardPanel::SetShiftMode | ( | int | nMode | ) |
Change the shift state, restyling the shift keys and relabelling every key.
A key <name> shows the text <name>, <name>_shift, or <name>_caps of the locale. Choosing the current shift state again returns to kShiftNone.
| nMode | One of ShiftMode. |
| void KeyboardPanel::Backspace | ( | ) |
Erase the character before the caret.
| void KeyboardPanel::MoveLeft | ( | ) |
Move the caret left.
| void KeyboardPanel::MoveRight | ( | ) |
Move the caret right.
| void KeyboardPanel::TypeTab | ( | ) |
Type a tab.
| void KeyboardPanel::TypeSpace | ( | ) |
Type a space.
| void KeyboardPanel::Delete | ( | ) |
Erase the character after the caret.
| void KeyboardPanel::Commit | ( | ) |
Hand the text to the user and return to the screen that opened the keyboard, unless the user moved to another screen.
| void KeyboardPanel::TypeFunctionKey | ( | const char * | pszKey | ) |
Replace the text with the text fkey_<key> of the locale, or go to kb_fkey_error_screen when the request disallows the function keys.
| pszKey | The function key, such as f1. |
| void KeyboardPanel::TypeChar | ( | char | ch | ) |
Type a character, replacing the starting text with the first one typed, and end a shift of one key.
| ch | The character. |
| bool KeyboardPanel::HandleInvalid | ( | UITextEntryInvalidMsg * | pMsg | ) |
Play the WRONG cue when the text is full, or go to kb_badkey_error_screen for a character the entry does not accept.
| pMsg | The message. |