A BButton is a labeled on-screen button. More...
Public Member Functions | |
| BButton (BRect frame, const char *name, const char *label, BMessage *message, uint32 resizingMode=B_FOLLOW_LEFT|B_FOLLOW_TOP, uint32 flags=B_WILL_DRAW|B_NAVIGABLE|B_FULL_UPDATE_ON_RESIZE) | |
| Creates and initializes a BButton control. | |
| BButton (const char *name, const char *label, BMessage *message, uint32 flags=B_WILL_DRAW|B_NAVIGABLE|B_FULL_UPDATE_ON_RESIZE) | |
| Creates and initializes a BButton control. | |
| BButton (const char *label, BMessage *message=NULL) | |
| Creates and initializes a BButton control. | |
| BButton (BMessage *archive) | |
| Constructs a BButton object from an archive message. | |
| virtual | ~BButton () |
| Destructor method. | |
| virtual status_t | AllArchived (BMessage *archive) const |
Method relating to the use of BArchiver. | |
| virtual void | AllAttached () |
| Similar to AttachedToWindow() but this method is triggered after all child views have already been attached to a window. | |
| virtual void | AllDetached () |
| Similar to AttachedToWindow() but this method is triggered after all child views have already been detached from a window. | |
| virtual status_t | AllUnarchived (const BMessage *archive) |
Method relating to the use of BUnarchiver. | |
| virtual status_t | Archive (BMessage *archive, bool deep=true) const |
| Archives the object into archive. | |
| virtual void | AttachedToWindow () |
| Hook method that is called when the object is attached to a window. | |
| virtual void | DetachedFromWindow () |
| Hook method that is called when the object is detached from a window. | |
| virtual void | Draw (BRect updateRect) |
| Draws the area of the button that intersects updateRect and sets the label. | |
| virtual void | DrawAfterChildren (BRect r) |
| Perform any drawing that needs to be done after child view have already been drawn. | |
| virtual void | FrameMoved (BPoint newLocation) |
| Hook method that gets called when the view is moved. | |
| virtual void | FrameResized (float width, float height) |
| Hook method that gets called when the view is resized. | |
| BLayout * | GetLayout () const |
| Get the layout of the view. | |
| virtual void | GetPreferredSize (float *_width, float *_height) |
| Gets the dimensions that the BButton would prefer to be. | |
| virtual status_t | GetSupportedSuites (BMessage *message) |
| Report the suites of understood messages. | |
| virtual status_t | Invoke (BMessage *message=NULL) |
| The BButton is invoked from a message. | |
| bool | IsDefault () const |
| Returns whether or not the BButton is the default button or not, i.e. it responds to the Enter key. | |
| bool | IsEnabled () const |
| Gets whether or not the control is currently enabled. | |
| virtual void | KeyDown (const char *bytes, int32 numBytes) |
| Hook method that is called when a keyboard key is pressed. | |
| virtual void | KeyUp (const char *bytes, int32 numBytes) |
| Hook method that is called when a keyboard key is released. | |
| const char * | Label () const |
| Gets the label of the control. | |
| virtual void | MakeDefault (bool flag) |
| Make the BButton the default button i.e. it will be activated when the user pushes the Enter key. | |
| virtual void | MakeFocus (bool focused=true) |
| Gives or removes focus from the control. | |
| virtual BSize | MaxSize () |
| Get the maximum size of the view. | |
| virtual void | MessageReceived (BMessage *message) |
| Handle message that has been received by the associated looper. | |
| virtual BSize | MinSize () |
| Get the minimum size of the view. | |
| virtual void | MouseDown (BPoint point) |
| Hook method that is called when a mouse button is pressed. | |
| virtual void | MouseMoved (BPoint point, uint32 transit, const BMessage *message) |
| Hook method that is called when the mouse is moved. | |
| virtual void | MouseUp (BPoint point) |
| Hook method that is called when a mouse button is released. | |
| virtual status_t | Perform (perform_code d, void *arg) |
| Perform some action. (Internal Method) | |
| virtual BSize | PreferredSize () |
| Get the preferred size of the view. | |
| virtual void | Pulse () |
Hook method that gets invoked when the view receives a B_PULSE message. | |
| virtual void | ResizeToPreferred () |
| Resize the control to its preferred size. | |
| virtual BHandler * | ResolveSpecifier (BMessage *message, int32 index, BMessage *specifier, int32 what, const char *property) |
| Determine the proper specifier for scripting messages. | |
| virtual void | SetEnabled (bool enabled) |
| Enables or disables the control. | |
| void | SetExplicitAlignment (BAlignment alignment) |
| Set this item's explicit alignment, to be used by Alignment(). | |
| void | SetExplicitMaxSize (BSize size) |
| Set this item's explicit max size, to be used by MaxSize(). | |
| void | SetExplicitMinSize (BSize size) |
| Set this item's explicit min size, to be used by MinSize(). | |
| void | SetExplicitPreferredSize (BSize size) |
| Set this item's explicit preferred size, to be used by PreferredSize(). | |
| virtual void | SetLabel (const char *string) |
| Sets the BButton's label. | |
| virtual void | SetLayout (BLayout *layout) |
| Set the layout of the view. | |
| virtual void | SetValue (int32 value) |
| Sets the value of the BButton. | |
| int32 | Value () const |
| Gets the value of the control. | |
| virtual void | WindowActivated (bool active) |
| Hook method that is called when the attached window becomes activated or deactivated. | |
Methods triggering or related to laying out this BLayout. | |
| BLayoutContext * | LayoutContext () const |
Returns the BLayoutContext this BLayout is currently operating in, or NULL. | |
Core Handler Functionality | |
| BLooper * | Looper () const |
| Return a pointer to the looper that this handler is associated with. | |
| void | SetName (const char *name) |
| Set or change the name of this handler. | |
| const char * | Name () const |
| Return the name of this handler. | |
| virtual void | SetNextHandler (BHandler *handler) |
| Set the next handler in the chain that the message is passed on to if this handler cannot process it. | |
| BHandler * | NextHandler () const |
| Return the next hander in the chain to which the message is passed on. | |
Message Filtering | |
| virtual void | AddFilter (BMessageFilter *filter) |
| Add filter as a prerequisite to this handler. | |
| virtual bool | RemoveFilter (BMessageFilter *filter) |
| Remove filter from the filter list. | |
| virtual void | SetFilterList (BList *filters) |
| Set the internal list of filters to filters. | |
| BList * | FilterList () |
| Return a pointer to the list of filters. | |
Locking | |
This class provides some utility functions to look the looper associated with this handler. | |
| bool | LockLooper () |
| Lock the looper associated with this handler. | |
| status_t | LockLooperWithTimeout (bigtime_t timeout) |
| Lock the looper associated with this handler, with a time out value. | |
| void | UnlockLooper () |
| Unlock the looper. | |
Observing | |
Handlers can function as state machines, which emit messages to observers when the state changes. Use the following methods to subscribe to these notifications. Note that there is a semantic difference between the two StartWatching() methods. The overloaded method that accepts a BHandler, expects as argument an observer that watches this handler. The method that accepts a BMessenger, expects a target that emits the state changes to this handler. | |
| status_t | StartWatching (BMessenger target, uint32 what) |
| Subscribe this handler to watch a specific state change of a target. | |
| status_t | StartWatching (BHandler *observer, uint32 what) |
| Subscribe an observer for a specific state change of this handler. | |
| status_t | StartWatchingAll (BMessenger target) |
| Subscribe this handler to watch a target for all events. | |
| status_t | StartWatchingAll (BHandler *observer) |
| Subscribe an observer for a all state changes. | |
| status_t | StopWatching (BMessenger target, uint32 what) |
| Unsubscribe this handler from watching a specific state. | |
| status_t | StopWatching (BHandler *observer, uint32 what) |
| Unsubscribe an observer from watching a specific state. | |
| status_t | StopWatchingAll (BMessenger target) |
| Unsubscribe this handler from watching all states. | |
| status_t | StopWatchingAll (BHandler *observer) |
| Unsubscribe an observer from watching all states. | |
Emitting State Changes | |
If your handler functions as a state machine, and it has observers (which subscribed using the StartWatching() method), you can emit these state changes. | |
| virtual void | SendNotices (uint32 what, const BMessage *notice=NULL) |
| Emit a state change to the observers. | |
| bool | IsWatched () const |
| Check if there are any observers watching this handler. | |
Static Public Member Functions | |
| static BArchivable * | Instantiate (BMessage *archive) |
| Creates a new object from an archive. | |
Protected Member Functions | |
| virtual void | LayoutInvalidated (bool descendants=false) |
| void | SetValueNoUpdate (int32 value) |
| Sets the value of the control without redrawing. | |
A BButton is a labeled on-screen button.
A BButton control is used to initiate an action. An action is activated by clicking on the button with the mouse or by a keyboard button. If the BButton is the default button for the active window then you can activate it by pushing the Enter key.
A BButton, unlike other user interface elements such as check boxes and radio buttons has only a single state. During a click event the BButton's value is set to 1, (B_CONTROL_ON) otherwise this value is 0 (B_CONTROL_OFF).
| BButton::BButton | ( | BRect | frame, |
| const char * | name, | ||
| const char * | label, | ||
| BMessage * | message, | ||
| uint32 | resizingMode = B_FOLLOW_LEFT | B_FOLLOW_TOP, |
||
| uint32 | flags = B_WILL_DRAW | B_NAVIGABLE | B_FULL_UPDATE_ON_RESIZE |
||
| ) |
Creates and initializes a BButton control.
BControl initializes the button's label and assigns it a message that identifies the action that should be carried out when the button is pressed. When the button is attached to a window it is resizes to the height of the button's frame rectangle to fit the button's border and label in the button's font.
The frame, name, resizingMode, and flags parameters are passed up the inheritance chain to the BView class.
| frame | The frame rectangle that the button is draw into. |
| name | The name of the button |
| label | The button label text |
| message | The BButtons's action message |
| resizingMode | Mask sets the parameters by which the BButton can be resized. It should be set to one option for vertical resizing combined with one option for horizontal resizing. Horizontal resizing options are
|
| flags | The flags mask sets what notifications the BButton can receive. Any combination of the following options is allowed
|
| BButton::BButton | ( | const char * | name, |
| const char * | label, | ||
| BMessage * | message, | ||
| uint32 | flags = B_WILL_DRAW | B_NAVIGABLE | B_FULL_UPDATE_ON_RESIZE |
||
| ) |
Creates and initializes a BButton control.
BControl initializes the button's label and assigns it a message that identifies the action that should be carried out when the button is pressed. When the button is attached to a window it is resizes to the height of the button's frame rectange to fit the button's border and label in the button's font.
| name | The name of the button |
| label | The button's label text |
| message | The button's action message |
| flags | The flags mask sets what notifications the button can receive. Any combination of the following options is allowed:
|
| BButton::BButton | ( | const char * | label, |
| BMessage * | message = NULL |
||
| ) |
Creates and initializes a BButton control.
Creates the button with the specified label. The action carried out by the button is specified by the message.
| label | The button's label text |
| message | The buttons action message |
| BButton::BButton | ( | BMessage * | archive | ) |
Constructs a BButton object from an archive message.
This method is usually not called directly. If you want to build a button from a message you should call Instantiate() which can handle errors properly.
If the archive deep, the BButton object will also unarchive each of its child views recursively.
| archive | The archive message to restore from. |
| BButton::~BButton | ( | ) | [virtual] |
Destructor method.
Standard Destructor.
| void BHandler::AddFilter | ( | BMessageFilter * | filter | ) | [virtual, inherited] |
Add filter as a prerequisite to this handler.
If the handler is associated with a looper, this looper needs to be locked in order for this operation to succeed.
Note that the filter is not copied, rather a pointer to the filter is stored. As such, you need to make sure that the filter object exists as long as it is added to this handler.
Method relating to the use of BArchiver.
This hook function is called once the first BArchiver that was created in an archiving session is either destroyed, or has its Finish() method called. Implementations of this method can be used, in conjunction with BArchiver::IsArchived(), to reference objects in your archive that you do not own, depending on whether or not those objects were archived by their owners. Implementations of this method should call the implementation of their parent class, the same as for the Archive() method.
Reimplemented from BArchivable.
| virtual void BButton::AllAttached | ( | ) | [virtual] |
Similar to AttachedToWindow() but this method is triggered after all child views have already been attached to a window.
Reimplemented from BControl.
| virtual void BButton::AllDetached | ( | ) | [virtual] |
Similar to AttachedToWindow() but this method is triggered after all child views have already been detached from a window.
Reimplemented from BControl.
Method relating to the use of BUnarchiver.
This hook function is called triggered in the BUnarchiver::Finish() method. In this method, you can rebuild references to objects that may be direct children of your object, or may be children of other objects. Implementations of this method should call the implementation of their parent class, the same as for the Archive() method.
Reimplemented from BArchivable.
Archives the object into archive.
| archive | The target archive that the data will go into. |
| deep | Whether or not to recursively archive child views. |
| B_OK | The archive operation was successful. |
| B_BAD_VALUE | NULL archive message. |
| B_ERROR | The archive operation failed. |
Reimplemented from BControl.
| virtual void BButton::AttachedToWindow | ( | ) | [virtual] |
Hook method that is called when the object is attached to a window.
This method overrides BView::AttachedToWindow() setting the low color and view color of the BControl so that it matches the view color of the control's parent view. It also makes the attached window the default target for Invoke() as long as another target has not already been set.
Reimplemented from BControl.
| virtual void BButton::DetachedFromWindow | ( | ) | [virtual] |
Hook method that is called when the object is detached from a window.
Reimplemented from BControl.
| void BButton::Draw | ( | BRect | updateRect | ) | [virtual] |
Draws the area of the button that intersects updateRect and sets the label.
| updateRect | The rectangular area to be drawn. |
Reimplemented from BView.
| void BView::DrawAfterChildren | ( | BRect | r | ) | [virtual, inherited] |
Perform any drawing that needs to be done after child view have already been drawn.
| r | The rectangular area to be drawn. |
| BList * BHandler::FilterList | ( | ) | [inherited] |
Return a pointer to the list of filters.
| virtual void BButton::FrameMoved | ( | BPoint | newPosition | ) | [virtual] |
Hook method that gets called when the view is moved.
| newPosition | The point of the top left corner of the frame that the view has been moved to. |
Reimplemented from BView.
| virtual void BButton::FrameResized | ( | float | newWidth, |
| float | newHeight | ||
| ) | [virtual] |
Hook method that gets called when the view is resized.
| newWidth | The new width of the view. |
| newHeight | The new height of the view. |
Reimplemented from BView.
| BLayout * BView::GetLayout | ( | ) | const [inherited] |
Get the layout of the view.
| void BButton::GetPreferredSize | ( | float * | _width, |
| float * | _height | ||
| ) | [virtual] |
Gets the dimensions that the BButton would prefer to be.
The size is computed from the children sizes, unless it was explicitly set for the BButton (which can be done only if the BButton is configured to use the Layout Kit).
NULL if you only want to get the other one.| [out] | _width | The width of the preferred size is placed in here. |
| [out] | _height | The height of the preferred size is placed in here. |
Reimplemented from BControl.
Report the suites of understood messages.
Reimplemented from BControl.
| static BArchivable* BButton::Instantiate | ( | BMessage * | archive | ) | [static] |
Creates a new object from an archive.
If the message is a valid object then the instance created from the passed in archive will be returned. Otherwise this method will return NULL.
| archive | The archive message. |
NULL.Reimplemented from BControl.
The BButton is invoked from a message.
This method is used to post a message when the button is clicked or activated by a keyboard button. You can set the object that will handle the message by calling a BControl::SetTarget() from a BInvoker inherited control. A model for the message is set by the BButton constructor or by the BControl::SetMessage() method inherited from BInvoker.
Reimplemented from BControl.
| bool BButton::IsDefault | ( | ) | const |
Returns whether or not the BButton is the default button or not, i.e. it responds to the Enter key.
| true | The button is the default button. |
| false | The button is not the default button. |
| bool BControl::IsEnabled | ( | ) | const [inherited] |
Gets whether or not the control is currently enabled.
true if the control is enabled, false if it is disabled. | virtual void BButton::KeyDown | ( | const char * | bytes, |
| int32 | numBytes | ||
| ) | [virtual] |
Hook method that is called when a keyboard key is pressed.
Overrides BView::KeyDown() to toggle the control value and then calls Invoke() for B_SPACE or B_ENTER. If this is not desired you should override this method in derived classes.
The KeyDown() method is only called if the BControl is the focus view in the active window. If the window has a default button, B_ENTER will be passed to that object instead of the focus view.
| bytes | The bytes of the key combination pressed. |
| numBytes | The number of bytes in bytes. |
Reimplemented from BControl.
| void BView::KeyUp | ( | const char * | bytes, |
| int32 | numBytes | ||
| ) | [virtual, inherited] |
Hook method that is called when a keyboard key is released.
| bytes | The bytes of the key combination pressed. |
| numBytes | The number of bytes in bytes. |
| const char * BControl::Label | ( | ) | const [inherited] |
Gets the label of the control.
returns The control's label.
| virtual void BButton::LayoutInvalidated | ( | bool | descendants = false | ) | [protected, virtual] |
Hook method called when this layout becomes invalid. This is a good place to clear any caches your object might hold.
Reimplemented from BView.
| bool BHandler::LockLooper | ( | ) | [inherited] |
Lock the looper associated with this handler.
| true | The looper is locked. |
| false | There was an error acquiring the lock. |
Lock the looper associated with this handler, with a time out value.
| timeout | The time to wait for acquiring the lock in microseconds. You may also use B_INFINITE_TIMEOUT, in which this method will wait as long as it takes to acquire the lock. |
| B_OK | Locking succeeded. |
| B_BAD_VALUE | This handler is not associated with a looper (anymore). |
| B_TIMED_OUT | The time specified in timeout has passed without locking the looper. |
| BLooper * BHandler::Looper | ( | ) | const [inherited] |
Return a pointer to the looper that this handler is associated with.
NULL. | void BButton::MakeDefault | ( | bool | flag | ) | [virtual] |
| virtual void BButton::MakeFocus | ( | bool | focused = true | ) | [virtual] |
Gives or removes focus from the control.
BControl::MakeFocus() overrides BView::MakeFocus() to call Draw() when the focus changes. Derived classes generally don't have to re-implement MakeFocus().
IsFocusChanging() returns true when Draw() is called from this method.
| focused | true to set focus, false to remove it. |
Reimplemented from BControl.
| virtual BSize BButton::MaxSize | ( | ) | [virtual] |
Get the maximum size of the view.
Reimplemented from BView.
| virtual void BButton::MessageReceived | ( | BMessage * | message | ) | [virtual] |
Handle message that has been received by the associated looper.
This method is reimplemented by subclasses. If the messages that have been received by a looper pass through the filters, then they end up in the MessageReceived() methods.
The example below shows a very common way to handle message. Usually, this involves parsing the BMessage::what constant and then perform an action based on that.
void ShowImageApp::MessageReceived(BMessage *message) { switch (message->what) { case MSG_FILE_OPEN: fOpenPanel->Show(); break; case B_CANCEL: // File open panel was closed, // start checking count of open windows. StartPulse(); break; default: // We do not handle this message, pass it on to the base class. BApplication::MessageReceived(message); break; } }
If your handler cannot process this message, you should pass it on to the base class. Eventually, it will reach the base implementation, which will reply with B_MESSAGE_NOT_UNDERSTOOD.
| message | The message that needs to be handled. |
Reimplemented from BControl.
| virtual BSize BButton::MinSize | ( | ) | [virtual] |
Get the minimum size of the view.
Reimplemented from BView.
| virtual void BButton::MouseDown | ( | BPoint | point | ) | [virtual] |
Hook method that is called when a mouse button is pressed.
| point | The point on the screen where to mouse pointer is when the mouse button is pressed. |
Reimplemented from BControl.
| virtual void BButton::MouseMoved | ( | BPoint | point, |
| uint32 | transit, | ||
| const BMessage * | message | ||
| ) | [virtual] |
Hook method that is called when the mouse is moved.
Reimplemented from BControl.
| virtual void BButton::MouseUp | ( | BPoint | point | ) | [virtual] |
Hook method that is called when a mouse button is released.
| point | The point on the screen where to mouse pointer is when the mouse button is released. |
Reimplemented from BControl.
| const char * BHandler::Name | ( | ) | const [inherited] |
Return the name of this handler.
| BHandler * BHandler::NextHandler | ( | ) | const [inherited] |
Return the next hander in the chain to which the message is passed on.
| virtual status_t BButton::Perform | ( | perform_code | code, |
| void * | _data | ||
| ) | [virtual] |
Perform some action. (Internal Method)
The following perform codes are recognized:
PERFORM_CODE_MIN_SIZE PERFORM_CODE_MAX_SIZE PERFORM_CODE_PREFERRED_SIZE PERFORM_CODE_LAYOUT_ALIGNMENT PERFORM_CODE_HAS_HEIGHT_FOR_WIDTH PERFORM_CODE_GET_HEIGHT_FOR_WIDTH PERFORM_CODE_SET_LAYOUT PERFORM_CODE_INVALIDATE_LAYOUT PERFORM_CODE_DO_LAYOUT | code | The perform code. |
| _data | A pointer to store some data. |
Reimplemented from BControl.
| virtual BSize BButton::PreferredSize | ( | ) | [virtual] |
Get the preferred size of the view.
Reimplemented from BView.
| void BView::Pulse | ( | ) | [virtual, inherited] |
Hook method that gets invoked when the view receives a B_PULSE message.
An action is performed each time the App Server calls the Pulse() method. The pulse rate is set by SetPulseRate(). You can implement Pulse() to do anything you want. The default version does nothing. The pulse granularity is no better than once per 100,000 microseconds.
Reimplemented in BTextView.
| bool BHandler::RemoveFilter | ( | BMessageFilter * | filter | ) | [virtual, inherited] |
Remove filter from the filter list.
If the handler is associated with a looper, this looper needs to be locked in order for this operation to succeed.
Note that the filter is not deleted, merely removed from the list. You need to take care of the memory yourself.
| true | The filter was in the filter list and is removed. |
| false | The filter was not found in the filter list. |
| virtual void BButton::ResizeToPreferred | ( | ) | [virtual] |
Resize the control to its preferred size.
Reimplemented from BControl.
| virtual BHandler* BButton::ResolveSpecifier | ( | BMessage * | message, |
| int32 | index, | ||
| BMessage * | specifier, | ||
| int32 | what, | ||
| const char * | property | ||
| ) | [virtual] |
Determine the proper specifier for scripting messages.
Reimplemented from BControl.
| void BHandler::SendNotices | ( | uint32 | what, |
| const BMessage * | msg = NULL |
||
| ) | [virtual, inherited] |
Emit a state change to the observers.
The actual state (specified by what) will not be transmitted. This is merely for internal bookkeeping. It is not entirely unimaginable that you still want to inform the observers of what actually took place. You can use the msg to transmit this, and any other data you want. Note that the message will be copied and slightly altered: the what member of the message will be B_OBSERVER_NOTICE_CHANGE, and the what constant you specified will be stored in the B_OBSERVE_ORIGINAL_WHAT label.
| what | The identifier of the state. |
| msg | Any data associated with the state change. You retain ownership of this data, so make sure you dispose it when you are done. |
| void BControl::SetEnabled | ( | bool | enabled | ) | [virtual, inherited] |
Enables or disables the control.
BControl objects are enabled by default. If the control changes enabled state then it is redrawn.
Disabled controls generally won't allow the user to focus on them (The B_NAVIGABLE flag is turned off), and don't post any messages.
Disabled controls in derived classes should be drawn in subdued colors to visually indicate that they are disabled and should not respond to keyboard or mouse events.
| enabled | If true enables the control, if false, disables it. |
Reimplemented in BColorControl.
| void BView::SetExplicitAlignment | ( | BAlignment | alignment | ) | [inherited] |
Set this item's explicit alignment, to be used by Alignment().
| void BView::SetExplicitMaxSize | ( | BSize | size | ) | [inherited] |
Set this item's explicit max size, to be used by MaxSize().
| void BView::SetExplicitMinSize | ( | BSize | size | ) | [inherited] |
Set this item's explicit min size, to be used by MinSize().
| void BView::SetExplicitPreferredSize | ( | BSize | size | ) | [inherited] |
Set this item's explicit preferred size, to be used by PreferredSize().
| void BHandler::SetFilterList | ( | BList * | filters | ) | [virtual, inherited] |
Set the internal list of filters to filters.
If the handler is associated with a looper, this looper needs to be locked in order for this operation to succeed.
The internal list will be replaced with the new list of filters. All the existing filters will be deleted.
| void BButton::SetLabel | ( | const char * | string | ) | [virtual] |
Sets the BButton's label.
| string | The string to set the label to. |
Reimplemented from BControl.
| void BView::SetLayout | ( | BLayout * | layout | ) | [virtual, inherited] |
| void BHandler::SetName | ( | const char * | name | ) | [inherited] |
Set or change the name of this handler.
| void BHandler::SetNextHandler | ( | BHandler * | handler | ) | [virtual, inherited] |
Set the next handler in the chain that the message is passed on to if this handler cannot process it.
This method has three requirements:
Failure to meet any of these requirements will result in your application crashing.
By default, the handlers are chained in order that they were associated to a looper with BLooper::AddHander().
| void BButton::SetValue | ( | int32 | value | ) | [virtual] |
Sets the value of the BButton.
| value | The value to set to the BButton to. Options include:
|
Reimplemented from BControl.
| void BControl::SetValueNoUpdate | ( | int32 | value | ) | [protected, inherited] |
Sets the value of the control without redrawing.
| value | The value to set. |
| status_t BHandler::StartWatching | ( | BMessenger | target, |
| uint32 | what | ||
| ) | [inherited] |
Subscribe this handler to watch a specific state change of a target.
Use this method to subscribe messengers to watch state changes in this handler, this also means that observers from other teams can be subscribed.
// Handler B watches Handler A BHandler A, B; BMessenger messengerA(&A) B.StartWatching(messengerA, kNetworkConnection);
| target | The messenger from which the notifications would be received. |
| what | The state that needs to be watched. |
B_OK.Subscribe an observer for a specific state change of this handler.
Use this method to subscribe observers to watch this handler. State changes of this handler that match the what argument, will be sent.
// Handler B wants to observe Handler A BHandler A, B; A.StartWatching(&B, kNetworkConnection);
Since pointers to handlers can only exist in the local namespace, have a look at StartWatching(BMessenger, uint32) for inter-team watching.
| observer | The observer for this handler. |
| what | The state that needs to be watched. |
B_OK.| status_t BHandler::StartWatchingAll | ( | BMessenger | target | ) | [inherited] |
Subscribe this handler to watch a target for all events.
This method performs the same task as StartWatching(BMessenger, uint32), but it will subscribe to all the state changes the target knows.
Subscribe an observer for a all state changes.
This method performs the same task as StartWatching(BHandler, uint32), but it will subscribe the observer to all the state changes this handler tracks.
| status_t BHandler::StopWatching | ( | BMessenger | target, |
| uint32 | what | ||
| ) | [inherited] |
Unsubscribe this handler from watching a specific state.
This method will unsubscribe this handler from watching a specific event in a target.
Unsubscribe an observer from watching a specific state.
This method will unsubscribe the handler from watching a specific event.
| status_t BHandler::StopWatchingAll | ( | BMessenger | target | ) | [inherited] |
Unsubscribe this handler from watching all states.
This method will unsubscribe the target from watching all state changes.
Unsubscribe an observer from watching all states.
This method will unsubscribe the handler from watching all state changes.
| int32 BControl::Value | ( | ) | const [inherited] |
Gets the value of the control.
| virtual void BButton::WindowActivated | ( | bool | active | ) | [virtual] |
Hook method that is called when the attached window becomes activated or deactivated.
The BControl is redrawn if it is a child of the focused view.
| active | true if the window becomes activated, false if the window becomes deactivated. |
Reimplemented from BControl.