xref: /haiku/src/apps/soundrecorder/UpDownButton.h (revision 820dca4df6c7bf955c46e8f6521b9408f50b2900)
1 /*
2  * Copyright 2005, Jérôme Duval. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Inspired by SoundCapture from Be newsletter (Media Kit Basics: Consumers and Producers)
6  */
7 #ifndef UPDOWNBUTTON_H
8 #define UPDOWNBUTTON_H
9 
10 #include <Bitmap.h>
11 #include <Control.h>
12 
13 #define DRAG_ITEM 'dndi'
14 
15 class UpDownButton : public BControl
16 {
17 public:
18 	UpDownButton(BRect rect, BMessage *msg, uint32 resizeFlags = 0);
19 	~UpDownButton();
20 	virtual void Draw(BRect);
21 	virtual void MouseDown(BPoint point);
22 	virtual void MouseMoved(BPoint point, uint32 transit, const BMessage *message);
23 	virtual void MouseUp(BPoint point);
24 
25 private:
26 	BBitmap *fBitmapUp, *fBitmapDown, *fBitmapMiddle;
27 	float fTrackingY;
28 	int32 fLastValue;
29 };
30 
31 #endif
32