A tab that goes in a BTabView. More...
Inherits BArchivable.
Public Member Functions | |
BTab (BMessage *archive) | |
Archive Constructor. | |
BTab (BView *contentsView=NULL) | |
Initializes a new BTab object as part of a tabView. | |
virtual | ~BTab () |
Destructor. | |
virtual status_t | Archive (BMessage *data, bool deep=true) const |
Archives the object into the data message. | |
virtual void | Deselect () |
Called by the BTabView when the tab is de-selected. | |
virtual void | DrawFocusMark (BView *owner, BRect frame) |
Draws the mark indicating that the BTab object is in focus. | |
virtual void | DrawLabel (BView *owner, BRect frame) |
Draws the tab's title. | |
virtual void | DrawTab (BView *owner, BRect frame, tab_position position, bool full=true) |
Draws the tab and label according to position and full. | |
bool | IsEnabled () const |
Returns whether or not the tab is enabled. | |
bool | IsFocus () const |
Returns whether or not the tab is the window's focus view. | |
bool | IsSelected () const |
Returns whether or not the tab is selected. | |
const char * | Label () const |
Returns the tab's label (the target view's name). | |
void | MakeFocus (bool focus=true) |
Makes the tab the window's focus view or removes it. | |
virtual status_t | Perform (uint32 d, void *arg) |
Perform some action. (Internal Method) | |
virtual void | Select (BView *owner) |
Called by the BTabView when the tab is selected. | |
virtual void | SetEnabled (bool enable) |
Enables or disables the tab. | |
virtual void | SetLabel (const char *label) |
Sets the target view's name, and updates the BTab accordingly. | |
virtual void | SetView (BView *view) |
Sets the view to be displayed for this tab. | |
BView * | View () const |
Returns a pointer to the view to be displayed for this tab. | |
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). | |
Static Public Member Functions | |
static BArchivable * | Instantiate (BMessage *archive) |
Instantiates a BTab object from the passed in archive. | |
Static Public Member Functions inherited from BArchivable | |
static BArchivable * | Instantiate (BMessage *archive) |
Static member to restore objects from messages. | |
A tab that goes in a BTabView.
BTab::BTab | ( | BMessage * | archive | ) |
Archive Constructor.
Archives the object into the data message.
data | A pointer to the BMessage object to archive the object into. |
deep | Whether or not to archive child views as well. |
B_OK
if everything went well or an error code otherwise. B_OK | The object was archived. |
B_NO_MEMORY | Ran out of memory while archiving the object. |
Reimplemented from BArchivable.
|
virtual |
Called by the BTabView when the tab is de-selected.
Draws the mark indicating that the BTab object is in focus.
This consists of a blue line drawn across the bottom of the tab frame by default.
|
virtual |
Draws the tab and label according to position and full.
This method draws the tab, then draws the tab's title by calling DrawLabel(). The position of the tab may affect how the tab is rendered – for example the first tab may have a different appearance than the other tabs. You may override this method to draw tabs differently in your BTab subclass.
owner | The view that owns the tab. |
frame | The frame rectangle to draw in. |
position | May affect how the tab is rendered. Choices include:
|
full | Whether or not to completely draw the tab. All tabs were full except for the tab before the selected tab on BeOS R5. |
|
static |
Instantiates a BTab object from the passed in archive.
bool BTab::IsSelected | ( | ) | const |
Returns whether or not the tab is selected.
const char * BTab::Label | ( | ) | const |
Returns the tab's label (the target view's name).
void BTab::MakeFocus | ( | bool | focus = true | ) |
Makes the tab the window's focus view or removes it.
|
virtual |
Called by the BTabView when the tab is selected.
owner | The view that the tab's view should be owned by. |
|
virtual |
Enables or disables the tab.
|
virtual |
Sets the target view's name, and updates the BTab accordingly.