Class XbpSLE() Foundation

Class function of the XbpSLE class.


The XbpSLE class provides objects that manage individual text entry fields (single-line edit fields). These are rectangular screen areas for keyboard input that allow character strings stored in the edit buffer of the XbpSLE object to be created or edited. The cursor marks the location within the character string where characters are inserted or overwritten.

An XbpSLE object can edit only character strings. It includes an edit buffer that is limited to 32 characters by default. When the character string being edited might contain more than 32 characters, the edit buffer must be dimensioned using the :bufferLength instance variable. The buffer can have a maximum size of 64kB characters (this limit is imposed by OS/2).

The XbpSLE object independently processes keyboard entries. The keys that are used to input ASCII characters are copied into the edit buffer while some other specific keys are automatically processed (such as the Insert and Delete keys). The following table lists the keys that receive special processing by the XbpSLE object along with action caused by each key:

Keys for editing an XbpSLE object
Key Description
Left Arrow Move cursor one character to the left
Right Arrow Move cursor one character to the right
Shift+Left Arrow Select one character to the left
Shift+Right Arrow Select one character to the right
Up Arrow Ignored
Down Arrow Ignored
Home Go to the start of the edit buffer
End Go to the end of the edit buffer
Backspace Delete the character to the left of the cursor
Shift+Insert Delete selected characters and replace them with the characters stored in the clipboard
Ctrl+Insert Copy marked characters to the clipboard
Delete Delete the character to the right of cursor or delete selected characters without copying them to the clipboard
Shift+Delete Delete selected characters and copy them to the clipboard
Ctrl+Delete Delete characters marked in the edit buffer without copying them to the clipboard
Return Ignored
Esc Ignored
Page Up Ignored
Page Down Ignored
Shift+Tab Transfer input focus to the previous Xbase Part
Tab Transfer the input focus to the next Xbase Part
Others Other keys containing ASCII characters are copied to the edit buffer as characters

An XbpSLE object can only edit character strings. Blank spaces at the end of character strings are not automatically deleted but are treated like any other character. If the edit buffer of an XbpSLE object is filled with blank spaces (Chr(32)), no additional characters can be added. In this case, characters must be deleted from the edit buffer before new characters can be added.

Class methods
Creates an instance of the XbpSLE class.

The instance variables in this group configure system resources. If changes are made to these values, they must either be made before the :create() method is executed or the :configure() method must be used to activate the changes.

Determines the alignment of text within the XbpSLE object.
(De)Activates automatic processing of keyboard events.
Automatically fits the size of the entry field to the edit buffer.
Automatically generates a Tab message when the edit buffer is full.
Displays the entry field with a border.
Sets the maximum length of the edit buffer.
Determines whether the text contained in the edit buffer of the XbpSLE object can be modified.
Determines whether the characters in the entry field are displayed as asterisks ("*").
Runtime data
Indicates whether the edit buffer has been changed by user entry.
Specifies the cue banner text displayed by the entry field.
Life cycle
Requests system resources for the XbpSLE object.
Reconfigures the XbpSLE object after :create() has been executed.
Releases the system resources of the XbpSLE object.
Deletes all of the characters in the edit buffer.
Copies the selected characters from the XbpSLE object to the clipboard.
Deletes the selected characters from the edit buffer and copies them to the clipboard.
Deletes the selected characters from the edit buffer.
Returns the value in the edit buffer of the XbpSLE object.
Returns the character string in the edit buffer of the XbpSLE object.
Hides the balloon tip window.
Replaces the selected characters in the edit buffer with characters from the clipboard.
Returns the position of the first character visible on the left of the XbpSLE screen display.
Determines the position of the first and last characters selected.
Sets the value of the character string in the edit buffer.
Sets the first character visible in the edit window.
Sets the characters selected in the edit buffer.
Displays a balloon-like window with information on the entry field.
Sets whether the edit buffer of the XbpSLE object is READONLY.
Sets or returns the insert mode (insert or overstrike).
The character string in the XbpSLE object has been horizontally scrolled.
The edit buffer is full.
Single line entry fields using XbpSLE()

// In the example, two XbpSLE objects are created in an XbpCrt 
// window with edit buffers limited to 20 and 15 characters, 
// respectively. Both XbpSLE objects use data code blocks 
// to access LOCAL variables. These code blocks are evaluated 
// when the XbpSLE object loses the input focus. In the callback 
// slot :killInputFocus, :getData() is called to read the edit 
// buffer and assign the values to LOCAL variables via :dataLink. 

#include "" 

   LOCAL nEvent, mp1, mp2, oXbp 
   LOCAL cVarA := "Test A", cVarB := "Test B" 

   // Create first SLE, specify position using :create() 
   // On :typeOut set the focus to the second SLE 
   oXbp              := XbpSLE():new() 
   oXbp:autoTab      := .T. 
   oXbp:bufferLength := 20 

   // Data code block containing assignment to LOCAL variable 
   oXbp:dataLink := {|x| IIf( x==NIL, cVarA, cVarA := x ) } 

   oXbp:create( , , {100,200}, {100,30} ) 


   // Assign the value of the edit buffer to a LOCAL variable 
   // when the input focus is lost 
   oXbp:killInputFocus := ; 
       { |x,y,oSLE| oSLE:getData(), QOut( "cVarA =", cVarA ) } 

   // Create second SLE, specify position using :new() 
   oXbp              := XbpSLE():new( , , {100,150}, {100,30} ) 
   oXbp:tabStop      := .T. 
   oXbp:bufferLength := 15 
   oXbp:dataLink := {|x| IIf( x==NIL, cVarB, cVarB := x ) } 

   oXbp:killInputFocus := ; 
       { |x,y,oSLE| oSLE:getData(), QOut( "cVarB =", cVarB ) } 

   // Event loop 
   nEvent := 0 
   DO WHILE nEvent <> xbeP_Close 
      nEvent := AppEvent( @mp1, @mp2, @oXbp ) 
      oXbp:handleEvent( nEvent, mp1, mp2 ) 


If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.