def __init__(self, parent, id=wx.ID_ANY, title=wx.EmptyString, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.DEFAULT_FRAME_STYLE, name='frame'): wx.Frame.__init__(self, parent, id, title, pos, size, style, name) log = printLog() wxVER = 'wxPython %s' % wx.version() pyVER = 'python %d.%d.%d.%s' % sys.version_info[0:4] versionInfos = '%s %s' % (wxVER, pyVER) self.CreateStatusBar().SetStatusText(versionInfos) panel = TestPanel(self, log) self.Bind(wx.EVT_CLOSE, self.OnDestroy) try: iconLoc = wx.IconLocation(sys.executable) icon = wx.IconFromLocation(iconLoc) self.SetIcon(icon) except Exception as exc: pass
def __init__(self): wx.Frame.__init__(self, None, title='Image Extractor') self.panel = wx.Panel(self) loc = wx.IconLocation(r'C:\Python35\python.exe', 0) self.SetIcon(wx.Icon(loc))
def updateIconPath(): if iconOpt_ctrl.GetValue() == self.ICON_CUSTOM: iconPath_ctrl.Show() icon = wx.IconFromLocation(wx.IconLocation(*_traytip_iconFile)) iconPath_ctrl.SetBitmap(wx.BitmapFromIcon(icon)) else: iconPath_ctrl.Hide()
def __init__(self, parent, *args, **kwargs): wx.Frame.__init__(self, parent, *args, **kwargs) self.SetIcon(wx.Icon(wx.IconLocation(str(ICON_PATH)))) self.SetSizeHints(minW=500, minH=500) self._Devices = self._ProbeDevices() self.Bind(wx.EVT_CLOSE, self.OnClose) self.Bind(EVT_PUBSUB, self.OnPubSend) # Create notebook and its pages. notebook = wx.Notebook(self) notebook.AddPage(MiningScreen(notebook, devices=self._Devices), text='Mining') notebook.AddPage(BenchmarksScreen(notebook, devices=self._Devices), text='Benchmarks') notebook.AddPage(SettingsScreen(notebook), text='Settings') notebook.AddPage(AboutScreen(notebook), text='About') # Check miner downloads. pub.subscribe(self._OnDownloadProgress, 'download.progress') self._DlThread = self._DlProgress = None self._DownloadMiners() # Read user data. pub.subscribe(self._OnSettings, 'data.settings') pub.subscribe(self._OnBenchmarks, 'data.benchmarks') loaded_settings = nuxhash.settings.load_settings(CONFIG_DIR) if loaded_settings == nuxhash.settings.DEFAULT_SETTINGS: self._FirstRun() pub.sendMessage('data.settings', settings=loaded_settings) benchmarks = nuxhash.settings.load_benchmarks(CONFIG_DIR, self._Devices) pub.sendMessage('data.benchmarks', benchmarks=benchmarks)
def __init__(self, engine): self._engine = engine wx.Frame.__init__(self, parent=None, title="J_PROJECT Duel Mode", size=(962,768), style=wx.SIMPLE_BORDER) self.SetIcon(wx.IconFromLocation(wx.IconLocation(os.path.join(self._engine.BaseDirectory,'mooseduel16x16.ico')))) self.CenterOnScreen() self.Game = GamePanel(self, self._engine) self.Bind(wx.EVT_CLOSE, self.OnExit)
def __init__(self): wx.Frame.__init__(self, None, title='Image Extractor') self.panel = wx.Panel(self) loc = wx.IconLocation(sys.executable, 0) self.SetIcon(wx.Icon(loc))
def run(self): self.frame = FrameLogin(None) loc = wx.IconLocation(r'icono.ico') self.frame.SetIcon(wx.IconFromLocation(loc)) self.capturarEventos() self.frame.ShowModal()
def run(self): self.frame = FrameClientes(self.parent.frame) loc = wx.IconLocation(r'icono.ico') self.frame.SetIcon(wx.IconFromLocation(loc)) self.frame.tc_dato_busqueda.SetFocus() self.capturarEventos() self.frame.Show()
def run(self): self.frame = FrameClientes(self.parent) loc = wx.IconLocation(r'icono.ico') self.frame.SetIcon(wx.IconFromLocation(loc)) self.capturarEventos() self.deshabilitarBTNS() self.frame.Show()
def run(self): self.frame = FrameHistorialClientes(self.parent) loc = wx.IconLocation(r'icono.ico') self.frame.SetIcon(wx.IconFromLocation(loc)) self.capturarEventos() self.cargarValidadores() self.frame.Show()
def run(self): self.frame = Frame(self.parent) loc = wx.IconLocation(r'icono.ico') self.frame.SetIcon(wx.IconFromLocation(loc)) self.cargarDatos() self.capturarEventos() self.frame.Show()
def run(self): self.frame = FrameIniciarCaja(self.parent) loc = wx.IconLocation(r'icono.ico') self.frame.SetIcon(wx.IconFromLocation(loc)) self.cargarDatos() resp = self.frame.ShowModal() if resp == wx.ID_OK: self.IniciarCaja()
def run(self): self.frame = FrameCajaIngresosVarios(self.parent) loc = wx.IconLocation(r'icono.ico') self.frame.SetIcon(wx.IconFromLocation(loc)) self.frame.tc_monto.SetValidator(Monto()) rta = self.frame.ShowModal() if rta == wx.ID_OK: self.Aceptar()
def run(self): self.frame = FrameUsuarios(self.parent) loc = wx.IconLocation(r'icono.ico') self.frame.SetIcon(wx.IconFromLocation(loc)) self.capturarEventos() self.cargarGrilla(self.listadoUsuarios) self.deshabilitarBTNS() self.frame.Show()
def run(self): self.frame = FrameCampanias(self.parent) loc = wx.IconLocation(r'icono.ico') self.frame.SetIcon(wx.IconFromLocation(loc)) self.capturarEventos() self.configurarGrilla(len(self.listadoCampanias)) self.cargarGrilla(self.listadoCampanias) self.deshabilitaBTNS() self.frame.Show()
def run(self): self.frame = Frame(self.parent) loc = wx.IconLocation(r'icono.ico') self.frame.SetIcon(wx.IconFromLocation(loc)) self.capturarEventos() rta = self.frame.ShowModal() if rta == wx.ID_OK: self.frame.Destroy()
def run(self): self.frame = FrameResultadoCampania(self.parent) loc = wx.IconLocation(r'icono.ico') self.frame.SetIcon(wx.IconFromLocation(loc)) self.frame.btn_volver.SetFocus() self.configurarGrilla() self.cargarGrilla() self.cargarDatos() self.capturarEventos() self.frame.Show()
def run(self): self.frame = FrameModificarMovimiento(self.parent) loc = wx.IconLocation(r'icono.ico') self.frame.SetIcon(wx.IconFromLocation(loc)) self.frame.btn_cancelar.SetFocus() self.cargarDatos() self.capturarEventos() self.cargarValidadores() rta = self.frame.ShowModal() if rta == wx.ID_OK: self.Aceptar()
def __init__(self, parent, id=wx.ID_ANY, title=wx.EmptyString, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.DEFAULT_FRAME_STYLE, name='frame'): wx.Frame.__init__(self, parent, id, title, pos, size, style, name) log = printLog() panel = TestPanel(self, log) self.Bind(wx.EVT_CLOSE, self.OnDestroy) try: self.SetIcon(wx.IconFromLocation(wx.IconLocation(sys.executable))) except Exception as exc: raise exc
def run(self): self.frame = FrameCajaInfoCliente(self.parent) loc = wx.IconLocation(r'icono.ico') self.frame.SetIcon(wx.IconFromLocation(loc)) self.frame.btn_aceptar.SetFocus() self.frame.tc_boleta.Enable(False) self.frame.tc_oficina.Enable(False) self.cargarDatos() self.carpturarEventos() rta = self.frame.ShowModal() if rta == wx.ID_OK: self.Aceptar()
def OnInit(self): str=urllib2.unquote((sys.argv[1].split('/',2))[2]) temp=str fid=(temp.split('&'))[0].split('=')[1] name=(str.split('&'))[1].split('=')[1] tid=(str.split('&'))[2].split('=')[1] title=(str.split('&'))[3].split('=')[1] uid=(str.split('&'))[4].split('=')[1] ulink=(str.split('&'))[5].split('=')[1] self.m_frame = MainFrame(None) self.m_frame.SetIcon(wx.IconFromLocation(wx.IconLocation(r'scanner.ico',0))) self.m_frame.setParams(fid,name,tid,title,uid,ulink) self.m_frame.Show() self.SetTopWindow(self.m_frame) return True
def run(self): self.frame = FrameLogin(self.parent) loc = wx.IconLocation(r'icono.ico') self.frame.SetIcon(wx.IconFromLocation(loc)) self.cargarValidadores() resp = self.frame.ShowModal() if resp == wx.ID_OK: usu = { 'nom': self.frame.tc_usuario.GetValue(), 'cla': self.frame.tc_clave.GetValue() } return usu else: return {}
def run(self): self.frame = FramePrincipal(None) loc = wx.IconLocation(r'icono.ico') self.frame.SetIcon(wx.IconFromLocation(loc)) self.panelUno = PanelUno(self.frame.notebook) self.panelDos = PanelDos(self.frame.notebook) self.capturarEventos() self.frame.notebook.AddPage(self.panelUno, u"Campaña actual", False) self.frame.notebook.AddPage(self.panelDos, u"Menú", False) self.cargarDatos() self.frame.Show()
def run(self): self.frame = FramePrincipal(self.parent) loc = wx.IconLocation(r'icono.ico') self.frame.SetIcon(wx.IconFromLocation(loc)) log = ControladorLogin(self.frame, False) self.usuario = log.run() if self.usuario != {}: self.panelUno = PanelUno(self.frame.notebook) self.panelDos = PanelDos(self.frame.notebook) self.frame.notebook.AddPage(self.panelUno, u"Clientes atendidos", False) self.frame.notebook.AddPage(self.panelDos, u"Ingresos/Egresos Varios", False) self.capturarEventos() self.cargarDatos() self.frame.Show()
def __init__(self, parent, title): super(Quant, self).__init__(parent, title=title, size=(300, 250)) BMP = wx.Image("images/bull_n_bear1.jpg").ConvertToBitmap() dc = wx.MemoryDC() dc.SelectObject(BMP) self.splash = GaugeSplash(BMP) self.splash.CenterOnScreen() self.splash.Show() wx.Yield() self.loc = wx.IconLocation('images/program_icon.ico', 0) self.SetIcon(wx.IconFromLocation(self.loc)) self.InitUI() self.anim = animation.FuncAnimation(self.figure1, self.animate, interval=60003) # Intervals: 10min self.CenterOnScreen() self.Fit() self.SQL() self.Show()
def __init__(self, engine): self._engine = engine wx.Frame.__init__(self, parent=None, title="CRAY ONLINE", size=(1024, 768), style=wx.MINIMIZE_BOX | wx.CAPTION | wx.CLOSE_BOX | wx.SYSTEM_MENU) self.SetIcon( wx.IconFromLocation( wx.IconLocation( os.path.join(self._engine.BaseDirectory, 'mooseduel16x16.ico')))) self.CenterOnScreen() self.Game = GamePanel(self, self._engine) self.Bind(wx.EVT_CLOSE, self.OnExit) if self.GetSetting('ShowFaceUpCardName') == 'Yes': self.ShowFullScreen(True, style=wx.FULLSCREEN_NOCAPTION | wx.FULLSCREEN_NOBORDER | wx.FULLSCREEN_NOSTATUSBAR) if wx.DisplaySize()[0] == 1024 and wx.DisplaySize( )[1] == 768 or wx.DisplaySize()[1] == 720: if wx.MessageDialog( None, 'Your screen resolution is low. Would you like to run in Full Screen Mode?', '', wx.YES_NO | wx.ICON_QUESTION | wx.YES_DEFAULT).ShowModal() == wx.ID_YES: self.ShowFullScreen(True, style=wx.FULLSCREEN_NOCAPTION | wx.FULLSCREEN_NOBORDER | wx.FULLSCREEN_NOSTATUSBAR) if wx.DisplaySize()[0] < 1024 and wx.DisplaySize()[1] < 768: wx.MessageDialog( None, 'Your Screen Resolution is too low. Change Your Screen Resolution to at least 1024x720.', '', wx.OK | wx.ICON_INFORMATION).ShowModal()
def __init__(self, parent, fileName): self.parent = parent self.fileName = fileName self.normalFont = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT) self.normalFont.SetPointSize(self.normalFont.GetPointSize() + 1) self.smallerFont = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT) self.greyColour = wx.SystemSettings.GetColour(wx.SYS_COLOUR_GRAYTEXT) if os.path.isdir(fileName): self.text = fileName bitmap = wx.Bitmap(os.path.join(bitmapDir, "folder.png"), wx.BITMAP_TYPE_PNG) self.icon = wx.Icon(bitmap) self.description = "" return self.text = os.path.split(fileName)[1] extension = os.path.splitext(fileName)[1] if not extension: self.text = fileName bitmap = wx.Bitmap(os.path.join(bitmapDir, "empty_icon.png"), wx.BITMAP_TYPE_PNG) self.icon = wx.Icon(bitmap) self.description = "File" return fileType = wx.TheMimeTypesManager.GetFileTypeFromExtension(extension) bmp = wx.Bitmap(os.path.join(bitmapDir, "empty_icon.png"), wx.BITMAP_TYPE_PNG) bmp = wx.Icon(bmp) if not fileType: icon = wx.Icon(wx.IconLocation(fileName)) if not icon.IsOk(): self.icon = bmp else: self.icon = icon self.description = "%s File" % extension[1:].upper() return #------- Icon info info = fileType.GetIconInfo() icon = None if info is not None: icon, file, idx = info if icon.IsOk(): bmp = icon else: icon = None if icon is None: icon = wx.Icon(wx.IconLocation(fileName)) if icon.IsOk(): bmp = icon else: command = fileType.GetOpenCommand(fileName) command = " ".join(command.split()[0:-1]) command = command.replace('"', "") if " -" in command: command = command[0:command.index(" -")] icon = wx.Icon(wx.IconLocation(command)) if icon.IsOk(): bmp = icon self.icon = bmp self.description = convert(fileType.GetDescription()) if not self.description: self.description = "%s File" % extension[1:].upper()
def test_iconloc2(self): loc = wx.IconLocation() loc.SetFileName(icoFile) i = wx.Icon(loc)
def test_iconloc1(self): loc = wx.IconLocation(icoFile) i = wx.Icon(loc)
def __init__(self, url=None, popup=False, params=None): if popup: title = os.path.basename(url) else: title = "Kam1n0" wx.Frame.__init__(self, parent=None, id=wx.ID_ANY, title=title) size = (800, 500) # icon #setup icon object #icon = wx.Icon(GetApplicationPath("www/img/favicon.ico"), wx.BITMAP_TYPE_ICO) #setup taskbar icon #tbicon = wx.TaskBarIcon() #tbicon.SetIcon(icon, "McGill Icon") loc = wx.IconLocation(GetApplicationPath("www/img/favicon.ico"), 0) self.SetIcon(wx.IconFromLocation(loc)) # This is an optional code to enable High DPI support. if "auto_zooming" in g_applicationSettings \ and g_applicationSettings["auto_zooming"] == "system_dpi": # This utility function will adjust width/height using # OS DPI settings. For 800/600 with Win7 DPI settings # being set to "Larger 150%" will return 1200/900. size = cefpython.DpiAware.CalculateWindowSize(size[0], size[1]) self.SetSize(size) global gdata if gdata is None: gdata = GetData() gdp = json.loads(gdata) if not url: url = gdp['url'] # Test hash in url. # url += "#test-hash" # self.CreateMenu() if TEST_EMBEDDING_IN_PANEL: print("Embedding in a wx.Panel!") # You also have to set the wx.WANTS_CHARS style for # all parent panels/controls, if it's deeply embedded. self.mainPanel = wx.Panel(self, style=wx.WANTS_CHARS) # Global client callbacks must be set before browser is created. self.clientHandler = ClientHandler() cefpython.SetGlobalClientCallback( "OnCertificateError", self.clientHandler._OnCertificateError) cefpython.SetGlobalClientCallback( "OnBeforePluginLoad", self.clientHandler._OnBeforePluginLoad) cefpython.SetGlobalClientCallback("OnAfterCreated", self.clientHandler._OnAfterCreated) windowInfo = cefpython.WindowInfo() windowInfo.SetAsChild(self.GetHandleForBrowser()) self.browser = cefpython.CreateBrowserSync( windowInfo, browserSettings=g_browserSettings, navigateUrl=url) self.clientHandler.mainBrowser = self.browser self.browser.SetClientHandler(self.clientHandler) jsBindings = cefpython.JavascriptBindings(bindToFrames=False, bindToPopups=True) self.javascriptExternal = JavascriptExternal(self.browser, gdata) jsBindings.SetObject("external", self.javascriptExternal) jsBindings.SetProperty("GData", gdata) if not params is None: jsBindings.SetProperty("params", params) self.browser.SetJavascriptBindings(jsBindings) if self.mainPanel: self.mainPanel.Bind(wx.EVT_SET_FOCUS, self.OnSetFocus) self.mainPanel.Bind(wx.EVT_SIZE, self.OnSize) else: self.Bind(wx.EVT_SET_FOCUS, self.OnSetFocus) self.Bind(wx.EVT_SIZE, self.OnSize) self.Bind(wx.EVT_CLOSE, self.OnClose) if USE_EVT_IDLE and not popup: # Bind EVT_IDLE only for the main application frame. print("Using EVT_IDLE to execute the CEF message loop work") self.Bind(wx.EVT_IDLE, self.OnIdle)