Browse Source

2002-09-25 Gaurav Vaish <[email protected]>

* RegextEditorDialog.cs   : Added a few more methods.
* BaseDataListComponentEditor.cs
                          : Completed.
* DataListComponentEditor.cs
                          : Completed
* BaseDataListPageInternal.cs,
* GeneralPageDataListInternal.cs,
* FormatPageInternal.cs,
* BordersPageInternal.cs  : Added private classes. Initial implementation.

svn path=/trunk/mcs/; revision=7802
Gaurav Vaish 23 years ago
parent
commit
78cefb0f7b

+ 57 - 0
mcs/class/System.Design/System.Web.UI.Design.WebControls/BaseDataListComponentEditor.cs

@@ -0,0 +1,57 @@
+/**
+ * Namespace:   System.Web.UI.Design.WebControls
+ * Class:       BaseDataListComponentEditor
+ *
+ * Author:      Gaurav Vaish
+ * Maintainer:  mastergaurav AT users DOT sf DOT net
+ *
+ * (C) Gaurav Vaish (2002)
+ */
+
+using System;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Web.UI.Design;
+using System.Windows.Forms;
+using System.Windows.Forms.Design;
+
+namespace System.Web.UI.Design.WebControls
+{
+	public abstract class BaseDataListComponentEditor : WindowsFormsComponentEditor
+	{
+		private int initialPage;
+
+		public BaseDataListComponentEditor(int initialPage) : base()
+		{
+			this.initialPage = initialPage;
+		}
+
+		public override bool EditComponent(ITypeDescriptorContext context,
+		                                   object obj, IWin32Window parent)
+		{
+			IComponent comp = (IComponent) obj;
+			ISite      site = comp.Site;
+			bool retVal  = false;
+			bool inTemplateMode = false;
+
+			if(site != null)
+			{
+				IDesignerHost dh = (IDesignerHost)site.GetService(typeof(IDesignerHost));
+				inTemplateMode = ((TemplatedControlDesigner)dh.GetDesigner(comp)).InTemplateMode;
+			}
+			if(inTemplateMode)
+			{
+				throw new NotImplementedException();
+			} else
+			{
+				retVal = base.EditComponent(context, obj, parent);
+			}
+			return retVal;
+		}
+
+		protected override int GetInitialComponentEditorPageIndex()
+		{
+			return initialPage;
+		}
+	}
+}

+ 26 - 0
mcs/class/System.Design/System.Web.UI.Design.WebControls/BaseDataListPageInternal.cs

@@ -0,0 +1,26 @@
+/**
+ * Namespace:   System.Web.UI.Design.WebControls
+ * Class:       BaseDataListPageInternal
+ *
+ * Author:      Gaurav Vaish
+ * Maintainer:  mastergaurav AT users DOT sf DOT net
+ *
+ * (C) Gaurav Vaish (2002)
+ */
+
+using System;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Web.UI.Design;
+using System.Windows.Forms.Design;
+using System.Web.UI.WebControls;
+
+namespace System.Web.UI.Design.WebControls
+{
+	abstract class BaseDataListPageInternal : ComponentEditorPage
+	{
+		public BaseDataListPageInternal() : base()
+		{
+		}
+	}
+}

+ 38 - 0
mcs/class/System.Design/System.Web.UI.Design.WebControls/BordersPageInternal.cs

@@ -0,0 +1,38 @@
+/**
+ * Namespace:   System.Web.UI.Design.WebControls
+ * Class:       BordersPageInternal
+ *
+ * Author:      Gaurav Vaish
+ * Maintainer:  mastergaurav AT users DOT sf DOT net
+ *
+ * (C) Gaurav Vaish (2002)
+ */
+
+using System;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Web.UI.Design;
+using System.Windows.Forms.Design;
+using System.Web.UI.WebControls;
+
+namespace System.Web.UI.Design.WebControls
+{
+	class BordersPageInternal : BaseDataListPageInternal
+	{
+		public BordersPageInternal() : base()
+		{
+		}
+
+		[MonoTODO]
+		protected override void LoadComponent()
+		{
+			throw new NotImplementedException();
+		}
+
+		[MonoTODO]
+		protected override void SaveComponent()
+		{
+			throw new NotImplementedException();
+		}
+	}
+}

+ 12 - 0
mcs/class/System.Design/System.Web.UI.Design.WebControls/ChangeLog

@@ -1,4 +1,16 @@
 
+2002-09-25     Gaurav Vaish <[email protected]>
+
+	* RegextEditorDialog.cs   : Added a few more methods.
+	* BaseDataListComponentEditor.cs
+	                          : Completed.
+	* DataListComponentEditor.cs
+	                          : Completed
+	* BaseDataListPageInternal.cs,
+	* GeneralPageDataListInternal.cs,
+	* FormatPageInternal.cs,
+	* BordersPageInternal.cs  : Added private classes. Initial implementation.
+
 2002-09-24     Gaurav Vaish <[email protected]>
 
 	* RegexTypeEditor.cs      : Completed

+ 50 - 0
mcs/class/System.Design/System.Web.UI.Design.WebControls/DataListComponentEditor.cs

@@ -0,0 +1,50 @@
+/**
+ * Namespace:   System.Web.UI.Design.WebControls
+ * Class:       DataListComponentEditor
+ *
+ * Author:      Gaurav Vaish
+ * Maintainer:  mastergaurav AT users DOT sf DOT net
+ *
+ * (C) Gaurav Vaish (2002)
+ */
+
+using System;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Web.UI.Design;
+using System.Windows.Forms.Design;
+using System.Web.UI.WebControls;
+
+namespace System.Web.UI.Design.WebControls
+{
+	public class DataListComponentEditor : BaseDataListComponentEditor
+	{
+		internal static int GENERAL = 0x00;
+		internal static int FORMAT  = 0x01;
+		internal static int BORDERS = 0x02;
+
+		private static Type[] componentEditorPages;
+
+		static DataListComponentEditor()
+		{
+			componentEditorPages = new Type[] {
+				typeof(GeneralPageDataListInternal),
+				typeof(FormatPageInternal),
+				typeof(BordersPageInternal)
+			};
+		}
+
+		public DataListComponentEditor() : base(GENERAL)
+		{
+		}
+		
+		public DataListComponentEditor(int initialPage) : base(initialPage)
+		{
+		}
+		
+		protected override Type[] GetComponentEditorPages()
+		{
+			return componentEditorPages;
+		}
+	}
+}

+ 38 - 0
mcs/class/System.Design/System.Web.UI.Design.WebControls/FormatPageInternal.cs

@@ -0,0 +1,38 @@
+/**
+ * Namespace:   System.Web.UI.Design.WebControls
+ * Class:       FormatPageInternal
+ *
+ * Author:      Gaurav Vaish
+ * Maintainer:  mastergaurav AT users DOT sf DOT net
+ *
+ * (C) Gaurav Vaish (2002)
+ */
+
+using System;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Web.UI.Design;
+using System.Windows.Forms.Design;
+using System.Web.UI.WebControls;
+
+namespace System.Web.UI.Design.WebControls
+{
+	class FormatPageInternal : BaseDataListPageInternal
+	{
+		public FormatPageInternal() : base()
+		{
+		}
+
+		[MonoTODO]
+		protected override void LoadComponent()
+		{
+			throw new NotImplementedException();
+		}
+
+		[MonoTODO]
+		protected override void SaveComponent()
+		{
+			throw new NotImplementedException();
+		}
+	}
+}

+ 38 - 0
mcs/class/System.Design/System.Web.UI.Design.WebControls/GeneralPageDataListInternal.cs

@@ -0,0 +1,38 @@
+/**
+ * Namespace:   System.Web.UI.Design.WebControls
+ * Class:       GeneralPageDataListInternal
+ *
+ * Author:      Gaurav Vaish
+ * Maintainer:  mastergaurav AT users DOT sf DOT net
+ *
+ * (C) Gaurav Vaish (2002)
+ */
+
+using System;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.Web.UI.Design;
+using System.Windows.Forms.Design;
+using System.Web.UI.WebControls;
+
+namespace System.Web.UI.Design.WebControls
+{
+	class GeneralPageDataListInternal : BaseDataListPageInternal
+	{
+		public GeneralPageDataListInternal() : base()
+		{
+		}
+
+		[MonoTODO]
+		protected override void LoadComponent()
+		{
+			throw new NotImplementedException();
+		}
+
+		[MonoTODO]
+		protected override void SaveComponent()
+		{
+			throw new NotImplementedException();
+		}
+	}
+}

+ 94 - 4
mcs/class/System.Design/System.Web.UI.Design.WebControls/RegexEditorDialog.cs

@@ -9,23 +9,78 @@
  */
 
 using System;
+using System.Drawing;
 using System.ComponentModel;
 using System.Windows.Forms;
+using System.Windows.Forms.Design;
 
 namespace System.Web.UI.Design.WebControls
 {
 	public class RegexEditorDialog : Form
 	{
-		private ISite site;
+		private ISite     site;
+		private Container components;
+		private bool      isActivated;
+		private bool      sVal;
 		private string regularExpression = String.Empty;
 
+		private Button   helpBtn;
+		private Button   testValBtn;
+		private Button   okBtn;
+		private Button   cancelBtn;
+
+		private Label    inputLabel;
+		private Label    testResultsLabel;
+		private Label    stdExprLabel;
+		private Label    exprLabel;
+
+		private ListBox  stdExprsList;
+
+		private TextBox  exprText;
+		private TextBox  sampleText;
+
+		private GroupBox exprGrp;
+
+		public RegexEditorDialog(ISite site) : base()
+		{
+			this.site        = site;
+			this.isActivated = false;
+			this.sVal        = false;
+
+			InitializeComponents();
+		}
+
 		[MonoTODO]
-		public RegexEditorDialog(ISite site)
+		private void InitializeComponents()
 		{
-			this.site = site;
+			components = new Container();
+
+			helpBtn    = new Button();
+			testValBtn = new Button();
+			okBtn      = new Button();
+			cancelBtn  = new Button();
+
+			inputLabel       = new Label();
+			testResultsLabel = new Label();
+			stdExprLabel     = new Label();
+			exprLabel        = new Label();
+
+			stdExprsList = new ListBox();
+
+			exprText   = new TextBox();
+			sampleText = new TextBox();
+
+			exprGrp = new GroupBox();
+
+			System.Drawing.Font cFont = System.Windows.Forms.Control.DefaultFont;
+			IUIService service = (IUIService)site.GetService(typeof(IUIService));
+			if(service != null)
+			{
+				cFont = (Font)(service.Styles["DialogFont"]);
+			}
 			throw new NotImplementedException();
 		}
-		
+
 		public string RegularExpression
 		{
 			get
@@ -37,5 +92,40 @@ namespace System.Web.UI.Design.WebControls
 				regularExpression = value;
 			}
 		}
+
+		protected override void Dispose(bool disposing)
+		{
+			if(disposing)
+			{
+				components.Dispose();
+			}
+			base.Dispose(disposing);
+		}
+
+		[MonoTODO]
+		private object[] CannedExpressions
+		{
+			get
+			{
+				throw new NotImplementedException();
+			}
+		}
+
+		private class CannedExpression
+		{
+			public string Description;
+			public string Expression;
+
+			public CannedExpression(string description, string expression)
+			{
+				Description = description;
+				Expression  = expression;
+			}
+
+			public override string ToString()
+			{
+				return Description;
+			}
+		}
 	}
 }