1 /* 2 * Copyright 2006-2009, Stephan Aßmus <superstippi@gmx.de>. 3 * All rights reserved. Distributed under the terms of the MIT License. 4 */ 5 #ifndef PAD_VIEW_H 6 #define PAD_VIEW_H 7 8 #include <View.h> 9 10 class BGroupLayout; 11 class LaunchButton; 12 13 #define DEFAULT_ICON_SIZE 32 14 15 class PadView : public BView { 16 public: 17 PadView(const char* name); 18 virtual ~PadView(); 19 20 // BView interface 21 virtual void Draw(BRect updateRect); 22 virtual void MessageReceived(BMessage* message); 23 virtual void MouseDown(BPoint where); 24 virtual void MouseUp(BPoint where); 25 virtual void MouseMoved(BPoint where, uint32 transit, 26 const BMessage* dragMessage); 27 28 // PadView 29 void AddButton(LaunchButton* button, 30 LaunchButton* beforeButton = NULL); 31 bool RemoveButton(LaunchButton* button); 32 LaunchButton* ButtonAt(int32 index) const; 33 34 void DisplayMenu(BPoint where, 35 LaunchButton* button = NULL) const; 36 37 void SetOrientation(enum orientation orientation); 38 enum orientation Orientation() const; 39 40 void SetIconSize(uint32 size); 41 uint32 IconSize() const; 42 43 void SetIgnoreDoubleClick(bool refuse); 44 bool IgnoreDoubleClick() const; 45 46 private: 47 void _NotifySettingsChanged(); 48 49 BPoint fDragOffset; 50 bool fDragging; 51 bigtime_t fClickTime; 52 BGroupLayout* fButtonLayout; 53 uint32 fIconSize; 54 }; 55 56 #endif // PAD_VIEW_H