+// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/
+//
#include "OB_ListView.h"
#include "OB_Filter.h"
return dropObj->isDropAccepted( dragObj );
}
+
+void OB_ListView::setColumnWidth( int col, int width )
+{
+ int max = columnMaxWidth( col );
+ if( max>0 && width>max )
+ width = max;
+ QListView::setColumnWidth( col, width );
+}
+
+int OB_ListView::columnMaxWidth( const int col ) const
+{
+ int res = -1;
+ if( myMaxColWidth.contains( col ) )
+ res = myMaxColWidth[col];
+ else if( myMaxColRatio.contains( col ) )
+ res = int( myMaxColRatio[col]*height() );
+ return res;
+}
+
+void OB_ListView::setColumnMaxWidth( const int col, const int w )
+{
+ myMaxColWidth.insert( col, w );
+}
+
+double OB_ListView::columnMaxRatio( const int col ) const
+{
+ double res = 0.0;
+ if( myMaxColRatio.contains( col ) )
+ res = myMaxColRatio[col];
+ return res;
+}
+
+void OB_ListView::setColumnMaxRatio( const int col, const double r )
+{
+ myMaxColRatio.insert( col, r );
+}