From 9bfd7f9213d40905620bb7eca46988f9ef057627 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Wed, 11 Nov 2020 17:02:04 +0100 Subject: [PATCH 1/2] move window on drop zone also --- GUIs.ZooFlow/frmFlowForm.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GUIs.ZooFlow/frmFlowForm.vb b/GUIs.ZooFlow/frmFlowForm.vb index 07ad53d7..f73d82ba 100644 --- a/GUIs.ZooFlow/frmFlowForm.vb +++ b/GUIs.ZooFlow/frmFlowForm.vb @@ -103,7 +103,7 @@ Public Class frmFlowForm Opacity = OPACITY_SHOWN End Sub - Private Sub frmFlowForm_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs) Handles Me.MouseMove + Private Sub frmFlowForm_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs) Handles Me.MouseMove, PictureBox1.MouseMove If e.Button = MouseButtons.Left Then ClassWin32.ReleaseCapture() ClassWin32.SendMessage(Handle, ClassWin32.WM_NCLBUTTONDOWN, ClassWin32.HTCAPTION, 0) From 2c9917bbf5de0d47423ffe575c8cbaeec58895e0 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Wed, 11 Nov 2020 17:02:31 +0100 Subject: [PATCH 2/2] position result window below search --- .../frmDocumentResultList.vb | 19 +++++++++--------- GUIs.ZooFlow/frmSearchStart.vb | 20 +++++++++++++++++++ 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/GUIs.Common/DocumentResultList/frmDocumentResultList.vb b/GUIs.Common/DocumentResultList/frmDocumentResultList.vb index aecd81c5..e26393b7 100644 --- a/GUIs.Common/DocumentResultList/frmDocumentResultList.vb +++ b/GUIs.Common/DocumentResultList/frmDocumentResultList.vb @@ -62,18 +62,19 @@ Public Class frmDocumentResultList SplitContainerControl2.SplitterPosition = _Config.Config.SplitContainer2Distance SwitchDetailContainerHorizontal.Checked = _Config.Config.SplitContainer2Horizontal - If Utils.IsVisibleOnAnyScreen(_Config.Config.WindowLocation) Then - If Utils.LocationIsVisible(_Config.Config.WindowLocation) Then - Location = _Config.Config.WindowLocation - End If - If Utils.SizeIsVisible(_Config.Config.WindowSize) Then - Size = _Config.Config.WindowSize - End If - End If - If _IsLegacy = True Then RibbonPageGroupNavigation.Visible = True Else + ' Location and size will be managed by the ZooFlow Search Window + If Utils.IsVisibleOnAnyScreen(_Config.Config.WindowLocation) Then + If Utils.LocationIsVisible(_Config.Config.WindowLocation) Then + Location = _Config.Config.WindowLocation + End If + If Utils.SizeIsVisible(_Config.Config.WindowSize) Then + Size = _Config.Config.WindowSize + End If + End If + RibbonPageGroupNavigation.Visible = False End If diff --git a/GUIs.ZooFlow/frmSearchStart.vb b/GUIs.ZooFlow/frmSearchStart.vb index bcaa2613..97e55731 100644 --- a/GUIs.ZooFlow/frmSearchStart.vb +++ b/GUIs.ZooFlow/frmSearchStart.vb @@ -829,15 +829,35 @@ Public Class frmSearchStart Dim oForm As New frmDocumentResultList(My.LogConfig, oEnvironment, oParams) oForm.Show() + + ' Position Result Window below this window + oForm.Location = GetResultFormLocation() + oForm.Size = GetResultFormSize() Else Display_InfoItem("No results for this searchcombination!", Color.OrangeRed) End If Catch ex As Exception + MsgBox(ex.Message, MsgBoxStyle.Critical, Text) Finally SplashScreenManager.CloseOverlayForm(oHandle) End Try End Sub + Private Function GetResultFormLocation() As Point + Dim oX = Location.X + Dim oY = Location.Y + Size.Height + + Return New Point(oX, oY) + End Function + + Private Function GetResultFormSize() As Size + Dim oWidth = Size.Width + ' TODO: Smarter height calculation, maybe depending on screen height and parent form location + Dim oHeight = 400 + + Return New Size(oWidth, oHeight) + End Function + Private Sub frmSearchStart_KeyUp(sender As Object, e As KeyEventArgs) Handles Me.KeyUp If e.KeyCode = Keys.F2 Then Start_Search()