#include <dialogs.h>
Inheritance diagram for TInputLine::
Public Methods | |
TInputLine (const TRect &bounds, int aMaxLen, TValidator *aValid=0) | |
~TInputLine () | |
virtual ushort | dataSize () |
virtual void | draw () |
virtual void | getData (void *rec) |
virtual TPalette& | getPalette () const |
virtual void | handleEvent (TEvent &event) |
void | selectAll (Boolean enable) |
virtual void | setData (void *rec) |
virtual void | setState (ushort aState, Boolean enable) |
virtual Boolean | valid (ushort cmd) |
void | setValidator (TValidator *aValid) |
Static Public Methods | |
TStreamable* | build () |
Public Attributes | |
char* | data |
int | maxLen |
int | curPos |
int | firstPos |
int | selStart |
int | selEnd |
Static Public Attributes | |
const char* const | name |
Protected Methods | |
TInputLine (StreamableInit) | |
virtual void | write (opstream &os) |
virtual void* | read (ipstream &is) |
Definition at line 261 of file dialogs.h.
|
Creates an input box control with the given values by calling TView::TView(bounds).
Memory is allocated and cleared for `aMaxlen' + 1 bytes and the data data member set to point at this allocation. An input line is sometimes used with a validator. Data validators are objects that detect when the user has entered valid or invalid information. In case of invalid data, the validator will provide appropriate feedback to the user.
|
|
Deletes the data memory allocation, then calls TView destructor to destroy the TInputLine object.
|
|
Each streamable class needs a "builder" to allocate the correct memory for its objects together with the initialized virtual table pointers. This is achieved by calling this constructor with an argument of type StreamableInit. |
|
Called to create an object in certain stream-reading situations. Reimplemented from TView. Reimplemented in TFileInputLine. |
|
Returns the size of the record for getData() and setData() calls. By default, it returns maxLen + 1. Override this member function if you define descendants to handle other data types. Reimplemented from TView. |
|
Draws the input box and its data. The box is drawn with the appropriate colors depending on whether the box is sfFocused (that is, whether the box view owns the cursor), and arrows are drawn if the input string exceeds the size of the view (in either or both directions).
Reimplemented from TView. |
|
Writes the number of bytes (obtained from a call to dataSize()) from the data string to the array given by `rec'. Used with setData() for a variety of applications; for example, temporary storage, or passing on the input string to other views. Override getData() if you define TInputLine descendants to handle non-string data types. You can also use getData() to convert from a string to other data types after editing by TInputLine. Reimplemented from TView. |
|
Returns the default palette string. Reimplemented from TView. |
|
Calls TView::handleEvent(), then handles all mouse and keyboard events if the input box is selected. This member function implements the standard editing capability of the input box. Editing features include:
Reimplemented from TView. Reimplemented in TFileInputLine. |
|
Reads from the input stream `is'. Reimplemented from TView. |
|
Sets curPos, firstPos and selStart data members to 0. If `enable' is set to True, selEnd is set to the length of the data string, thereby selecting the whole input line; if `enable' is set to False, selEnd is set to 0, thereby deselecting the whole line. Finally, the view is redrawn by calling TView::drawView(). |
|
By default, copies the number of bytes (as returned by dataSize()) from the `rec' array to the data string, and then calls selectAll(True). This zeros curPos, firstPos and selStart.
Override setData() if you define descendants to handle non-string data types. You also use setData() to convert other data types to a string for editing by TInputLine. Reimplemented from TView. |
|
Called when the input box needs redrawing (for example, if the palette is changed) following a change of state. Calls TView::setState() to set or clear the view's state with the given `aState' bit(s). Then if `aState' is sfSelected (or sfActive and the input box is sfSelected), selectAll(enable) is called (which, in turn, calls TView::drawView()).
Reimplemented from TView. |
|
Undocumented. |
|
Undocumented. Reimplemented from TView. |
|
Writes to the output stream `os'. Reimplemented from TView. |
|
Index to insertion point (that is, to the current cursor position). |
|
The string containing the edited information. |
|
Index to the first displayed character. |
|
Maximum length allowed for string to grow (excluding the final 0). |
|
Undocumented. Reimplemented from TView. Reimplemented in TFileInputLine. |
|
Index to the end of the selection area (that is, to the last character block marked). |
|
Index to the beginning of the selection area (that is, to the first character block marked). |