flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cframp...@apache.org
Subject svn commit: r1453601 - in /flex/sdk/branches/develop/frameworks/projects/spark/src/spark/components/gridClasses: GridHeaderViewLayout.as GridSelection.as
Date Wed, 06 Mar 2013 22:48:12 GMT
Author: cframpton
Date: Wed Mar  6 22:48:12 2013
New Revision: 1453601

URL: http://svn.apache.org/r1453601
Log:
Fix up a few errors in the method headers.

Modified:
    flex/sdk/branches/develop/frameworks/projects/spark/src/spark/components/gridClasses/GridHeaderViewLayout.as
    flex/sdk/branches/develop/frameworks/projects/spark/src/spark/components/gridClasses/GridSelection.as

Modified: flex/sdk/branches/develop/frameworks/projects/spark/src/spark/components/gridClasses/GridHeaderViewLayout.as
URL: http://svn.apache.org/viewvc/flex/sdk/branches/develop/frameworks/projects/spark/src/spark/components/gridClasses/GridHeaderViewLayout.as?rev=1453601&r1=1453600&r2=1453601&view=diff
==============================================================================
--- flex/sdk/branches/develop/frameworks/projects/spark/src/spark/components/gridClasses/GridHeaderViewLayout.as
(original)
+++ flex/sdk/branches/develop/frameworks/projects/spark/src/spark/components/gridClasses/GridHeaderViewLayout.as
Wed Mar  6 22:48:12 2013
@@ -34,6 +34,7 @@ import spark.components.Grid;
 import spark.components.GridColumnHeaderGroup;
 import spark.components.Group;
 import spark.components.supportClasses.GroupBase;
+import spark.core.NavigationUnit;
 import spark.layouts.supportClasses.LayoutBase;
 
 use namespace mx_internal;
@@ -380,6 +381,11 @@ public class GridHeaderViewLayout extend
         var visibleLeft:Number = 0;
         var visibleRight:Number = 0;
         
+        const dataGrid:DataGrid = grid.dataGrid;
+        const vsbVisible:Boolean =
+            (dataGrid && dataGrid.scroller && 
+             dataGrid.scroller.verticalScrollBar && dataGrid.scroller.verticalScrollBar.visible);
+        
         // This isn't quite as simple as: 
         //     for each (var columnIndex:int in visibleColumnIndices)
         // since the GridColumnHeaderGroup may be wider than the grid because it
@@ -424,9 +430,19 @@ public class GridHeaderViewLayout extend
 			var rendererX:Number = gridViewLayout.gridDimensionsView.getCellX(0, headerViewColumnIndex);
             var rendererWidth:Number = grid.getColumnWidth(columnIndex);
             
-			if (isLastColumn)
+            // If this is the last visible column and there is a visible vertical scroll
bar then
+            // adjust the width of the last visible column header so it includes the small
space 
+            // on top of the vertical scroll bar.
+
+            // ToDo: This needs more work. I'm not sure what the correct behavior should
be.  With
+            // the adjustment below the width of the last visible renderer seems to include
most of 
+            // the space over the sb but not all of it.  What is the correct width?
+            // The default header renderer will truncate the text if it doesn't fit in the
width.
+            // If we're scrolling horizontally to the right, and there are more columns to
the right 
+            // should the header be truncated or clipped if it doesn't all fit in the width?
+            if (isLastColumn && vsbVisible)
                 rendererWidth = horizontalScrollPosition + unscaledWidth - rendererX - 1;
// TODO: this is a temporary hack
-			
+            
             renderer.setLayoutBoundsSize(rendererWidth, rendererHeight);
             renderer.setLayoutBoundsPosition(rendererX, rendererY);
             

Modified: flex/sdk/branches/develop/frameworks/projects/spark/src/spark/components/gridClasses/GridSelection.as
URL: http://svn.apache.org/viewvc/flex/sdk/branches/develop/frameworks/projects/spark/src/spark/components/gridClasses/GridSelection.as?rev=1453601&r1=1453600&r2=1453601&view=diff
==============================================================================
--- flex/sdk/branches/develop/frameworks/projects/spark/src/spark/components/gridClasses/GridSelection.as
(original)
+++ flex/sdk/branches/develop/frameworks/projects/spark/src/spark/components/gridClasses/GridSelection.as
Wed Mar  6 22:48:12 2013
@@ -620,8 +620,8 @@ public class GridSelection
     
     /**
      *  If the <code>selectionMode</code> is <code>GridSelectionMode.MULTIPLE_ROWS</code>,

-     *  replaces the current selection with the rows starting at 
-     *  <code>startRowIndex</code> and ending with <code>endRowIndex</code>.
+     *  replaces the current selection with the <code>rowCount</code> rows starting
at 
+     *  <code>rowIndex</code>.
      * 
      *  @param rowIndex 0-based row index of the first row in the selection.
      *  @param rowCount Number of rows in the selection.
@@ -1172,11 +1172,12 @@ public class GridSelection
 
     /**
      *  @private
-     *  This should only be used for setCellRegion.  The selection should
-     *  be cleared first.  This will add a cellRegion to the list of cellRegions.
+     *  This should only be called by setCellRegion after the selection has been
+     *  removed.
+     *  This will add a cellRegion to the list of cellRegions.
      *  This allows the special-handling needed for setting a cell region 
-     *  which has one of more columns which are not visible and not to be
-     *  included in the selection.
+     *  which has one of more columns which are not visible since only visible columns should
+     *  be included in the selection.
      *  
      *  The code is not equipped to handle the general case of overlapping
      *  cell regions.
@@ -1596,7 +1597,7 @@ public class GridSelection
 
     /**
      *  @private
-     *  Add an column to the columns collection.
+     *  Add a column to the columns collection.
      */
     private function columnsCollectionAdd(event:CollectionEvent):Boolean
     {



Mime
View raw message