Public Member Functions | Protected Member Functions | List of all members
BToolTip Class Referenceabstract

Displays help text on hover. More...

Inherits BArchivable, and BReferenceable.

Inherited by BTextToolTip.

Public Member Functions

 BToolTip ()
 Creates a new BToolTip object. More...
 
 BToolTip (BMessage *archive)
 Creates a BToolTip object from the passed in archive. More...
 
virtual ~BToolTip ()
 Frees the memory allocated and destroys the object. More...
 
BAlignment Alignment () const
 Returns the tool tip's alignment. More...
 
virtual status_t Archive (BMessage *archive, bool deep=true) const
 Archives the object into the data message. More...
 
bool IsSticky () const
 Returns whether or not the sticky flag is set. More...
 
BPoint MouseRelativeLocation () const
 Returns the tool tip's relative mouse location. More...
 
virtual void SetAlignment (BAlignment alignment)
 Set the alignment of the tool tip which determines where the tool tip should appear i.e. left or right from the current mouse cursor position, etc. More...
 
virtual void SetMouseRelativeLocation (BPoint location)
 Set the location of the tooltip relative to the current mouse position. More...
 
virtual void SetSticky (bool enable)
 Turns sticky flag on or off which determines whether or not the tool tip stays visible when the mouse moves. More...
 
- 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...
 
virtual status_t Perform (perform_code d, void *arg)
 Perform some action (Internal method defined for binary compatibility purposes).
 
- Public Member Functions inherited from BReferenceable
 BReferenceable ()
 Initialize the object with a reference count of 1. More...
 
virtual ~BReferenceable ()
 Destructor. More...
 
int32 AcquireReference ()
 Acquire a reference to the object. More...
 
int32 CountReferences () const
 Return the number of references to the object. More...
 
int32 ReleaseReference ()
 Release a reference to the object. More...
 

Protected Member Functions

bool Lock ()
 Allows derived classes to lock the tool tip while modifying it. More...
 
void Unlock ()
 Allows derived classes to unlock the tool tip. More...
 
- Protected Member Functions inherited from BReferenceable
virtual void FirstReferenceAcquired ()
 Called when the first reference to the object is reacquired. More...
 
virtual void LastReferenceReleased ()
 Called when the last reference to the object is released. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from BArchivable
static BArchivableInstantiate (BMessage *archive)
 Static member to restore objects from messages. More...
 

Detailed Description

Displays help text on hover.

Attention
Use at your own risk! This class is private and may change before release.

This class is for advanced uses of tool tips with custom contents or behavior. The simple way to use tooltips is via BView::SetToolTip().

Since
Haiku R1

Constructor & Destructor Documentation

◆ BToolTip() [1/2]

BToolTip::BToolTip ( )

Creates a new BToolTip object.

Since
Haiku R1

◆ BToolTip() [2/2]

BToolTip::BToolTip ( BMessage archive)

Creates a BToolTip object from the passed in archive.

Since
Haiku R1

◆ ~BToolTip()

BToolTip::~BToolTip ( )
virtual

Frees the memory allocated and destroys the object.

Since
Haiku R1

Member Function Documentation

◆ Alignment()

BAlignment BToolTip::Alignment ( ) const

Returns the tool tip's alignment.

Since
Haiku R1

◆ Archive()

status_t BToolTip::Archive ( BMessage archive,
bool  deep = true 
) const
virtual

Archives the object into the data message.

Saves the tool tip's sticky flag.

Parameters
archiveA 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
Haiku R1

Reimplemented from BArchivable.

◆ IsSticky()

bool BToolTip::IsSticky ( ) const

Returns whether or not the sticky flag is set.

Since
Haiku R1

◆ Lock()

bool BToolTip::Lock ( )
protected

Allows derived classes to lock the tool tip while modifying it.

Since
Haiku R1

◆ MouseRelativeLocation()

BPoint BToolTip::MouseRelativeLocation ( ) const

Returns the tool tip's relative mouse location.

Since
Haiku R1

◆ SetAlignment()

void BToolTip::SetAlignment ( BAlignment  alignment)
virtual

Set the alignment of the tool tip which determines where the tool tip should appear i.e. left or right from the current mouse cursor position, etc.

Since
Haiku R1

◆ SetMouseRelativeLocation()

void BToolTip::SetMouseRelativeLocation ( BPoint  location)
virtual

Set the location of the tooltip relative to the current mouse position.

The position is relative to the mouse cursor location at the time the tool tip is shown. It should be as close as possible to the mouse cursor without hiding important parts of the UI near the cursor while the parent view remains visible and reachable.

Since
Haiku R1

◆ SetSticky()

void BToolTip::SetSticky ( bool  enable)
virtual

Turns sticky flag on or off which determines whether or not the tool tip stays visible when the mouse moves.

Since
Haiku R1

◆ Unlock()

void BToolTip::Unlock ( )
protected

Allows derived classes to unlock the tool tip.

Since
Haiku R1