The Layout Library: MPictureButton

Derived from: public MView, public BPictureButton

Declared in: <MPictureButton.h>


Overview

An MPictureButton is liblayout's version of BPictureButton. Like MButton, it works asynchronous, meaning is does not keep the window locked when you keep the mousebutton pressed down on it. It serves as a base-class for MRew, MPlayBW, MStop, MPlayFW, MFFWD and MEject.


Constructor and Destructor


MPictureButton()

      MPictureButton(minimax size,
         BPicture *off, 
         BPicture *on, 
         BMessage *message = NULL, 
         BHandler *target = NULL, 
         uint32 behavior = B_ONE_STATE_BUTTON) 

Since the size of a picture cannot be determined, you must specify a size for this control, and this size should be fixed. You specify the pictures for the pressed/unpressed state with the on and off arguments. You can specify the message that the control should send when clicked, as well as a target for this message. Finally, you can set the behavior to either B_ONE_STATE_BUTTON or B_TWO_STATE_BUTTON. A one-state button displays the off image normally and the on image to highlight the button when it's clicked. A two-state button toggles between the off image and the on image

When the button has been activated and it's time to call BInvoker::Invoke(), MPictureButton will add a boolean called M_DOUBLECLICK to the message. When this boolean is true, the button was doubleclicked.
It also adds an int32 called M_BUTTON_MASK to the message, which indicates with which mousebuttons the MPictureButton was clicked.

See also: the BPictureButton constructor.


~MPictureButton()

      virtual ~MPictureButton(void)

Cleans up after the MPictureButton.



Copyright © 1997 Marco Nelissen (marcone@xs4all.nl) All rights reserved.

Be, BeOS, BeBox, BeWare, GeekPort, the Be logo, the BeOS logo, roColour, Beatware and Beatware painter are trademarks or registered trademarks of their respective owners.