jj: show results over search start
This commit is contained in:
@@ -567,17 +567,34 @@ Public Class frmSearchStart
|
||||
End Function
|
||||
|
||||
Private Sub BarButtonStartSearch_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonStartSearch.ItemClick
|
||||
Prepare_Search()
|
||||
End Sub
|
||||
|
||||
Private Sub Prepare_Search()
|
||||
RenewSearchAttributes()
|
||||
|
||||
' Minimize the search form, but only if results were found
|
||||
If Start_Search() Then
|
||||
MinimizeSearchForm()
|
||||
Hide()
|
||||
|
||||
' Position Result Window below this window
|
||||
LastSearchForm.Location = GetResultFormLocation()
|
||||
LastSearchForm.Size = GetResultFormSize()
|
||||
|
||||
AddHandler LastSearchForm.FormClosed, AddressOf LastSearchForm_FormClosed
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub LastSearchForm_FormClosed(sender As Object, e As EventArgs)
|
||||
If LastSearchForm.ShouldReturnToPreviousForm = True Then
|
||||
Show()
|
||||
LastSearchForm = Nothing
|
||||
Else
|
||||
Close()
|
||||
LastSearchForm = Nothing
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function Start_Search() As Boolean
|
||||
Dim oHandle As IOverlaySplashScreenHandle = Nothing
|
||||
Dim oItemsFound As Boolean = False
|
||||
@@ -620,10 +637,6 @@ Public Class frmSearchStart
|
||||
Dim oForm As New frmDocumentResultList(My.LogConfig, oEnvironment, oParams)
|
||||
oForm.Show()
|
||||
|
||||
AddHandler oForm.FormClosed, Sub()
|
||||
LastSearchForm = Nothing
|
||||
End Sub
|
||||
|
||||
LastSearchForm = oForm
|
||||
End If
|
||||
|
||||
@@ -641,42 +654,35 @@ Public Class frmSearchStart
|
||||
End Function
|
||||
|
||||
Private Function GetResultFormLocation() As Point
|
||||
Dim oX = Location.X
|
||||
Dim oY = Location.Y + Size.Height
|
||||
|
||||
Return New Point(oX, oY)
|
||||
Return Location
|
||||
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)
|
||||
Return Size
|
||||
End Function
|
||||
|
||||
Private Sub frmSearchStart_KeyUp(sender As Object, e As KeyEventArgs) Handles Me.KeyUp
|
||||
If e.KeyCode = Keys.F2 Then
|
||||
Start_Search()
|
||||
Prepare_Search()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub MinimizeSearchForm()
|
||||
HeightBeforeMinimizing = Height
|
||||
Height = 200
|
||||
'Private Sub MinimizeSearchForm()
|
||||
' HeightBeforeMinimizing = Height
|
||||
' Height = 200
|
||||
|
||||
BarButtonItem2.Visibility = DevExpress.XtraBars.BarItemVisibility.Always
|
||||
End Sub
|
||||
' BarButtonItem2.Visibility = DevExpress.XtraBars.BarItemVisibility.Always
|
||||
'End Sub
|
||||
|
||||
Private Sub RestoreSearchForm()
|
||||
Height = HeightBeforeMinimizing
|
||||
'Private Sub RestoreSearchForm()
|
||||
' Height = HeightBeforeMinimizing
|
||||
|
||||
If LastSearchForm IsNot Nothing Then
|
||||
LastSearchForm.Location = GetResultFormLocation()
|
||||
End If
|
||||
' If LastSearchForm IsNot Nothing Then
|
||||
' LastSearchForm.Location = GetResultFormLocation()
|
||||
' End If
|
||||
|
||||
BarButtonItem2.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
|
||||
End Sub
|
||||
' BarButtonItem2.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
|
||||
'End Sub
|
||||
|
||||
|
||||
|
||||
@@ -710,11 +716,11 @@ Public Class frmSearchStart
|
||||
End Sub
|
||||
|
||||
Private Sub BarButtonItem1_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem1.ItemClick
|
||||
RestoreSearchForm()
|
||||
'RestoreSearchForm()
|
||||
End Sub
|
||||
|
||||
Private Sub BarButtonItem2_ItemClick_1(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem2.ItemClick
|
||||
RestoreSearchForm()
|
||||
'RestoreSearchForm()
|
||||
End Sub
|
||||
|
||||
Private Sub RibbonControl1_MinimizedRibbonHiding(sender As Object, e As DevExpress.XtraBars.Ribbon.MinimizedRibbonEventArgs) Handles RibbonControl1.MinimizedRibbonHiding
|
||||
|
||||
Reference in New Issue
Block a user