def create_toolbar(self): # create the toolbar self.toolbar = wx.ToolBar(self.toolbarpanel, style=wx.TB_FLAT | wx.TB_NODIVIDER | wx.TB_HORZ_TEXT) self.toolbar.SetToolBitmapSize((16, 16)) force_mask = False if osutils.is_msw() and not osutils.is_win2000(): force_mask = not guiutil.is_xp_styled() self.tooltip_config.add_to_toolbar(self.toolbar, permanent=False) self.tooltip_config.bind_to_toolbar(self.toolbar) # self.toolbar.AddSeparator() self.gui_anchor = self.toolbar.AddLabelTool( wx.ID_ANY, _("Anchor"), bmp("anchor.png", force_mask=force_mask), shortHelp=_("Don't hide this tooltip")) self.gui_copy = self.toolbar.AddLabelTool( wx.ID_ANY, _("Copy All"), bmp("page_copy.png", force_mask=force_mask), shortHelp=_("Copy tooltip text (with links)")) self.toolbar.Bind(wx.EVT_TOOL, self.stay_on_top, id=self.gui_anchor.Id) self.toolbar.Bind(wx.EVT_TOOL, self.copy_all, id=self.gui_copy.Id) self.toolbar.Realize()
def create_toolbar_items(self): self.gui_reference = versetree.VerseTree(self.toolbar, with_verses=True) self.gui_reference.SetSize((140, -1)) self.gui_go = self.toolbar.AddTool( wx.ID_ANY, guiutil.bmp("accept.png"), shortHelpString=_("Go to this reference")) self.toolbar.AddSeparator() self.gui_link = self.toolbar.AddCheckTool( wx.ID_ANY, guiutil.bmp("link.png"), shortHelp=_("Link the %s to the Bible") % self.title) self.linked = True self.toolbar.ToggleTool(self.gui_link.Id, True) self.toolbar.InsertControl(0, self.gui_reference) self.toolbar.Bind(wx.EVT_TOOL, self.set_ref, id=self.gui_go.Id) self.toolbar.Bind(wx.EVT_TOOL, self.on_link, id=self.gui_link.Id) self.gui_reference.Bind(wx.EVT_TEXT_ENTER, self.set_ref) self.gui_reference.on_selected_in_tree += self.set_ref
def create_toolbar_items(self): self.gui_reference = versetree.VerseTree(self.toolbar, with_verses=True) self.gui_reference.SetSize((140, -1)) self.gui_go = self.toolbar.AddTool(wx.ID_ANY, guiutil.bmp("accept.png"), shortHelpString=_("Go to this reference")) self.toolbar.AddSeparator() self.gui_link = self.toolbar.AddCheckTool( wx.ID_ANY, guiutil.bmp("link.png"), shortHelp=_("Link the %s to the Bible") % self.title ) self.linked = True self.toolbar.ToggleTool(self.gui_link.Id, True) self.toolbar.InsertControl(0, self.gui_reference) self.toolbar.Bind(wx.EVT_TOOL, self.set_ref, id=self.gui_go.Id) self.toolbar.Bind(wx.EVT_TOOL, self.on_link, id=self.gui_link.Id) self.gui_reference.Bind(wx.EVT_TEXT_ENTER, self.set_ref) self.gui_reference.on_selected_in_tree += self.set_ref
def create_toolbar(self): # create the toolbar self.toolbar = wx.ToolBar(self.toolbarpanel, style=wx.TB_FLAT|wx.TB_NODIVIDER|wx.TB_HORZ_TEXT) self.toolbar.SetToolBitmapSize((16, 16)) force_mask = False if osutils.is_msw() and not osutils.is_win2000(): force_mask = not guiutil.is_xp_styled() self.tooltip_config.add_to_toolbar(self.toolbar, permanent=False) self.tooltip_config.bind_to_toolbar(self.toolbar) # self.toolbar.AddSeparator() self.gui_anchor = self.toolbar.AddLabelTool(wx.ID_ANY, _("Anchor"), bmp("anchor.png", force_mask=force_mask), shortHelp=_("Don't hide this tooltip")) self.gui_copy = self.toolbar.AddLabelTool(wx.ID_ANY, _("Copy All"), bmp("page_copy.png", force_mask=force_mask), shortHelp=_("Copy tooltip text (with links)")) self.toolbar.Bind(wx.EVT_TOOL, self.stay_on_top, id=self.gui_anchor.Id) self.toolbar.Bind(wx.EVT_TOOL, self.copy_all, id=self.gui_copy.Id) self.toolbar.Realize()
def create_toolbar_items(self): super(VerseCompareFrame, self).create_toolbar_items() self.gui_book_choice = self.toolbar.InsertTool( 3, wx.ID_ANY, guiutil.bmp("book.png"), shortHelpString=_("Choose books to compare")) self.gui_parallel = self.toolbar.InsertTool( 4, wx.ID_ANY, guiutil.bmp("text_columns.png"), isToggle=True, shortHelpString=_("View in parallel mode")) self.toolbar.ToggleTool(self.gui_parallel.Id, verse_comparison_settings["parallel"]) self.toolbar.InsertSeparator(5) self.toolbar.Bind(wx.EVT_TOOL, self.on_parallel_toggle, id=self.gui_parallel.Id) self.toolbar.Bind(wx.EVT_TOOL, lambda evt: self.set_versions(), id=self.gui_book_choice.Id)
def add_to_toolbar(self, toolbar, permanent): toolbar.gui_edit = toolbar.AddLabelTool( wx.ID_ANY, _("Edit"), guiutil.bmp("page_edit.png"), shortHelp=_("Edit this comment")) toolbar.gui_delete = toolbar.AddLabelTool(wx.ID_ANY, _("Delete"), guiutil.bmp("delete.png"), shortHelp=_("Delete this comment"))
def __init__(self, parent): super(SourcesPanel, self).__init__(parent) self.sources = SourcesModel() self.toolbar = wx.ToolBar(self.toolbar_panel, style=wx.TB_FLAT | wx.TB_HORZ_TEXT | wx.TB_NODIVIDER ) self.toolbar.SetToolBitmapSize((16, 16)) self.gui_add = self.toolbar.AddLabelTool(wx.ID_ANY, "Add", bmp("application_form_add.png", ), shortHelp="Add a new install source" ) self.gui_remove = self.toolbar.AddLabelTool(wx.ID_ANY, "Delete", bmp("application_form_delete.png", ), shortHelp="Remove this install source" ) self.toolbar.Bind(wx.EVT_UPDATE_UI, lambda evt: evt.Enable(self.sources_list.GetSelection() != wx.NOT_FOUND), self.gui_remove ) self.source_name.Bind(wx.EVT_TEXT, self.change_item_caption) self.source_location.Bind(wx.EVT_TEXT, lambda evt: self.sources.set_url(self.source_location.Value)) self.sources_list.Bind(wx.EVT_LISTBOX, self.change_item) self.toolbar.Bind(wx.EVT_TOOL, self.add_item, self.gui_add) self.toolbar.Bind(wx.EVT_TOOL, self.remove_item, self.gui_remove) self.toolbar.Realize() self.toolbar.MinSize = self.toolbar.Size sizer = wx.BoxSizer(wx.HORIZONTAL) sizer.Add(self.toolbar, 1, wx.GROW) self.toolbar_panel.SetSizerAndFit(sizer) self.SetSize((550, 320)) self.Layout() self.update_ui() self.sources.on_change_item += self.on_change_item self.sources.on_source_added += self.on_add_item self.sources.on_source_deleted += self.on_delete_item
def __init__(self, parent): super(SourcesPanel, self).__init__(parent) self.sources = SourcesModel() self.toolbar = wx.ToolBar(self.toolbar_panel, style=wx.TB_FLAT | wx.TB_HORZ_TEXT | wx.TB_NODIVIDER) self.toolbar.SetToolBitmapSize((16, 16)) self.gui_add = self.toolbar.AddLabelTool( wx.ID_ANY, "Add", bmp("application_form_add.png", ), shortHelp="Add a new install source") self.gui_remove = self.toolbar.AddLabelTool( wx.ID_ANY, "Delete", bmp("application_form_delete.png", ), shortHelp="Remove this install source") self.toolbar.Bind( wx.EVT_UPDATE_UI, lambda evt: evt.Enable( self.sources_list.GetSelection() != wx.NOT_FOUND), self.gui_remove) self.source_name.Bind(wx.EVT_TEXT, self.change_item_caption) self.source_location.Bind( wx.EVT_TEXT, lambda evt: self.sources.set_url(self.source_location.Value)) self.sources_list.Bind(wx.EVT_LISTBOX, self.change_item) self.toolbar.Bind(wx.EVT_TOOL, self.add_item, self.gui_add) self.toolbar.Bind(wx.EVT_TOOL, self.remove_item, self.gui_remove) self.toolbar.Realize() self.toolbar.MinSize = self.toolbar.Size sizer = wx.BoxSizer(wx.HORIZONTAL) sizer.Add(self.toolbar, 1, wx.GROW) self.toolbar_panel.SetSizerAndFit(sizer) self.SetSize((550, 320)) self.Layout() self.update_ui() self.sources.on_change_item += self.on_change_item self.sources.on_source_added += self.on_add_item self.sources.on_source_deleted += self.on_delete_item
def create_toolbar(self): self.toolbar = wx.ToolBar(self.toolbarpanel, style=wx.TB_FLAT | wx.TB_NODIVIDER | wx.TB_HORZ_TEXT) if self.tooltip_config.add_to_toolbar(self.toolbar, permanent=True): self.toolbar.AddSeparator() self.tooltip_config.bind_to_toolbar(self.toolbar) self.gui_anchor = self.toolbar.AddLabelTool(wx.ID_ANY, _("Stay on top"), guiutil.bmp("pushpin.gif"), shortHelp=_("Stay on top"), kind=wx.ITEM_CHECK) self.toolbar.Bind(wx.EVT_TOOL, self.toggle_topness, id=self.gui_anchor.Id) self.toolbar.Bind(wx.EVT_UPDATE_UI, lambda evt: evt.Check(self.stayontop), id=self.gui_anchor.Id) self.toolbar.Realize()
def add_to_toolbar(self, toolbar, permanent): #if not self.shortened: return False toolbar.gui_find = toolbar.AddLabelTool(wx.ID_ANY, _("Find"), guiutil.bmp("find.png"), shortHelp=_("Search for this strong's number in the Bible")) self.bind_to_toolbar(toolbar) return True
def add_to_toolbar(self, toolbar, permanent): #if not self.shortened: return False toolbar.gui_find = toolbar.AddLabelTool( wx.ID_ANY, _("Find"), guiutil.bmp("find.png"), shortHelp=_("Search for this strong's number in the Bible")) self.bind_to_toolbar(toolbar) return True
def create_toolbar_items(self): super(VerseCompareFrame, self).create_toolbar_items() self.gui_book_choice = self.toolbar.InsertTool(3, wx.ID_ANY, guiutil.bmp("book.png"), shortHelpString=_("Choose books to compare") ) self.gui_parallel = self.toolbar.InsertTool(4, wx.ID_ANY, guiutil.bmp("text_columns.png"), isToggle=True, shortHelpString=_("View in parallel mode") ) self.toolbar.ToggleTool(self.gui_parallel.Id, verse_comparison_settings["parallel"] ) self.toolbar.InsertSeparator(5) self.toolbar.Bind(wx.EVT_TOOL, self.on_parallel_toggle, id=self.gui_parallel.Id) self.toolbar.Bind(wx.EVT_TOOL, lambda evt:self.set_versions(), id=self.gui_book_choice.Id)
def add_to_toolbar(self, toolbar, permanent): toolbar.permanent = permanent if not permanent: return toolbar.gui_reference = wx.TextCtrl(toolbar, style=wx.TE_PROCESS_ENTER, size=(140, -1)) toolbar.AddControl(toolbar.gui_reference) toolbar.gui_go = toolbar.AddLabelTool(wx.ID_ANY, _("Go to verses"), guiutil.bmp("accept.png"), shortHelp=_("Open this reference") ) return True
def add_to_toolbar(self, toolbar, permanent): toolbar.permanent = permanent if not permanent: return toolbar.gui_reference = wx.TextCtrl(toolbar, style=wx.TE_PROCESS_ENTER, size=(140, -1)) toolbar.AddControl(toolbar.gui_reference) toolbar.gui_go = toolbar.AddLabelTool( wx.ID_ANY, _("Go to verses"), guiutil.bmp("accept.png"), shortHelp=_("Open this reference")) return True
def __init__(self, parent): super(TextEntry, self).__init__(parent) self.text = wx.TextCtrl(self, style=wx.TE_PROCESS_ENTER) self.calendar_pic = bmp("calendar_view_day.png") self.calendar = wx.BitmapButton(self, bitmap=self.calendar_pic) # self.calendar.SetBezelWidth(1) w, h = self.text.Size[1], self.text.Size[1] self.calendar.SetSize((w, h)) self.calendar.MinSize = self.calendar.Size self.calendar.Bind(wx.EVT_BUTTON, self.show_popup) sizer = wx.BoxSizer(wx.HORIZONTAL) sizer.Add(self.text, 1, wx.GROW) self.calendar_sizer_item = sizer.Add(self.calendar, 0, flag=wx.FIXED_MINSIZE | wx.ALIGN_CENTER | wx.SHAPED) self.SetSizer(sizer) self.show_calendar(False)
def create_toolbar(self): self.toolbar = wx.ToolBar(self.toolbarpanel, style=wx.TB_FLAT | wx.TB_NODIVIDER | wx.TB_HORZ_TEXT) if self.tooltip_config.add_to_toolbar(self.toolbar, permanent=True): self.toolbar.AddSeparator() self.tooltip_config.bind_to_toolbar(self.toolbar) self.gui_anchor = self.toolbar.AddLabelTool( wx.ID_ANY, _("Show in tooltip"), guiutil.bmp("anchor.png"), shortHelp=_("Show this in a tooltip") ) self.toolbar.Bind(wx.EVT_TOOL, self.stay_on_top, id=self.gui_anchor.Id) # self.toolbar.Bind(wx.EVT_TOOL, self.toggle_topness, # id=self.gui_anchor.Id) # self.toolbar.Bind(wx.EVT_UPDATE_UI, # lambda evt:evt.Check(self.stayontop), id=self.gui_anchor.Id) self.toolbar.Realize()
def create_toolbar(self): self.toolbar = wx.ToolBar(self.toolbarpanel, style=wx.TB_FLAT|wx.TB_NODIVIDER|wx.TB_HORZ_TEXT) if self.tooltip_config.add_to_toolbar(self.toolbar, permanent=True): self.toolbar.AddSeparator() self.tooltip_config.bind_to_toolbar(self.toolbar) self.gui_anchor = self.toolbar.AddLabelTool(wx.ID_ANY, _("Stay on top"), guiutil.bmp("pushpin.gif"), shortHelp=_("Stay on top"), kind=wx.ITEM_CHECK) self.toolbar.Bind(wx.EVT_TOOL, self.toggle_topness, id=self.gui_anchor.Id) self.toolbar.Bind(wx.EVT_UPDATE_UI, lambda evt:evt.Check(self.stayontop), id=self.gui_anchor.Id) self.toolbar.Realize()
def __init__(self, parent): super(TextEntry, self).__init__(parent) self.text = wx.TextCtrl(self, style=wx.TE_PROCESS_ENTER) self.calendar_pic = bmp("calendar_view_day.png") self.calendar = wx.BitmapButton(self, bitmap=self.calendar_pic) #self.calendar.SetBezelWidth(1) w, h = self.text.Size[1], self.text.Size[1] self.calendar.SetSize((w, h)) self.calendar.MinSize = self.calendar.Size self.calendar.Bind(wx.EVT_BUTTON, self.show_popup) sizer = wx.BoxSizer(wx.HORIZONTAL) sizer.Add(self.text, 1, wx.GROW) self.calendar_sizer_item = sizer.Add(self.calendar, 0, flag=wx.FIXED_MINSIZE | wx.ALIGN_CENTER | wx.SHAPED) self.SetSizer(sizer) self.show_calendar(False)
def create_toolbar(self): self.toolbar = wx.ToolBar(self.toolbarpanel, style=wx.TB_FLAT | wx.TB_NODIVIDER | wx.TB_HORZ_TEXT) if self.tooltip_config.add_to_toolbar(self.toolbar, permanent=True): self.toolbar.AddSeparator() self.tooltip_config.bind_to_toolbar(self.toolbar) self.gui_anchor = self.toolbar.AddLabelTool( wx.ID_ANY, _("Show in tooltip"), guiutil.bmp("anchor.png"), shortHelp=_("Show this in a tooltip")) self.toolbar.Bind(wx.EVT_TOOL, self.stay_on_top, id=self.gui_anchor.Id) #self.toolbar.Bind(wx.EVT_TOOL, self.toggle_topness, # id=self.gui_anchor.Id) #self.toolbar.Bind(wx.EVT_UPDATE_UI, # lambda evt:evt.Check(self.stayontop), id=self.gui_anchor.Id) self.toolbar.Realize()