1 /* 2 * Copyright 2005, Jérôme Duval. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Reworked from DarkWyrm version in CDPlayer 6 */ 7 8 #ifndef _DRAW_BUTTON_H 9 #define _DRAW_BUTTON_H 10 11 #include <Control.h> 12 #include <Bitmap.h> 13 14 class DrawButton : public BControl 15 { 16 public: 17 DrawButton(BRect frame, const char *name, const unsigned char *on, 18 const unsigned char *off, BMessage *msg, int32 resize = 0, 19 int32 flags = 0); 20 ~DrawButton(void); 21 22 void Draw(BRect update); 23 void AttachedToWindow(); 24 void MouseUp(BPoint pt); ButtonState()25 bool ButtonState() { return fButtonState; }; 26 private: 27 28 BBitmap fOn; 29 BBitmap fOff; 30 bool fButtonState; 31 }; 32 33 #endif 34