C4 Engine Terathon Software C4 Engine API Documentation

• Interface Manager

API Links
Developer Links

class PasswordWidget

Defined in:  C4Widgets.h
The PasswordWidget class represents an interface widget that displays an editable text box for passwords.
Definition

class PasswordWidget : public EditTextWidget

Member Functions
PasswordWidget::GetPassword Returns the password entered into the editable text box.
Constructor

PasswordWidget(const Vector2D& size, long maxGlyph, const char *font = nullptr);

Parameters
size The size of the text box, in pixels.
maxGlyph The maximum number of characters that can be entered into the text box.
font The name of the font in which the password dots are displayed.
Description
The PasswordWidget class is a special type of EditTextWidget that is intended for password entry. The specific characteristics that differentiate a password widget from an ordinary editable text widget are as follows.

1. The text displayed in the text box is always a sequence of dot characters (Unicode value U+2022).
2. If the user attempts to copy text from a password widget, then only the dot characters are copied.
3. The memory occupied by the actual password text is intentionally erased when the password widget is destroyed as a security feature.

The TextWidget::GetText function cannot retrieve the password string from a password widget. Instead, the PasswordWidget::GetPassword function should be used.
Base Classes
EditTextWidget The PasswordWidget class is a special type of editable text box.