A scrollable list box control for selection of a one or more of PString objects
![]() | PCustomListBox ( PInteractor * parent, StringSorting sorted = Sorted, SelectType select = SingleSelect, PDIMENSION columnWidth = 0, BOOL deleteObj = TRUE ) Create a custom list box with the specified options. |
![]() | PCustomListBox ( PInteractorLayout * parent, PRESOURCE_ID ctlID, const PNotifier & notify, PINDEX * valuePtr ) Create control from interactor layout with the specified control ID. |
![]() | AddEntry ( PObject * obj, BOOL update = TRUE ) Add a new entry to the list box. |
![]() | AddEntries ( const PCollection & objects, BOOL update = TRUE ) Add a collection of new entries to the list box. |
![]() | InsertEntry ( PObject * obj, PINDEX index, BOOL update = TRUE ) Insert an entry at the specified location. |
![]() | FindEntry ( const PObject & obj, PINDEX startIndex = P_MAX_INDEX ) const Find the entry in the list box starting at the entry after the specified index. |
![]() | SetEntry ( PObject * obj, PINDEX index, BOOL update = TRUE ) Set the entry at the index position. |
![]() | GetEntry ( PINDEX index ) const Get the entry at the index. |
![]() | OnDrawEntry ( PINDEX index, PObject & obj, PCanvas & canvas, const PRect & rect, BOOL hasFocus, BOOL isSelected ) The system calls this whenever an object in the list needs to be redrawn. |
![]() | OnMeasureEntry ( PINDEX index, PObject & obj, PCanvas & canvas ) The system calls this whenever it needs to get the size of an object in the list. |
![]() | PStringListBox ( PInteractor * parent, StringSorting sorted = Sorted, SelectType select = SingleSelect, PDIMENSION columnWidth = 0 ) Create a list box with the specified options. |
![]() | PStringListBox ( PInteractorLayout * parent, PRESOURCE_ID ctlID, const PNotifier & notify, PINDEX * valuePtr ) Create control from interactor layout with the specified control ID. |
![]() | ~PStringListBox () Destroy the list box and all the strings it contains. |
![]() | AddString ( const PString & str, BOOL update = TRUE ) Add a new entry to the list box. |
![]() | AddStrings ( const PCollection & objects, BOOL update = TRUE ) Add a collection of new entries to the list box. |
![]() | InsertString ( const PString & str, PINDEX index, BOOL update = TRUE ) Insert an entry at the specified location. |
![]() | DeleteString ( PINDEX index, BOOL update = TRUE ) Delete the string from the list box. |
![]() | FindString ( const PString & str, PINDEX startIndex = P_MAX_INDEX, BOOL exact = FALSE ) const Find the string in the list box starting at the string after the specified index. |
![]() | SetString ( const PString & str, PINDEX index, BOOL update = TRUE ) Set the string at the index position. |
![]() | GetString ( PINDEX index ) const Get the string at the index. |
![]() | GetSelectedString () const Get the selected string in a non-multiselect list box. |
![]() | SetTabStops ( PDIMENSION tab ) Set the tab stop positions for strings in each row of the list box. |
![]() | New functions for class |
![]() | System callback functions. |
![]() | New functions for class |
PNotifier codes
Overrides from class PControl
Overrides from class PInteractor
Overrides from class PInteractor
Member variables
Overrides from class PObject
A scrollable list box control for selection of a one or more of PString objects
If the update parameter is FALSE then it is the users
responsibility to redraw the list box, 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 box in one go. The user would add the entries
and then call the PInteractor::Invalidate() function on the list
box 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 box, 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 box in one go. The user would add the entries
and then call the PInteractor::Invalidate() function on the list
box to force a redraw. 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 sorted option was used this will place the entry in the correct
position, not that specified by the
parameter. Note the removal of the previous value still takes place. If the update parameter is FALSE then it is the users
responsibility to redraw the list box, 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 box in one go. The user would change the
entries and then call the PInteractor::Invalidate() function on
the list box 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 box, 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 box in one go. The user would add the entries
and then call the PInteractor::Invalidate() function on the list
box to force a redraw. This is much faster and tidier in appearance.
If the collection is not of string objects then they are translated into
a string by the use of the operator<< function.
If the update parameter is FALSE then it is the users
responsibility to redraw the list box, 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 box in one go. The user would add the entries
and then call the PInteractor::Invalidate() function on the list
box 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 box, 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 box in one go. The user would delete the
entries and then call the PInteractor::Invalidate() function on
the list box to force a redraw. This is much faster and tidier in
appearance.
The
otherwise a string in the list box that matches up to the length of
the argument string will be found.
If there was an existing entry at the index position then that entry
is removed. If the sorted option was used this will place the entry in the correct
position, not that specified by the
parameter. Note the removal of the previous value still takes place. If the update parameter is FALSE then it is the users
responsibility to redraw the list box, 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 box in one go. The user would change the
entries and then call the PInteractor::Invalidate() function on
the list box to force a redraw. This is much faster and tidier in
appearance.
The first form sets all tab stops to be the same distance. There are an
infinite number of tab stops of this size. The other forms set explicit tab stops for the specified positions. The
distance between the last two entries, or between 0 and the first array
entry if there is only one entry, is used for all subsequent tab stops.
PCustomListBox( PInteractorLayout * parent, PRESOURCE_ID ctlID, const PNotifier & notify, PINDEX * valuePtr )
ctlID - Identifier for the control in the layout.
notify - Function to call when changes state.
valuePtr - Variable to change to the list box state. New functions for class
virtual PINDEX AddEntry( PObject * 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.virtual void InsertEntry( PObject * obj, PINDEX index, BOOL update = TRUE )
index - Index position in list box to insert entry.
update - Flag to indicate screen should be updated.virtual PINDEX FindEntry( const PObject & obj, PINDEX startIndex = P_MAX_INDEX ) const
startIndex - Starting index for the search.virtual void SetEntry( PObject * obj, PINDEX index, BOOL update = TRUE )
index - Index position in list box to set entry.
update - Flag to indicate screen should be updated.virtual const PObject* GetEntry( PINDEX index ) const
System callback functions.
virtual void OnDrawEntry( PINDEX index, PObject & obj, PCanvas & canvas, const PRect & rect, BOOL hasFocus, BOOL isSelected )
obj - Object to draw for this entry in the list box.
canvas - Canvas in which to draw the object entry.
rect - Rectangle of canvas in which the item is drawn.
hasFocus - Flag indicating the item has the focus.
isSelected - Flag indicating the item is selected.virtual PDim OnMeasureEntry( PINDEX index, PObject & obj, PCanvas & canvas )
obj - Object to measure for this entry in the list box.
canvas - Canvas in which to measure the object entry. PStringListBox( PInteractor * parent, StringSorting sorted = Sorted, SelectType select = SingleSelect, PDIMENSION columnWidth = 0 )
sorted - If set to Sorted then strings will be inserted in sorted
order. This requires that the PObject::Compare() function
operate correctly for objects placed into the list box.
select - If set to MultiSelect then more than one item may be
selected at a time. Otherwise only zero or one item may be selected.
columnWidth - If this parameter is zero then only one column with a vertical scroll
bar is displayed. If non-zero, then multiple columns of this width,
in font based coordinates, will be used and a horizontal scroll bar
displayed.
PStringListBox( PInteractorLayout * parent, PRESOURCE_ID ctlID, const PNotifier & notify, PINDEX * valuePtr )
ctlID - Identifier for the control in the layout.
notify - Function to call when changes state.
valuePtr - Variable to change to the list box state.virtual ~PStringListBox()
New functions for class
virtual PINDEX AddString( const PString & str, BOOL update = TRUE )
update - Flag to indicate screen should be updated.void AddStrings( const PCollection & objects, BOOL update = TRUE )
update - Flag to indicate screen should be updated.virtual void InsertString( const PString & str, PINDEX index, BOOL update = TRUE )
index - Index position in list box to insert entry.
update - Flag to indicate screen should be updated.virtual void DeleteString( PINDEX index, BOOL update = TRUE )
update - Flag to indicate screen should be updated.virtual PINDEX FindString( const PString & str, PINDEX startIndex = P_MAX_INDEX, BOOL exact = FALSE ) const
startIndex - Starting index for the search.
exact - Flag for search for exact string or substring.void SetString( const PString & str, PINDEX index, BOOL update = TRUE )
index - Index position in list box to set entry.
update - Flag to indicate screen should be updated.virtual PString GetString( PINDEX index ) const
PString GetSelectedString() const
void SetTabStops( PDIMENSION tab )
Alphabetic index HTML hierarchy of classes or Java