Author: jordi
Date: 2005-04-01 03:33:30 -0500 (Fri, 01 Apr 2005)
New Revision: 42454
Added:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridBoolColumn.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridColumnStyle.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridTextBox.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridTextBoxColumn.cs
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridTableStyle.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/GridColumnStylesCollection.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/GridTableStylesCollection.cs
Log:
2005-04-01 Jordi Mas i Hernandez <[EMAIL PROTECTED]>
* DataGridTextBoxColumn.cs: implements DataGridTextBoxColumn class
* GridColumnStylesCollection.cs: implements GridColumnStylesCollection
* GridTableStylesCollection.cs: implements GridTableStylesCollection
* DataGridTableStyle.cs: implements DataGridTableStyle
* DataGridBoolColumn.cs: implements DataGridBoolColumn
* DataGridTextBox.cs: implements DataGridTextBox
* DataGridColumnStyle.cs: implements DataGridColumnStyle
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2005-03-31 23:00:01 UTC (rev 42453)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2005-04-01 08:33:30 UTC (rev 42454)
@@ -1,3 +1,13 @@
+2005-04-01 Jordi Mas i Hernandez <[EMAIL PROTECTED]>
+
+ * DataGridTextBoxColumn.cs: implements DataGridTextBoxColumn class
+ * GridColumnStylesCollection.cs: implements GridColumnStylesCollection
+ * GridTableStylesCollection.cs: implements GridTableStylesCollection
+ * DataGridTableStyle.cs: implements DataGridTableStyle
+ * DataGridBoolColumn.cs: implements DataGridBoolColumn
+ * DataGridTextBox.cs: implements DataGridTextBox
+ * DataGridColumnStyle.cs: implements DataGridColumnStyle
+
2005-03-31 Alexander Olk <[EMAIL PROTECTED]>
* FileDialog.cs: Added simple PopupButton class for ButtonPanel
Added:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridBoolColumn.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridBoolColumn.cs
2005-03-31 23:00:01 UTC (rev 42453)
+++
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridBoolColumn.cs
2005-04-01 08:33:30 UTC (rev 42454)
@@ -0,0 +1,216 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2005 Novell, Inc. (http://www.novell.com)
+//
+// Author:
+// Jordi Mas i Hernadez <[EMAIL PROTECTED]>
+//
+//
+
+// NOT COMPLETE
+
+using System.ComponentModel;
+using System.Drawing;
+using System.Runtime.InteropServices;
+using System.Diagnostics;
+
+namespace System.Windows.Forms
+{
+ public class DataGridBoolColumn : DataGridColumnStyle
+ {
+ #region Local Variables
+ private bool allownull;
+ private object falsevalue;
+ private object nullvalue;
+ private object truevalue;
+ #endregion // Local Variables
+
+ #region Constructors
+ public DataGridBoolColumn ()
+ {
+ CommonConstructor ();
+ }
+
+ public DataGridBoolColumn (PropertyDescriptor prop)
+ {
+ CommonConstructor ();
+ }
+
+ public DataGridBoolColumn (PropertyDescriptor prop, bool
isDefault)
+ {
+ CommonConstructor ();
+ }
+
+ private void CommonConstructor ()
+ {
+ allownull = true;
+ falsevalue = false;
+ nullvalue = null;
+ truevalue = true;
+ }
+
+ #endregion
+
+ #region Public Instance Properties
+ public bool AllowNull {
+ get {
+ return allownull;
+ }
+ set {
+ if (value != allownull) {
+ allownull = value;
+
+ if (AllowNullChanged != null) {
+ AllowNullChanged (this,
EventArgs.Empty);
+ }
+ }
+ }
+ }
+
+ public object FalseValue {
+ get {
+ return falsevalue;
+ }
+ set {
+ if (value != falsevalue) {
+ falsevalue = value;
+
+ if (FalseValueChanged != null) {
+ FalseValueChanged (this,
EventArgs.Empty);
+ }
+ }
+ }
+ }
+
+ public object NullValue {
+ get {
+ return nullvalue;
+ }
+ set {
+ if (value != nullvalue) {
+ nullvalue = value;
+ }
+ }
+ }
+
+ public object TrueValue {
+ get {
+ return truevalue;
+ }
+ set {
+ if (value != truevalue) {
+ truevalue = value;
+
+ if (TrueValueChanged != null) {
+ TrueValueChanged (this,
EventArgs.Empty);
+ }
+ }
+ }
+ }
+ #endregion // Public Instance Properties
+
+ #region Public Instance Methods
+ [MonoTODO]
+ protected internal override void Abort (int rowNum)
+ {
+
+ }
+
+ [MonoTODO]
+ protected internal override bool Commit (CurrencyManager
dataSource, int rowNum)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ protected internal override void ConcedeFocus ()
+ {
+
+ }
+
+ [MonoTODO]
+ protected internal override void Edit (CurrencyManager source,
int rowNum, Rectangle bounds, bool readOnly, string instantText, bool
cellIsVisible)
+ {
+
+ }
+
+ [MonoTODO]
+ protected internal override void EnterNullValue ()
+ {
+
+ }
+
+ [MonoTODO]
+ protected internal override object GetColumnValueAtRow
(CurrencyManager lm, int row)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ protected internal override int GetMinimumHeight ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ protected internal override int GetPreferredHeight (Graphics g,
object value)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ protected internal override Size GetPreferredSize (Graphics g,
object value)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ protected internal override void Paint (Graphics g, Rectangle
bounds, CurrencyManager source, int rowNum)
+ {
+
+ }
+
+ [MonoTODO]
+ protected internal override void Paint(Graphics g, Rectangle
bounds, CurrencyManager source, int rowNum, bool alignToRight)
+ {
+
+ }
+
+ [MonoTODO]
+ protected internal override void Paint(Graphics g, Rectangle
bounds, CurrencyManager source, int rowNum, Brush backBrush, Brush foreBrush,
bool alignToRight)
+ {
+
+ }
+
+ [MonoTODO]
+ protected internal override void SetColumnValueAtRow
(CurrencyManager lm, int row, object value)
+ {
+
+ }
+ #endregion // Public Instance Methods
+
+
+ #region Events
+ public event EventHandler AllowNullChanged;
+ public event EventHandler FalseValueChanged;
+ public event EventHandler TrueValueChanged;
+ #endregion // Events
+ }
+}
Added:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridColumnStyle.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridColumnStyle.cs
2005-03-31 23:00:01 UTC (rev 42453)
+++
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridColumnStyle.cs
2005-04-01 08:33:30 UTC (rev 42454)
@@ -0,0 +1,423 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2005 Novell, Inc. (http://www.novell.com)
+//
+// Author:
+// Jordi Mas i Hernadez <[EMAIL PROTECTED]>
+//
+//
+
+// NOT COMPLETE
+
+using System.ComponentModel;
+using System.Drawing;
+using System.Runtime.InteropServices;
+using System.Diagnostics;
+
+namespace System.Windows.Forms
+{
+ public abstract class DataGridColumnStyle : Component,
IDataGridColumnStyleEditingNotificationService
+ {
+ [ComVisible(true)]
+ protected class DataGridColumnHeaderAccessibleObject :
AccessibleObject
+ {
+ #region Local Variables
+ private DataGridColumnStyle owner;
+ #endregion
+
+ #region Constructors
+ public DataGridColumnHeaderAccessibleObject
(DataGridColumnStyle columnstyle)
+ {
+ owner = columnstyle;
+ }
+ #endregion //Constructors
+
+ #region Public Instance Properties
+ [MonoTODO]
+ public override Rectangle Bounds {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public override string Name {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ protected DataGridColumnStyle Owner {
+ get { return owner; }
+ }
+
+ public override AccessibleObject Parent {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public override AccessibleRole Role {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+ #endregion
+
+ #region Public Instance Methods
+ [MonoTODO]
+ public override AccessibleObject Navigate
(AccessibleNavigation navdir)
+ {
+ throw new NotImplementedException ();
+ }
+ #endregion Public Instance Methods
+ }
+
+ protected class CompModSwitches
+ {
+ public CompModSwitches ()
+ {
+ }
+
+ #region Public Instance Methods
+ [MonoTODO]
+ public static TraceSwitch DGEditColumnEditing {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+ #endregion Public Instance Methods
+ }
+
+ #region Local Variables
+ private HorizontalAlignment alignment;
+ private int fontheight;
+ private DataGridTableStyle table_style;
+ private string header_text;
+ private string mapping_name;
+ private string null_text;
+ private PropertyDescriptor property_descriptor;
+ private bool read_only;
+ private int width;
+ private DataGridColumnHeaderAccessibleObject accesible_object;
+ #endregion // Local Variables
+
+ #region Constructors
+ public DataGridColumnStyle ()
+ {
+ CommmonConstructor ();
+ property_descriptor = null;
+ }
+
+ public DataGridColumnStyle (PropertyDescriptor prop)
+ {
+ CommmonConstructor ();
+ property_descriptor = prop;
+ }
+
+ private void CommmonConstructor ()
+ {
+ fontheight = -1;
+ table_style = null;
+ header_text = string.Empty;
+ mapping_name = "(null)";
+ null_text = string.Empty;
+ accesible_object = new
DataGridColumnHeaderAccessibleObject (this);
+ read_only = false;
+ width = -1;
+ alignment = HorizontalAlignment.Left;
+ }
+
+ #endregion
+
+ #region Public Instance Properties
+ public virtual HorizontalAlignment Alignment {
+ get {
+ return alignment;
+ }
+ set {
+ if (value != alignment) {
+ alignment = value;
+
+ if (AlignmentChanged != null) {
+ AlignmentChanged (this,
EventArgs.Empty);
+ }
+ }
+ }
+ }
+
+ public virtual DataGridTableStyle DataGridTableStyle {
+ get {
+ return table_style;
+ }
+ }
+
+ protected int FontHeight {
+ get {
+ if (fontheight != -1) {
+ return fontheight;
+ }
+
+ if (table_style != null) {
+ //return table_style.DataGrid.FontHeight
+ return -1;
+ }
+
+ // TODO: Default Datagrid font height
+ return -1;
+ }
+ }
+
+ public AccessibleObject HeaderAccessibleObject {
+ get {
+ return accesible_object;
+ }
+ }
+
+ public virtual string HeaderText {
+ get {
+ return header_text;
+ }
+ set {
+ if (value != header_text) {
+ header_text = value;
+
+ if (HeaderTextChanged != null) {
+ HeaderTextChanged (this,
EventArgs.Empty);
+ }
+ }
+ }
+ }
+
+ public string MappingName {
+ get {
+ return mapping_name;
+ }
+ set {
+ if (value != mapping_name) {
+ mapping_name = value;
+
+ if (MappingNameChanged != null) {
+ MappingNameChanged (this,
EventArgs.Empty);
+ }
+ }
+ }
+ }
+
+ public virtual string NullText {
+ get {
+ return null_text;
+ }
+ set {
+ if (value != null_text) {
+ null_text = value;
+
+ if (NullTextChanged != null) {
+ NullTextChanged (this,
EventArgs.Empty);
+ }
+ }
+ }
+ }
+
+ public virtual PropertyDescriptor PropertyDescriptor {
+ get {
+ return property_descriptor;
+ }
+ set {
+ if (value != property_descriptor) {
+ property_descriptor = value;
+
+ if (PropertyDescriptorChanged != null) {
+ PropertyDescriptorChanged
(this, EventArgs.Empty);
+ }
+ }
+ }
+ }
+
+ public virtual bool ReadOnly {
+ get {
+ return read_only;
+ }
+ set {
+ if (value != read_only) {
+ read_only = value;
+
+ if (ReadOnlyChanged != null) {
+ ReadOnlyChanged (this,
EventArgs.Empty);
+ }
+ }
+ }
+ }
+
+ public virtual int Width {
+ get {
+ return width;
+ }
+ set {
+ if (value != width) {
+ width = value;
+
+ if (WidthChanged != null) {
+ WidthChanged (this,
EventArgs.Empty);
+ }
+ }
+ }
+ }
+
+ #endregion // Public Instance Properties
+
+ #region Public Instance Methods
+ protected internal abstract void Abort (int rowNum);
+
+ [MonoTODO]
+ protected void BeginUpdate ()
+ {
+
+ }
+
+ [MonoTODO]
+ protected void CheckValidDataSource (CurrencyManager value)
+ {
+
+ }
+
+ [MonoTODO]
+ protected internal virtual void ColumnStartedEditing (Control
editingControl)
+ {
+
+ }
+
+ protected internal abstract bool Commit (CurrencyManager
dataSource, int rowNum);
+
+
+ protected internal virtual void ConcedeFocus ()
+ {
+
+ }
+
+ [MonoTODO]
+ protected virtual AccessibleObject CreateHeaderAccessibleObject
()
+ {
+ throw new NotImplementedException ();
+ }
+
+
+ protected internal virtual void Edit (CurrencyManager source,
int rowNum, Rectangle bounds, bool readOnly)
+ {
+
+ }
+
+ [MonoTODO]
+ protected internal virtual void Edit (CurrencyManager source,
int rowNum, Rectangle bounds, bool readOnly, string instantText)
+ {
+
+ }
+
+ protected internal abstract void Edit (CurrencyManager source,
int rowNum, Rectangle bounds, bool readOnly, string instantText, bool
cellIsVisible);
+
+
+ [MonoTODO]
+ protected void EndUpdate ()
+ {
+
+ }
+
+ protected internal virtual void EnterNullValue ()
+ {
+
+ }
+
+ [MonoTODO]
+ protected internal virtual object GetColumnValueAtRow
(CurrencyManager source, int rowNum)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected internal abstract int GetMinimumHeight ();
+
+ protected internal abstract int GetPreferredHeight (Graphics g,
object value);
+
+ protected internal abstract Size GetPreferredSize (Graphics g,
object value);
+
+ void
IDataGridColumnStyleEditingNotificationService.ColumnStartedEditing (Control
editingControl)
+ {
+
+ }
+
+ protected virtual void Invalidate ()
+ {
+
+ }
+
+ protected internal abstract void Paint (Graphics g, Rectangle
bounds, CurrencyManager source, int rowNum);
+ protected internal abstract void Paint (Graphics g, Rectangle
bounds, CurrencyManager source, int rowNum, bool alignToRight);
+
+ [MonoTODO]
+ protected internal virtual void Paint (Graphics g, Rectangle
bounds, CurrencyManager source, int rowNum,
+ Brush backBrush, Brush foreBrush, bool alignToRight)
+ {
+
+ }
+
+ protected internal virtual void ReleaseHostedControl ()
+ {
+
+ }
+
+ public void ResetHeaderText ()
+ {
+ HeaderText = string.Empty;
+ }
+
+
+ protected internal virtual void SetColumnValueAtRow
(CurrencyManager source, int rowNum, object value)
+ {
+
+ }
+
+ protected virtual void SetDataGrid (DataGrid value)
+ {
+
+ }
+
+ protected virtual void SetDataGridInColumn (DataGrid value)
+ {
+
+ }
+
+ protected internal virtual void UpdateUI (CurrencyManager
source, int rowNum, string instantText)
+ {
+
+ }
+
+ #endregion // Public Instance Methods
+
+
+ #region Events
+ public event EventHandler AlignmentChanged;
+ public event EventHandler FontChanged;
+ public event EventHandler HeaderTextChanged;
+ public event EventHandler MappingNameChanged;
+ public event EventHandler NullTextChanged;
+ public event EventHandler PropertyDescriptorChanged;
+ public event EventHandler ReadOnlyChanged;
+ public event EventHandler WidthChanged;
+ #endregion // Events
+ }
+}
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridTableStyle.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridTableStyle.cs
2005-03-31 23:00:01 UTC (rev 42453)
+++
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridTableStyle.cs
2005-04-01 08:33:30 UTC (rev 42454)
@@ -5,10 +5,10 @@
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
-//
+//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
-//
+//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -17,40 +17,111 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-// Copyright (c) 2004 Novell, Inc.
+// Copyright (c) 2004-2005 Novell, Inc.
//
// Authors:
-// Peter Bartok [EMAIL PROTECTED]
//
+// Peter Bartok <[EMAIL PROTECTED]>
+// Jordi Mas i Hernandez <[EMAIL PROTECTED]>
//
+//
+// NOT COMPLETE
+//
-
-// NOT COMPLETE - Empty (and some functions minimally stubbed for
dependencies) until DataGrid is implemented
-
using System.ComponentModel;
using System.Drawing;
+using System.Runtime.InteropServices;
-namespace System.Windows.Forms {
- public class DataGridTableStyle : Component {
+namespace System.Windows.Forms
+{
+ public class DataGridTableStyle : Component
+ {
#region Local Variables
- internal bool allow_sorting;
- internal DataGrid datagrid;
- internal Color header_forecolor;
- internal string mapping_name;
+ private static readonly Color
def_alternating_backcolor = SystemColors.Window;
+ private static readonly Color def_backcolor =
SystemColors.Window;
+ private static readonly Color def_forecolor =
SystemColors.WindowText;
+ private static readonly Color def_gridline_color =
SystemColors.Control;
+ private static readonly Color def_header_backcolor =
SystemColors.Control;
+ private static readonly Font def_header_font = null;
+ private static readonly Color def_header_forecolor =
SystemColors.ControlText;
+ private static readonly Color def_link_color =
SystemColors.HotTrack;
+ private static readonly Color def_link_hovercolor =
SystemColors.HotTrack;
+ private static readonly Color def_selection_backcolor
= SystemColors.ActiveCaption;
+ private static readonly Color def_selection_forecolor
= SystemColors.ActiveCaptionText;
+
+ private bool allow_sorting;
+ private DataGrid datagrid;
+ private Color header_forecolor;
+ private string mapping_name;
+ private Color alternating_backcolor;
+ private bool columnheaders_visible;
+ private GridColumnStylesCollection column_styles;
+ private Color gridline_color;
+ private DataGridLineStyle gridline_style;
+ private Color header_backcolor;
+ private Font header_font;
+ private Color link_color;
+ private Color link_hovercolor;
+ private int preferredcolumn_width;
+ private int preferredrow_height;
+ private bool _readonly;
+ private bool rowheaders_visible;
+ private Color selection_backcolor;
+ private Color selection_forecolor;
+ private int rowheaders_width;
+ private Color backcolor;
+ private Color forecolor;
+ private bool is_default;
#endregion // Local Variables
#region Constructors
- public DataGridTableStyle() {
- allow_sorting = false;
- datagrid = new DataGrid();
- header_forecolor = Color.Black;
+ public DataGridTableStyle ()
+ {
+ CommonConstructor ();
+ is_default = false;
+ }
+
+ public DataGridTableStyle (bool isDefaultTableStyle)
+ {
+ CommonConstructor ();
+ is_default = isDefaultTableStyle;
+ }
+
+ // TODO: What to do with the CurrencyManager
+ public DataGridTableStyle (CurrencyManager listManager)
+ {
+ CommonConstructor ();
+ is_default = false;
+ }
+
+ private void CommonConstructor ()
+ {
+ allow_sorting = true;
+ datagrid = null;
+ header_forecolor = def_header_forecolor;
mapping_name = string.Empty;
+ column_styles = new GridColumnStylesCollection (this);
+
+ alternating_backcolor = def_alternating_backcolor;
+ columnheaders_visible = true;
+ gridline_color = def_gridline_color;
+ gridline_style = DataGridLineStyle.Solid;
+ header_backcolor = def_header_backcolor;
+ header_font = def_header_font;
+ link_color = def_link_color;
+ link_hovercolor = def_link_hovercolor;
+ preferredcolumn_width = 75;
+ preferredrow_height =
ThemeEngine.Current.DefaultFont.Height + 3;
+ _readonly = false;
+ rowheaders_visible = true;
+ selection_backcolor = def_selection_backcolor;
+ selection_forecolor = def_selection_forecolor;
+ rowheaders_width = 35;
+ backcolor = def_backcolor;
+ forecolor = def_forecolor;
}
#endregion
- #region Public Static Fields
- #endregion // Public Static Fields
-
#region Public Instance Properties
public bool AllowSorting {
get {
@@ -60,12 +131,50 @@
set {
if (allow_sorting != value) {
allow_sorting = value;
+ OnAllowSortingChanged (EventArgs.Empty);
+ }
+ }
+ }
- OnAllowSortingChanged(EventArgs.Empty);
+ public Color AlternatingBackColor {
+ get {
+ return alternating_backcolor;
+ }
+
+ set {
+ if (!alternating_backcolor.Equals (value)) {
+ alternating_backcolor = value;
+ OnAlternatingBackColorChanged
(EventArgs.Empty);
}
}
}
+ public Color BackColor {
+ get {
+ return backcolor;
+ }
+
+ set {
+ if (!backcolor.Equals (value)) {
+ backcolor = value;
+ OnBackColorChanged (EventArgs.Empty);
+ }
+ }
+ }
+
+ public bool ColumnHeadersVisible {
+ get {
+ return columnheaders_visible;
+ }
+
+ set {
+ if (columnheaders_visible != value) {
+ columnheaders_visible = value;
+ OnColumnHeadersVisibleChanged
(EventArgs.Empty);
+ }
+ }
+ }
+
public virtual DataGrid DataGrid {
get {
return datagrid;
@@ -78,18 +187,122 @@
}
}
+ public Color ForeColor {
+ get {
+ return forecolor;
+ }
+
+ set {
+ if (!forecolor.Equals (value)) {
+ forecolor = value;
+ OnForeColorChanged (EventArgs.Empty);
+ }
+ }
+ }
+
+ public virtual GridColumnStylesCollection GridColumnStyles {
+ get { return column_styles; }
+ }
+
+ public Color GridLineColor {
+ get {
+ return gridline_color;
+ }
+
+ set {
+ if (!gridline_color.Equals (value)) {
+ gridline_color = value;
+ OnGridLineColorChanged
(EventArgs.Empty);
+ }
+ }
+ }
+
+ public DataGridLineStyle GridLineStyle {
+ get {
+ return gridline_style;
+ }
+
+ set {
+ if (gridline_style != value) {
+ gridline_style = value;
+ OnGridLineStyleChanged
(EventArgs.Empty);
+ }
+ }
+ }
+
+ public Color HeaderBackColor {
+ get {
+ return header_backcolor;
+ }
+
+ set {
+ if (!header_backcolor.Equals (value)) {
+ header_backcolor = value;
+ OnHeaderBackColorChanged
(EventArgs.Empty);
+ }
+ }
+ }
+
+ public Font HeaderFont {
+ get {
+ if (header_font != null)
+ return header_font;
+
+ if (datagrid != null)
+ return datagrid.Font;
+
+ return ThemeEngine.Current.DefaultFont;
+ }
+
+ set {
+ if (header_font != value) {
+ header_font = value;
+ OnHeaderFontChanged (EventArgs.Empty);
+ }
+ }
+ }
+
public Color HeaderForeColor {
get {
return header_forecolor;
}
set {
- if (header_forecolor != value) {
+
+ if (!header_forecolor.Equals (value)) {
header_forecolor = value;
+ OnHeaderForeColorChanged
(EventArgs.Empty);
}
}
}
+ public Color LinkColor {
+ get {
+ return link_color;
+ }
+
+ set {
+ if (!link_color.Equals (value)) {
+ link_color = value;
+ OnLinkColorChanged (EventArgs.Empty);
+ }
+ }
+ }
+
+ [ComVisible(false)]
+ public Color LinkHoverColor {
+ get {
+ return link_hovercolor;
+ }
+
+ set {
+ if (!link_hovercolor.Equals (value)) {
+ link_hovercolor = value;
+ OnLinkHoverColorChanged
(EventArgs.Empty);
+ }
+ }
+ }
+
public string MappingName {
get {
return mapping_name;
@@ -98,33 +311,408 @@
set {
if (mapping_name != value) {
mapping_name = value;
+ OnMappingNameChanged (EventArgs.Empty);
+ }
+ }
+ }
- OnMappingNameChanged(EventArgs.Empty);
+ public int PreferredColumnWidth {
+ get {
+ return preferredcolumn_width;
+ }
+
+ set {
+ if (preferredcolumn_width != value) {
+ preferredcolumn_width = value;
+ OnPreferredColumnWidthChanged
(EventArgs.Empty);
}
}
}
+
+ public int PreferredRowHeight {
+ get {
+ return preferredrow_height;
+ }
+
+ set {
+ if (preferredrow_height != value) {
+ preferredrow_height = value;
+ OnPreferredRowHeightChanged
(EventArgs.Empty);
+ }
+ }
+ }
+
+ public bool ReadOnly {
+ get {
+ return _readonly;
+ }
+
+ set {
+ if (_readonly != value) {
+ _readonly = value;
+ OnReadOnlyChanged (EventArgs.Empty);
+ }
+ }
+ }
+
+ public bool RowHeadersVisible {
+ get {
+ return rowheaders_visible;
+ }
+
+ set {
+ if (rowheaders_visible != value) {
+ rowheaders_visible = value;
+ OnRowHeadersVisibleChanged
(EventArgs.Empty);
+ }
+ }
+ }
+
+ public int RowHeaderWidth {
+ get {
+ return rowheaders_width;
+ }
+
+ set {
+ if (rowheaders_width != value) {
+ rowheaders_width = value;
+ OnRowHeaderWidthChanged
(EventArgs.Empty);
+ }
+ }
+ }
+
+ public Color SelectionBackColor {
+ get {
+ return selection_backcolor;
+ }
+
+ set {
+ if (!selection_backcolor.Equals (value)) {
+ selection_backcolor = value;
+ OnSelectionBackColorChanged
(EventArgs.Empty);
+ }
+ }
+ }
+
+ public Color SelectionForeColor {
+ get {
+ return selection_forecolor;
+ }
+
+ set {
+ if (!selection_forecolor.Equals (value)) {
+ selection_forecolor = value;
+ OnSelectionForeColorChanged
(EventArgs.Empty);
+ }
+ }
+ }
+
#endregion // Public Instance Properties
#region Public Instance Methods
- #endregion // Public Instance Methods
- #region Protected Instance Methods
- protected virtual void OnMappingNameChanged(EventArgs e) {
+ [MonoTODO]
+ public virtual bool BeginEdit (DataGridColumnStyle gridColumn,
int rowNumber)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected internal virtual DataGridColumnStyle CreateGridColumn
(PropertyDescriptor prop)
+ {
+ throw new NotImplementedException ();
+ }
+
+ // TODO: How to specify the isDefault boolean
+ protected internal virtual DataGridColumnStyle CreateGridColumn
(PropertyDescriptor prop, bool isDefault)
+ {
+ throw new NotImplementedException ();
+
+ }
+
+ protected override void Dispose (bool disposing)
+ {
+ base.Dispose (disposing);
+ }
+
+ [MonoTODO]
+ public virtual bool EndEdit ( DataGridColumnStyle gridColumn,
int rowNumber, bool shouldAbort)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected virtual void OnAllowSortingChanged (EventArgs e)
+ {
+ if (AllowSortingChanged != null) {
+ AllowSortingChanged (this, e);
+ }
+ }
+
+ protected virtual void OnAlternatingBackColorChanged (EventArgs
e)
+ {
+ if (AlternatingBackColorChanged != null) {
+ AlternatingBackColorChanged (this, e);
+ }
+ }
+
+ protected virtual void OnBackColorChanged (EventArgs e)
+ {
+ if (BackColorChanged != null) {
+ BackColorChanged (this, e);
+ }
+ }
+
+ protected virtual void OnColumnHeadersVisibleChanged (EventArgs
e)
+ {
+ if (ColumnHeadersVisibleChanged != null) {
+ ColumnHeadersVisibleChanged (this, e);
+ }
+ }
+
+ protected virtual void OnForeColorChanged (EventArgs e)
+ {
+ if (ForeColorChanged != null) {
+ ForeColorChanged (this, e);
+ }
+ }
+
+ protected virtual void OnGridLineColorChanged (EventArgs e)
+ {
+ if (GridLineColorChanged != null) {
+ GridLineColorChanged (this, e);
+ }
+ }
+
+ protected virtual void OnGridLineStyleChanged (EventArgs e)
+ {
+ if (GridLineStyleChanged != null) {
+ GridLineStyleChanged (this, e);
+ }
+ }
+
+ protected virtual void OnHeaderBackColorChanged (EventArgs e)
+ {
+ if (HeaderBackColorChanged != null) {
+ HeaderBackColorChanged (this, e);
+ }
+ }
+
+ protected virtual void OnHeaderFontChanged (EventArgs e)
+ {
+ if (HeaderFontChanged != null) {
+ HeaderFontChanged (this, e);
+ }
+ }
+
+ protected virtual void OnHeaderForeColorChanged (EventArgs e)
+ {
+ if (HeaderForeColorChanged != null) {
+ HeaderForeColorChanged (this, e);
+ }
+ }
+
+ protected virtual void OnLinkColorChanged (EventArgs e)
+ {
+ if (LinkColorChanged != null) {
+ LinkColorChanged (this, e);
+ }
+ }
+
+ protected virtual void OnLinkHoverColorChanged (EventArgs e)
+ {
+ if (LinkHoverColorChanged != null) {
+ LinkHoverColorChanged (this, e);
+ }
+ }
+
+ protected virtual void OnMappingNameChanged (EventArgs e)
+ {
if (MappingNameChanged != null) {
MappingNameChanged(this, e);
}
}
- protected virtual void OnAllowSortingChanged(EventArgs e) {
- if (AllowSortingChanged != null) {
- AllowSortingChanged(this, e);
+ protected virtual void OnPreferredColumnWidthChanged (EventArgs
e)
+ {
+ if (PreferredColumnWidthChanged != null) {
+ PreferredColumnWidthChanged (this, e);
}
}
+
+ protected virtual void OnPreferredRowHeightChanged (EventArgs e)
+ {
+ if (PreferredRowHeightChanged != null) {
+ PreferredRowHeightChanged (this, e);
+ }
+ }
+
+ protected virtual void OnReadOnlyChanged (EventArgs e)
+ {
+ if (ReadOnlyChanged != null) {
+ ReadOnlyChanged (this, e);
+ }
+ }
+
+ protected virtual void OnRowHeadersVisibleChanged (EventArgs e)
+ {
+ if (RowHeadersVisibleChanged != null) {
+ RowHeadersVisibleChanged (this, e);
+ }
+ }
+
+ protected virtual void OnRowHeaderWidthChanged (EventArgs e)
+ {
+ if (RowHeaderWidthChanged != null) {
+ RowHeaderWidthChanged (this, e);
+ }
+ }
+
+ protected virtual void OnSelectionBackColorChanged (EventArgs e)
+ {
+ if (SelectionBackColorChanged != null) {
+ SelectionBackColorChanged (this, e);
+ }
+ }
+
+ protected virtual void OnSelectionForeColorChanged (EventArgs e)
+ {
+ if (SelectionForeColorChanged != null) {
+ SelectionForeColorChanged (this, e);
+ }
+ }
+
+ public void ResetAlternatingBackColor ()
+ {
+ AlternatingBackColor = def_alternating_backcolor;
+ }
+
+ public void ResetBackColor ()
+ {
+ BackColor = def_backcolor;
+ }
+
+ public void ResetForeColor ()
+ {
+ ForeColor = def_forecolor;
+ }
+
+ public void ResetGridLineColor ()
+ {
+ GridLineColor = def_gridline_color;
+ }
+
+ public void ResetHeaderBackColor ()
+ {
+ HeaderBackColor = def_header_backcolor;
+ }
+
+ public void ResetHeaderFont ()
+ {
+ HeaderFont = def_header_font;
+ }
+
+ public void ResetHeaderForeColor ()
+ {
+ HeaderForeColor = def_header_forecolor;
+ }
+
+ public void ResetLinkColor ()
+ {
+ LinkColor = def_link_color;
+ }
+
+ public void ResetLinkHoverColor ()
+ {
+ LinkHoverColor = def_link_hovercolor;
+ }
+
+ public void ResetSelectionBackColor ()
+ {
+ SelectionBackColor = def_selection_backcolor;
+ }
+
+ public void ResetSelectionForeColor ()
+ {
+ SelectionForeColor = def_selection_forecolor;
+ }
+
+ protected virtual bool ShouldSerializeAlternatingBackColor ()
+ {
+ return (!alternating_backcolor.Equals
(def_alternating_backcolor));
+ }
+
+ protected bool ShouldSerializeBackColor ()
+ {
+ return (!backcolor.Equals (def_backcolor));
+ }
+
+ protected bool ShouldSerializeForeColor ()
+ {
+ return (!forecolor.Equals (def_forecolor));
+ }
+
+ protected virtual bool ShouldSerializeGridLineColor ()
+ {
+ return (!gridline_color.Equals (def_gridline_color));
+ }
+
+ protected virtual bool ShouldSerializeHeaderBackColor ()
+ {
+ return (!header_backcolor.Equals
(def_header_backcolor));
+ }
+
+ protected virtual bool ShouldSerializeHeaderForeColor ()
+ {
+ return (!header_forecolor.Equals
(def_header_forecolor));
+ }
+
+ protected virtual bool ShouldSerializeLinkColor ()
+ {
+ return (!link_color.Equals (def_link_color));
+ }
+
+ protected virtual bool ShouldSerializeLinkHoverColor ()
+ {
+ return (!link_hovercolor.Equals (def_link_hovercolor));
+ }
+
+ protected bool ShouldSerializePreferredRowHeight ()
+ {
+ return (preferredrow_height !=
ThemeEngine.Current.DefaultFont.Height + 3);
+ }
+
+ protected bool ShouldSerializeSelectionBackColor ()
+ {
+ return (!selection_backcolor.Equals
(def_selection_backcolor));
+ }
+
+ protected virtual bool ShouldSerializeSelectionForeColor ()
+ {
+ return (!selection_forecolor.Equals
(def_selection_forecolor));
+ }
#endregion // Protected Instance Methods
#region Events
public event EventHandler AllowSortingChanged;
+ public event EventHandler AlternatingBackColorChanged;
+ public event EventHandler BackColorChanged;
+ public event EventHandler ColumnHeadersVisibleChanged;
+ public event EventHandler ForeColorChanged;
+ public event EventHandler GridLineColorChanged;
+ public event EventHandler GridLineStyleChanged;
+ public event EventHandler HeaderBackColorChanged;
+ public event EventHandler HeaderFontChanged;
+ public event EventHandler HeaderForeColorChanged;
+ public event EventHandler LinkColorChanged;
+ public event EventHandler LinkHoverColorChanged;
public event EventHandler MappingNameChanged;
+ public event EventHandler PreferredColumnWidthChanged;
+ public event EventHandler PreferredRowHeightChanged;
+ public event EventHandler ReadOnlyChanged;
+ public event EventHandler RowHeadersVisibleChanged;
+ public event EventHandler RowHeaderWidthChanged;
+ public event EventHandler SelectionBackColorChanged;
+ public event EventHandler SelectionForeColorChanged;
#endregion // Events
}
}
+
Added:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridTextBox.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridTextBox.cs
2005-03-31 23:00:01 UTC (rev 42453)
+++
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridTextBox.cs
2005-04-01 08:33:30 UTC (rev 42454)
@@ -0,0 +1,95 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2005 Novell, Inc. (http://www.novell.com)
+//
+// Author:
+// Jordi Mas i Hernadez <[EMAIL PROTECTED]>
+//
+//
+
+// NOT COMPLETE
+
+using System.ComponentModel;
+using System.Drawing;
+using System.Runtime.InteropServices;
+using System.Diagnostics;
+
+namespace System.Windows.Forms
+{
+ public class DataGridTextBox : TextBox
+ {
+
+ #region Local Variables
+ private bool isedit;
+ private DataGrid grid;
+ #endregion // Local Variables
+
+ #region Constructors
+ public DataGridTextBox ()
+ {
+ isedit = true;
+ grid = null;
+ }
+ #endregion
+
+ #region Public Instance Properties
+ public bool IsInEditOrNavigateMode {
+ get {
+ return isedit;
+ }
+ set {
+ if (value != isedit) {
+ isedit = value;
+ }
+ }
+ }
+
+ #endregion // Public Instance Properties
+
+ #region Public Instance Methods
+ protected override void OnKeyPress (KeyPressEventArgs e)
+ {
+ base.OnKeyPress (e);
+ }
+
+ protected override void OnMouseWheel (MouseEventArgs e)
+ {
+ base.OnMouseWheel (e);
+ }
+
+ protected internal override bool ProcessKeyMessage (ref Message
m)
+ {
+ return base.ProcessKeyMessage (ref m);
+ }
+
+ public void SetDataGrid (DataGrid parentGrid)
+ {
+ grid = parentGrid;
+ }
+
+ protected override void WndProc (ref Message m)
+ {
+ base.WndProc (ref m);
+ }
+
+ #endregion // Public Instance Methods
+
+ }
+}
Added:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridTextBoxColumn.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridTextBoxColumn.cs
2005-03-31 23:00:01 UTC (rev 42453)
+++
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridTextBoxColumn.cs
2005-04-01 08:33:30 UTC (rev 42454)
@@ -0,0 +1,234 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2005 Novell, Inc. (http://www.novell.com)
+//
+// Author:
+// Jordi Mas i Hernadez <[EMAIL PROTECTED]>
+//
+//
+
+// NOT COMPLETE
+
+using System.ComponentModel;
+using System.Drawing;
+using System.Runtime.InteropServices;
+using System.Diagnostics;
+
+namespace System.Windows.Forms
+{
+ public class DataGridTextBoxColumn : DataGridColumnStyle
+ {
+ #region Local Variables
+ private string format;
+ private IFormatProvider format_provider;
+ #endregion // Local Variables
+
+ #region Constructors
+ public DataGridTextBoxColumn ()
+ {
+
+ }
+
+ public DataGridTextBoxColumn (PropertyDescriptor prop)
+ {
+
+ }
+
+ public DataGridTextBoxColumn (PropertyDescriptor prop, bool
isDefault)
+ {
+
+ }
+
+ public DataGridTextBoxColumn (PropertyDescriptor prop, string
format)
+ {
+
+ }
+
+ public DataGridTextBoxColumn (PropertyDescriptor prop, string
format, bool isDefault)
+ {
+
+ }
+
+ #endregion
+
+ #region Public Instance Properties
+ public string Format {
+ get {
+ return format;
+ }
+ set {
+ if (value != format) {
+ format = value;
+ }
+ }
+ }
+
+ public IFormatProvider FormatInfo {
+ get {
+ return format_provider;
+ }
+ set {
+ if (value != format_provider) {
+ format_provider = value;
+ }
+ }
+ }
+
+ PropertyDescriptor PropertyDescriptor {
+ set {
+ base.PropertyDescriptor = value;
+ }
+ }
+
+ public override bool ReadOnly {
+ get {
+ return base.ReadOnly;
+ }
+ set {
+ base.ReadOnly = value;
+ }
+ }
+
+ [MonoTODO]
+ public virtual TextBox TextBox {
+ get {
+ return null;
+ }
+ }
+ #endregion // Public Instance Properties
+
+ #region Public Instance Methods
+
+ [MonoTODO]
+ protected internal override void Abort (int rowNum)
+ {
+
+ }
+
+ [MonoTODO]
+ protected internal override bool Commit (CurrencyManager
dataSource, int rowNum)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ protected internal override void ConcedeFocus ()
+ {
+
+ }
+
+ [MonoTODO]
+ protected internal override void Edit (CurrencyManager source,
int rowNum, Rectangle bounds, bool _readonly, string instantText, bool
cellIsVisible)
+ {
+
+ }
+
+ [MonoTODO]
+ protected void EndEdit ()
+ {
+
+ }
+
+ [MonoTODO]
+ protected internal override void EnterNullValue ()
+ {
+
+ }
+
+ [MonoTODO]
+ protected internal override int GetMinimumHeight ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ protected internal override int GetPreferredHeight (Graphics g,
object value)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ protected internal override Size GetPreferredSize (Graphics g,
object value)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ protected void HideEditBox ()
+ {
+
+ }
+
+ [MonoTODO]
+ protected internal override void Paint (Graphics g, Rectangle
bounds, CurrencyManager source, int rowNum)
+ {
+
+ }
+
+ [MonoTODO]
+ protected internal override void Paint (Graphics g, Rectangle
bounds, CurrencyManager source, int rowNum, bool alignToRight)
+ {
+
+ }
+
+ [MonoTODO]
+ protected internal override void Paint (Graphics g, Rectangle
bounds, CurrencyManager source, int rowNum, Brush backBrush, Brush foreBrush,
bool alignToRight)
+ {
+
+ }
+
+ [MonoTODO]
+ protected void PaintText (Graphics g, Rectangle bounds, string
text, bool alignToRight)
+ {
+
+ }
+
+ [MonoTODO]
+ protected void PaintText (Graphics g, Rectangle textBounds,
string text, Brush backBrush, Brush foreBrush, bool alignToRight)
+ {
+
+ }
+
+ [MonoTODO]
+ protected internal override void ReleaseHostedControl ()
+ {
+
+ }
+
+ [MonoTODO]
+ protected override void SetDataGridInColumn (DataGrid value)
+ {
+
+ }
+
+ [MonoTODO]
+ protected internal override void UpdateUI (CurrencyManager
source, int rowNum, string instantText)
+ {
+
+ }
+
+ #endregion // Public Instance Methods
+
+
+ #region Events
+
+ #endregion // Events
+ }
+}
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/GridColumnStylesCollection.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/GridColumnStylesCollection.cs
2005-03-31 23:00:01 UTC (rev 42453)
+++
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/GridColumnStylesCollection.cs
2005-04-01 08:33:30 UTC (rev 42454)
@@ -5,10 +5,10 @@
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
-//
+//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
-//
+//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -17,31 +17,175 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-// Copyright (c) 2004 Novell, Inc. (http://www.novell.com)
+// Copyright (c) 2005 Novell, Inc. (http://www.novell.com)
//
-// Authors:
-// Peter Bartok ([EMAIL PROTECTED])
+// Author:
+// Jordi Mas i Hernadez <[EMAIL PROTECTED]>
//
-//
-// NOT COMPLETE - Empty until DataGrid is implemented
-
using System;
using System.Collections;
using System.ComponentModel;
-namespace System.Windows.Forms {
- public class GridColumnStylesCollection {
+namespace System.Windows.Forms
+{
+ public class GridColumnStylesCollection : BaseCollection, IList
+ {
+ private ArrayList items;
+ private DataGridTableStyle owner;
+
+ internal GridColumnStylesCollection (DataGridTableStyle
tablestyle)
+ {
+ items = new ArrayList ();
+ owner = tablestyle;
+ }
+
#region Public Instance Properties
+ public DataGridColumnStyle this[string columnName] {
+ get {
+ for (int i = 0; i < items.Count; i++) {
+ DataGridColumnStyle column =
(DataGridColumnStyle) items[i];
+ if (column.MappingName == columnName) {
+ return column;
+ }
+ }
+
+ return null;
+ }
+ }
+
+ public DataGridColumnStyle this[int index] {
+ get {
+ return (DataGridColumnStyle) items[index];
+ }
+ }
+
+ [MonoTODO]
+ public DataGridColumnStyle this[PropertyDescriptor propDesc] {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ protected override ArrayList List {
+ get { return items; }
+ }
+
+ int ICollection.Count {
+ get { return items.Count;}
+ }
+
+ bool ICollection.IsSynchronized {
+ get { return false; }
+ }
+
+ object ICollection.SyncRoot {
+ get { return this;}
+ }
+
+ bool IList.IsFixedSize {
+ get { return false; }
+ }
+
+ bool IList.IsReadOnly {
+ get { return false;}
+ }
+
+ object IList.this [int index] {
+ get {
+ return items[index];
+ }
+ set {
+ throw new NotSupportedException ();
+ }
+ }
+
#endregion Public Instance Properties
- #region Protected Instance Properties
- #endregion Protected Instance Properties
-
#region Public Instance Methods
- #endregion Public Instance Methods
+ public virtual int Add (DataGridColumnStyle column)
+ {
+ return items.Add (column);
+ }
- #region Public Instance Methods
+ public void AddRange (DataGridColumnStyle[] columns)
+ {
+ foreach (DataGridColumnStyle mi in columns)
+ Add (mi);
+ }
+
+ public void Clear ()
+ {
+ items.Clear ();
+ }
+
+ public bool Contains (DataGridColumnStyle column)
+ {
+ return items.Contains (column);
+ }
+
+ [MonoTODO]
+ public bool Contains (PropertyDescriptor propDesc)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public bool Contains (string name)
+ {
+ return (this[name] != null);
+ }
+
+ void ICollection.CopyTo (Array dest, int index)
+ {
+ items.CopyTo (dest, index);
+ }
+
+ IEnumerator IEnumerable.GetEnumerator ()
+ {
+ return items.GetEnumerator ();
+ }
+
+ int IList.Add (object value)
+ {
+ return items.Add (value);
+ }
+
+ void IList.Clear ()
+ {
+ items.Clear ();
+ }
+
+ bool IList.Contains (object value)
+ {
+ return items.Contains (value);
+ }
+
+ int IList.IndexOf (object value)
+ {
+ return items.IndexOf (value);
+ }
+
+ void IList.Insert (int index, object value)
+ {
+ throw new NotSupportedException ();
+ }
+
+ void IList.Remove (object value)
+ {
+ items.Remove (value);
+ }
+
+ void IList.RemoveAt (int index)
+ {
+ items.RemoveAt (index);
+ }
+
+ [MonoTODO]
+ public void ResetPropertyDescriptors ()
+ {
+ throw new NotImplementedException ();
+ }
+
#endregion Public Instance Methods
#region Events
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/GridTableStylesCollection.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/GridTableStylesCollection.cs
2005-03-31 23:00:01 UTC (rev 42453)
+++
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/GridTableStylesCollection.cs
2005-04-01 08:33:30 UTC (rev 42454)
@@ -5,10 +5,10 @@
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
-//
+//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
-//
+//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -17,38 +17,195 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-// Copyright (c) 2004 Novell, Inc. (http://www.novell.com)
+// Copyright (c) 2005 Novell, Inc. (http://www.novell.com)
//
-// Authors:
-// Peter Bartok ([EMAIL PROTECTED])
+// Author:
+// Jordi Mas i Hernadez <[EMAIL PROTECTED]>
//
-//
-// NOT COMPLETE - Empty (and minimally stubbed for dependencies) until
DataGrid is implemented
-
using System;
using System.Collections;
using System.ComponentModel;
-namespace System.Windows.Forms {
- public class GridTableStylesCollection {
+namespace System.Windows.Forms
+{
+ public class GridTableStylesCollection : BaseCollection, IList
+ {
+ private ArrayList items;
+ private DataGrid owner;
+
+ internal GridTableStylesCollection (DataGrid grid)
+ {
+ items = new ArrayList ();
+ owner = owner;
+ }
+
#region Public Instance Properties
+ public DataGridTableStyle this[string columnName] {
+ get {
+ for (int i = 0; i < items.Count; i++) {
+ DataGridTableStyle column =
(DataGridTableStyle) items[i];
+ if (column.MappingName == columnName) {
+ return column;
+ }
+ }
+
+ return null;
+ }
+ }
+
+ public DataGridTableStyle this[int index] {
+ get {
+ return (DataGridTableStyle) items[index];
+ }
+ }
+
+ protected override ArrayList List {
+ get { return items; }
+ }
+
+ int ICollection.Count {
+ get { return items.Count;}
+ }
+
+ bool ICollection.IsSynchronized {
+ get { return false; }
+ }
+
+ object ICollection.SyncRoot {
+ get { return this;}
+ }
+
+ bool IList.IsFixedSize {
+ get { return false; }
+ }
+
+ bool IList.IsReadOnly {
+ get { return false;}
+ }
+
+ object IList.this [int index] {
+ get {
+ return items[index];
+ }
+ set {
+ throw new NotSupportedException ();
+ }
+ }
+
#endregion Public Instance Properties
- #region Protected Instance Properties
- #endregion Protected Instance Properties
+ #region Public Instance Methods
+ public virtual int Add (DataGridTableStyle column)
+ {
+ int cnt = items.Add (column);
- #region Public Instance Methods
- [MonoTODO]
- public virtual void AddRange(DataGridTableStyle[] tables) {
- throw new NotImplementedException();
+ OnCollectionChanged (new CollectionChangeEventArgs
(CollectionChangeAction.Add, column));
+ return cnt;
}
- #endregion Public Instance Methods
- #region Public Instance Methods
+ public void AddRange (DataGridTableStyle[] columns)
+ {
+ foreach (DataGridTableStyle mi in columns)
+ items.Add (mi);
+
+ OnCollectionChanged (new CollectionChangeEventArgs
(CollectionChangeAction.Refresh, null));
+ }
+
+ public void Clear ()
+ {
+ items.Clear ();
+ OnCollectionChanged (new CollectionChangeEventArgs
(CollectionChangeAction.Refresh , null));
+ }
+
+ public bool Contains (DataGridTableStyle column)
+ {
+ return items.Contains (column);
+ }
+
+ public bool Contains (string name)
+ {
+ return (this[name] != null);
+ }
+
+ void ICollection.CopyTo (Array dest, int index)
+ {
+ items.CopyTo (dest, index);
+ }
+
+ IEnumerator IEnumerable.GetEnumerator ()
+ {
+ return items.GetEnumerator ();
+ }
+
+ int IList.Add (object value)
+ {
+ int cnt = items.Add (value);
+
+ OnCollectionChanged (new CollectionChangeEventArgs
(CollectionChangeAction.Add, null));
+ return cnt;
+ }
+
+ void IList.Clear ()
+ {
+ items.Clear ();
+ OnCollectionChanged (new CollectionChangeEventArgs
(CollectionChangeAction.Refresh , null));
+ }
+
+ bool IList.Contains (object value)
+ {
+ return items.Contains (value);
+ }
+
+ int IList.IndexOf (object value)
+ {
+ return items.IndexOf (value);
+ }
+
+ void IList.Insert (int index, object value)
+ {
+ throw new NotSupportedException ();
+ }
+
+ void IList.Remove (object value)
+ {
+ items.Remove (value);
+ OnCollectionChanged (new CollectionChangeEventArgs
(CollectionChangeAction.Remove, value));
+ }
+
+ void IList.RemoveAt (int index)
+ {
+ object item = items[index];
+ items.RemoveAt (index);
+ OnCollectionChanged (new CollectionChangeEventArgs
(CollectionChangeAction.Remove, item));
+ }
+
+ protected void OnCollectionChanged (CollectionChangeEventArgs
ccevent)
+ {
+ if (CollectionChanged != null) {
+ CollectionChanged (this, ccevent);
+ }
+ }
+
+ public void Remove (DataGridTableStyle table)
+ {
+ items.Remove (table);
+ OnCollectionChanged (new CollectionChangeEventArgs
(CollectionChangeAction.Remove, table));
+ }
+
+ public void RemoveAt (int index)
+ {
+ object item = items[index];
+
+ items.RemoveAt (index);
+ OnCollectionChanged (new CollectionChangeEventArgs
(CollectionChangeAction.Remove, item));
+ }
+
#endregion Public Instance Methods
#region Events
+ public event CollectionChangeEventHandler CollectionChanged;
#endregion Events
}
}
+
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches