2 * Copyright 2001-2015, Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 #ifndef _RADIO_BUTTON_H
6 #define _RADIO_BUTTON_H
13 class BRadioButton
: public BControl
{
15 BRadioButton(BRect frame
, const char* name
,
16 const char* label
, BMessage
* message
,
17 uint32 resizingMode
= B_FOLLOW_LEFT_TOP
,
18 uint32 flags
= B_WILL_DRAW
| B_NAVIGABLE
);
19 BRadioButton(const char* name
,
20 const char* label
, BMessage
* message
,
21 uint32 flags
= B_WILL_DRAW
| B_NAVIGABLE
);
22 BRadioButton(const char* label
,
25 BRadioButton(BMessage
* data
);
26 virtual ~BRadioButton();
28 static BArchivable
* Instantiate(BMessage
* data
);
29 virtual status_t
Archive(BMessage
* data
, bool deep
= true) const;
31 virtual void Draw(BRect updateRect
);
32 virtual void MouseDown(BPoint where
);
33 virtual void AttachedToWindow();
34 virtual void KeyDown(const char* bytes
, int32 numBytes
);
35 virtual void SetValue(int32 value
);
36 virtual void GetPreferredSize(float* _width
,
38 virtual void ResizeToPreferred();
39 virtual status_t
Invoke(BMessage
* message
= NULL
);
41 virtual void MessageReceived(BMessage
* message
);
42 virtual void WindowActivated(bool active
);
43 virtual void MouseUp(BPoint where
);
44 virtual void MouseMoved(BPoint where
, uint32 code
,
45 const BMessage
* dragMessage
);
46 virtual void DetachedFromWindow();
47 virtual void FrameMoved(BPoint newPosition
);
48 virtual void FrameResized(float newWidth
, float newHeight
);
50 virtual BHandler
* ResolveSpecifier(BMessage
* message
,
51 int32 index
, BMessage
* specifier
,
52 int32 what
, const char* property
);
54 virtual void MakeFocus(bool focus
= true);
55 virtual void AllAttached();
56 virtual void AllDetached();
57 virtual status_t
GetSupportedSuites(BMessage
* message
);
59 virtual status_t
Perform(perform_code d
, void* argument
);
61 virtual BSize
MaxSize();
62 virtual BAlignment
LayoutAlignment();
64 virtual status_t
SetIcon(const BBitmap
* icon
, uint32 flags
= 0);
67 friend status_t
_init_interface_kit_();
69 virtual void _ReservedRadioButton1();
70 virtual void _ReservedRadioButton2();
72 BRadioButton
& operator=(const BRadioButton
& other
);
74 BRect
_KnobFrame() const;
76 const font_height
& fontHeight
) const;
78 // for use in "synchronous" BWindows
81 static BBitmap
* sBitmaps
[2][3];
88 #endif // _RADIO_BUTTON_H