wavelength 1.0.0
Loading...
Searching...
No Matches
EditField Class Reference

Line of text the keyboard edits, with a cursor and an overwrite mode. More...

#include <editfield.h>

Public Types

enum  KeyResult { kKeyCancel = -2 , kKeySubmit = -1 , kKeyIgnored = 0 , kKeyChanged = 1 }
 The values of HandleKey(). More...

Public Member Functions

 EditField (int nMaxLength)
 Construct an empty field.
 ~EditField ()
 Release the text.
int HandleKey (KeyboardKeyMsg *pMsg)
 Apply a key to the text and the cursor.
const char * GetText ()
 Report the text.
void Clear ()
 Empty the text to a single space and move the cursor to the start.
int GetCursor () const

Detailed Description

Line of text the keyboard edits, with a cursor and an overwrite mode.

The class is not polymorphic and emits no RTTI, and its title is inferred. The object is 0x1c bytes. Only the members the chat calls are declared.

Member Enumeration Documentation

◆ KeyResult

The values of HandleKey().

Enumerator
kKeyCancel 

The key cancels the edit.

kKeySubmit 

The key submits the text.

kKeyIgnored 

The key does not change the text.

kKeyChanged 

The key changes the text.

Constructor & Destructor Documentation

◆ EditField()

EditField::EditField ( int nMaxLength)
explicit

Construct an empty field.

Parameters
nMaxLengthThe most characters the field takes.
Ghidra address:
NTSC-U/C: 0x001e4648
Ghidra address:
PAL: 0x001ed3e8

◆ ~EditField()

EditField::~EditField ( )

Release the text.

Ghidra address:
NTSC-U/C: 0x001e46f8
Ghidra address:
PAL: 0x001ed498

Member Function Documentation

◆ HandleKey()

int EditField::HandleKey ( KeyboardKeyMsg * pMsg)

Apply a key to the text and the cursor.

Parameters
pMsgThe key.
Returns
One of KeyResult.
Ghidra address:
NTSC-U/C: 0x001e4758
Ghidra address:
PAL: 0x001ed4f8

◆ GetText()

const char * EditField::GetText ( )

Report the text.

Returns
The text.
Ghidra address:
NTSC-U/C: 0x001e4b40
Ghidra address:
PAL: 0x001ed8e0

◆ Clear()

void EditField::Clear ( )

Empty the text to a single space and move the cursor to the start.

Ghidra address:
NTSC-U/C: 0x001e4b48
Ghidra address:
PAL: 0x001ed8e8 Whether a typed character goes in before the one at the cursor rather than replacing it. The constructor leaves it unset.

◆ GetCursor()

int EditField::GetCursor ( ) const
inline
Returns
The character the cursor stands before.

The documentation for this class was generated from the following file: