'Static code module
Sub Process_Globals
Private fx As JFX
Private frmConnections As Form
Private mnuConnViewFileClose As MenuItem
Private mnuConnViewEditRefresh As MenuItem
Private tvConnView As TableView
Private clsView As class_view_connnections
Private frmConnectionsState As Boolean
End Sub
Public Sub ui_load_connections
' // already visible, so exit
If frmConnectionsState Then
Return
End If
' // settings
frmConnections.Initialize("",-1,-1)
frmConnections.RootPane.LoadLayout("frmConnections")
frmConnections.Icon = fx.LoadImage(File.DirAssets,"user_connections_rt.png")
frmConnections.Title = "User Connections"
frmConnections.SetOwner(frmConnections)
frmConnections.Show
frmConnectionsState = True
' // draw the header
draw_connections_header
' // start a new thread to show the user connections
clsView.Initialize(tvConnView)
End Sub
Sub close_view_connections
' // turn off
clsView.terminate
' // close form
frmConnections.Close
' // falg as not visible
frmConnectionsState = False
Log("frmConnections_Closed " & frmConnectionsState)
End Sub
Sub frmConnections_Closed()
Log("frmConnections_Closed")
close_view_connections
End Sub
Sub mnuConnViewEditRefresh_Action
clsView.draw_connections
End Sub
Sub mnuConnViewFileClose_Action
close_view_connections
End Sub
Sub tvConnView_Resize (Width As Double, Height As Double)
draw_connections_header
End Sub
Sub draw_connections_header
Dim cw As Double, x As Int
tvConnView.SetColumns(Array As String("Connection", "IP","User","Last Packet","Packet Count","Up Time"))
cw = tvConnView.Width/6
For x = 0 To 5
tvConnView.SetColumnWidth(x, cw)
Next
End Sub