A list item, a member of a BListView or BOutlineListView. More...
Inherits BArchivable.
Inherited by BStringItem.
Public Member Functions | |
BListItem (BMessage *archive) | |
Create a new list item from archived message. | |
BListItem (uint32 outlineLevel=0, bool expanded=true) | |
Create a new list item with the specified level. | |
virtual | ~BListItem () |
Destroy the list item freeing any memory used. | |
void | Deselect () |
Unselect the list item. | |
float | Height () const |
Return the height of the list item. | |
bool | IsEnabled () const |
Returns whether or not the list item is currently enabled. | |
bool | IsExpanded () const |
Returns whether or not the list item is currently expanded. | |
bool | IsSelected () const |
Return whether or not the list item is currently selected. | |
uint32 | OutlineLevel () const |
Returns the current outline level of the list item. This only makes sense if the list item is part of a BOutlineListView. | |
virtual status_t | Perform (perform_code code, void *arg) |
Performs an action give a perform_code and arg. (Internal Method) | |
void | Select () |
Select the list item. | |
virtual void | SetEnabled (bool enabled) |
Enable or disable the list item. | |
void | SetExpanded (bool expanded) |
Set the expanded state of the list item. This only makes sense if the list item is part of a BOutlineListView. | |
void | SetHeight (float height) |
Set the height of the list item to height. | |
void | SetOutlineLevel (uint32 level) |
Set the outline level of the list item. | |
void | SetWidth (float width) |
Set the width of the list item to width. | |
virtual void | Update (BView *owner, const BFont *font) |
Hook method that's called when the owner changes. | |
float | Width () const |
Return the width of the list item. | |
Archiving | |
virtual status_t | Archive (BMessage *archive, bool deep=true) const |
Archive the list item to a message. | |
virtual void | DrawItem (BView *owner, BRect frame, bool complete=false)=0 |
Hook method called when the item is drawn. | |
Public Member Functions inherited from BArchivable | |
BArchivable () | |
Constructor. Does nothing. | |
BArchivable (BMessage *from) | |
Constructor. Does important behind-the-scenes work in the unarchiving process. | |
virtual | ~BArchivable () |
Destructor. Does nothing. | |
virtual status_t | AllArchived (BMessage *archive) const |
Method relating to the use of BArchiver . | |
virtual status_t | AllUnarchived (const BMessage *archive) |
Method relating to the use of BUnarchiver . | |
virtual status_t | Archive (BMessage *into, bool deep=true) const |
Archive the object into a BMessage. | |
virtual status_t | Perform (perform_code d, void *arg) |
Perform some action (Internal method defined for binary compatibility purposes). | |
Additional Inherited Members | |
Static Public Member Functions inherited from BArchivable | |
static BArchivable * | Instantiate (BMessage *archive) |
Static member to restore objects from messages. | |
A list item, a member of a BListView or BOutlineListView.
BListItem::BListItem | ( | uint32 | level = 0 , |
bool | expanded = true |
||
) |
Create a new list item with the specified level.
The level and expanded arguments are only used if the item is added to a BOutlineListView.
level | The level to create the list item on, default level is 0. |
expanded | Whether or not the item is expanded. |
BListItem::BListItem | ( | BMessage * | data | ) |
Create a new list item from archived message.
data | The message to create the list item from. |
|
virtual |
Destroy the list item freeing any memory used.
The default destructor is empty.
Archive the list item to a message.
archive | The message to archive the list item to. |
deep | If true also archive child views. |
Reimplemented from BArchivable.
Reimplemented in BStringItem.
void BListItem::Deselect | ( | ) |
Unselect the list item.
Hook method called when the item is drawn.
owner | The view that the list item is a child of. |
frame | The frame of the item. |
complete | Whether or not to draw the background in addition to the item's contents. |
Implemented in BStringItem.
float BListItem::Height | ( | ) | const |
Return the height of the list item.
bool BListItem::IsEnabled | ( | ) | const |
Returns whether or not the list item is currently enabled.
true
if the list item is enabled, false
if it is disabled.bool BListItem::IsExpanded | ( | ) | const |
Returns whether or not the list item is currently expanded.
true
if the list item is expanded, false
if it is not expanded.bool BListItem::IsSelected | ( | ) | const |
Return whether or not the list item is currently selected.
true
if the list item is selected, false
otherwise.uint32 BListItem::OutlineLevel | ( | ) | const |
Returns the current outline level of the list item. This only makes sense if the list item is part of a BOutlineListView.
|
virtual |
Performs an action give a perform_code and arg. (Internal Method)
d | The perform code. |
arg | A pointer to some data to perform on. |
Reimplemented from BArchivable.
Reimplemented in BStringItem.
void BListItem::Select | ( | ) |
Select the list item.
|
virtual |
Enable or disable the list item.
on | Set true to enable, false to disable the list item. |
void BListItem::SetExpanded | ( | bool | expanded | ) |
Set the expanded state of the list item. This only makes sense if the list item is part of a BOutlineListView.
expanded | true to expand the list item, false to un-expand the list item. |
void BListItem::SetHeight | ( | float | height | ) |
Set the height of the list item to height.
height | The height to set the list item to. |
void BListItem::SetOutlineLevel | ( | uint32 | level | ) |
Set the outline level of the list item.
level | The outline level to set the list item to. |
void BListItem::SetWidth | ( | float | width | ) |
Set the width of the list item to width.
width | The width to set the list item to. |
Hook method that's called when the owner changes.
This method gets called when the list item is added to the list view.
The default implementation sets the width of the list item to the width of owner and sets the height to fit font.
owner | The list item's new owner. |
font | The font set to the list item's current owner. |
Reimplemented in BStringItem.
float BListItem::Width | ( | ) | const |
Return the width of the list item.