2 * Copyright 2010, Axel Dörfler, axeld@pinc-software.de.
3 * Distributed under the terms of the MIT License.
15 class RadioView
: public BView
{
17 RadioView(BRect frame
, const char* name
,
21 void SetPercent(int32 percent
);
22 void SetMax(int32 max
);
26 bool IsPulsing() const
27 { return fPulse
!= NULL
; }
29 static void Draw(BView
* view
, BRect rect
, int32 percent
,
31 static int32
DefaultMax();
34 virtual void AttachedToWindow();
35 virtual void DetachedFromWindow();
37 virtual void MessageReceived(BMessage
* message
);
38 virtual void Draw(BRect updateRect
);
39 virtual void FrameResized(float width
, float height
);
42 void _RestartPulsing();
44 static void _Compute(const BRect
& bounds
, BPoint
& center
,
45 int32
& count
, int32 max
, float& step
);
46 static void _DrawBow(BView
* view
, int32 index
,
47 const BPoint
& center
, int32 count
,
49 static void _SetColor(BView
* view
, int32 percent
,
50 int32 phase
, int32 index
, int32 count
);
51 static bool _IsDisabled(int32 percent
, int32 index
,
56 BMessageRunner
* fPulse
;
62 #endif // RADIO_VIEW_H