rSize ruiLinearLayout::ComputeSize() { rRect testRect(0, 0, INT_MAX, INT_MAX); if (m_layoutDirection == ruiLAYOUT_HORIZONTAL) { return LayoutHorizontal(testRect, false); } else { return LayoutVertical(testRect, false); } }
rSize ruiLinearLayout::Layout(rRect& rect){ rSize size; if (m_layoutDirection == ruiLAYOUT_HORIZONTAL) size = LayoutHorizontal(rect); else size = LayoutVertical(rect); return size; }
/*************************************************************************** * ARP-KNOB-PANEL * This class constructs a knob along with an optional label and/or int * control. Part of its usefulness is that it hides hooking up the knob * and int controls to each other, which is behaviour that will probably * change at some point. ***************************************************************************/ ArpKnobPanel::ArpKnobPanel( const char* name, const char* label, BMessage* message, int32 minValue, int32 maxValue, bool showIntControl, orientation layout, uint32 knobFlags, float labelWidth, float intControlWidth, uint32 rmask, uint32 flags) : inherited( BRect( 0, 0, 0, 0 ), "knob_panel", rmask, flags ) { if( layout == B_VERTICAL ) LayoutVertical(name, label, message, minValue, maxValue, showIntControl, knobFlags, labelWidth, intControlWidth); else LayoutHorizontal(name, label, message, minValue, maxValue, showIntControl, knobFlags, labelWidth, intControlWidth); float width = 0, height = 0; BView* view; for( view = ChildAt(0); view; view = view->NextSibling() ) { BRect f = view->Frame(); if( f.right > width ) width = f.right; if( f.bottom > height ) height = f.bottom; } ResizeTo( width, height ); }