diff --git a/app/TaskFlow/frmFormDesigner.Designer.vb b/app/TaskFlow/frmFormDesigner.Designer.vb index da0d6a5..7cb4834 100644 --- a/app/TaskFlow/frmFormDesigner.Designer.vb +++ b/app/TaskFlow/frmFormDesigner.Designer.vb @@ -436,6 +436,7 @@ Partial Class frmFormDesigner Me.Controls.Add(Me.RibbonControl1) Me.IconOptions.Icon = CType(resources.GetObject("frmFormDesigner.IconOptions.Icon"), System.Drawing.Icon) Me.IconOptions.SvgImage = Global.taskFLOW.My.Resources.Resources.chartdesigner1 + Me.KeyPreview = True Me.MinimizeBox = False Me.Name = "frmFormDesigner" Me.Ribbon = Me.RibbonControl1 diff --git a/app/TaskFlow/frmFormDesigner.resx b/app/TaskFlow/frmFormDesigner.resx index a8bc1c4..eeca56d 100644 --- a/app/TaskFlow/frmFormDesigner.resx +++ b/app/TaskFlow/frmFormDesigner.resx @@ -125,6 +125,10 @@ 0, 132 + + + True + Fill @@ -134,7 +138,6 @@ 820, 455 - 1 @@ -142,7 +145,7 @@ pnldesigner - DigitalData.Controls.SnapPanel.ClassSnapPanel, DigitalData.Controls.SnapPanel, Version=1.0.1.0, Culture=neutral, PublicKeyToken=null + DigitalData.Controls.SnapPanel.ClassSnapPanel, DigitalData.Controls.SnapPanel, Version=2.0.1.0, Culture=neutral, PublicKeyToken=null SplitContainerDesigner.Panel1 @@ -197,7 +200,7 @@ - Control löschen + Control löschen (del) @@ -221,7 +224,7 @@ - Aktualisieren + Aktualisieren (F5) @@ -333,7 +336,7 @@ Linie - Breiter + Breiter (+) @@ -355,7 +358,7 @@ - Schmaler + Schmaler (-) @@ -377,7 +380,7 @@ - Größer + Größer (Strg und +) @@ -396,7 +399,7 @@ - Kleiner + Kleiner (Strg und -) @@ -1314,10 +1317,4 @@ DevExpress.XtraBars.Ribbon.RibbonForm, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a - - Steuerelement - - - Steuerelement hinzufügen - \ No newline at end of file diff --git a/app/TaskFlow/frmFormDesigner.vb b/app/TaskFlow/frmFormDesigner.vb index 95d4267..dbe68ce 100644 --- a/app/TaskFlow/frmFormDesigner.vb +++ b/app/TaskFlow/frmFormDesigner.vb @@ -403,25 +403,40 @@ Public Class frmFormDesigner MsgBox("Error while loading Column Configuration: " & vbCrLf & ex.Message, MsgBoxStyle.Critical) End Try End Sub - - - Sub DeleteControl(controlName As String) - Try - Dim result As MsgBoxResult = MsgBox("Wollen Sie das Control: " & controlName & " wirklich löschen?", MsgBoxStyle.YesNo, "Bestätigung:") + Sub Control_Delete() + If CurrentControl Is Nothing = False Then + Dim result As MsgBoxResult = MsgBox("Wollen Sie das Control: " & CurrentControl.Name & " wirklich löschen?", MsgBoxStyle.YesNo, "Bestätigung:") ' wenn Speichern ja If result = MsgBoxResult.Yes Then - Dim controlId As Integer = TBPM_PROFILE_CONTROLSTableAdapter.cmdGetGUID(ProfileId, controlName) - If controlId > 0 Then - TBPM_CONTROL_TABLETableAdapter.DeleteColumnsByControlId(controlId) - TBPM_PROFILE_CONTROLSTableAdapter.Delete(controlId) - LoadControls() - End If + DeleteControl(CurrentControl.Name) + 'pgControls.Enabled = False + pgControlsNew.Enabled = False + tslblAenderungen.Caption = $"Control {CurrentControl.Name} deleted - " + Now.ToString + CurrentControl = Nothing + RibPGCtrlheight.Enabled = False + RibPGCtrlWidth.Enabled = False + + Reload_ControlNameList() + + End If + + End If + End Sub + Sub DeleteControl(controlName As String) + Try + Dim controlId As Integer = TBPM_PROFILE_CONTROLSTableAdapter.cmdGetGUID(ProfileId, controlName) + If controlId > 0 Then + TBPM_CONTROL_TABLETableAdapter.DeleteColumnsByControlId(controlId) + TBPM_PROFILE_CONTROLSTableAdapter.Delete(controlId) + LoadControls() End If Catch ex As Exception _Logger.Error(ex) MsgBox(ex.Message, MsgBoxStyle.Critical, "DeleteControl:") End Try End Sub + + ' +++ Public Helper Methods +++ Public Function GetCursorPosition() As Point Return pnldesigner.PointToClient(Cursor.Position) @@ -1261,6 +1276,51 @@ Public Class frmFormDesigner End Sub Private Sub bbtniwidth_plus_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles bbtniwidth_plus.ItemClick + Width_Plus() + End Sub + + Private Sub bbtniwidth_min_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles bbtniwidth_min.ItemClick + Width_Min() + End Sub + + Private Sub bbtniheight_min_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles bbtniheight_min.ItemClick + Height_minus() + End Sub + + Private Sub bbtniheight_plus_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles bbtniheight_plus.ItemClick + Height_plus() + End Sub + + + Private Sub frmFormDesigner_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown + + If e.Control AndAlso (e.KeyCode = e.KeyCode.Add Or e.KeyCode = e.KeyCode.Oemplus) Then + Height_plus() + + ElseIf e.Control AndAlso (e.KeyCode = e.KeyCode.Subtract Or e.KeyCode = e.KeyCode.Oemplus) Then + Height_minus() + Else + Console.WriteLine("e.keycode: " + e.KeyCode.ToString) + If e.KeyCode = e.KeyCode.Delete Then + Control_Delete() + ElseIf e.KeyCode = e.KeyCode.F5 Then + LoadControls() + tslblAenderungen.Caption = "Controls loaded - " + Now.ToString + ElseIf e.KeyCode = Keys.Escape Then + If Me.Cursor = Cursors.Cross Then + Mouse_IsPressed = False + Me.Cursor = Cursors.Default + End If + ElseIf (e.KeyCode = e.KeyCode.Add Or e.KeyCode = e.KeyCode.Oemplus) Then + Width_Plus() + ElseIf (e.KeyCode = e.KeyCode.Subtract Or e.KeyCode = e.KeyCode.Oemplus) Then + Width_Min() + End If + End If + + + End Sub + Sub Width_Plus() If CurrentControl Is Nothing = False Then CurrentControl.Size = New Size(CurrentControl.Width + 5, CurrentControl.Height) DirectCast(pgControlsNew.SelectedObject, BaseProperties).Size = CurrentControl.Size @@ -1269,8 +1329,7 @@ Public Class frmFormDesigner UpdateSingleValue("WIDTH", CurrentControl.Size.Width) End If End Sub - - Private Sub bbtniwidth_min_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles bbtniwidth_min.ItemClick + Sub Width_Min() If CurrentControl Is Nothing = False Then Dim newWidth = CurrentControl.Width - 5 ' Verhindert, dass das Control unsichtbar wird @@ -1285,7 +1344,7 @@ Public Class frmFormDesigner End If End Sub - Private Sub bbtniheight_min_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles bbtniheight_min.ItemClick + Sub Height_minus() If CurrentControl Is Nothing = False Then Dim newHeight As Integer = CurrentControl.Height - 5 @@ -1307,7 +1366,7 @@ Public Class frmFormDesigner End If End Sub - Private Sub bbtniheight_plus_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles bbtniheight_plus.ItemClick + Sub Height_plus() If CurrentControl Is Nothing = False Then Dim newHeight As Integer = CurrentControl.Height + 5 @@ -1324,5 +1383,4 @@ Public Class frmFormDesigner End If End Sub - End Class \ No newline at end of file