// 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.
//
#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;
#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; }
// 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.
//
{
[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;
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;
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;
}
}
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;
}
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;
}
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);
// 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.
//
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;
[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 {
}
[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 {
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
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
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.
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
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
//
//
//
-// $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.
//
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;
}