A scrollable list view control for selection of a one or more of items.
![]() | Styles Options on creation of the list view control. |
![]() | PListViewControl ( PInteractor * parent, unsigned styles = ShowHeadings, PINDEX columnCount = 1, const char * const * headings = NULL ) Create a list view control. |
![]() | SetForegroundColour ( const PColour & newColour ) Set the default foreground or text colour of the interactor. |
![]() | SetBackgroundColour ( const PColour & newColour ) Set the background colour of the interactor. |
![]() | TransferValue ( int option ) This function transfers the value of the control to or from the variable pointed to by the value pointer member variable. |
![]() | AllowDeleteObjects ( BOOL yes = TRUE ) Set flag to delete entry objects using delete operator. |
![]() | DisallowDeleteObjects () Reset flag to delete entry objects using delete operator. |
![]() | AddEntry ( PListViewItem * obj, BOOL update = TRUE ) Add a new entry to the end of the list view. |
![]() | AddEntries ( const PCollection & objects, BOOL update = TRUE ) Add a collection of new entries to the list view. |
![]() | InsertEntry ( PListViewItem * obj, PINDEX index, BOOL update = TRUE ) Insert an entry at the specified location, ie before that entry. |
![]() | DeleteEntry ( PINDEX index, BOOL update = TRUE ) Delete the entry from the list view. |
![]() | DeleteAllEntries ( BOOL update = TRUE ) Delete all of the entries in the list view. |
![]() | FindEntry ( const PListViewItem & obj, PINDEX startIndex = P_MAX_INDEX ) const Find the entry in the list view starting at the entry after the specified index. |
![]() | UpdateEntry ( PINDEX index, BOOL update = TRUE ) Update the entry on in the list view. |
![]() | SetEntry ( PListViewItem * obj, PINDEX index, BOOL update = TRUE ) Set the entry at the index position. |
![]() | GetEntry ( PINDEX index ) const Get the entry at the index. |
![]() | GetCount () const Get the count of the number of items in the list of entries in the list view. |
![]() | GetTopIndex () const Get the index of the list view entry that is currently visible at the top of the list. |
![]() | InsertColumn ( const PString & heading, PINDEX before = P_MAX_INDEX, BOOL update = TRUE ) Add a new column to the list view. |
![]() | DeleteColumn ( PINDEX column, BOOL update = TRUE ) Delete an existing column. |
![]() | GetColumnCount () Get the number of columns that are in the list view. |
![]() | SetColumnHeading ( PINDEX column, const PString & str ) Set the heading string for the column. |
![]() | GetColumnWidth ( PINDEX column ) Get the width of the column in the list view. |
![]() | SetColumnWidth ( PINDEX column, PDIMENSION newWidth = 0, BOOL update = TRUE ) Set the new width of column in the list view. |
![]() | GetStringWidth ( const PString & str ) Get the width of the string as used in the list view. |
![]() | SetSelection ( PINDEX index ) Set the current selection to the entry specified by the index. |
![]() | GetSelection () const Get the current selection index. |
![]() | Select ( PINDEX index, BOOL update = TRUE, BOOL sel = TRUE ) Set the selection state of the list view item. |
![]() | Deselect ( PINDEX index, BOOL update = TRUE ) Reset the selection state of the list view item. |
![]() | IsSelected ( PINDEX index ) const Get the selection state of the list view item. |
![]() | GetSelCount () const Get the number of list view items that are selected. |
![]() | GetValuePointer () const Get the current value pointer associated with the control. |
![]() | SetValuePointer ( PINDEX * ptr ) Set the current value pointer associated with the control. |
![]() | OnColumnClick ( PINDEX column ) This callback is executed whenever the user clicks on a column heading. |
![]() | OnRightClick ( PINDEX index ) This callback is executed whenever the user clicks the right mouse button on an item. |
![]() | OnBeginDrag ( BOOL rightButton, PINDEX index ) This callback is executed whenever the user starts to drag an item in list view. |
![]() | OnDrawControl ( PCanvas & canvas, BOOL completed ) Thus callback is executed before draw operation on the contents of the list view. |
![]() | OnDrawEntry ( PINDEX index, PINDEX column, PListViewItem & obj, PCanvas & canvas, unsigned flags ) The system calls this whenever an object in the list needs to be redrawn. |
Member variables
Overrides from class PObject
System callback functions.
A scrollable list view control for selection of a one or more of items. The items are PListViewItem descendents.
CanHeadingSort
SingleSelection
If the update parameter is FALSE then it is the users
responsibility to redraw the list view, ie call
PInteractor::Invalidate() or PInteractor::Update() some
time afterward. This is typically used if a large number of entries are
to be added to the list view in one go. The user would add the entries
and then call the PInteractor::Invalidate() function on the list
view to force a redraw. This is much faster and tidier in appearance.
If the update parameter is FALSE then it is the users
responsibility to redraw the list view, ie call
PInteractor::Invalidate() or PInteractor::Update() some
time afterward. This is typically used if a large number of entries are
to be added to the list view in one go. The user would add the entries
and then call the PInteractor::Invalidate() function on the list
view to force a redraw. This is much faster and tidier in appearance.
If the update parameter is FALSE then it is the users
responsibility to redraw the list view, ie call
PInteractor::Invalidate() or PInteractor::Update() some
time afterward. This is typically used if a large number of entries are
to be deleted to the list view in one go. The user would delete the
entries and then call the PInteractor::Invalidate() function on
the list view to force a redraw. This is much faster and tidier in
appearance.
If the update parameter is FALSE then it is the users
responsibility to redraw the list view, ie call
PInteractor::Invalidate() or PInteractor::Update() some
time afterward. This is typically used if entries are to be added to the
list view immediately after deleting then. This is much faster and tidier
in appearance.
This uses the objects PObject::Compare() function to test for
equality on the objects in the list.
If there was an existing entry at the index position then that entry
is removed and if the delet objects option selected it is also deleted
using the delete operator. If the update parameter is FALSE then it is the users
responsibility to redraw the list view, ie call
PInteractor::Invalidate() or PInteractor::Update() some
time afterward. This is typically used if a large number of entries are
to be changed in the list view in one go. The user would change the
entries and then call the PInteractor::Invalidate() function on
the list view to force a redraw. This is much faster and tidier in
appearance.
If the update parameter is FALSE then it is the users
responsibility to redraw the list view, ie call
PInteractor::Invalidate() or PInteractor::Update() some
time afterward.
If the update parameter is FALSE then it is the users
responsibility to redraw the list view, ie call
PInteractor::Invalidate() or PInteractor::Update() some
time afterward.
If the newWidth parameter is zero, then the column is set
to the minimium width required to contain the longest string in the
column. If the update parameter is FALSE then it is the users
responsibility to redraw the list view, ie call
PInteractor::Invalidate() or PInteractor::Update() some
time afterward.
If the multiple selection option is used then this will deselect all
other items and only have the specified entry selected. If the
then all entries are deselected.
If the update parameter is FALSE then it is the users
responsibility to redraw the list view, ie call
PInteractor::Invalidate() or PInteractor::Update() some
time afterward. This is typically used if a large number of entries are
to be changed in the list view in one go. The user would change the
entries and then call the PInteractor::Invalidate() function on
the list view to force a redraw. This is much faster and tidier in
appearance.
If the list view was not multi select then all entries a deselected.
The default behaviour is to sort the entries by that column, provided
that the CanHeadingSort style was used in the creation of the list view.
The default behaviour does nothing.
The default behaviour does nothing.
Note that the return value is only examined on the first call, when the
completed flag is FALSE. Also no furter calls to
OnDrawControl() or OnDrawEntry() are made if FALSE is returned. The default behaviour simply returns FALSE.
If the column field is P_MAX_INDEX, then the function is
being called before the draw of any of the columns. The default behaviour simply returns FALSE.
PNotifier codes
Notification codes passed to the PNotifier function when the specified notification events occur
Overrides from class PInteractor
virtual void SetForegroundColour( const PColour & newColour )
virtual void SetBackgroundColour( const PColour & newColour )
Overrides from class PControl
virtual void TransferValue( int option )
New functions for class
void AllowDeleteObjects( BOOL yes = TRUE )
void DisallowDeleteObjects()
PINDEX AddEntry( PListViewItem * obj, BOOL update = TRUE )
update - Flag to indicate screen should be updated.void AddEntries( const PCollection & objects, BOOL update = TRUE )
update - Flag to indicate screen should be updated.void InsertEntry( PListViewItem * obj, PINDEX index, BOOL update = TRUE )
index - Index position in list view to insert entry.
update - Flag to indicate screen should be updated.void DeleteEntry( PINDEX index, BOOL update = TRUE )
update - Flag to indicate screen should be updated.void DeleteAllEntries( BOOL update = TRUE )
PINDEX FindEntry( const PListViewItem & obj, PINDEX startIndex = P_MAX_INDEX ) const
startIndex - Starting index for the search.void UpdateEntry( PINDEX index, BOOL update = TRUE )
update - Flag to indicate screen should be updated.void SetEntry( PListViewItem * obj, PINDEX index, BOOL update = TRUE )
index - Index position in list view to set entry.
update - Flag to indicate screen should be updated.PListViewItem* GetEntry( PINDEX index ) const
PINDEX GetCount() const
PINDEX GetTopIndex() const
void InsertColumn( const PString & heading, PINDEX before = P_MAX_INDEX, BOOL update = TRUE )
before - Index of column to insert before
update - Flag to indicate screen should be updated.void DeleteColumn( PINDEX column, BOOL update = TRUE )
update - Flag to indicate screen should be updated.PINDEX GetColumnCount()
void SetColumnHeading( PINDEX column, const PString & str )
str - New heading for columnPDIMENSION GetColumnWidth( PINDEX column )
void SetColumnWidth( PINDEX column, PDIMENSION newWidth = 0, BOOL update = TRUE )
newWidth - New width for the columns in the list view.
update - Flag to indicate screen should be updated.PDIMENSION GetStringWidth( const PString & str )
void SetSelection( PINDEX index )
PINDEX GetSelection() const
void Select( PINDEX index, BOOL update = TRUE, BOOL sel = TRUE )
update - Flag to indicate screen should be updated.
sel - State in which to set the entries selection.void Deselect( PINDEX index, BOOL update = TRUE )
update - Flag to indicate screen should be updated.BOOL IsSelected( PINDEX index ) const
PINDEX GetSelCount() const
PINDEX* GetValuePointer() const
void SetValuePointer( PINDEX * ptr )
virtual void OnColumnClick( PINDEX column )
virtual void OnRightClick( PINDEX index )
virtual void OnBeginDrag( BOOL rightButton, PINDEX index )
index - Index of item that was dragged.virtual BOOL OnDrawControl( PCanvas & canvas, BOOL completed )
completed - Indication that the drawing has completed.virtual BOOL OnDrawEntry( PINDEX index, PINDEX column, PListViewItem & obj, PCanvas & canvas, unsigned flags )
column - Index of column to draw in the list view.
canvas - Canvas in which to draw the object entry.
flags - Flags indicating is selected or has focus, etc.unsigned defaultStyles
PINDEX numColumns
BOOL deleteObjects
Alphabetic index HTML hierarchy of classes or Java