1#ifndef TRACKMENU_H 2#define TRACKMENU_H 3 4#include <Invoker.h> 5#include <View.h> 6 7class TrackMenu : public BView, public BInvoker { 8 public: 9 TrackMenu(const BRect &frame, const char *name, BMessage *msg, 10 const int32 &resize = B_FOLLOW_LEFT | B_FOLLOW_TOP, 11 const int32 &flags = B_WILL_DRAW); 12 ~TrackMenu(); 13 14 void AttachedToWindow(); 15 void MessageReceived(BMessage *msg); 16 void Draw(BRect update); 17 void MouseDown(BPoint pt); 18 void MouseUp(BPoint pt); 19 void MouseMoved(BPoint pt, uint32 transit, const BMessage *msg); 20 21 int32 CountItems() const { return fCount; } 22 void SetItemCount(const int32 &count); 23 24 int32 Value() const { return fCurrentItem; } 25 void SetValue(const int32 &value); 26 27 private: 28 int32 ItemAt(const BPoint &pt); 29 30 int32 fCurrentItem; 31 int32 fCount; 32 BRect fItemRect; 33 34 bool fIsTracking; 35 36 float fFontHeight; 37}; 38 39#endif // TRACKMENU_H 40