1 /* 2 * Copyright 2006, Haiku. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Stephan Aßmus <superstippi@gmx.de> 7 */ 8 9 #ifndef GROUP_H 10 #define GROUP_H 11 12 #include <View.h> 13 14 class Group : public BView { 15 public: 16 Group(BRect frame, 17 const char* name, 18 orientation direction = B_HORIZONTAL); 19 virtual ~Group(); 20 21 // BView interface 22 virtual void AttachedToWindow(); 23 virtual void FrameResized(float width, float height); 24 virtual void GetPreferredSize(float* width, float* height); 25 26 // Group 27 void SetSpacing(float insetFromBorder, 28 float childSpacing); 29 30 private: 31 void _LayoutControls(BRect frame) const; 32 BRect _MinFrame() const; 33 void _LayoutControl(BView* view, 34 BRect frame, 35 bool resizeWidth = false, 36 bool resizeHeight = false) const; 37 38 orientation fOrientation; 39 float fInset; 40 float fSpacing; 41 }; 42 43 #endif // GROUP_H 44