You may return to the Cvo Object Documenation Index from this document. This document contains the following sections describing the Cvo_List object:
Cvo_List
Cvo_TextViewPort
#include
<Cvo/List.h++>
new
Cvo_List ( char *resource_name,
{ Cvo_Object *parent | Display *display },
Cvo_Page *page )
A Cvo_List object displays a list of items in a Cvo_TextViewPort and allows the user to select one of them by clicking on it with a mouse button. Generally page is a Cvo_TextPage and it contains the list of items to choose from.
This object defines the following member functions in addition to those defined by its parent and ancestor objects.
ClearSelected (
)
Cause the selected line (if any) to no longer be selected.
Select (
int line,
[ int count [ int button ] ] )
This function causes line number line to be selected and
highlighted. The CvoListItemSelectedEvent
event will be sent.
The count and button arguments, if provided, will be used to
fill in the corresponding elements of the
Cvo_ListItemSelectedEvent
structure.
int Current (
)
Return the line number of the line currently selected, or -1 if no line is selected.
NewTextPage (
Cvo_Page *page )
Change the Cvo_Page being displayed to page.
UseRadioStyle (
[ BOOL value ] )
This function causes radio mode to be activated, or if value is
False
, to be deactivated. In this mode, one of the items must
always be selected. The default is to have radio mode turned off.
AllowReselect (
[ BOOL value ] )
When value is True
, this function activates reselect mode. By
default, it is activated. This mode only has significance when the
object has had the radio mode turned on as well, with the
UseRadioStyle()
function. In that case, this mode will cause each
selection of a line to behave as an original selection of that line,
even if the line is already selected. If a selected line is
reselected, then a CvoListItemSelectedEvent
will be sent.
When this mode is deactivated, by passing value with a False
value, reselecting previously selected lines will not cause an event
to be sent.
This object defines the following Cvo Events in addition to those defined by its parent and ancestor objects.
CvoListItemSelectedEvent
struct
Cvo_ListItemSelectedEvent
.arg
int line,
void *item,
int button,
int oldline,
int count
This event is generated when the user selects or deselects a line in the Cvo_List display. The line element is the number of the line which was selected, or -1 if no line is currently selected.
The item element is a pointer to the Cvo_Page object the Cvo_List object is currently displaying.
The button element returns which mouse button was pressed. Possible values are:
Button1
Button2
Button3
Button4
Button5
The oldline element contains the line number of the item which became deselected. A -1 indicates that no line had been selected.
The count element contains the number of extra clicks on this item. Note that if the user double clicks, two events will be generated, one with a count of 0 and a second with a count of 1.
This object defines the following event translations in addition to those defined by its parent and ancestor objects.
<Button1>
:
Press(1,0)
<Button2>
:
Press(2,0)
<Button3>
:
Press(3,0)
<Button1>(2)
:
Press(1,1)
<Button2>(2)
:
Press(2,1)
<Button3>(2)
:
Press(3,1)
This translation is used to cause an item to be selected. The first argument is the button number, the second is the button click count.
<ButtonRelease>
:
Release(0)
<ButtonRelease>(2)
:
Release(1)
This translation is currently non functional.
This object modifies the following X resources which are used by its parent or other ancestors.
*CvoList.CvoFrame.CvoCRT.Cursor
(new value:
Top Left Arrow
)
*CvoList.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.