Add Search & Home Form + Attached Panels
This commit is contained in:
@@ -6,6 +6,8 @@ Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Modules.License
|
||||
Imports DevExpress.LookAndFeel
|
||||
Imports DevExpress.XtraBars.Ribbon
|
||||
Imports DevExpress.XtraBars.Docking
|
||||
Imports DevExpress.XtraGrid
|
||||
|
||||
Public Class frmMain
|
||||
Private _Timer As ClassTimer
|
||||
@@ -41,37 +43,24 @@ Public Class frmMain
|
||||
' Initialize Main Timer
|
||||
_Timer = New ClassTimer(My.LogConfig, Me, My.SysConfig.HeartbeatInterval)
|
||||
AddHandler _Timer.OnlineChanged, AddressOf HandleOnlineChanged
|
||||
|
||||
' Show Service Status Label
|
||||
SetOnlineLabel()
|
||||
|
||||
' Apply Selected Skin Style
|
||||
UserLookAndFeel.Default.SetSkinStyle(My.UIConfig.SkinName)
|
||||
|
||||
' Show User Info
|
||||
LabelCurrentUser.Caption = My.Application.User.UserName
|
||||
LabelCurrentMachine.Caption = My.Application.User.MachineName
|
||||
LabelCurrentVersion.Caption = My.Application.Info.Version.ToString
|
||||
LabelCurrentLanguage.Caption = My.Application.User.Language
|
||||
|
||||
Dim oDashboard = New frmDashboard()
|
||||
oDashboard.MdiParent = DocumentManager.MdiParent
|
||||
oDashboard.Show()
|
||||
|
||||
' --- Process Manager Panel ---
|
||||
Dim oDataTable = New DataTable("PMDocuments")
|
||||
Dim oDocNameColumn = New DataColumn("DocName", GetType(String))
|
||||
oDataTable.Columns.Add(oDocNameColumn)
|
||||
|
||||
Dim oRow = oDataTable.NewRow()
|
||||
oRow.Item("DocName") = "test1.xlsx"
|
||||
|
||||
oDataTable.Rows.Add(oRow)
|
||||
|
||||
ProcessManagerWidget.DataSource = oDataTable
|
||||
AddHandler ProcessManagerWidget.RowDoubleClicked, Sub(RowView As DataRowView)
|
||||
MsgBox($"Clicked on Document {RowView.Row.Item("DocName")}")
|
||||
End Sub
|
||||
|
||||
' Load and Save Layout
|
||||
AddHandler UserLookAndFeel.Default.StyleChanged, AddressOf frmMain_StyleChanged
|
||||
|
||||
LoadLayout()
|
||||
|
||||
' We're done loading now
|
||||
_Loading = False
|
||||
Catch ex As Exception
|
||||
_ErrorHandler.ShowErrorMessage(ex)
|
||||
@@ -95,11 +84,11 @@ Public Class frmMain
|
||||
Dim oLayoutPathForDocumentManager As String = GetLayoutPath(GroupName.LayoutMain, LayoutComponent.DocumentManager)
|
||||
|
||||
If File.Exists(oLayoutPathForDockManager) Then
|
||||
DockManager.RestoreLayoutFromXml(oLayoutPathForDockManager)
|
||||
'DockManager.RestoreLayoutFromXml(oLayoutPathForDockManager)
|
||||
End If
|
||||
|
||||
If File.Exists(oLayoutPathForDocumentManager) Then
|
||||
DocumentManager.View.RestoreLayoutFromXml(oLayoutPathForDocumentManager)
|
||||
'DocumentManager.View.RestoreLayoutFromXml(oLayoutPathForDocumentManager)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
_ErrorHandler.ShowErrorMessage(ex)
|
||||
@@ -115,8 +104,8 @@ Public Class frmMain
|
||||
Directory.CreateDirectory(oDirectory)
|
||||
End If
|
||||
|
||||
DockManager.SaveLayoutToXml(oLayoutPathForDockManager)
|
||||
DocumentManager.View.SaveLayoutToXml(oLayoutPathForDocumentManager)
|
||||
'DockManager.SaveLayoutToXml(oLayoutPathForDockManager)
|
||||
'DocumentManager.View.SaveLayoutToXml(oLayoutPathForDocumentManager)
|
||||
Catch ex As Exception
|
||||
_ErrorHandler.ShowErrorMessage(ex)
|
||||
End Try
|
||||
@@ -128,11 +117,6 @@ Public Class frmMain
|
||||
frm.Show()
|
||||
End Sub
|
||||
|
||||
Private Sub BarButtonDashboard_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonDashboard.ItemClick
|
||||
Dim frm As New frmDashboard()
|
||||
frm.MdiParent = DocumentManager.MdiParent
|
||||
frm.Show()
|
||||
End Sub
|
||||
|
||||
Private Sub BarButtonItem1_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem1.ItemClick
|
||||
Dim frm As New frmFileTest()
|
||||
@@ -200,10 +184,54 @@ Public Class frmMain
|
||||
frm.Show()
|
||||
End Sub
|
||||
|
||||
Private Sub BarButtonInbox_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonInbox.ItemClick
|
||||
Dim oForm As New frmInbox With {
|
||||
Private Sub BarButtonInbox_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs)
|
||||
Dim oForm As New frmHome With {
|
||||
.MdiParent = DocumentManager.MdiParent
|
||||
}
|
||||
oForm.Show()
|
||||
End Sub
|
||||
|
||||
Private Sub MainNav_SelectedItemChanging(sender As Object, e As DevExpress.XtraBars.Navigation.SelectedItemChangingEventArgs) Handles MainNav.SelectedItemChanging
|
||||
Select Case e.Item.Name
|
||||
Case NavbarItemHome.Name
|
||||
Dim oForm As New frmHome()
|
||||
oForm.MdiParent = DocumentManager.MdiParent
|
||||
oForm.Show()
|
||||
Case NavbarItemSearch.Name
|
||||
Dim oForm As New frmSearch()
|
||||
oForm.MdiParent = DocumentManager.MdiParent
|
||||
oForm.Show()
|
||||
|
||||
Dim oSearchPanel = DockManager.AddPanel(DockingStyle.Bottom)
|
||||
oSearchPanel.Options.ShowCloseButton = False
|
||||
oSearchPanel.Options.ShowAutoHideButton = False
|
||||
oSearchPanel.Text = "Search " & New Random().Next()
|
||||
oSearchPanel.Controls.Add(New GridControl With {.Dock = DockStyle.Fill})
|
||||
|
||||
Dim oSearchPanel2 = DockManager.AddPanel(DockingStyle.Bottom)
|
||||
oSearchPanel2.Options.ShowCloseButton = False
|
||||
oSearchPanel2.Options.ShowAutoHideButton = False
|
||||
oSearchPanel2.Text = "Search " & New Random().Next()
|
||||
oSearchPanel2.Controls.Add(New GridControl With {.Dock = DockStyle.Fill})
|
||||
|
||||
oSearchPanel2.DockTo(oSearchPanel)
|
||||
|
||||
AddHandler oForm.FormClosed, Sub()
|
||||
oSearchPanel.Close()
|
||||
oSearchPanel2.Close()
|
||||
End Sub
|
||||
|
||||
'AddHandler oForm.Deactivate, Sub()
|
||||
' oSearchPanel.Visibility = DockVisibility.Hidden
|
||||
' oSearchPanel2.Visibility = DockVisibility.Hidden
|
||||
' End Sub
|
||||
|
||||
'AddHandler oForm.Activated, Sub()
|
||||
' oSearchPanel2.Visibility = DockVisibility.Visible
|
||||
' oSearchPanel.Visibility = DockVisibility.Visible
|
||||
' End Sub
|
||||
End Select
|
||||
|
||||
e.Cancel = True
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user