Ejemplo n.º 1
0
    def __init__(self, parent, title):
        wx.Frame.__init__(self, parent, -1, title)
        self.config = wx.Config.Get()
        window_size_x = max(self.config.ReadInt("window_size_x", 800), 800)
        window_size_y = max(self.config.ReadInt("window_size_y", 600), 600)
        window_pos_x = max(self.config.ReadInt("window_pos_x", -1), -1)
        window_pos_y = max(self.config.ReadInt("window_pos_y", -1), -1)
        self.SetSize((window_size_x, window_size_y))
        self.SetPosition((window_pos_x, window_pos_y))
        self.SetMinSize((800, 600))
        self.SetupMenu()
        self.SetupToolbar()
        self.SetupStatusBar()
        self.SetupSashLayout(self)
        self.filterviewbuttonsenable = True

        icons = wx.IconBundle()
        icons.AddIcon(wx.IconFromBitmap(_afimages.getapp16x16Bitmap()))
        icons.AddIcon(wx.IconFromBitmap(_afimages.getapp32x32Bitmap()))
        self.SetIcons(icons)

        self.rightWindowSizer = wx.BoxSizer(wx.VERTICAL)
        self.rightWindow.SetSizer(self.rightWindowSizer)

        self.bottomWindowSizer = wx.BoxSizer(wx.VERTICAL)
        self.bottomWindow.SetSizer(self.bottomWindowSizer)

        self.treeCtrl = afProductTree(self.leftWindow)
        self.treeCtrl.Disable()

        self.expand = False
        self.filterview = None
Ejemplo n.º 2
0
def get_appicons():
    icons = wx.IconBundle()
    [
        icons.AddIcon(wx.IconFromBitmap(i.GetBitmap())) for i in
        [Icon32bit16x16, Icon32bit32x32, Icon8bit16x16, Icon8bit32x32]
    ]
    return icons
Ejemplo n.º 3
0
    def __init__(self,parent,utility,download_state):
        self.utility = utility
        wx.Frame.__init__(self, None, -1, self.utility.lang.get('tb_dlhelp_short'), 
                          size=(640,520))
        
        main_panel = wx.Panel(self)
        self.downloadHelperPanel = self.createMainPanel(main_panel,download_state)
        bot_box = self.createBottomBoxer(main_panel)
        
        mainbox = wx.BoxSizer(wx.VERTICAL)
        mainbox.Add(self.downloadHelperPanel, 1, wx.EXPAND|wx.ALL, 5)
        mainbox.Add(bot_box, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALL, 5)
        main_panel.SetSizer(mainbox)


        iconpath = os.path.join(self.utility.session.get_tracker_favicon())
        # Giving it the whole bundle throws an exception about image 6
        self.icons = wx.IconBundle()
        print >> sys.stderr, iconpath
        if iconpath:
            self.icons.AddIconFromFile(iconpath,wx.BITMAP_TYPE_ICO)
        self.SetIcons(self.icons)

        self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
        self.Show()
Ejemplo n.º 4
0
    def __init__(self, parent, *args, **kwargs):
        """do any initial setup required for Orbis"""

        super().__init__(parent, *args, **kwargs)

        ico = wx.IconBundle()
        icon_path = settings.get_img_path("qcpump.ico")
        logger.debug(f"Loading icons from {icon_path}")
        ico.AddIcon(icon_path)
        self.SetTitle(f"QCPump - {settings.VERSION}")
        self.SetIcons(ico)
        self.SetMinSize((1024, 768))
        self.Fit()
        self.Center()

        self.do_pump_on_startup.SetValue(settings.PUMP_ON_STARTUP)

        self.pump_windows = {}

        # do expensive intialization after show event
        self._init_finished = False
        self._show_completed = True
        self._startup_pump_run = False

        # used to track when user has asked to stop pumping
        self.kill_event = threading.Event()
Ejemplo n.º 5
0
Archivo: 2048.py Proyecto: absop/2048
    def __init__(self, parent, title):
        super(GameFrame, self).__init__(parent,
                                        title=title,
                                        size=wx.Size(480 + 20, 640 + 20),
                                        style=wx.DEFAULT_FRAME_STYLE
                                        ^ wx.MAXIMIZE_BOX ^ wx.RESIZE_BORDER)

        self.arrow = ""
        self.background = wx.Colour("#FAFAFA")
        self.tabbar = Tabbar()
        self.board = Board()
        self.directions = {
            wx.WXK_UP: "↑",
            wx.WXK_DOWN: "↓",
            wx.WXK_LEFT: "←",
            wx.WXK_RIGHT: "→"
        }

        self.SetIcons(wx.IconBundle(wx.Icon("2048.ico")))

        self.SetTransparent(235)
        self.CentreOnScreen()
        self.SetBackgroundColour(self.background)
        self.CreateStatusBar()
        self.SetStatusText("Welcome to Game 2048!")

        self.Bind(wx.EVT_PAINT, self.OnPaint)
        self.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown)

        self.GameStart()
Ejemplo n.º 6
0
    def test_iconbndl4(self):
        ib = wx.IconBundle()

        ib.Icon
        ib.IconCount

        wx.NullIconBundle
Ejemplo n.º 7
0
 def createOutputWindow(self, st):
     if FxStudio.getConsoleVariableAsSwitch(
             'py_enableoutputwindow') == True:
         self.frame = wx.Frame(FxStudio.getMainWindow(),
                               -1,
                               self.title,
                               self.pos,
                               self.size,
                               style=wx.DEFAULT_FRAME_STYLE)
         self.text = wx.TextCtrl(self.frame,
                                 -1,
                                 "",
                                 style=wx.TE_MULTILINE | wx.TE_READONLY)
         self.text.SetFont(
             wx.Font(8, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL,
                     wx.FONTWEIGHT_NORMAL, False,
                     FxStudio.getUnicodeFontName(), wx.FONTENCODING_SYSTEM))
         self.text.SetBackgroundColour(self.color_palette['BaseColour1'])
         self.text.SetForegroundColour(self.color_palette['BaseColour8'])
         ib = wx.IconBundle()
         ib.AddIconFromFile(FxStudio.getAppIconPath(), wx.BITMAP_TYPE_ANY)
         self.frame.SetIcons(ib)
         self.text.AppendText(st)
         self.log_to_file(st)
         self.frame.Show(True)
         self.frame.Bind(wx.EVT_CLOSE, self.onCloseWindow)
     else:
         self.log_to_file(st)
Ejemplo n.º 8
0
 def set_icons(self, filepath):
     icons = wx.IconBundle()
     if const.IS_WX4:
         icons.AddIcon(utils.tr(filepath), wx.BITMAP_TYPE_ANY)
     else:
         icons.AddIconFromFile(utils.tr(filepath), wx.BITMAP_TYPE_ANY)
     self.SetIcons(icons)
Ejemplo n.º 9
0
 def addIcons(self):
     icons = wx.IconBundle()
     icons.AddIcon(Icons.icon16.Icon)
     icons.AddIcon(Icons.icon32.Icon)
     icons.AddIcon(Icons.icon48.Icon)
     icons.AddIcon(Icons.icon256.Icon)
     self.SetIcons(icons)
Ejemplo n.º 10
0
def ICON():
    global _icon
    if _icon is None:
        fn = _find_asset("icon.ico")
        with open(fn, 'rb') as fp:
            _icon = wx.IconBundle(fp)
    return _icon
Ejemplo n.º 11
0
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.SetSize((800, 600))

        #tb = self.CreateToolBar( TBFLAGS )
        #tsize = wx.Size(16,16)
        #hd_bmp =  wx.ArtProvider.GetBitmap(wx.ART_HARDDISK, wx.ART_TOOLBAR, tsize)
        #flop_bmp =  wx.ArtProvider.GetBitmap(wx.ART_FLOPPY, wx.ART_TOOLBAR, tsize)
        #flop_bmp = wx.Bitmap('pencil6c_mac_24.png')
        #cd_bmp =  wx.ArtProvider.GetBitmap(wx.ART_CDROM, wx.ART_TOOLBAR, tsize)
        #test_bmp = wx.Bitmap(my_bitmap)
        #tb.SetToolBitmapSize(tsize)
        #tool = tb.AddRadioTool( wx.ID_ANY, "Radio0", hd_bmp,
        #        shortHelp="Radio 0")
        #tool = tb.AddRadioTool(wx.ID_ANY, "Radio1", flop_bmp,
        #        shortHelp="Radio 1")
        #tool = tb.AddRadioTool(wx.ID_ANY, "Radio2", test_bmp,
        #        shortHelp="Radio 2")
        #tb.Realize()

        my_icon_bundle = wx.IconBundle('marcam.ico')
        #my_icon_bundle = wx.IconBundle('marcam.icns')
        self.SetIcons(my_icon_bundle)

        self.Show(True)
Ejemplo n.º 12
0
    def OnInit(self):
        self.model = Model()
        self.startupservice = StartupService()

        self.frame_console = wx.py.shell.ShellFrame(None)
        self.trayicon = wx.TaskBarIcon()

        if os.path.exists(conf.IconPath):
            icons = wx.IconBundle()
            icons.AddIconFromFile(conf.IconPath, wx.BITMAP_TYPE_ICO)
            self.frame_console.SetIcons(icons)
            icon = (icons.GetIconOfExactSize(
                (16, 16)) if "win32" == sys.platform else icons.GetIcon(
                    (24, 24)))
            self.trayicon.SetIcon(icon, conf.Title)

        self.frame_console.Title = "%s Console" % conf.Title

        self.Bind(wx.EVT_CLOSE, self.OnClose)
        self.Bind(wx.EVT_DISPLAY_CHANGED, self.OnDisplayChanged)
        self.trayicon.Bind(wx.EVT_TASKBAR_LEFT_DCLICK, self.OnOpenUI)
        self.trayicon.Bind(wx.EVT_TASKBAR_LEFT_DOWN, self.OnOpenMenu)
        self.trayicon.Bind(wx.EVT_TASKBAR_RIGHT_DOWN, self.OnOpenMenu)
        self.frame_console.Bind(wx.EVT_CLOSE, self.OnToggleConsole)

        wx.CallAfter(self.model.log_resolution, wx.GetDisplaySize())
        wx.CallAfter(self.model.start)
        return True  # App.OnInit returns whether processing should continue
Ejemplo n.º 13
0
	def _setIcon(self, val):
		if self._constructed():
			setIconFunc = self.SetIcon
			if val is None:
				ico = wx.NullIcon
			elif isinstance(val, wx.Icon):
				ico = val
			else:
				setIconFunc = self.SetIcons
				if isinstance(val, basestring):
					icon_strs = (val,)
				else:
					icon_strs = val
				ico = wx.IconBundle()
				for icon_str in icon_strs:
					iconPath = dabo.icons.getIconFileName(icon_str)
					if iconPath and os.path.exists(iconPath):
						ext = os.path.splitext(iconPath)[1].lower()
						if ext == ".png":
							bitmapType = wx.BITMAP_TYPE_PNG
						elif ext == ".ico":
							bitmapType = wx.BITMAP_TYPE_ICO
						else:
							# punt:
							bitmapType = wx.BITMAP_TYPE_ANY
						single_ico = wx.Icon(iconPath, bitmapType)
					else:
						single_ico = wx.NullIcon
					ico.AddIcon(single_ico)
			# wx doesn't provide GetIcon()
			self._icon = val
			setIconFunc(ico)

		else:
			self._properties["Icon"] = val
Ejemplo n.º 14
0
    def __init__(self, parent, utility, title, iconpath, vlcwrap,
                 logopath):  ## rm utility
        self.parent = parent
        self.utility = utility  ## parent.utility
        if title is None:
            title = self.utility.lang.get('tb_video_short')

        if vlcwrap is None:
            size = (800, 150)
        else:
            if sys.platform == 'darwin':
                size = (800, 520)
            else:
                size = (
                    800, 520
                )  # Use 16:9 aspect ratio: 500 = (800/16) * 9 + 50 for controls
        wx.Frame.__init__(self, None, -1, title, size=size)
        self.Centre()

        self.create_videopanel(vlcwrap, logopath)

        # Set icons for Frame
        self.icons = wx.IconBundle()
        self.icons.AddIconFromFile(iconpath, wx.BITMAP_TYPE_ICO)
        self.SetIcons(self.icons)

        self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
Ejemplo n.º 15
0
 def GetFrameMainIconBundle():
     ib = wx.IconBundle()
     ib.AddIcon(wx.ArtProvider.GetIcon('logo_16'))
     ib.AddIcon(wx.ArtProvider.GetIcon('logo_32'))
     ib.AddIcon(wx.ArtProvider.GetIcon('logo_48'))
     ib.AddIcon(wx.ArtProvider.GetIcon('logo_64'))
     return ib
Ejemplo n.º 16
0
 def setIcon(self, from_r, from_g, from_b, to_r, to_g, to_b):
     ib = wx.IconBundle()
     bmp = self.make_grad_image(32, 32, (from_r, from_g, from_b),
                                (to_r, to_g, to_b))
     icon = wx.EmptyIcon()
     icon.CopyFromBitmap(bmp)
     ib.AddIcon(icon)
     self.mainWindow.SetIcons(ib)
Ejemplo n.º 17
0
def set_icon(window):
    bundle = wx.IconBundle()
    bundle.AddIcon(wx.Icon('icons/16.png', wx.BITMAP_TYPE_PNG))
    bundle.AddIcon(wx.Icon('icons/24.png', wx.BITMAP_TYPE_PNG))
    bundle.AddIcon(wx.Icon('icons/32.png', wx.BITMAP_TYPE_PNG))
    bundle.AddIcon(wx.Icon('icons/48.png', wx.BITMAP_TYPE_PNG))
    bundle.AddIcon(wx.Icon('icons/256.png', wx.BITMAP_TYPE_PNG))
    window.SetIcons(bundle)
Ejemplo n.º 18
0
def _set_frame_icon(frame):
    bundle = wx.IconBundle()
    for image in ('matplotlib.png', 'matplotlib_large.png'):
        icon = wx.Icon(_load_bitmap(image))
        if not icon.IsOk():
            return
        bundle.AddIcon(icon)
    frame.SetIcons(bundle)
Ejemplo n.º 19
0
def get_icon_resource(name):
    """Convert a Window ICO contained in a string to an IconBundle."""

    bundle = wx.IconBundle()
    for img in _get_icon_resource_as_images(name):
        bmp = wx.Bitmap(img)
        icon = wx.Icon(bmp)
        bundle.AddIcon(icon)
    return bundle
Ejemplo n.º 20
0
    def setup_icon(self):
        # icon_file = get_root_path('icon.ico')
        # # wx.IconFromBitmap is not available on Linux in wxPython 3.0/4.0
        # if os.path.exists(icon_file) and hasattr(wx, "IconFromBitmap"):
        #     icon = wx.IconFromBitmap(wx.Bitmap(icon_file, wx.BITMAP_TYPE_PNG))
        #     self.SetIcon(icon)

        ib = wx.IconBundle()
        ib.AddIcon(get_root_path('icon.ico'), wx.BITMAP_TYPE_ANY)
        self.SetIcons(ib)
Ejemplo n.º 21
0
 def setIcon(self):
     ib = wx.IconBundle()
     if current.outputMode:
         bmp = self.make_grad_image(32, 32, (255, 255, 0), (0, 0, 0))
     else:
         bmp = self.make_grad_image(32, 32, (0, 0, 0), (0, 0, 0))
     icon = wx.EmptyIcon()
     icon.CopyFromBitmap(bmp)
     ib.AddIcon(icon)
     self.mainWindow.SetIcons(ib)
Ejemplo n.º 22
0
    def get_frame_icon_bundle(self, bundleid):
        # wx.ArtProvider would have a GetIconBundle method, but it's not easy
        #  to understand how to use it... if it's actually
        #  implemented/tested/maintained at all...
        bundle = wx.IconBundle()

        for path in self.bundles[bundleid]:
            bundle.AddIcon(wx.Icon(path))

        return bundle
Ejemplo n.º 23
0
    def __init__(self, wxapp, iconfilename):
        wx.TaskBarIcon.__init__(self)
        self.wxapp = wxapp

        self.icons = wx.IconBundle()
        self.icons.AddIconFromFile(iconfilename, wx.BITMAP_TYPE_ICO)
        self.icon = self.icons.GetIcon(wx.Size(-1, -1))

        if sys.platform != "darwin":
            # Mac already has the right icon set at startup
            self.SetIcon(self.icon, self.wxapp.appname)
Ejemplo n.º 24
0
def add_icon(frame):
    """
    Probably best to add largest first:
    http://stackoverflow.com/questions/525329/embedding-icon-in-exe-with-py2exe-visible-in-vista/6198910#6198910
    """
    ib = wx.IconBundle()
    for sz in (128, 64, 48, 32, 16):
        icon_path = str(
            Path(mg.SCRIPT_PATH) / 'images' / f'sofastats_{sz}.xpm')
        ib.AddIcon(icon_path, wx.BITMAP_TYPE_XPM)
    frame.SetIcons(ib)
Ejemplo n.º 25
0
 def __init__(self, redirect=False):
     wx.App.__init__(self)
     ib = wx.IconBundle()
     bmp = self.make_grad_image(32, 32, (0, 0, 0), (0, 0, 0))
     icon = wx.EmptyIcon()
     icon.CopyFromBitmap(bmp)
     ib.AddIcon(icon)
     self.mainWindow = GUIMain()
     self.setIcon(0, 0, 0, 0, 0, 0)
     self.mainWindow.Center()
     self.mainWindow.Show(True)
Ejemplo n.º 26
0
 def setIcon(self):
     ib = wx.IconBundle()
     if current.outputMode:
             bmp = self.make_grad_image(32,32, (255,255,0), (0,0,0))
             self.mainWindow.currentTopPanel.outputButton.SetLabel("Pause Output ( Ctrl End )")
     else:
             bmp = self.make_grad_image(32,32, (0,0,0), (0,0,0))
             self.mainWindow.currentTopPanel.outputButton.SetLabel("Continue Output ( Ctrl Home )")
     icon = wx.EmptyIcon()
     icon.CopyFromBitmap(bmp)
     ib.AddIcon(icon)
     self.mainWindow.SetIcons(ib)
Ejemplo n.º 27
0
 def __init__(self, redirect=False):
     wx.App.__init__(self)
     ib = wx.IconBundle()
     bmp = self.make_grad_image(32, 32, (0, 0, 0), (0, 0, 0))
     icon = wx.EmptyIcon()
     icon.CopyFromBitmap(bmp)
     ib.AddIcon(icon)
     self.mainWindow = GUIMain()
     self.mainWindow.SetIcons(ib)
     self.mainWindow.Center()
     self.mainWindow.Show(True)
     self.mainWindow.timer.Start(int(1000.0 / profile.niaFPS))
Ejemplo n.º 28
0
def icon_bundle(fn):
    """
    wx doesn't automatically load all the different sizes from a .ico :(
    """
    icons = wx.IconBundle()
    for sz in [16, 32, 48]:
        try:
            icon = wx.Icon(fn, wx.BITMAP_TYPE_ICO, desiredWidth=sz, desiredHeight=sz)
            icons.AddIcon(icon)
        except:
            pass
    return icons
Ejemplo n.º 29
0
 def __init__(self, redirect=False):
     wx.App.__init__(self)
     ib = wx.IconBundle()
     bmp = wx.Image('icons' + os.sep + 'triathlon.png',
                    wx.BITMAP_TYPE_ANY).ConvertToBitmap()
     icon = wx.EmptyIcon()
     icon.CopyFromBitmap(bmp)
     ib.AddIcon(icon)
     self.mainWindow = StarterMain()
     self.mainWindow.SetIcons(ib)
     self.mainWindow.Center()
     self.mainWindow.Show(True)
Ejemplo n.º 30
0
def icon_bundle(fn):
    import wx
    icons = wx.IconBundle()
    for sz in [16, 32, 48]:
        try:
            icon = wx.Icon(fn,
                           wx.BITMAP_TYPE_ICO,
                           desiredWidth=sz,
                           desiredHeight=sz)
            icons.AddIcon(icon)
        except:
            pass
    return icons