1 #ifndef ANALOG_CLOCK_H 2 #define ANALOG_CLOCK_H 3 4 #include <Message.h> 5 #include <View.h> 6 7 class TOffscreen: public BView { 8 public: 9 TOffscreen(BRect frame, const char *name); 10 virtual ~TOffscreen(); 11 12 virtual void DrawX(); 13 BPoint Position(); 14 15 BPoint f_MinutePoints[60]; 16 BPoint f_HourPoints[60]; 17 short f_Hours; 18 short f_Minutes; 19 short f_Seconds; 20 private: 21 BBitmap *f_bitmap; 22 BBitmap *f_centerbmp; 23 BBitmap *f_capbmp; 24 BPoint f_center; 25 }; 26 27 class TAnalogClock: public BView { 28 public: 29 TAnalogClock(BRect frame, const char *name, uint32 resizingmode, uint32 flags); 30 virtual ~TAnalogClock(); 31 32 virtual void AttachedToWindow(); 33 virtual void Draw(BRect updaterect); 34 virtual void MessageReceived(BMessage *); 35 36 void InitView(BRect frame); 37 void SetTo(int32, int32, int32); 38 private: 39 BPoint f_drawpt; 40 BBitmap *f_bitmap; 41 TOffscreen *f_offscreen; 42 }; 43 44 #endif //ANALOG_CLOCK_H 45