1 /* 2 * Copyright 2006, Ingo Weinhold <bonefish@cs.tu-berlin.de>. 3 * All rights reserved. Distributed under the terms of the MIT License. 4 */ 5 6 #include <GroupView.h> 7 8 9 // constructor 10 BGroupView::BGroupView(enum orientation orientation, float spacing) 11 : BView(NULL, 0, new BGroupLayout(orientation, spacing)) 12 { 13 SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); 14 } 15 16 // destructor 17 BGroupView::~BGroupView() 18 { 19 } 20 21 // SetLayout 22 void 23 BGroupView::SetLayout(BLayout* layout) 24 { 25 // only BGroupLayouts are allowed 26 if (!dynamic_cast<BGroupLayout*>(layout)) 27 return; 28 29 BView::SetLayout(layout); 30 } 31 32 // GroupLayout 33 BGroupLayout* 34 BGroupView::GroupLayout() const 35 { 36 return dynamic_cast<BGroupLayout*>(GetLayout()); 37 } 38