1 // ObjectView.h 2 3 #ifndef OBJECT_VIEW_H 4 #define OBJECT_VIEW_H 5 6 #include <List.h> 7 #include <View.h> 8 9 class State; 10 11 enum { 12 MSG_OBJECT_COUNT_CHANGED = 'obcc', 13 }; 14 15 class ObjectView : public BView { 16 public: 17 ObjectView(BRect frame, const char* name, 18 uint32 resizeFlags, uint32 flags); 19 20 // BView 21 virtual void AttachedToWindow(); 22 23 virtual void Draw(BRect updateRect); 24 25 virtual void MouseDown(BPoint where); 26 virtual void MouseUp(BPoint where); 27 virtual void MouseMoved(BPoint where, uint32 transit, 28 const BMessage* dragMessage); 29 30 // ObjectView 31 void SetState(State* state); 32 33 void SetObjectType(int32 type); 34 int32 ObjectType() const 35 { return fObjectType; } 36 37 void AddObject(State* state); 38 int32 CountObjects() const; 39 void MakeEmpty(); 40 41 void SetStateColor(rgb_color color); 42 rgb_color StateColor() const 43 { return fColor; } 44 45 void SetStateFill(bool fill); 46 bool StateFill() const 47 { return fFill; } 48 49 void SetStatePenSize(float penSize); 50 float StatePenSize() const 51 { return fPenSize; } 52 53 private: 54 State* fState; 55 int32 fObjectType; 56 57 BList fStateList; 58 59 rgb_color fColor; 60 bool fFill; 61 float fPenSize; 62 63 bool fScrolling; 64 BPoint fLastMousePos; 65 }; 66 67 #endif // OBJECT_VIEW_H 68