You may return to the Cvo Object Documenation Index from this document. This document contains the following sections describing the Cvo_GenericList object:
Cvo_GenericList
Cvo_ViewPort
#include
<Cvo/GenericList.h++>
new
Cvo_GenericList ( char *resource_name,
{ Cvo_Object *parent | Display *display },
Cvo_Page *page )
The Cvo_GenericList object displays a list of items in a Cvo_ViewPort object and allows the user to select one of them by clicking on it with a mouse button. The items to be displayed are given by the page argument.
Unlike the standard Cvo_List object, the Cvo_GenericList object requests the item in page draw itself and therefore the item may contain non-text data. Currently the NO_SUCH_ALIAS object uses this feature. Also note that when an item is selected, the Cvo_Page page has the chance to preview the request to determine if the item was really selected or something else was going on.
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 )
Select line and highlight it.
int Current (
)
Return the the line number currently selected, -1 if no line is selected.
Change the Cvo_Page being displayed to page.
UseRadioStyle (
[ BOOL value ] )
If value is not present, or is True
, radio mode is selected.
In this mode, one of the items must always be selected. The default
is to have radio mode turned off.
Return the Cvo_Page associated with the Cvo_GenericList object.
int FirstLine (
)
int LastLine (
)
Return the number of the first or last line displayed in the Cvo_GenericList object.
Jump (
[ BOOL value ] )
If value is True
or not specified, this routine will cause
the Cvo_GenericList object to jump to the end of the Cvo_Page object
data when new data is added. If value is False
this does not
happen. The default action is to jump to the end when new data is
added.
OnlyEvaluateScreen (
[ BOOL value ] )
If value is True
or not specified, this routine will cause
the object to look only at the data currently displayed when
configuring the horizontal scroll bar. If value is False
every line in the page is examined. This is the default action.
This should be set to True
for very large pages, or pages in
which accessing every line is expensive.
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_GenericList 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 is composed of the following Cvo objects. Each object has the shown resource name. This link displays the composition of the parent object.
Cvo_Window
:
*CvoGenericList.upper_part.list
This object uses the following X resources in addition to those used by its parent and ancestor objects.
verticalScrollBar
(class:
ScrollBar
) (default value:
True
)
horizontalScrollBar
(class:
ScrollBar
) (default value:
True
)
These resources determine whether or not the Cvo_GenericList object will display scrollbars.
This object modifies the following X resources which are used by its parent or other ancestors.
*CvoGenericList.BorderWidth
(new value:
0
)
*CvoGenericList.CvoFrame.list.Cursor
(new value:
Top Left Arrow
)
*CvoGenericList.CvoFrame.list.sunken
(new value:
True
)
*CvoGenericList.CvoFrame.list.Pad
(new value:
2
)
*CvoGenericList.CvoFrame.list.FontFamily
(new value:
Helvetica
)
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.