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 (BView *contentsView=NULL)
 Initializes a new BTab object as part of a tabView. More...
 
 BTab (BMessage *archive)
 Archive Constructor. More...
 
virtual ~BTab ()
 Destructor.
 
virtual status_t Archive (BMessage *data, bool deep=true) const
 Archives the object into the data message. More...
 
virtual void Deselect ()
 Called by the BTabView when the tab is de-selected. More...
 
virtual void DrawFocusMark (BView *owner, BRect frame)
 Draws the mark indicating that the BTab object is in focus. More...
 
virtual void DrawLabel (BView *owner, BRect frame)
 Draws the tab's title. More...
 
virtual void DrawTab (BView *owner, BRect frame, tab_position position, bool full=true)
 Draws the tab. More...
 
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. More...
 
const char * Label () const
 Returns the tab's label (the target view's name). More...
 
void MakeFocus (bool focus=true)
 Makes the tab the window's focus view or removes it. More...
 
virtual status_t Perform (uint32 d, void *arg)
 Perform some action. (Internal Method) More...
 
virtual void Select (BView *owner)
 Called by the BTabView when the tab is selected. More...
 
virtual void SetEnabled (bool enable)
 Enables or disables the tab. More...
 
virtual void SetLabel (const char *label)
 Sets the target view's name, and updates the BTab accordingly. More...
 
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 (BMessage *from)
 Constructor. Does important behind-the-scenes work in the unarchiving process. More...
 
 BArchivable ()
 Constructor. Does nothing. More...
 
virtual ~BArchivable ()
 Destructor. Does nothing. More...
 
virtual status_t AllArchived (BMessage *archive) const
 Method relating to the use of BArchiver. More...
 
virtual status_t AllUnarchived (const BMessage *archive)
 Method relating to the use of BUnarchiver. More...
 

Static Public Member Functions

static BArchivableInstantiate (BMessage *archive)
 Instantiates a BTab object from the passed in archive. More...
 
- Static Public Member Functions inherited from BArchivable
static BArchivableInstantiate (BMessage *archive)
 Static member to restore objects from messages. More...
 

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.

This method draws the tab's title by calling DrawLabel(), then draws the tab itself. The position of the tab may affect how the tab is rendered – for example the frontmost tab may have a different appearance than the other tabs.

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
  • B_TAB_FRONT
  • B_TAB_ANY
fullWhether or not to completely draw the tab, no longer used.
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