Work on Editor

This commit is contained in:
Jonathan Jenne
2019-03-28 16:24:17 +01:00
parent 0eb1eeb287
commit 05f5e730e1
25 changed files with 503 additions and 198 deletions

View File

@@ -105,6 +105,8 @@ Public Class frmFormDesigner
End Sub
Private Async Sub frmFormDesigner_Load(sender As Object, e As EventArgs) Handles MyBase.Load
FormDesignerRibbon.SelectPage(RibbonPageFormDesigner)
_ControlLoader = New ControlLoader(My.LogConfig, LayoutControlGroupMain)
Dim oTable = Await My.Common.Views.VWICM_FORM_CONTROL(_FormId)
@@ -117,31 +119,78 @@ Public Class frmFormDesigner
End Function
Private Sub LayoutControlMain_ItemSelectionChanged(sender As Object, e As EventArgs) Handles LayoutControlMain.ItemSelectionChanged
' TODO: Load Property Grid for selected item
' only layout control items have properties
If TypeOf sender IsNot LayoutControlItem Then
Exit Sub
End If
Dim oLayoutItem As LayoutControlItem = DirectCast(sender, LayoutControlItem)
Dim oSelectedControl As BaseEdit = oLayoutItem.Control
Dim oMetadata As Metadata = oSelectedControl.Tag
Dim oMetadata As Metadata
' Don't load properties for layout items like splitters, separators, etc.
If oLayoutItem.Control Is Nothing Then
Exit Sub
End If
oMetadata = oSelectedControl.Tag
Select Case oSelectedControl.GetType
Case GetType(MemoEdit)
PropertyGridControlMain.SelectedObject = New MemoeditProperties() With {
.Id = oMetadata.Id,
.Name = oMetadata.Caption
}
Case GetType(TextEdit)
PropertyGridControlMain.SelectedObject = New TextboxProperties() With {
.Id = oMetadata.Id,
.Name = oMetadata.Caption
}
Case GetType(LookupControl2)
PropertyGridControlMain.SelectedObject = New ComboboxProperties() With {
.Datasource = New DatasourceType,
.Id = oMetadata.Id
.Id = oMetadata.Id,
.Name = oMetadata.Caption
}
Case GetType(DateEdit)
PropertyGridControlMain.SelectedObject = New DatepickerProperties() With {
.Id = oMetadata.Id,
.Name = oMetadata.Caption
}
Case GetType(CheckEdit)
PropertyGridControlMain.SelectedObject = New CheckboxProperties() With {
.Id = oMetadata.Id,
.Name = oMetadata.Caption
}
End Select
End Sub
Private Sub BarCheckEditLayout_CheckedChanged(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarCheckEditLayout.CheckedChanged
If BarCheckEditLayout.Checked Then
LayoutControlMain.ShowCustomizationForm()
Else
LayoutControlMain.HideCustomizationForm()
XtraTabPageProperties.PageEnabled = True
XtraTabPageControls.PageEnabled = False
XtraTabControlMain.SelectedTabPage = XtraTabPageProperties
End If
End Sub
Private Sub BarCheckEditControls_CheckedChanged(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarCheckEditControls.CheckedChanged
If BarCheckEditControls.Checked Then
LayoutControlMain.HideCustomizationForm()
XtraTabPageProperties.PageEnabled = False
XtraTabPageControls.PageEnabled = True
XtraTabControlMain.SelectedTabPage = XtraTabPageControls
End If
End Sub
Private Sub LayoutControlMain_HideCustomization(sender As Object, e As EventArgs) Handles LayoutControlMain.HideCustomization
BarCheckEditControls.Checked = True
End Sub
Private Sub LayoutControlMain_ShowCustomization(sender As Object, e As EventArgs) Handles LayoutControlMain.ShowCustomization
BarCheckEditLayout.Checked = True
End Sub
End Class