xref: /haiku/src/apps/pulse/CPUButton.h (revision 5d9e40fe9252c8f9c5e5e41594545bfa4419fcc7)
1 //****************************************************************************************
2 //
3 //	File:		CPUButton.h
4 //
5 //	Written by:	Daniel Switkin
6 //
7 //	Copyright 1999, Be Incorporated
8 //
9 //****************************************************************************************
10 
11 #ifndef CPUBUTTON_H
12 #define CPUBUTTON_H
13 
14 #include <interface/Control.h>
15 #include <app/MessageRunner.h>
16 
17 class CPUButton : public BControl {
18 	public:
19 		CPUButton(BRect rect, const char *name, const char *label, BMessage *message);
20 		CPUButton(BMessage *message);
21 		void Draw(BRect rect);
22 		void MouseDown(BPoint point);
23 		void MouseUp(BPoint point);
24 		void MouseMoved(BPoint point, uint32 transit, const BMessage *message);
25 		~CPUButton();
26 
27 		status_t Invoke(BMessage *message = NULL);
28 		static CPUButton *Instantiate(BMessage *data);
29 		status_t Archive(BMessage *data, bool deep = true) const;
30 		void MessageReceived(BMessage *message);
31 
32 		void UpdateColors(int32 color);
33 		void AttachedToWindow();
34 
35 	private:
36 		rgb_color on_color, off_color;
37 		bool replicant;
38 		BMessageRunner *messagerunner;
39 };
40 
41 #endif
42