You may return to the Cvo Object Documenation Index from this document. This document contains the following sections describing the Cvo_InputViewPort object:
Cvo_InputViewPort
Cvo_TextViewPort
#include
<Cvo/InputViewPort.h++>
new
Cvo_InputViewPort ( char *resource_name,
{ Cvo_Object *parent | Display *display } )
The Cvo_InputViewPort object provides a multi-line input area with a vertical scroll bar.
This object defines the following member functions in addition to those defined by its parent and ancestor objects.
Enter (
Cvo_CharacterBuffer text )
Enter (
{ wchar_t * | char * } text )
Insert text at the current insertion point.
GetText (
Cvo_CharacterBuffer *buffer )
GetText (
{ char ** | wchar_t ** } ptext )
Retrieve the text from the Cvo_InputViewPort placing it either in buffer or pointing ptext at the data. Trailing spaces and newlines are deleted.
Clear (
)
Clear the screen and home the cursor to the upper left corner.
MoveCursor (
int row,
int column )
Move the cursor to the specified row and column. Note that the origin is 0, 0 and not 1, 1.
This object defines the following event translations in addition to those defined by its parent and ancestor objects.
<Key>
:
Insert()
This translation causes the key to be inserted into the Cvo_InputViewPort at the current insertion point.
<Key>Enter
:
InsertLine()
<Key>Return
:
InsertLine()
This translation inserts a new line just before the cursor position, causing the current line to be split between the two lines.
<Key>BackSpace
:
Delete()
This translation causes the character prior to the cursor (or under the cursor if the cursor is at the begining of the line) to be deleted.
<Key>Clear
:
Clear()
This translation clears the Cvo_InputViewPort.
<Key>Linefeed
:
Return()
<Key>KP_Enter
:
Return()
Ctrl<Key>m
:
Return()
This translation moves the cursor to the start of the next line.
<Key>Right
:
Forward()
Ctrl<Key>l
:
Forward()
This translation causes the insertion point to be moved forward one position.
<Key>Left
:
Backward()
Ctrl<Key>h
:
Backward()
This translation causes the insertion point to be moved backward one position.
<Key>Up
:
Upward()
Ctrl<Key>k
:
Upward()
This translation moves the cursor up one line.
<Key>Down
:
Downward()
Ctrl<Key>j
:
Downward()
This translation moves the cursor dow one line.
<Key>Delete
:
delete-selection()
This translation will delete the text in the selection field if one is highlighted. If not, the Delete translation will be performed.
<Btn1Down>
:
select-start()
This translation starts a selection at the position the mouse is currently pointing to.
<Btn3Down>
:
start-extend()
This translation extends the current selection to the position the mouse is currently pointing.
<Btn1Motion>
:
select-extend()
<Btn3Motion>
:
select-extend()
This translation extends the current selection to where the mouse has been dragged.
<Btn1Up>
:
select-end(PRIMARY, CUT_BUFFER0)
<Btn3Up>
:
select-end(PRIMARY, CUT_BUFFER0)
This translation ends the current selection. If the selection is empty, (that is, you clicked the mouse) the cursor is moved to this point and the old selection is not removed fro mteh buffer. Otherwise, the old selection is replaced with the newly selected text.
~Ctrl<Btn2Up>
:
insert-selection(PRIMARY, CUT_BUFFER0)
This translation causes the text in the primary cut buffer to be inserted at the current cursor position as if it has been typed at the keyboard.
This object uses the following X resources in addition to those used by its parent and ancestor objects.
selectionForeground
(class:
SelectionForeground
)
selectionBackground
(class:
SelectionBackground
)These resources specify the colors which will be used when highlighting text regions in this object.
This object modifies the following X resources which are used by its parent or other ancestors.
*CvoInputViewPort*FontFamily:
(new value:
Courier
)
*CvoInputViewPort.BorderWidth:
(new value:
0
)
See the example source code for an example of how to use this object.
See the legend for information about the conventions used in this documentation.