WDS_GetString

WDS_GetString

wds

1998 12-05


CLASS

WDS_GetString - string entry widget


SYNOPSIS

Class WDS_GetString allows for the entry of generic text. Upon selection, it uses focused keyboard action to alter a text field. The mouse can move the cursor and select portions of text by pressing, dragging, and double/triple-clicking. Double-clicking selects a word. Triple-clicking selects all the text.


PUBLIC MEMBER FUNCTIONS

Inheritance from class WDS_Widget



void SetString(char *a_string)

WDS_String *GetString(void)

WDS_String *GetStoreBuffer(void)
Set/Get the text string. If the string is currently being editted, GetStoreBuffer() returns the saved previous data during editing. GetString() always returns the current buffer.



void SetStringDisplayChar(char set)
Set the character (in ASCII) to be displayed instead of each real character in the string, such as when hiding passwords. When set is the value zero, characters are drawn normally. This single setting is used independently of whether the user is editing the string. To control the edit string and non-edit string separately, use WDS_String::SetDisplayChar() directly.



void SetAcceptKeys(long set)

long GetAcceptKeys(void)

void SetAbortKeys(long set)

long GetAbortKeys(void)
Set/Get the key(s) that causes an end of edit, either to accept or abort the edit. The current default keys are Return and Escape, respectively. The values for set are defined as event items as in an EW_Event. In simple cases, an ASCII value is acceptable.



void SetKeySet(GPL_BitGroup *set)

GPL_BitGroup *GetKeySet(void)
Set/Get a restricted set of keys. Each bit represents an ASCII character, from 0 to 255, that is permitted. Certain characters such as backspace and delete are always recognized. The default setting of set to NULL permits all characters.



void StartEdit(long cursor_position,EW_Event *event)

void StopEdit(long restore,EW_Event *event)
Manually initiate or terminate an edit. For StartEdit(), the cursor_position sets the character position to place to cursor. For StopEdit(), a non-zero restore restores the previous value instead of using the newly changed value. For either function, the event is passed to any callbacks that are triggered. An event of NULL is accepted, but not desireable.



void SelectWord(long index)

void SelectAll(void)
Select part or all of the text. For SelectWord(), the index indicate the character position about which to select an entire word. A word, used here, is defined as a contiguous block of EITHER whitespace (space or tab) OR alpha-numerics (A-Z a-z 0-9).


STATE CHANGES


WDS_STATE_0 End of edit
WDS_STATE_1 Start of edit


FILES

wds/getstr.h String entry header file


SEE ALSO

WDS_intro(3), WDS_Widget(3), WDS_Scope(3), WDS_String(3), EW_Event(3)


NOTES

Depending on WDS_Look settings, this widget will attach to either the deepest or shallowest scope. For functionality similar to other common systems, a deep scope usually means that only one WDS_GetString (or other keyboard-scoped) widget can be active in any particular window, assuming that there is the recomended underlying encompassing scope at the base of the widget hierarchy. If the widget is allowed to use a shallow scope (specified in Look-And-Feel configuration), then mulitple WDS_GetString's can be active, each in different scope. In that case, the keyboard focuses to a particular WDS_GetString is based on the position of the mouse within the window.


In previous releases, WDS_GetString would switch to an edit string when editing and copy the data back when complete. This was though an member GetEditBuffer(), no longer supported. Now, the main string always holds the current string, even when editing.