[f-spot/cleanup-backend: 9/23] Move methods from IconView.SelectinoCollection to IconView



commit fc608dd42eb80ea69d093f545c2543caa2553f6e
Author: Mike Gemünde <mike gemuende de>
Date:   Fri Jul 16 09:42:31 2010 +0200

    Move methods from IconView.SelectinoCollection to IconView
    
    The Methods SelectRect and ToggleRect shall be really in IconView!

 src/Widgets/IconView.cs |   47 ++++++++++++++++++++++-------------------------
 1 files changed, 22 insertions(+), 25 deletions(-)
---
diff --git a/src/Widgets/IconView.cs b/src/Widgets/IconView.cs
index 9cbaf79..ab5c3e1 100644
--- a/src/Widgets/IconView.cs
+++ b/src/Widgets/IconView.cs
@@ -354,29 +354,6 @@ namespace FSpot.Widgets
                 OnChanged ();
 			}
 
-			public void SelectRect (int start_row, int end_row, int start_line, int end_line, int cells_per_row)
-			{
-				for (int row = start_row; row < end_row; row++)
-					for (int line = start_line; line < end_line; line++) {
-						int index = line*cells_per_row + row;
-						if (index < parent.Count)
-							QuietSelect (index);
-					}
-			}
-
-			public void ToggleRect (int start_row, int end_row, int start_line, int end_line, int cells_per_row)
-			{
-				for  (int row = start_row; row < end_row; row++)
-					for (int line = start_line; line < end_line; line++) {
-						int index = line*cells_per_row + row;
-						if (index < parent.Count)
-                            if (Contains (index))
-                                QuietUnselect (index);
-                            else
-                                QuietSelect (index);
-					}
-			}
-
 		}
 
 		// Updating.
@@ -830,6 +807,26 @@ namespace FSpot.Widgets
 
 		}
 
+            private void SelectRect (int start_row, int end_row, int start_line, int end_line)
+            {
+                for (int row = start_row; row < end_row; row++)
+                    for (int line = start_line; line < end_line; line++) {
+                        Selection.QuietSelect (line*cells_per_row + row);
+                    }
+            }
+
+            private void ToggleRect (int start_row, int end_row, int start_line, int end_line)
+            {
+                for  (int row = start_row; row < end_row; row++)
+                    for (int line = start_line; line < end_line; line++) {
+                        int index = line*cells_per_row + row;
+                        if (Selection.Contains (index))
+                            Selection.QuietUnselect (index);
+                        else
+                            Selection.QuietSelect (index);
+                    }
+            }
+
 		private void DrawAllCells (Gdk.Rectangle area)
 		{
 			if (cell_width == 0 || cell_height == 0)
@@ -1303,9 +1300,9 @@ namespace FSpot.Widgets
 			Selection.FocusedIndex = start_line * cells_per_row + start_row;
 
 			if ((mod & ModifierType.ControlMask) == 0)
-				selection.SelectRect (start_row, end_row, start_line, end_line, cells_per_row);
+				SelectRect (start_row, end_row, start_line, end_line);
 			else
-				selection.ToggleRect (start_row, end_row, start_line, end_line, cells_per_row);
+				ToggleRect (start_row, end_row, start_line, end_line);
 
 			// fire events for cells which have changed selection flag
 //			BitArray new_selection = selection.ToBitArray();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]