Skip to content

Commit f1df74f

Browse files
committed
Update FormViewer.vb
1 parent e3d1b88 commit f1df74f

1 file changed

Lines changed: 68 additions & 6 deletions

File tree

src/viewers/HDSViewer/FormViewer.vb

Lines changed: 68 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,56 @@
1-
Imports Microsoft.VisualBasic.DataStorage.HDSPack.FileSystem
1+
Imports Galaxy.Workbench
2+
Imports Microsoft.VisualBasic.DataStorage.HDSPack.FileSystem
23
Imports Microsoft.VisualStudio.WinForms.Docking
34

4-
Public Class FormViewer
5+
Public Class FormViewer : Implements AppHost
56

67
Friend pack As StreamPack
78
Friend filepath As String
89
Friend explorer As FormExplorer
910

11+
Public ReadOnly Property ActiveDocument As Form Implements AppHost.ActiveDocument
12+
Get
13+
Return DockPanel1.ActiveDocument
14+
End Get
15+
End Property
16+
17+
Private ReadOnly Property AppHost_ClientRectangle As Rectangle Implements AppHost.ClientRectangle
18+
Get
19+
Return New Rectangle(Location, Size)
20+
End Get
21+
End Property
22+
23+
Public Event ResizeForm As AppHost.ResizeFormEventHandler Implements AppHost.ResizeForm
24+
Public Event CloseWorkbench As AppHost.CloseWorkbenchEventHandler Implements AppHost.CloseWorkbench
25+
26+
Public Sub SetWorkbenchVisible(visible As Boolean) Implements AppHost.SetWorkbenchVisible
27+
Me.Visible = visible
28+
End Sub
29+
30+
Public Sub SetWindowState(stat As FormWindowState) Implements AppHost.SetWindowState
31+
Me.WindowState = stat
32+
End Sub
33+
34+
Public Sub SetTitle(title As String) Implements AppHost.SetTitle
35+
Me.Text = title
36+
End Sub
37+
38+
Public Sub StatusMessage(msg As String, Optional icon As Image = Nothing) Implements AppHost.StatusMessage
39+
40+
End Sub
41+
42+
Public Sub Warning(msg As String) Implements AppHost.Warning
43+
44+
End Sub
45+
46+
Public Sub LogText(text As String) Implements AppHost.LogText
47+
48+
End Sub
49+
50+
Public Sub ShowProperties(obj As Object) Implements AppHost.ShowProperties
51+
Call CommonRuntime.GetPropertyWindow.SetObject(obj)
52+
End Sub
53+
1054
Private Sub ExitToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ExitToolStripMenuItem.Click
1155
Call Me.Close()
1256
End Sub
@@ -29,14 +73,32 @@ Public Class FormViewer
2973
End Using
3074
End Sub
3175

32-
Private Sub DockPanel1_ActiveContentChanged(sender As Object, e As EventArgs) Handles DockPanel1.ActiveContentChanged
33-
34-
End Sub
35-
3676
Private Sub FormViewer_Load(sender As Object, e As EventArgs) Handles Me.Load
3777
explorer = New FormExplorer
3878
explorer.viewer = Me
3979
explorer.Show(DockPanel1)
4080
explorer.DockState = DockState.DockLeftAutoHide
81+
82+
Call CommonRuntime.Hook(Me)
4183
End Sub
84+
85+
Public Function GetDesktopLocation() As Point Implements AppHost.GetDesktopLocation
86+
Return Location
87+
End Function
88+
89+
Public Function GetClientSize() As Size Implements AppHost.GetClientSize
90+
Return Size
91+
End Function
92+
93+
Public Function GetDocuments() As IEnumerable(Of Form) Implements AppHost.GetDocuments
94+
Return DockPanel1.Documents.OfType(Of Form)
95+
End Function
96+
97+
Public Function GetDockPanel() As Control Implements AppHost.GetDockPanel
98+
Return DockPanel1
99+
End Function
100+
101+
Public Function GetWindowState() As FormWindowState Implements AppHost.GetWindowState
102+
Return WindowState
103+
End Function
42104
End Class

0 commit comments

Comments
 (0)