This class defines a text edit box control.
![]() | PEditBox ( PInteractor * parent ) Create a new single line edit box control. |
![]() | PEditBox ( PInteractorLayout * parent, PRESOURCE_ID ctlID, const PNotifier & notify, PString * valuePtr ) Create control from interactor layout with the specified control ID. |
![]() | ~PEditBox () Destroy the edit box control. |
![]() | OnEndInput () The system calls this whenever the system wishes to change focus to another interactor in a given PTitledWindow or PInteractorLayout. |
![]() | TransferValue ( int option ) This function transfers the value of the control to or from the variable pointed to by the value pointer member variable. |
![]() | SetText ( const PString & str ) Set the text contents of the edit box control. |
![]() | GetText () const Get the current text contents of the edit box control as entered by the user, or set via the SetText() function. |
![]() | GetValuePointer () const Get the current value pointer associated with the control. |
![]() | SetValuePointer ( PString * ptr ) Set the current value pointer associated with the control. |
![]() | SetMaxText ( PINDEX max ) Set the maximum amount of text that the user may enter in the combo-box edit text part. |
![]() | GetLength () const Get the current length of the text entered into the edit box. |
![]() | IsModified () const Determine if the edit control has been modified by the user since the last call to SetText() or GetText(). |
![]() | SetSelection ( PINDEX start = 0, PINDEX finish = P_MAX_INDEX ) Set the selected region in the text within the edit box. |
![]() | GetSelection ( PINDEX * start = NULL, PINDEX * finish = NULL ) const Get the selected region in the text in the edit box. |
![]() | ReplaceSelection ( const PString & text, BOOL canUndo = TRUE ) Replace the selection with the string. |
![]() | CanUndo () const Determine if the edit control can undo the last edit operation performed by the user. |
![]() | Undo () Undo the last edit operation performed by the user. |
![]() | Cut () Cut the selected text to the clipboard. |
![]() | Copy () const Copy the selected text to the clipboard. |
![]() | Paste () Paste into the edit control from the clipboard into the edit box at the current caret position. |
![]() | Clear () Delete the selected text. |
![]() | PNotifier codes |
![]() | Notification codes sent to the callback function. |
![]() | Overrides from class PInteractor |
![]() | Overrides from class PControl |
![]() | New functions for class |
Member variables
Overrides from class PObject
System callback functions.
This class defines a text edit box control. This control is for a single line of text. The usual capabilities for editing text are available, though the exact features are platform dependent.
This function in conjunction with the keyboard focus changing and the
PInteractor::SetFocusInteractor() function controls the transfer
of focus from one interactor in a logical group (eg dialog) to another.
It is primarily used for field level validation. For example the
PIntegerEditBox control uses this to prevent the user from
exiting the control until a valid entry hash been made. Note that the focus does actually change with appropriate
calls to the PInteractor::OnGainFocus() and
PInteractor::OnLostFocus() functions. The focus gets set back to
the original interactor when this function disallows the focus change. For edit boxes this will execute the notification function before
returning TRUE.
A call to this function will cause the notification function to be
called with a code of EditChange.
If start and finish are equal then there is
no selected region. However, the caret is placed immediately before
that position, ie so that the next character entered will be at
start offset into the resultant string. If finish is less than start it is set to the
same value as start. If either value is greater than the
current length of the edit box, then they are set to the position of
the end of the string.
If there is no current selection then this function does nothing. A call to this function will cause the notification functionto be
called with a code of EditChange.
If there is no current selection then this function does nothing.
If the paste would add so many characters that the limit set with
SetMaxText() would be exceeded then the paste does not take
place. Also, if there is no text in the clipboard then this function does
nothing. A call to this function will cause the notification functionto be
called with a code of EditChange.
If there is no current selection then this function does nothing. A call to this function will cause the notification functionto be
called with a code of EditChange.
PEditBox( PInteractorLayout * parent, PRESOURCE_ID ctlID, const PNotifier & notify, PString * valuePtr )
ctlID - Identifier for the control in the layout.
notify - Function to call when changes state.
valuePtr - Variable to change to the editor value.virtual ~PEditBox()
PNotifier codes
Notification codes sent to the callback function.
EditChange
EndEdit
Overrides from class PInteractor
virtual BOOL OnEndInput()
Overrides from class PControl
virtual void TransferValue( int option )
New functions for class
virtual void SetText( const PString & str )
PString GetText() const
PString* GetValuePointer() const
void SetValuePointer( PString * ptr )
void SetMaxText( PINDEX max )
PINDEX GetLength() const
BOOL IsModified() const
void SetSelection( PINDEX start = 0, PINDEX finish = P_MAX_INDEX )
finish - Finish index position of selected text.BOOL GetSelection( PINDEX * start = NULL, PINDEX * finish = NULL ) const
finish - Pointer to receive finishing position of selected text.void ReplaceSelection( const PString & text, BOOL canUndo = TRUE )
canUndo - Flag to indicate replacement can be undone.BOOL CanUndo() const
void Undo()
void Cut()
void Copy() const
void Paste()
void Clear()
Alphabetic index HTML hierarchy of classes or Java