Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
BTab Class Reference

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.
 
BViewView () 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 BArchivableInstantiate (BMessage *archive)
 Instantiates a BTab object from the passed in archive.
 
- Static Public Member Functions inherited from BArchivable
static BArchivableInstantiate (BMessage *archive)
 Static member to restore objects from messages.
 

Detailed Description

A tab that goes in a BTabView.

Since
BeOS R3

Constructor & Destructor Documentation

◆ BTab() [1/2]

BTab::BTab ( BView contentsView = NULL)

Initializes a new BTab object as part of a tabView.

The BTab is enabled, but not selected nor the current focus. contentsView is set as the tab's target view – when the tab is selected, its target view is activated.

Since
BeOS R3

◆ BTab() [2/2]

BTab::BTab ( BMessage archive)

Archive Constructor.

Since
BeOS R3

Member Function Documentation

◆ Archive()

status_t BTab::Archive ( BMessage data,
bool  deep = true 
) const
virtual

Archives the object into the data message.

Parameters
dataA pointer to the BMessage object to archive the object into.
deepWhether or not to archive child views as well.
Returns
A status code, B_OK if everything went well or an error code otherwise.
Return values
B_OKThe object was archived.
B_NO_MEMORYRan out of memory while archiving the object.
Since
BeOS R3

Reimplemented from BArchivable.

◆ Deselect()

void BTab::Deselect ( )
virtual

Called by the BTabView when the tab is de-selected.

Since
BeOS R3

◆ DrawFocusMark()

void BTab::DrawFocusMark ( BView owner,
BRect  frame 
)
virtual

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.

Since
BeOS R3

◆ DrawLabel()

void BTab::DrawLabel ( BView owner,
BRect  frame 
)
virtual

Draws the tab's title.

Since
BeOS R3

◆ DrawTab()

void BTab::DrawTab ( BView owner,
BRect  frame,
tab_position  position,
bool  full = true 
)
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.

Parameters
ownerThe view that owns the tab.
frameThe frame rectangle to draw in.
positionMay affect how the tab is rendered. Choices include:
  • B_TAB_FIRST The first tab
  • B_TAB_FRONT The selected or active tab
  • B_TAB_ANY Tab that is not first or front
fullWhether or not to completely draw the tab. All tabs were full except for the tab before the selected tab on BeOS R5.
Warning
The position and full parameters should no longer be used. This information can be gathered from BTabView by calling the BTabView::IndexOf(), BTabView::Selection(), and BTabView::CountTabs() methods.
Since
BeOS R3

◆ Instantiate()

BArchivable * BTab::Instantiate ( BMessage archive)
static

Instantiates a BTab object from the passed in archive.

Since
BeOS R3

◆ IsSelected()

bool BTab::IsSelected ( ) const

Returns whether or not the tab is selected.

Since
BeOS R3

◆ Label()

const char * BTab::Label ( ) const

Returns the tab's label (the target view's name).

Since
BeOS R3

◆ MakeFocus()

void BTab::MakeFocus ( bool  focus = true)

Makes the tab the window's focus view or removes it.

Since
BeOS R3

◆ Perform()

status_t BTab::Perform ( uint32  d,
void *  arg 
)
virtual

Perform some action. (Internal Method)

Since
BeOS R3

Reimplemented from BArchivable.

◆ Select()

void BTab::Select ( BView owner)
virtual

Called by the BTabView when the tab is selected.

Parameters
ownerThe view that the tab's view should be owned by.
Since
BeOS R3

◆ SetEnabled()

void BTab::SetEnabled ( bool  enable)
virtual

Enables or disables the tab.

Since
BeOS R3

◆ SetLabel()

void BTab::SetLabel ( const char *  label)
virtual

Sets the target view's name, and updates the BTab accordingly.

Since
BeOS R3