Some formatting for my last checkins.
authorRavindra <ravindra@mono-cvs.ximian.com>
Tue, 26 Oct 2004 09:55:48 +0000 (09:55 -0000)
committerRavindra <ravindra@mono-cvs.ximian.com>
Tue, 26 Oct 2004 09:55:48 +0000 (09:55 -0000)
svn path=/trunk/mcs/; revision=35329

mcs/class/Managed.Windows.Forms/System.Windows.Forms/ColumnHeader.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListViewItem.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs

index 0ebc9578896587c625a7fe7f42c3b363e79cb2de..ba29696f98eb598a1e7013dccc69ba051a04a547 100644 (file)
 // Author:
 //     Ravindra (rkumar@novell.com)
 //
-// $Revision: 1.3 $
+// $Revision: 1.4 $
 // $Modtime: $
 // $Log: ColumnHeader.cs,v $
+// Revision 1.4  2004/10/26 09:55:48  ravindra
+// Some formatting for my last checkins.
+//
 // Revision 1.3  2004/10/26 09:33:00  ravindra
 // Added some internal members and calculations for ColumnHeader.
 //
@@ -59,7 +62,8 @@ namespace System.Windows.Forms
                #endregion      // Instance Variables
 
                #region Internal Constructor
-               internal ColumnHeader (ListView owner, string text, HorizontalAlignment alignment, int width)
+               internal ColumnHeader (ListView owner, string text,
+                                      HorizontalAlignment alignment, int width)
                {
                        this.owner = owner;
                        this.text = text;
@@ -76,7 +80,7 @@ namespace System.Windows.Forms
                #region Private Internal Methods Properties
                // Since this class inherits from MarshalByRef,
                // we can't do ColumnHeader.column_rect.XXX. Hence,
-               // we have following properties to work around.
+               // we have some of the following properties to work around CS0197.
                internal int X {
                        get { return this.column_rect.X; }
                        set { this.column_rect.X = value; }
index 532f8d9005313c5c321e61a034fd7d986aead67e..b0adbaf9b1c88d87e2b358231b8a36b288303ab6 100644 (file)
 // Author:
 //     Ravindra (rkumar@novell.com)
 //
-// $Revision: 1.4 $
+// $Revision: 1.5 $
 // $Modtime: $
 // $Log: ListView.cs,v $
+// Revision 1.5  2004/10/26 09:55:48  ravindra
+// Some formatting for my last checkins.
+//
 // Revision 1.4  2004/10/26 09:31:35  ravindra
 // Added some internal members and calculations for ListView.
 //
@@ -51,7 +54,8 @@ namespace System.Windows.Forms
 {
        [DefaultEvent ("SelectedIndexChanged")]
        [DefaultProperty ("Items")]
-       [Designer ("System.Windows.Forms.Design.ListViewDesigner, " + Consts.AssemblySystem_Design, typeof (IDesigner))]
+       [Designer ("System.Windows.Forms.Design.ListViewDesigner, " + Consts.AssemblySystem_Design,
+                  typeof (IDesigner))]
        public class ListView : Control
        {
                private ItemActivation activation = ItemActivation.Standard;
@@ -405,7 +409,8 @@ namespace System.Windows.Forms
                        ColumnHeader col = this.columns [index];
 
                        if (col.Width == -2) { // autosize = max(items, columnheader)
-                               Size size = Size.Ceiling (this.DeviceContext.MeasureString (text, this.Font));
+                               Size size = Size.Ceiling (this.DeviceContext.MeasureString
+                                                         (text, this.Font));
                                ret_size = BiggestItem (index);
                                if (size.Width > ret_size.Width)
                                        ret_size = size;
@@ -424,21 +429,23 @@ namespace System.Windows.Forms
 
                        if (col == 0) {
                                foreach (ListViewItem item in items) {
-                                               temp = Size.Ceiling (this.DeviceContext.MeasureString (item.Text, this.Font));
-                                               if (temp.Width > ret_size.Width)
-                                                       ret_size = temp;
-                                       }
+                                       temp = Size.Ceiling (this.DeviceContext.MeasureString
+                                                            (item.Text, this.Font));
+                                       if (temp.Width > ret_size.Width)
+                                               ret_size = temp;
+                               }
                        }
                        else {
                                foreach (ListViewItem item in items) {
-                                               if (col >=item.SubItems.Count)
-                                                       continue;
-                                       Console.WriteLine ("col: {0}, count: {1}", col, item.SubItems.Count);
-                                               temp = Size.Ceiling (this.DeviceContext.MeasureString (item.SubItems [col].Text , this.Font));
-                                               if (temp.Width > ret_size.Width)
-                                                       ret_size = temp;
-                                       }
-                       }                               
+                                       if (col >=item.SubItems.Count)
+                                               continue;
+
+                                       temp = Size.Ceiling (this.DeviceContext.MeasureString
+                                                            (item.SubItems [col].Text  , this.Font));
+                                       if (temp.Width > ret_size.Width)
+                                               ret_size = temp;
+                               }
+                       }
                        return ret_size;
                }
 
@@ -462,16 +469,16 @@ namespace System.Windows.Forms
                        }
                        else if (view == View.Details) {
                                if (columns.Count > 0) {
-                                               text_size = this.BiggestItem (0);
-                                               if (check_boxes)
-                                                       text_size.Width -= (ThemeEngine.Current.CheckBoxWidth + 2);
-                                               if (small_image_list != null)
-                                                       text_size.Width -= small_image_list.ImageSize.Width;
+                                       text_size = this.BiggestItem (0);
+                                       if (check_boxes)
+                                               text_size.Width -= (ThemeEngine.Current.CheckBoxWidth + 2);
+                                       if (small_image_list != null)
+                                               text_size.Width -= small_image_list.ImageSize.Width;
                                }
                        }
                        else
                                text_size = BiggestItem (0);
-                       
+
                        // we do the default settings, if we have got 0's
                        if (text_size.Height <= 0)
                                text_size.Height = this.Font.Height;
@@ -513,15 +520,14 @@ namespace System.Windows.Forms
                                }
                                break;
                        case View.LargeIcon:
-                                       // take care of alignment, autoarrange too
+                               // take care of alignment, autoarrange too
                                break;
 
                        case View.List:
                                break;
 
                        case View.SmallIcon:
-                                       // take care of alignment, autoarrange too
-                                       
+                               // take care of alignment, autoarrange too
                                break;
                        }
 
@@ -554,12 +560,14 @@ namespace System.Windows.Forms
                                return;
 
                        if (redraw) {
-                               ThemeEngine.Current.DrawListView (this.DeviceContext, pe.ClipRectangle, this);
+                               ThemeEngine.Current.DrawListView (this.DeviceContext,
+                                                                 pe.ClipRectangle, this);
                                redraw = false;
                        }
 
                        // paint on the screen
-                       pe.Graphics.DrawImage (this.ImageBuffer, pe.ClipRectangle, pe.ClipRectangle, GraphicsUnit.Pixel);
+                       pe.Graphics.DrawImage (this.ImageBuffer, pe.ClipRectangle,
+                                              pe.ClipRectangle, GraphicsUnit.Pixel);
 
                        if (Paint != null)
                                Paint (this, pe);
index 6842559dd930fac9e8ef8fd563a3840ef33f8953..deeab3e2aec5f0b06203228fbee3696b35f4de67 100644 (file)
 // Author:
 //      Ravindra (rkumar@novell.com)
 //
-// $Revision: 1.4 $
+// $Revision: 1.5 $
 // $Modtime: $
 // $Log: ListViewItem.cs,v $
+// Revision 1.5  2004/10/26 09:55:48  ravindra
+// Some formatting for my last checkins.
+//
 // Revision 1.4  2004/10/26 09:32:19  ravindra
 // Calculations for ListViewItem.
 //
@@ -70,8 +73,8 @@ namespace System.Windows.Forms
                private bool use_item_style = true;
 
                // internal variables
-               internal CheckBox checkbox;                             // the associated checkbox with an item
-               internal Rectangle checkbox_rect;               // calculated by CalcListViewItem method
+               internal CheckBox checkbox;             // the associated checkbox with an item
+               internal Rectangle checkbox_rect;       // calculated by CalcListViewItem method
                internal Rectangle entire_rect;
                internal Rectangle icon_rect;
                internal Rectangle item_rect;
@@ -171,7 +174,8 @@ namespace System.Windows.Forms
 
                [DefaultValue (-1)]
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
-               [Editor ("System.Windows.Forms.Design.ImageIndexEditor, " + Consts.AssemblySystem_Design, typeof (System.Drawing.Design.UITypeEditor))]
+               [Editor ("System.Windows.Forms.Design.ImageIndexEditor, " + Consts.AssemblySystem_Design,
+                        typeof (System.Drawing.Design.UITypeEditor))]
                [Localizable (true)]
                [TypeConverter (typeof (ImageIndexConverter))]
                public int ImageIndex {
@@ -229,7 +233,8 @@ namespace System.Windows.Forms
                }
 
                [DefaultValue (-1)]
-               [Editor ("System.Windows.Forms.Design.ImageIndexEditor, " + Consts.AssemblySystem_Design, typeof (System.Drawing.Design.UITypeEditor))]
+               [Editor ("System.Windows.Forms.Design.ImageIndexEditor, " + Consts.AssemblySystem_Design,
+                        typeof (System.Drawing.Design.UITypeEditor))]
                [Localizable (true)]
                [TypeConverter (typeof (ImageIndexConverter))]
                public int StateImageIndex {
@@ -373,7 +378,8 @@ namespace System.Windows.Forms
 
                        if (owner.CheckBoxes) {
                                checkbox_rect.Location = this.location;
-                               checkbox_rect.Height = checkbox_rect.Width = ThemeEngine.Current.CheckBoxWidth;
+                               checkbox_rect.Height = checkbox_rect.Width
+                                       = ThemeEngine.Current.CheckBoxWidth;
                                checkbox = new CheckBox ();
                        }
                        else
@@ -391,10 +397,12 @@ namespace System.Windows.Forms
                                icon_rect.X = checkbox_rect.X + checkbox_rect.Width + 2;
                                icon_rect.Y = location.Y;
 
-                               item_ht = Math.Max (ThemeEngine.Current.CheckBoxWidth + 1, text_size.Height);
+                               item_ht = Math.Max (ThemeEngine.Current.CheckBoxWidth + 1,
+                                                   text_size.Height);
 
                                if (owner.SmallImageList != null) {
-                                       item_ht = Math.Max (item_ht, owner.SmallImageList.ImageSize.Height + 1);
+                                       item_ht = Math.Max (item_ht,
+                                                           owner.SmallImageList.ImageSize.Height + 1);
                                        icon_rect.Width = owner.SmallImageList.ImageSize.Width;
                                }
                                else
@@ -406,7 +414,8 @@ namespace System.Windows.Forms
                                label_rect.Y = icon_rect.Y;
                                label_rect.Width = text_size.Width;
 
-                               item_rect = entire_rect = Rectangle.Union (Rectangle.Union (checkbox_rect, icon_rect), label_rect);
+                               item_rect = entire_rect = Rectangle.Union
+                                       (Rectangle.Union (checkbox_rect, icon_rect), label_rect);
 
                                // Take into account the rest of columns. First column
                                // is already taken into account above.
@@ -445,7 +454,8 @@ namespace System.Windows.Forms
                                item_ht = Math.Max (ThemeEngine.Current.CheckBoxWidth, text_size.Height);
 
                                if (owner.SmallImageList != null) {
-                                       item_ht = Math.Max (item_ht, owner.SmallImageList.ImageSize.Height + 1);
+                                       item_ht = Math.Max (item_ht,
+                                                           owner.SmallImageList.ImageSize.Height + 1);
                                        icon_rect.Width = owner.SmallImageList.ImageSize.Width;
                                }
                                else
@@ -468,7 +478,8 @@ namespace System.Windows.Forms
                                item_ht = Math.Max (ThemeEngine.Current.CheckBoxWidth, text_size.Height);
 
                                if (owner.SmallImageList != null) {
-                                       item_ht = Math.Max (item_ht, owner.SmallImageList.ImageSize.Height + 1);
+                                       item_ht = Math.Max (item_ht,
+                                                           owner.SmallImageList.ImageSize.Height + 1);
                                        icon_rect.Width = owner.SmallImageList.ImageSize.Width;
                                }
                                else
index dfb545db9263866b3b1eb0b3d27e1d5617c1cd67..64904ec2262db076f9ed8d38841081773146d70e 100644 (file)
 //
 //
 //
-// $Revision: 1.50 $
+// $Revision: 1.51 $
 // $Modtime: $
 // $Log: ThemeWin32Classic.cs,v $
+// Revision 1.51  2004/10/26 09:55:48  ravindra
+// Some formatting for my last checkins.
+//
 // Revision 1.50  2004/10/26 09:36:32  ravindra
 // Implemented DetailView drawing for ListView control and default values.
 //
@@ -907,13 +910,21 @@ namespace System.Windows.Forms
                                                sub_item_rect.Width = col.Wd;
 
                                                if (item.UseItemStyleForSubItems) {
-                                                       dc.FillRectangle (this.ResPool.GetSolidBrush (item.BackColor), sub_item_rect);
-                                                       dc.DrawString (subItem.Text, item.Font, this.ResPool.GetSolidBrush (item.ForeColor), sub_item_rect, col.Format);
+                                                       dc.FillRectangle (this.ResPool.GetSolidBrush
+                                                                         (item.BackColor), sub_item_rect);
+                                                       dc.DrawString (subItem.Text, item.Font,
+                                                                      this.ResPool.GetSolidBrush
+                                                                      (item.ForeColor), sub_item_rect,
+                                                                      col.Format);
                                                }
                                                else {
-                                                       dc.FillRectangle (this.ResPool.GetSolidBrush (subItem.BackColor), sub_item_rect);
+                                                       dc.FillRectangle (this.ResPool.GetSolidBrush
+                                                                         (subItem.BackColor),
+                                                                         sub_item_rect);
                                                        dc.DrawString (subItem.Text, subItem.Font,
-                                                                      this.ResPool.GetSolidBrush (subItem.ForeColor), sub_item_rect, col.Format);
+                                                                      this.ResPool.GetSolidBrush
+                                                                      (subItem.ForeColor),
+                                                                      sub_item_rect, col.Format);
                                                }
                                                sub_item_rect.X += col.Wd;
                                        }