Compare commits

..

10 Commits

Author SHA1 Message Date
38da99058e change 2022-10-24 22:35:37 -05:00
e263d10724 opening settings window 2022-10-24 22:32:03 -05:00
77c7aed79d added user settings ui 2022-10-24 22:26:58 -05:00
c6f45ae2d9 toolbar 2022-10-04 20:57:29 -05:00
c9e71c7376 Merge branch 'master' of https://git.deck.sh/Interfaz/ff into fuckyUI 2022-10-04 20:53:36 -05:00
870a4559f8 Button above exists properly!!! 2022-09-20 20:22:19 -05:00
6997899788 toolbar icon trial DOESNT WORK AHA fml 2022-09-20 19:40:32 -05:00
84003128e6 Added additional rows, commented out checkbox code 2022-09-13 20:39:19 -05:00
4298d8da16 Initial UI additions 2022-09-13 20:18:06 -05:00
f80115da99 simple ui 2022-09-06 20:31:24 -05:00
6 changed files with 151 additions and 55 deletions

BIN
IPPigeonLogo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 KiB

BIN
WXPython.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

151
helloWorld.py Normal file
View File

@ -0,0 +1,151 @@
import glob
import wx
import wx.lib.buttons as buttons
from wx.adv import Wizard, WizardPageSimple
class ServerPanel(wx.Frame):
def __init__(self, parent):
self.open_dashboard
super().__init__(parent)
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(0, '',wx.Bitmap("WXPython.png"), "Server Dashboard")
tb.AddTool(1, '',wx.Bitmap("settings.png"), "Settings")
#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 )
tb.Realize()
main_sizer.Add(tb)
self.Show(True)
self.row_obj_dict = {}
self.list_ctrl = wx.ListCtrl(
self, size=(-1, 100),
style=wx.LC_REPORT | wx.BORDER_SUNKEN
)
self.SetBackgroundColour(wx.BLACK)
self.list_ctrl.InsertColumn(0, 'Server name', width=140)
self.list_ctrl.InsertColumn(1, 'Port number', width=140)
self.list_ctrl.InsertColumn(2, 'Status', width=200)
main_sizer.Add(self.list_ctrl, 0, wx.ALL | wx.EXPAND, 5)
start_button = wx.Button(self, label='Start')
start_button.SetBackgroundColour((205, 215, 206))
start_button.Bind(wx.EVT_BUTTON, self.on_edit)
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)
main_sizer.Add(start_button, 0, wx.CENTER | 100, 5)
main_sizer.Add(stop_button, 0, wx.CENTER | 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.Bind(wx.EVT_TOOL, self.open_dashboard, id=0)
self.Bind(wx.EVT_TOOL, self.open_settings, id=1)
# self.Bind(wx.EVT_BUTTON, super().__init__(parent))
# self.Bind(wx.EVT_BUTTON, self.open_settings)
def on_edit(self, event):
print('in on_edit')
def open_dashboard(self, e):
print("open dashboard")
def open_settings(self,e):
print("open settings")
dg = GetData(parent = None)
dg.ShowModal()
# box = wx.TextEntryDialog(None, "Host: ")
# if box.ShowModal() == wx.ID_OK:
# answer = box.GetValue()
# main_sizer = wx.BoxSizer(wx.VERTICAL)
# self.Bind(wx.EVT_TOOL, self.open_dashboard, id=0)
# self.Bind(wx.EVT_TOOL, self.open_settings, id=1)
class GetData(wx.Dialog):
def __init__(self, parent):
wx.Dialog.__init__(self, parent, wx.ID_ANY, "User Settings", size = (800,440))
self.p = wx.Panel(self, wx.ID_ANY)
self.hostname = wx.StaticText(self.p, label="Host", pos=(20,20))
self.hostnametext = wx.TextCtrl(self.p, value="", pos=(180,20), size=(500,-1))
self.user = wx.StaticText(self.p, label="User: ", pos=(20,60))
self.usertext = wx.TextCtrl(self.p, value="", pos=(180,60), size=(500,-1))
self.port = wx.StaticText(self.p, label="Port: ", pos=(20,100))
self.porttext = wx.TextCtrl(self.p, value="", pos=(180,100), size=(500,-1))
self.keyfile = wx.StaticText(self.p, label="Keyfile: ", pos=(20,140))
self.keyfiletext = wx.TextCtrl(self.p, value="", pos=(180,140), size=(500,-1))
self.filepathsend = wx.StaticText(self.p, label="Sending File Path: ", pos=(20,180))
self.filepathsendtext = wx.TextCtrl(self.p, value="", pos=(180,180), size=(500,-1))
self.filepathsendlogin = wx.StaticText(self.p, label="Sending Login Path: ", pos=(20,220))
self.filepathsendlogintext = wx.TextCtrl(self.p, value="", pos=(180,220), size=(500,-1))
self.filepathreceive = wx.StaticText(self.p, label="Receiving File Path: ", pos=(20,260))
self.filepathreceivetext = wx.TextCtrl(self.p, value="", pos=(180,260), size=(500,-1))
self.filepathreceivelogin = wx.StaticText(self.p, label="Receiving Login Path: ", pos=(20,300))
self.filepathreceivelogintext = wx.TextCtrl(self.p, value="", pos=(180,300), size=(500,-1))
self.darkmode = wx.StaticText(self.p, label="Dark mode (On/Off): ", pos=(20,340))
self.darkmodetext = wx.TextCtrl(self.p, value="", pos=(180,340), size=(500,-1))
self.interval = wx.StaticText(self.p, label="Interval (sec): ", pos=(20,380))
self.interval = wx.TextCtrl(self.p, value="", pos=(180,380), size=(500,-1))
self.Bind(wx.EVT_CLOSE, self.OnQuit)
def OnQuit(self, event):
self.result_name = None
self.Destroy()
def on_edit(self, event):
print('in on_edit')
class ServerFrame(wx.Frame):
def __init__(self):
super().__init__(parent=None, title='Server Dashboard')
self.frame = ServerPanel(self)
# image = wx.StaticBitmap(self, wx.ID_ANY)
# image.SetBitmap(wx.Bitmap('WXPython.png'))
# self.Show()
if __name__ == '__main__':
app = wx.App(False)
frame = ServerFrame()
app.MainLoop()

BIN
icon.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

BIN
settings.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

View File

@ -1,55 +0,0 @@
import wx.adv
import wx
TRAY_TOOLTIP = 'Name'
TRAY_ICON = 'icon.png'
def create_menu_item(menu, label, func):
item = wx.MenuItem(menu, -1, label)
menu.Bind(wx.EVT_MENU, func, id=item.GetId())
menu.Append(item)
return item
class TaskBarIcon(wx.adv.TaskBarIcon):
def __init__(self, frame):
self.frame = frame
super(TaskBarIcon, self).__init__()
self.set_icon(TRAY_ICON)
self.Bind(wx.adv.EVT_TASKBAR_LEFT_DOWN, self.on_left_down)
def CreatePopupMenu(self):
menu = wx.Menu()
create_menu_item(menu, 'Site', self.on_hello)
menu.AppendSeparator()
create_menu_item(menu, 'Exit', self.on_exit)
return menu
def set_icon(self, path):
icon = wx.Icon(path)
self.SetIcon(icon, TRAY_TOOLTIP)
def on_left_down(self, event):
print ('Tray icon was left-clicked.')
def on_hello(self, event):
print ('Hello, world!')
def on_exit(self, event):
wx.CallAfter(self.Destroy)
self.frame.Close()
class App(wx.App):
def OnInit(self):
frame=wx.Frame(None)
self.SetTopWindow(frame)
TaskBarIcon(frame)
return True
def main():
app = App(False)
app.MainLoop()
if __name__ == '__main__':
main()