Compare commits

..

No commits in common. 'c9e71c7376271a7551e3982fc69146a8e13f5df5' and '870a4559f8f282c03b7f63d3622e31a864521cfc' have entirely different histories.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 182 KiB

@ -1,63 +1,61 @@
import glob import glob
import wx import wx
import wx.lib.buttons as buttons
class ServerPanel(wx.Frame): class ServerPanel(wx.Panel):
def __init__(self, parent): def __init__(self, parent):
super().__init__(parent) super().__init__(parent)
main_sizer = wx.BoxSizer(wx.VERTICAL) main_sizer = wx.BoxSizer(wx.VERTICAL)
secondary_sizer = wx.BoxSizer(wx.HORIZONTAL)
menubar = wx.MenuBar()
menu = wx.Menu()
menubar.Append(menu,"File")
self.SetMenuBar(menubar)
tb = wx.ToolBar( self, -1)
self.ToolBar = tb
tb.AddTool( wx.ID_ANY, '', wx.Bitmap("IPPigeonLogo.png"))
tb.AddTool(wx.ID_ANY, '',wx.Bitmap("WXPython.png"))
tb.AddTool(wx.ID_ANY, '',wx.Bitmap("settings.png"))
#tb.Bind(wx.EVT_TOOL, self.Onright)
#tb.Bind(wx.EVT_COMBOBOX,self.OnCombo)
#self.combo = wx.ComboBox( tb, 555, value = "Times", choices = ["Papyrus","Times","Comic Sans"])
#tb.AddControl(self.combo ) toolbar1 = wx.ToolBar(self)
tb.Realize() toolbar1.AddTool(wx.ID_ANY, '', wx.Bitmap('pigeonLOGO.png'))
main_sizer.Add(tb) toolbar1.Realize()
main_sizer.Add(toolbar1, 0, wx.EXPAND)
self.Bind(wx.EVT_TOOL, self.OnQuit)
self.Show(True) self.SetSizer(main_sizer)
self.SetSize((350, 250))
self.Centre()
self.row_obj_dict = {} self.row_obj_dict = {}
self.list_ctrl = wx.ListCtrl( self.list_ctrl = wx.ListCtrl(
self, size=(-1, 100), self, size=(-1, 100),
style=wx.LC_REPORT | wx.BORDER_SUNKEN style=wx.LC_REPORT | wx.BORDER_SUNKEN
) )
self.SetBackgroundColour(wx.BLACK) self.list_ctrl.InsertColumn(0, 'PID', width=140)
self.list_ctrl.InsertColumn(0, 'Server name', width=140) self.list_ctrl.InsertColumn(1, 'Local Address', width=140)
self.list_ctrl.InsertColumn(1, 'Port number', width=140) self.list_ctrl.InsertColumn(2, 'Timestamp', width=140)
self.list_ctrl.InsertColumn(2, 'Status', width=200) self.list_ctrl.InsertColumn(3, 'Proto', width=140)
main_sizer.Add(self.list_ctrl, 0, wx.ALL | wx.EXPAND, 5) self.list_ctrl.InsertColumn(4, 'Recv-Q', width=140)
self.list_ctrl.InsertColumn(5, 'Send-Q', width=140)
self.list_ctrl.InsertColumn(6, 'Foreign Address', width=140)
self.list_ctrl.InsertColumn(7, 'Block', width=60)
self.list_ctrl.InsertColumn(8, 'State', width=140)
self.list_ctrl.InsertColumn(9, 'Duration', width=140)
## To add checkboxes for whether or not something is blocked
##idx = 0
##for i in varNameForBlock:
## index = self.list.InsertItem(idx, i[0])
## self.list.SetItem(index, 1, i[1])
## self.list.SetItem(index, 2, i[2])
## idx += 1
main_sizer.Add(self.list_ctrl, 0, wx.ALL | wx.EXPAND, 5)
start_button = wx.Button(self, label='Start') start_button = wx.Button(self, label='Start')
start_button.SetBackgroundColour((205, 215, 206))
start_button.Bind(wx.EVT_BUTTON, self.on_edit) start_button.Bind(wx.EVT_BUTTON, self.on_edit)
stop_button = wx.Button(self, label='Stop') stop_button = wx.Button(self, label='Stop')
stop_button.SetBackgroundColour('#F08080')
# wx.BORDER(stop_button, wx.BORDER_NONE)
stop_button.Bind(wx.EVT_BUTTON, self.on_edit) stop_button.Bind(wx.EVT_BUTTON, self.on_edit)
main_sizer.Add(start_button, 0, wx.CENTER | 100, 5) main_sizer.Add(start_button, 0, wx.ALL | 100, 5)
main_sizer.Add(stop_button, 0, wx.CENTER | 100, 5) main_sizer.Add(stop_button, 0, wx.ALL | 100, 5)
# start_button.SetWindowStyleFlag(wx.SIMPLE_BORDER)
# stop_button.SetWindowStyleFlag(wx.SIMPLE_BORDER)
# wx.StaticBitmap(self, -1, png, (500, 300), (png.GetWidth(), png.GetHeight()))
self.SetSizer(main_sizer) self.SetSizer(main_sizer)
def OnQuit(self, e): def OnQuit(self, e):
@ -69,18 +67,12 @@ class ServerPanel(wx.Frame):
def update_mp3_listing(self, folder_path): def update_mp3_listing(self, folder_path):
print(folder_path) print(folder_path)
# def Onright(self, event):
# self.text.AppendText(str(event.GetId())+"\n")
# def OnCombo(self,event):
# self.text.AppendText( self.combo.GetValue()+"\n")
class ServerFrame(wx.Frame): class ServerFrame(wx.Frame):
def __init__(self): def __init__(self):
super().__init__(parent=None, title='Server Dashboard') super().__init__(parent=None,
self.frame = ServerPanel(self) title='Server Dashboard')
# image = wx.StaticBitmap(self, wx.ID_ANY)
# image.SetBitmap(wx.Bitmap('WXPython.png')) self.panel = ServerPanel(self)
self.Show() self.Show()
if __name__ == '__main__': if __name__ == '__main__':

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Loading…
Cancel
Save