Example #1
0
 def _icon(self, name='information'):
     name = 'ART_%s' % name.upper()
     #title icon
     bitmap = graphics.bitmap(name, (16, 16))
     _ic = wx.EmptyIcon()
     _ic.CopyFromBitmap(bitmap)
     self.SetIcon(_ic)
     #dialog icon
     bitmap = graphics.bitmap(name, self._icon_size)
     self.icon.SetBitmap(bitmap)
     self.icon.Show(True)
Example #2
0
 def _icon(self, name='information'):
     name = 'ART_%s' % name.upper()
     #title icon
     bitmap = graphics.bitmap(name, (16, 16))
     _ic = wx.EmptyIcon()
     _ic.CopyFromBitmap(bitmap)
     self.SetIcon(_ic)
     #dialog icon
     bitmap = graphics.bitmap(name, self._icon_size)
     self.icon.SetBitmap(bitmap)
     self.icon.Show(True)
Example #3
0
 def show_droplet(self, checked):
     if checked:
         if api.check_actionlist(self.tree.export_forms(),
                 wx.GetApp().settings):
             self.droplet = droplet.Frame(self,
                 title=_("Drag & Drop") + ' - ' + ct.TITLE,
                 bitmap=graphics.bitmap(images.DROPLET),
                 method=self.on_drop,
                 label=self.droplet_label_format(
                     system.filename_to_title(self.filename)),
                 label_color=wx.Colour(217, 255, 186),
                 label_pos=(8, 8),
                 label_angle=0,
                 pos=self.GetPosition(),
                 auto=True,
                 OnShow=self.on_show_droplet,
                 tooltip=_(
                 "Drop any files and/or folders on this Phatch droplet\n"
                 "to batch process them.\n"
                 "Right-click or double-click to switch to normal view."))
         else:
             wx.CallAfter(self.on_show_droplet, False)
     else:
         if self.droplet:
             self.droplet.show(False)
Example #4
0
 def add_tool(self, bitmap, label, tooltip, method, item=wx.ITEM_NORMAL):
     id = wx.NewId()
     bitmap = graphics.bitmap(bitmap, self.tool_bitmap_size,
                 client=wx.ART_TOOLBAR)
     args = (id, label, bitmap, wx.NullBitmap, item,
                 tooltip, "")
     tool = self.frame_toolbar.AddLabelTool(*args)
     self.Bind(wx.EVT_TOOL, method, id=id)
     return tool
Example #5
0
 def show_notification(self, message, force=False, report=None):
     self.set_report(report)
     active = wx.GetApp().IsActive() or self.IsActive()
     if force or not active:
         notify.send(title=system.filename_to_title(self.filename),
                     message=message,
                     icon=self.get_icon_filename(),
                     wxicon=graphics.bitmap(images.ICON_PHATCH_64))
     if not active:
         self.RequestUserAttention()
Example #6
0
 def show_notification(self, message, force=False, report=None):
     self.set_report(report)
     active = wx.GetApp().IsActive() or self.IsActive()
     if force or not active:
         notify.send(
             title=system.filename_to_title(self.filename),
             message=message,
             icon=self.get_icon_filename(),
             wxicon=graphics.bitmap(images.ICON_PHATCH_64))
     if not active:
         self.RequestUserAttention()
Example #7
0
 def on_menu_help_about(self, event):
     from lib.pyWx import about
     from data.info import all_credits
     dlg = about.Dialog(self,
         title='%(version)s' % ct.INFO,
         logo=graphics.bitmap(images.LOGO),
         description=_('PHoto bATCH Processor'),
         website=ct.INFO['url'],
         credits=all_credits(),
         license=ct.LICENSE,
     )
     dlg.ShowModal()
     dlg.Destroy()
Example #8
0
 def OnContextMenu(self, event):
     # todo: does contextmenu always have to be recreated?
     #create id
     self.id_view_source = wx.NewId()
     #create menu
     menu = wx.Menu()
     item = wx.MenuItem(menu, self.id_view_source, _("View Source"))
     item.SetBitmap(graphics.bitmap('ART_FIND', (16, 16)))
     self.Bind(wx.EVT_MENU, self.OnViewSource, id=self.id_view_source)
     menu.AppendItem(item)
     #show menu
     self.PopupMenu(menu)
     #destroy menu
     menu.Destroy()
Example #9
0
 def OnContextMenu(self, event):
     # todo: does contextmenu always have to be recreated?
     #create id
     self.id_view_source = wx.NewId()
     #create menu
     menu = wx.Menu()
     item = wx.MenuItem(menu, self.id_view_source, _("View Source"))
     item.SetBitmap(graphics.bitmap('ART_FIND', (16, 16)))
     self.Bind(wx.EVT_MENU, self.OnViewSource, id=self.id_view_source)
     menu.AppendItem(item)
     #show menu
     self.PopupMenu(menu)
     #destroy menu
     menu.Destroy()
Example #10
0
 def on_menu_tools_python_shell(self, event):
     from lib.pyWx import shell
     self.tree.close_popup()
     if self.shell is None:
         title = ct.TITLE.lower()
         self.shell = shell.Frame(self,
             title=_('%(name)s Shell') % ct.INFO,
             intro='%(name)s ' % ct.INFO,
             values={
                 '%s_%s' % (title, _('application')): wx.GetApp(),
                 '%s_%s' % (title, _('frame')): self,
                 '%s_%s' % (title, _('actions')): self.tree.export_forms,
                 },
             icon=graphics.bitmap(images.ICON_PHATCH_64),
         )
     self.shell.Show(event.IsChecked())
Example #11
0
 def GetItem(self, n):
     action = self.actions[n]
     return (_(action.label), _(action.__doc__),
             graphics.bitmap(action.icon, self.GetIconSize()))
Example #12
0
 def GetItem(self, n):
     action = self.actions[n]
     return (_(action.label), _(action.__doc__),
         graphics.bitmap(action.icon, self.GetIconSize()))
Example #13
0
 def _splash(self):
     return droplet.Frame(None,
         title=ct.TITLE,
         bitmap=graphics.bitmap(images.SPLASH),
         splash=True,
     )