From 148092eb23501307ba789704d6dcad1e32c0fb2b Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Wed, 18 Nov 2020 16:28:08 +0100 Subject: [PATCH] ZooFlow: Small fixes for FlowForm, Save Location on Form Move and Resize --- GUIs.ZooFlow/frmFlowForm.Designer.vb | 35 ++++++++------- GUIs.ZooFlow/frmFlowForm.resx | 5 +-- GUIs.ZooFlow/frmFlowForm.vb | 65 +++++++++++++--------------- 3 files changed, 51 insertions(+), 54 deletions(-) diff --git a/GUIs.ZooFlow/frmFlowForm.Designer.vb b/GUIs.ZooFlow/frmFlowForm.Designer.vb index 5924ecb7..e1fa02ab 100644 --- a/GUIs.ZooFlow/frmFlowForm.Designer.vb +++ b/GUIs.ZooFlow/frmFlowForm.Designer.vb @@ -37,7 +37,7 @@ Partial Class frmFlowForm Me.AlleAnzeigenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.TimerRefreshData = New System.Windows.Forms.Timer(Me.components) Me.PictureBoxAbo = New System.Windows.Forms.PictureBox() - Me.PictureBox1 = New System.Windows.Forms.PictureBox() + Me.PictureBoxDragDrop = New System.Windows.Forms.PictureBox() Me.PictureBoxGlobix = New System.Windows.Forms.PictureBox() Me.PictureBoxPM = New System.Windows.Forms.PictureBox() Me.PictureBoxSearch = New System.Windows.Forms.PictureBox() @@ -47,7 +47,7 @@ Partial Class frmFlowForm Me.ContextMenuSystray.SuspendLayout() Me.ContextMenuForm.SuspendLayout() CType(Me.PictureBoxAbo, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.PictureBoxDragDrop, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.PictureBoxGlobix, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.PictureBoxPM, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.PictureBoxSearch, System.ComponentModel.ISupportInitialize).BeginInit() @@ -121,28 +121,30 @@ Partial Class frmFlowForm ' 'PictureBoxAbo ' + Me.PictureBoxAbo.Cursor = System.Windows.Forms.Cursors.Hand Me.PictureBoxAbo.Image = Global.DigitalData.GUIs.ZooFlow.My.Resources.Resources._2_ZOO_FLOW_Abo - Me.PictureBoxAbo.Location = New System.Drawing.Point(203, 69) + Me.PictureBoxAbo.Location = New System.Drawing.Point(209, 75) Me.PictureBoxAbo.Name = "PictureBoxAbo" Me.PictureBoxAbo.Size = New System.Drawing.Size(40, 36) Me.PictureBoxAbo.TabIndex = 11 Me.PictureBoxAbo.TabStop = False Me.ToolTip1.SetToolTip(Me.PictureBoxAbo, "Abonnierte Suchen") ' - 'PictureBox1 + 'PictureBoxDragDrop ' - Me.PictureBox1.Dock = System.Windows.Forms.DockStyle.Left - Me.PictureBox1.Image = Global.DigitalData.GUIs.ZooFlow.My.Resources.Resources._1_LOGO_ZOO_FLOW - Me.PictureBox1.Location = New System.Drawing.Point(0, 0) - Me.PictureBox1.Name = "PictureBox1" - Me.PictureBox1.Size = New System.Drawing.Size(197, 150) - Me.PictureBox1.TabIndex = 10 - Me.PictureBox1.TabStop = False - Me.ToolTip1.SetToolTip(Me.PictureBox1, "Drag and Drop files here") + Me.PictureBoxDragDrop.Dock = System.Windows.Forms.DockStyle.Left + Me.PictureBoxDragDrop.Image = Global.DigitalData.GUIs.ZooFlow.My.Resources.Resources._1_LOGO_ZOO_FLOW + Me.PictureBoxDragDrop.Location = New System.Drawing.Point(0, 0) + Me.PictureBoxDragDrop.Name = "PictureBoxDragDrop" + Me.PictureBoxDragDrop.Size = New System.Drawing.Size(197, 150) + Me.PictureBoxDragDrop.TabIndex = 10 + Me.PictureBoxDragDrop.TabStop = False + Me.ToolTip1.SetToolTip(Me.PictureBoxDragDrop, "Drag and Drop files here") ' 'PictureBoxGlobix ' Me.PictureBoxGlobix.BackColor = System.Drawing.Color.Transparent + Me.PictureBoxGlobix.Cursor = System.Windows.Forms.Cursors.Hand Me.PictureBoxGlobix.Image = CType(resources.GetObject("PictureBoxGlobix.Image"), System.Drawing.Image) Me.PictureBoxGlobix.Location = New System.Drawing.Point(448, 23) Me.PictureBoxGlobix.Name = "PictureBoxGlobix" @@ -155,6 +157,7 @@ Partial Class frmFlowForm 'PictureBoxPM ' Me.PictureBoxPM.BackColor = System.Drawing.Color.Transparent + Me.PictureBoxPM.Cursor = System.Windows.Forms.Cursors.Hand Me.PictureBoxPM.Image = CType(resources.GetObject("PictureBoxPM.Image"), System.Drawing.Image) Me.PictureBoxPM.Location = New System.Drawing.Point(335, 23) Me.PictureBoxPM.Name = "PictureBoxPM" @@ -168,6 +171,7 @@ Partial Class frmFlowForm 'PictureBoxSearch ' Me.PictureBoxSearch.BackColor = System.Drawing.Color.Transparent + Me.PictureBoxSearch.Cursor = System.Windows.Forms.Cursors.Hand Me.PictureBoxSearch.Image = CType(resources.GetObject("PictureBoxSearch.Image"), System.Drawing.Image) Me.PictureBoxSearch.Location = New System.Drawing.Point(220, 23) Me.PictureBoxSearch.Name = "PictureBoxSearch" @@ -198,12 +202,11 @@ Partial Class frmFlowForm Me.ClientSize = New System.Drawing.Size(577, 150) Me.ContextMenuStrip = Me.ContextMenuForm Me.Controls.Add(Me.PictureBoxAbo) - Me.Controls.Add(Me.PictureBox1) + Me.Controls.Add(Me.PictureBoxDragDrop) Me.Controls.Add(Me.PictureBoxGlobix) Me.Controls.Add(Me.PictureBoxPM) Me.Controls.Add(Me.PictureBoxSearch) Me.DoubleBuffered = True - Me.Font = New System.Drawing.Font("Tahoma", 8.25!) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None Me.Name = "frmFlowForm" Me.Text = "frmFlowForm_Test1" @@ -211,7 +214,7 @@ Partial Class frmFlowForm Me.ContextMenuSystray.ResumeLayout(False) Me.ContextMenuForm.ResumeLayout(False) CType(Me.PictureBoxAbo, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.PictureBoxDragDrop, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.PictureBoxGlobix, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.PictureBoxPM, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.PictureBoxSearch, System.ComponentModel.ISupportInitialize).EndInit() @@ -227,7 +230,7 @@ Partial Class frmFlowForm Friend WithEvents ZooFlowBeendenToolStripMenuItem As ToolStripMenuItem Friend WithEvents ContextMenuForm As ContextMenuStrip Friend WithEvents AlleAnzeigenToolStripMenuItem As ToolStripMenuItem - Friend WithEvents PictureBox1 As PictureBox + Friend WithEvents PictureBoxDragDrop As PictureBox Friend WithEvents TimerRefreshData As Timer Friend WithEvents PictureBoxAbo As PictureBox Friend WithEvents ToolTip1 As ToolTip diff --git a/GUIs.ZooFlow/frmFlowForm.resx b/GUIs.ZooFlow/frmFlowForm.resx index 1b32040c..118ec9e7 100644 --- a/GUIs.ZooFlow/frmFlowForm.resx +++ b/GUIs.ZooFlow/frmFlowForm.resx @@ -2040,13 +2040,10 @@ iTozEYp40EgT8aCRIsXWP0j108YYpYdeAAAAAElFTkSuQmCC - - 764, 17 - 863, 17 - 17, 56 + 1045, 17 \ No newline at end of file diff --git a/GUIs.ZooFlow/frmFlowForm.vb b/GUIs.ZooFlow/frmFlowForm.vb index 6d1396d9..ff866c40 100644 --- a/GUIs.ZooFlow/frmFlowForm.vb +++ b/GUIs.ZooFlow/frmFlowForm.vb @@ -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 \ No newline at end of file