Пример #1
0
//==== Compute Width ======//
int GroupLayout::FitWidth( int used_w, int default_w )
{
    int w = default_w;
    if ( m_FitWidthFlag )
    {
        w = m_Group->w() -  used_w;

        Fl_Scroll* s = dynamic_cast< Fl_Scroll* >( m_Group );

        if ( s == NULL ) // Group is not a Fl_Scroll
        {
            return w;
        }

        int sw = s->scrollbar_size();

        if ( sw == 0 )  // Check size, if zero, global size is used.
        {
            sw = Fl::scrollbar_size();
        }

        w = w - sw;
    }

    return w;
}