diff options
author | Ravindra <ravindra@mono-cvs.ximian.com> | 2004-10-26 13:55:48 +0400 |
---|---|---|
committer | Ravindra <ravindra@mono-cvs.ximian.com> | 2004-10-26 13:55:48 +0400 |
commit | 8c1ce19e22115d1f0b186ae16c7eae2b58657e08 (patch) | |
tree | 606b177217af5fa16f160b5b9103cb0a774d05db /mcs | |
parent | b24a6246cce04629195193473c5dc06f1c853d6e (diff) |
Some formatting for my last checkins.
svn path=/trunk/mcs/; revision=35329
Diffstat (limited to 'mcs')
4 files changed, 79 insertions, 45 deletions
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ColumnHeader.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ColumnHeader.cs index 0ebc9578896..ba29696f98e 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ColumnHeader.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ColumnHeader.cs @@ -22,9 +22,12 @@ // 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; } diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs index 532f8d90053..b0adbaf9b1c 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs @@ -22,9 +22,12 @@ // 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); diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListViewItem.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListViewItem.cs index 6842559dd93..deeab3e2aec 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListViewItem.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListViewItem.cs @@ -22,9 +22,12 @@ // 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 diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs index dfb545db926..64904ec2262 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs @@ -26,9 +26,12 @@ // // // -// $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; } |