ZooFlow: Small fixes for FlowForm, Save Location on Form Move and Resize

This commit is contained in:
Jonathan Jenne
2020-11-18 16:28:08 +01:00
parent f9c7761474
commit 148092eb23
3 changed files with 51 additions and 54 deletions

View File

@@ -2,6 +2,7 @@
Imports DevExpress.XtraSplashScreen
Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.Messaging
Imports DigitalData.GUIs.ClipboardWatcher
Public Class frmFlowForm
' Constants
@@ -11,10 +12,14 @@ Public Class frmFlowForm
Private ActiveModules As List(Of String)
Private Logger As Logger
Private Init As ClassInit
Private DTIDB_SEARCHES As DataTable
Private CLSFileDrop As ClassFileDrop
Private clsFilehandle As ClassFilehandle
' Helper Classes
Private Init As ClassInit
Private FileDrop As ClassFileDrop
Private FileHandle As ClassFilehandle
Private ProfileFilter As ProfileFilter
' Runtime Flags
Private ApplicationLoading As Boolean = True
Private IDBSearchActive As Boolean = False
@@ -26,6 +31,7 @@ Public Class frmFlowForm
' Events
Public Event ClipboardChanged As EventHandler(Of IDataObject)
Private WithEvents Watcher As ClassClipboardWatcher = ClassClipboardWatcher.Singleton
Public Sub New()
' Dieser Aufruf ist für den Designer erforderlich.
@@ -44,8 +50,9 @@ Public Class frmFlowForm
' === Initialization ===
Init = New ClassInit(My.LogConfig, Me)
CLSFileDrop = New ClassFileDrop(My.LogConfig)
clsFilehandle = New ClassFilehandle(My.LogConfig)
FileDrop = New ClassFileDrop(My.LogConfig)
FileHandle = New ClassFilehandle(My.LogConfig)
AddHandler Init.Completed, AddressOf Init_Completed
Init.InitializeApplication()
End Sub
@@ -59,9 +66,6 @@ Public Class frmFlowForm
AddHandler TimerRefreshData.Tick, AddressOf TimerRefreshData_Tick
TimerRefreshData.Enabled = True
' === Setup Flow Form ===
Location = My.UIConfig.FlowForm.Location
' === Register As Event Listener ===
EventBus.Instance.Register(Me)
@@ -82,7 +86,7 @@ Public Class frmFlowForm
Next
' TODO: Clean up
Dim oSQL = $"SELECT * FROM [dbo].[FNIDB_GET_SEARCH_PROFILES] ({My.Application.User.UserId},'{My.Application.User.Language}')"
Dim oSQL = My.Queries.Common.FNIDB_GET_SEARCH_PROFILES(My.Application.User.UserId, My.Application.User.Language)
Dim oDatatable As DataTable = My.DatabaseIDB.GetDatatable(oSQL)
PictureBoxSearch.Visible = False
@@ -100,15 +104,15 @@ Public Class frmFlowForm
'TODO: Refresh Data
End Sub
Private Sub frmFlowForm_MouseLeave(sender As Object, e As EventArgs)
Private Sub frmFlowForm_MouseLeave(sender As Object, e As EventArgs) Handles MyBase.MouseLeave
Opacity = OPACITY_HIDDEN
End Sub
Private Sub frmFlowForm_MouseEnter(sender As Object, e As EventArgs) Handles Me.MouseEnter, MyBase.MouseLeave
Private Sub frmFlowForm_MouseEnter(sender As Object, e As EventArgs) Handles Me.MouseEnter
Opacity = OPACITY_SHOWN
End Sub
Private Sub frmFlowForm_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs) Handles Me.MouseMove, PictureBox1.MouseMove
Private Sub frmFlowForm_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs) Handles Me.MouseMove, PictureBoxDragDrop.MouseMove
If e.Button = MouseButtons.Left Then
ClassWin32.ReleaseCapture()
ClassWin32.SendMessage(Handle, ClassWin32.WM_NCLBUTTONDOWN, ClassWin32.HTCAPTION, 0)
@@ -130,13 +134,8 @@ Public Class frmFlowForm
End Sub
Sub ExitZooflow()
Dim oResult As DialogResult = MessageBox.Show("Exit Zooflow", "Please Varify", MessageBoxButtons.YesNo)
Dim oResult As DialogResult = MessageBox.Show("Exit Zooflow", "Are you sure you want to close ZooFlow", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If oResult = DialogResult.Yes Then
' Save Settings
My.UIConfig.FlowForm.Location = Location
My.UIConfigManager.Save()
' Exit
Application.Exit()
Else
ESCHitCount = 0
@@ -192,7 +191,7 @@ Public Class frmFlowForm
End Sub
Private Sub frmFlowForm_DragEnter(sender As Object, e As DragEventArgs) Handles MyBase.DragEnter
PictureBox1.Image = My.Resources._1_LOGO_ZOO_FLOW_DROP3
PictureBoxDragDrop.Image = My.Resources._1_LOGO_ZOO_FLOW_DROP3
e.Effect = DragDropEffects.Copy
Drag_Enter(sender, e)
@@ -203,7 +202,7 @@ Public Class frmFlowForm
End Sub
Private Sub frmFlowForm_DragLeave(sender As Object, e As EventArgs) Handles Me.DragLeave
PictureBox1.Image = My.Resources._1_LOGO_ZOO_FLOW1
PictureBoxDragDrop.Image = My.Resources._1_LOGO_ZOO_FLOW1
End Sub
Private Sub PictureBoxAbo_MouseEnter(sender As Object, e As EventArgs) Handles PictureBoxAbo.MouseEnter
@@ -220,7 +219,7 @@ Public Class frmFlowForm
Cursor = Cursors.Default
Exit Sub
End If
Dim oForm2 As New frmPreSearch()
Dim oForm2 As New frmSearchPredefined()
oForm2.Show()
Cursor = Cursors.Default
End Sub
@@ -247,10 +246,6 @@ Public Class frmFlowForm
TimerCheckActiveForms.Enabled = False
End Function
Private Sub UserKonfigurationToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles UserKonfigurationToolStripMenuItem.Click
End Sub
Private Sub DatenbankverbindungToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles DatenbankverbindungToolStripMenuItem.Click
frmConfigDatabase.ShowDialog()
End Sub
@@ -267,7 +262,7 @@ Public Class frmFlowForm
End If
End Sub
Private Sub PictureBox1_DragEnter(sender As Object, e As DragEventArgs) Handles PictureBox1.DragEnter
Private Sub PictureBox1_DragEnter(sender As Object, e As DragEventArgs) Handles PictureBoxDragDrop.DragEnter
Drag_Enter(sender, e)
End Sub
Sub Drag_Enter(sender As Object, e As DragEventArgs)
@@ -296,12 +291,14 @@ Public Class frmFlowForm
'Erstmal alles löschen
My.Database.ExecuteNonQuery("DELETE FROM TBGI_FILES_USER WHERE UPPER(USER@WORK) = UPPER('" & Environment.UserName & "')")
If CLSFileDrop.Drop_File(e) = True Then
If FileDrop.Drop_File(e) = True Then
TimerCheckDroppedFiles.Start()
End If
PictureBoxDragDrop.Image = My.Resources._1_LOGO_ZOO_FLOW1
End Sub
Private Sub PictureBox1_DragDrop(sender As Object, e As DragEventArgs) Handles PictureBox1.DragDrop
Private Sub PictureBox1_DragDrop(sender As Object, e As DragEventArgs) Handles PictureBoxDragDrop.DragDrop
DragDropForm(e)
End Sub
@@ -319,7 +316,7 @@ Public Class frmFlowForm
Dim handleType As String = Str.Substring(0, Str.LastIndexOf("|") + 1)
Dim filename As String = Str.Substring(Str.LastIndexOf("|") + 1)
If My.Application.Globix.FileExistsinDropTable(filename) = False Then
clsFilehandle.Decide_FileHandle(filename, handleType)
FileHandle.Decide_FileHandle(filename, handleType)
i += 1
Else
' Console.WriteLine("File gibt es bereits")
@@ -366,9 +363,6 @@ Public Class frmFlowForm
End Sub
Sub Globix_Open_IndexDialog()
Try
'Hide()
IndexForm = New frmGlobix_Index(My.LogConfig)
IndexForm.Show()
Cursor = Cursors.Default
@@ -378,8 +372,11 @@ Public Class frmFlowForm
Catch ex As Exception
Logger.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical)
Finally
' Show()
End Try
End Sub
Private Sub frmFlowForm_ResizeEnd(sender As Object, e As EventArgs) Handles Me.ResizeEnd
My.UIConfig.FlowForm.Location = Location
My.UIConfigManager.Save()
End Sub
End Class