EDMI: New Form Designer

This commit is contained in:
Jonathan Jenne
2019-03-14 17:00:39 +01:00
parent 62d04a8c21
commit 3312ebc569
8 changed files with 412 additions and 14 deletions

View File

@@ -59,7 +59,7 @@ Partial Class frmEntityDesigner
Me.PanelMain.Location = New System.Drawing.Point(0, 0)
Me.PanelMain.Name = "PanelMain"
Me.PanelMain.ShowGrid = True
Me.PanelMain.Size = New System.Drawing.Size(564, 283)
Me.PanelMain.Size = New System.Drawing.Size(808, 458)
Me.PanelMain.TabIndex = 0
'
'TabControlMain
@@ -68,7 +68,7 @@ Partial Class frmEntityDesigner
Me.TabControlMain.Location = New System.Drawing.Point(0, 0)
Me.TabControlMain.Name = "TabControlMain"
Me.TabControlMain.SelectedTabPage = Me.TabPageControls
Me.TabControlMain.Size = New System.Drawing.Size(224, 283)
Me.TabControlMain.Size = New System.Drawing.Size(224, 458)
Me.TabControlMain.TabIndex = 0
Me.TabControlMain.TabPages.AddRange(New DevExpress.XtraTab.XtraTabPage() {Me.TabPageControls, Me.TabPageProperties})
'
@@ -79,7 +79,7 @@ Partial Class frmEntityDesigner
Me.TabPageControls.Controls.Add(Me.btnTextbox)
Me.TabPageControls.Controls.Add(Me.btnLabel)
Me.TabPageControls.Name = "TabPageControls"
Me.TabPageControls.Size = New System.Drawing.Size(222, 258)
Me.TabPageControls.Size = New System.Drawing.Size(222, 433)
Me.TabPageControls.Text = "Controls"
'
'Label1
@@ -143,7 +143,7 @@ Partial Class frmEntityDesigner
Me.SplitContainerControlMain.Panel1.Text = "Panel1"
Me.SplitContainerControlMain.Panel2.Controls.Add(Me.TabControlMain)
Me.SplitContainerControlMain.Panel2.Text = "Panel2"
Me.SplitContainerControlMain.Size = New System.Drawing.Size(800, 283)
Me.SplitContainerControlMain.Size = New System.Drawing.Size(1044, 458)
Me.SplitContainerControlMain.SplitterPosition = 224
Me.SplitContainerControlMain.TabIndex = 1
Me.SplitContainerControlMain.Text = "SplitContainerControl1"
@@ -157,7 +157,7 @@ Partial Class frmEntityDesigner
Me.RibbonControl1.Name = "RibbonControl1"
Me.RibbonControl1.PageCategories.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageCategory() {Me.RibbonPageCategory1})
Me.RibbonControl1.ShowApplicationButton = DevExpress.Utils.DefaultBoolean.[False]
Me.RibbonControl1.Size = New System.Drawing.Size(800, 146)
Me.RibbonControl1.Size = New System.Drawing.Size(1044, 146)
Me.RibbonControl1.StatusBar = Me.RibbonStatusBar1
'
'BarButtonItem1
@@ -188,10 +188,10 @@ Partial Class frmEntityDesigner
'
'RibbonStatusBar1
'
Me.RibbonStatusBar1.Location = New System.Drawing.Point(0, 429)
Me.RibbonStatusBar1.Location = New System.Drawing.Point(0, 604)
Me.RibbonStatusBar1.Name = "RibbonStatusBar1"
Me.RibbonStatusBar1.Ribbon = Me.RibbonControl1
Me.RibbonStatusBar1.Size = New System.Drawing.Size(800, 21)
Me.RibbonStatusBar1.Size = New System.Drawing.Size(1044, 21)
'
'RibbonPage2
'
@@ -202,7 +202,7 @@ Partial Class frmEntityDesigner
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(800, 450)
Me.ClientSize = New System.Drawing.Size(1044, 625)
Me.Controls.Add(Me.SplitContainerControlMain)
Me.Controls.Add(Me.RibbonStatusBar1)
Me.Controls.Add(Me.RibbonControl1)

View File

@@ -0,0 +1,158 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmFormDesigner
Inherits BaseRibbonForm
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Me.RibbonControl = New DevExpress.XtraBars.Ribbon.RibbonControl()
Me.RibbonPage1 = New DevExpress.XtraBars.Ribbon.RibbonPage()
Me.RibbonStatusBar = New DevExpress.XtraBars.Ribbon.RibbonStatusBar()
Me.LayoutControlMain = New DevExpress.XtraLayout.LayoutControl()
Me.LayoutControlGroupMain = New DevExpress.XtraLayout.LayoutControlGroup()
Me.ToolboxControl1 = New DevExpress.XtraToolbox.ToolboxControl()
Me.ToolboxGroup1 = New DevExpress.XtraToolbox.ToolboxGroup()
Me.ToolboxItemTextbox = New DevExpress.XtraToolbox.ToolboxItem()
Me.ToolboxItemMemo = New DevExpress.XtraToolbox.ToolboxItem()
Me.RibbonPageGroup1 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup()
Me.ToolboxItem1 = New DevExpress.XtraToolbox.ToolboxItem()
CType(Me.RibbonControl, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.LayoutControlMain, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.LayoutControlGroupMain, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'RibbonControl
'
Me.RibbonControl.ExpandCollapseItem.Id = 0
Me.RibbonControl.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl.ExpandCollapseItem})
Me.RibbonControl.Location = New System.Drawing.Point(0, 0)
Me.RibbonControl.MaxItemId = 1
Me.RibbonControl.Name = "RibbonControl"
Me.RibbonControl.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPage1})
Me.RibbonControl.Size = New System.Drawing.Size(870, 146)
Me.RibbonControl.StatusBar = Me.RibbonStatusBar
'
'RibbonPage1
'
Me.RibbonPage1.Name = "RibbonPage1"
Me.RibbonPage1.Text = "RibbonPage1"
'
'RibbonStatusBar
'
Me.RibbonStatusBar.Location = New System.Drawing.Point(0, 508)
Me.RibbonStatusBar.Name = "RibbonStatusBar"
Me.RibbonStatusBar.Ribbon = Me.RibbonControl
Me.RibbonStatusBar.Size = New System.Drawing.Size(870, 21)
'
'LayoutControlMain
'
Me.LayoutControlMain.BackColor = System.Drawing.Color.FromArgb(CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer))
Me.LayoutControlMain.Dock = System.Windows.Forms.DockStyle.Fill
Me.LayoutControlMain.Location = New System.Drawing.Point(0, 146)
Me.LayoutControlMain.Name = "LayoutControlMain"
Me.LayoutControlMain.Root = Me.LayoutControlGroupMain
Me.LayoutControlMain.Size = New System.Drawing.Size(658, 362)
Me.LayoutControlMain.TabIndex = 2
Me.LayoutControlMain.Text = "LayoutControl1"
'
'LayoutControlGroupMain
'
Me.LayoutControlGroupMain.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.[True]
Me.LayoutControlGroupMain.GroupBordersVisible = False
Me.LayoutControlGroupMain.Name = "LayoutControlGroupMain"
Me.LayoutControlGroupMain.Size = New System.Drawing.Size(658, 362)
Me.LayoutControlGroupMain.TextVisible = False
'
'ToolboxControl1
'
Me.ToolboxControl1.Caption = "Form Controls"
Me.ToolboxControl1.Dock = System.Windows.Forms.DockStyle.Right
Me.ToolboxControl1.Groups.Add(Me.ToolboxGroup1)
Me.ToolboxControl1.Location = New System.Drawing.Point(658, 146)
Me.ToolboxControl1.Name = "ToolboxControl1"
Me.ToolboxControl1.OptionsView.ShowMenuButton = False
Me.ToolboxControl1.OptionsView.ShowToolboxCaption = True
Me.ToolboxControl1.Size = New System.Drawing.Size(212, 362)
Me.ToolboxControl1.TabIndex = 4
Me.ToolboxControl1.Text = "Form Controls"
'
'ToolboxGroup1
'
Me.ToolboxGroup1.BeginGroupCaption = ""
Me.ToolboxGroup1.Caption = "ToolboxGroup1"
Me.ToolboxGroup1.Items.Add(Me.ToolboxItemTextbox)
Me.ToolboxGroup1.Items.Add(Me.ToolboxItemMemo)
Me.ToolboxGroup1.Items.Add(Me.ToolboxItem1)
Me.ToolboxGroup1.Name = "ToolboxGroup1"
'
'ToolboxItemTextbox
'
Me.ToolboxItemTextbox.BeginGroupCaption = Nothing
Me.ToolboxItemTextbox.Caption = "Textbox"
Me.ToolboxItemTextbox.Name = "ToolboxItemTextbox"
'
'ToolboxItemMemo
'
Me.ToolboxItemMemo.BeginGroupCaption = Nothing
Me.ToolboxItemMemo.Caption = "Multiline Textbox"
Me.ToolboxItemMemo.Name = "ToolboxItemMemo"
'
'RibbonPageGroup1
'
Me.RibbonPageGroup1.Name = "RibbonPageGroup1"
Me.RibbonPageGroup1.Text = "RibbonPageGroup1"
'
'ToolboxItem1
'
Me.ToolboxItem1.BeginGroupCaption = Nothing
Me.ToolboxItem1.Caption = "ToolboxItem1"
Me.ToolboxItem1.Name = "ToolboxItem1"
'
'frmFormDesigner
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(870, 529)
Me.Controls.Add(Me.LayoutControlMain)
Me.Controls.Add(Me.ToolboxControl1)
Me.Controls.Add(Me.RibbonStatusBar)
Me.Controls.Add(Me.RibbonControl)
Me.Name = "frmFormDesigner"
Me.Ribbon = Me.RibbonControl
Me.StatusBar = Me.RibbonStatusBar
Me.Text = "frmFormDesigner"
CType(Me.RibbonControl, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.LayoutControlMain, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.LayoutControlGroupMain, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents RibbonControl As DevExpress.XtraBars.Ribbon.RibbonControl
Friend WithEvents RibbonPage1 As DevExpress.XtraBars.Ribbon.RibbonPage
Friend WithEvents RibbonStatusBar As DevExpress.XtraBars.Ribbon.RibbonStatusBar
Friend WithEvents LayoutControlMain As DevExpress.XtraLayout.LayoutControl
Friend WithEvents LayoutControlGroupMain As DevExpress.XtraLayout.LayoutControlGroup
Friend WithEvents ToolboxControl1 As DevExpress.XtraToolbox.ToolboxControl
Friend WithEvents RibbonPageGroup1 As DevExpress.XtraBars.Ribbon.RibbonPageGroup
Friend WithEvents ToolboxGroup1 As DevExpress.XtraToolbox.ToolboxGroup
Friend WithEvents ToolboxItemTextbox As DevExpress.XtraToolbox.ToolboxItem
Friend WithEvents ToolboxItemMemo As DevExpress.XtraToolbox.ToolboxItem
Friend WithEvents ToolboxItem1 As DevExpress.XtraToolbox.ToolboxItem
End Class

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,68 @@
Imports DevExpress.XtraEditors
Imports DevExpress.XtraLayout
Public Class frmFormDesigner
Private Const CONTROL_TEXTEDIT = "TextBox"
Private Const CONTROL_MEMOEDIT = "Memoedit"
Private Const CONTROL_COMBOEDIT = "Combobox"
Private Const CONTROL_CHECKEDIT = "Checkbox"
Private Const CONTROL_RADIOEDIT = "Radiobutton"
Private Const CONTROL_DATEEDIT = "Datepicker"
Private Sub frmFormDesigner_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim oFormId As Int64 = 104
My.Channel.CreateDatabaseRequest("Load Controls", True)
Dim oSQL As String = $"SELECT * FROM VWICM_FORMCONTROL WHERE FORMID = {oFormId}"
Dim oResult = My.Channel.ReturnDatatable(oSQL)
Dim oTable = oResult.Table
If Not oResult.OK Then
ShowErrorMessage(New ApplicationException(oResult.ErrorMessage))
End If
My.Channel.CloseDatabaseRequest()
LoadControls(oTable)
End Sub
Private Sub LoadControls(Datatable As DataTable)
For Each oRow As DataRow In Datatable.Rows
Dim oEditor As BaseEdit = Nothing
Dim oCaption As String = oRow.Item("COLNAME")
Dim oControlType As String = oRow.Item("CTRLTYPE")
Dim oControlId As String = oRow.Item("RECORD_ID").ToString
Select Case oControlType
Case CONTROL_TEXTEDIT
Dim oTextEdit As New TextEdit() With {.Name = oControlId}
oEditor = oTextEdit
Case CONTROL_MEMOEDIT
Dim oMemoEdit As New MemoEdit() With {.Name = oControlId}
oEditor = oMemoEdit
Case CONTROL_DATEEDIT
Dim oDateEdit As New DateEdit() With {.Name = oControlId}
oEditor = oDateEdit
Case CONTROL_CHECKEDIT
Dim oCheckEdit As New CheckEdit() With {.Name = oControlId}
oEditor = oCheckEdit
Case CONTROL_COMBOEDIT
Dim oComboEdit As New ComboBoxEdit() With {.Name = oControlId}
oEditor = oComboEdit
Case Else
End Select
If oEditor Is Nothing Then
Continue For
End If
LayoutControlGroupMain.AddItem(oCaption, oEditor)
Next
LayoutControlGroupMain.AddItem(New EmptySpaceItem())
End Sub
End Class