def __init__(self, parent): self.hovering = False # is the user hovering the mouse over the control self.clicking = False self.pulledDown = False wx.Control.__init__(self, parent, wx.ID_ANY, style=wx.NO_BORDER) self.pullDownBitmap = getResourceRegistry().getBitmap( u"images/widgets/detailspanel/pulldown.png") #$NON-NLS-1$ self.pullDownBitmapHover = getResourceRegistry().getBitmap( u"images/widgets/detailspanel/pulldown_hover.png") #$NON-NLS-1$ self.pullUpBitmap = getResourceRegistry().getBitmap( u"images/widgets/detailspanel/pullup.png") #$NON-NLS-1$ self.pullUpBitmapHover = getResourceRegistry().getBitmap( u"images/widgets/detailspanel/pullup_hover.png") #$NON-NLS-1$ self.Bind(wx.EVT_PAINT, self.onPaint, self) self.Bind(wx.EVT_ERASE_BACKGROUND, self.onEraseBackground, self) self.Bind(wx.EVT_ENTER_WINDOW, self.onEnter, self) self.Bind(wx.EVT_LEAVE_WINDOW, self.onLeave, self) self.Bind(wx.EVT_LEFT_DOWN, self.onLeftClickDown, self) self.Bind(wx.EVT_LEFT_UP, self.onLeftClickUp, self) self.SetSizeHints(self.pullDownBitmap.GetWidth(), self.pullDownBitmap.GetHeight() + 2)
def _createWidgets(self): self.descriptionLabel = wx.StaticText( self, wx.ID_ANY, _extstr(u"flickrprovider.FlickrAuthDescription")) #$NON-NLS-1$ self.stepOneLabel = wx.StaticText( self, wx.ID_ANY, _extstr(u"flickrprovider.BeginAuthLabel")) #$NON-NLS-1$ self.stepOneButton = wx.Button( self, wx.ID_ANY, _extstr(u"flickrprovider.Begin")) #$NON-NLS-1$ self.stepTwoLabel = wx.StaticText( self, wx.ID_ANY, _extstr(u"flickrprovider.ClickHereLabel")) #$NON-NLS-1$ self.stepTwoButton = wx.Button( self, wx.ID_ANY, _extstr(u"flickrprovider.Authorized")) #$NON-NLS-1$ self.resultLabel = wx.StaticText( self, wx.ID_ANY, _extstr(u"flickrprovider.NotYetAuthorized")) #$NON-NLS-1$ self.completeBitmap = getResourceRegistry().getBitmap( u"images/common/check.png") #$NON-NLS-1$ self.completeImage = ZStaticBitmap(self, self.completeBitmap) self.warningBitmap = getResourceRegistry().getBitmap( u"images/common/warning.png") #$NON-NLS-1$ self.warningImage = ZStaticBitmap(self, self.warningBitmap)
def _createImportMenuModel(self): menuModel = ZMenuModel() zbwId = menuModel.addMenuItemWithAction(_extstr(u"manager.FromZBW"), 0, ZImportFromZBWAction(self, self.model), None) #$NON-NLS-1$ menuModel.setMenuItemBitmap(zbwId, getResourceRegistry().getBitmap(u"images/common/zbw/BlogWriter.ico")) #$NON-NLS-1$ wlwId = menuModel.addMenuItemWithAction(_extstr(u"manager.FromWLW"), 0, ZImportFromWLWAction(self, self.model), None) #$NON-NLS-1$ menuModel.setMenuItemBitmap(wlwId, getResourceRegistry().getBitmap(u"images/common/wlw/LiveWriter.png")) #$NON-NLS-1$ return menuModel
def _populateWidgets(self): params = { u"account_summary": _extstr(u"acctsummary.AccountSummary"), #$NON-NLS-1$ #$NON-NLS-2$ u"zoundry_raven": _extstr(u"ZoundryRaven"), #$NON-NLS-1$ #$NON-NLS-2$ u"view_settings_desc": _extstr( u"acctsummary.ViewSettingsDesc"), #$NON-NLS-1$ #$NON-NLS-2$ u"refresh_account": _extstr(u"acctsummary.RefreshDesc"), #$NON-NLS-1$ #$NON-NLS-2$ u"view_settings": _extstr(u"acctsummary.ViewSettings"), #$NON-NLS-1$ #$NON-NLS-2$ u"refresh": _extstr(u"acctsummary.Refresh"), #$NON-NLS-1$ #$NON-NLS-2$ u"account_name": self.account.getName(), #$NON-NLS-1$ u"settings_imgpath": getResourceRegistry().getImagePath( u"images/perspectives/standard/contextinfo/account_summary/settings.png" ), #$NON-NLS-1$ #$NON-NLS-2$ u"refresh_imgpath": getResourceRegistry().getImagePath( u"images/perspectives/standard/contextinfo/account_summary/synch.png" ), #$NON-NLS-1$ #$NON-NLS-2$ } htmlPath = getResourceRegistry().getResourcePath( u"html/perspectives/standard/contextinfo/account_summary.html" ) #$NON-NLS-1$ html = loadStaticHtml(htmlPath, params) #$NON-NLS-1$ self.htmlWidget.SetPage(html)
def _createContentWidgets(self, parent): htmlPath = getResourceRegistry().getResourcePath( u"html/perspectives/standard/contextinfo/getting_started.html" ) #$NON-NLS-1$ logoPath = getResourceRegistry().getResourcePath( u"images/perspectives/standard/contextinfo/logo.png") #$NON-NLS-1$ params = { u"getting_started": _extstr(u"welcome.GettingStarted"), #$NON-NLS-1$ #$NON-NLS-2$ u"zoundry_raven": _extstr(u"ZoundryRaven"), #$NON-NLS-1$ #$NON-NLS-2$ u"welcome_to_raven": _extstr(u"welcome.WelcomeToRaven"), #$NON-NLS-1$ #$NON-NLS-2$ u"create_account": _extstr(u"welcome.CreateAnAccount"), #$NON-NLS-1$ #$NON-NLS-2$ u"create_account_desc": _extstr(u"welcome.CreateAccountDesc"), #$NON-NLS-1$ #$NON-NLS-2$ u"write_post": _extstr(u"welcome.WritePost"), #$NON-NLS-1$ #$NON-NLS-2$ u"write_post_desc": _extstr(u"welcome.WritePostDesc"), #$NON-NLS-1$ #$NON-NLS-2$ u"publish": _extstr(u"welcome.Publish"), #$NON-NLS-1$ #$NON-NLS-2$ u"publish_desc": _extstr(u"welcome.PublishDesc"), #$NON-NLS-1$ #$NON-NLS-2$ u"logo": logoPath, #$NON-NLS-1$ } html = loadStaticHtml(htmlPath, params) self.htmlWidget = ZHTMLControl(parent, style=wx.NO_BORDER) self.htmlWidget.SetBorders(0) self.htmlWidget.SetPage(html)
def _createImageMap(self): imageList = ZMappedImageList() bitmap = getResourceRegistry().getBitmap(u"images/dialogs/translation/editor/checked.png") #$NON-NLS-1$ imageList.addImage(u"checked", bitmap) #$NON-NLS-1$ bitmap = getResourceRegistry().getBitmap(u"images/dialogs/translation/editor/unchecked.png") #$NON-NLS-1$ imageList.addImage(u"unchecked", bitmap) #$NON-NLS-1$ return imageList
def _createImageMap(self): imageList = ZMappedImageList() bitmap = getResourceRegistry().getBitmap( u"images/dialogs/translation/editor/checked.png") #$NON-NLS-1$ imageList.addImage(u"checked", bitmap) #$NON-NLS-1$ bitmap = getResourceRegistry().getBitmap( u"images/dialogs/translation/editor/unchecked.png") #$NON-NLS-1$ imageList.addImage(u"unchecked", bitmap) #$NON-NLS-1$ return imageList
def getAllFlagBitmaps(): u"returns a list of (countryCode, bitmap) tuples" #$NON-NLS-1$ rval = [] flagPath = getResourceRegistry().getResourcePath(u"images/common/flags", True) #$NON-NLS-1$ for filePath in getDirectoryListing(flagPath): baseFileName = os.path.basename(filePath) countryCode = os.path.splitext(baseFileName)[0] bitmap = getResourceRegistry().getBitmap(u"images/common/flags/%s" % baseFileName) #$NON-NLS-1$ if countryCode and bitmap is not None and len(countryCode) == 2: rval.append( (countryCode, bitmap) ) return rval
def getFlagBitmapForLocale(locale): u"""getFlagBitmapForLocale(string|ZLocale) -> wx.Bitmap Gets the flag bitmap for the given ZLocale or locale string.""" #$NON-NLS-1$ if not isinstance(locale, ZLocale): locale = ZLocale(locale) bitmap = None if locale.hasCountryCode(): bitmap = getResourceRegistry().getBitmap(u"images/common/flags/%s.png" % string.lower(locale.getCountryCode())) #$NON-NLS-1$ if bitmap is None: bitmap = getResourceRegistry().getBitmap(u"images/common/flags/%s.png" % locale.getLanguageCode()) #$NON-NLS-1$ return bitmap
def getFlagPathForLocale(localeStr): u"""getFlagPathForLocale(string) -> string Gets the flag bitmap path for the given locale.""" #$NON-NLS-1$ locale = ZLocale(localeStr) bitmapPath = None if locale.hasCountryCode(): bitmapPath = getResourceRegistry().getImagePath(u"images/common/flags/%s.png" % string.lower(locale.getCountryCode())) #$NON-NLS-1$ if bitmapPath is None or not os.path.isfile(bitmapPath): bitmapPath = getResourceRegistry().getImagePath(u"images/common/flags/%s.png" % locale.getLanguageCode()) #$NON-NLS-1$ if bitmapPath is None or not os.path.isfile(bitmapPath): bitmapPath = None return bitmapPath
def _createHeaderWidgets(self, parent, widgetList): bitmap = getResourceRegistry().getBitmap(u"images/perspectives/standard/summary/panel_menu.png") #$NON-NLS-1$ self.panelMenuButton = ZImageButton(parent, bitmap, True, None, True) bitmap = getResourceRegistry().getBitmap(u"images/perspectives/standard/summary/use_template.png") #$NON-NLS-1$ self.templateToggleButton = ZNoFocusToggleButton(parent, bitmap) widgetList.append(self.templateToggleButton) widgetList.append(self.panelMenuButton) appModel = getApplicationModel() userProfile = appModel.getUserProfile() userPrefs = userProfile.getPreferences() useTemplateInPreview = userPrefs.getUserPreferenceBool(IZBlogAppUserPrefsKeys.POST_PREVIEW_VIEW_USE_TEMPLATE, True) self.templateToggleButton.Toggle(useTemplateInPreview)
def _buildModel(self): menuId = self.addMenuItemWithActionId( 5, IZBlogAppActionIDs.ACCOUNT_SYNCHRONIZE_ACTION) self.setMenuItemBitmap( menuId, getResourceRegistry().getBitmap( u"images/common/menu/blog-account/synchronize.png") ) #$NON-NLS-1$ self.addSeparator(50) menuId = self.addMenuItemWithActionId( 55, IZBlogAppActionIDs.ACCOUNT_SETTINGS_ACTION) self.setMenuItemBitmap( menuId, getResourceRegistry().getBitmap( u"images/common/menu/blog-account/settings.png")) #$NON-NLS-1$
def _updateHeader(self): self.headerLink.SetLabel(self._getHeaderTitle()) self.headerLink.SetURL(self._getHeaderHelpURL()) self.headerMessage.SetLabel(self._getHeaderMessage()) self.headerIcon.setBitmap(getResourceRegistry().getBitmap(self._getHeaderImagePath())) self.headerPanel.Layout() self.headerPanel.Refresh()
def _loadErrorHTML(self): global RESOURCE_REGISTRY return ERROR_HTML % { u"error_header" : _extstr(u"error_dialog.Error"), #$NON-NLS-1$ #$NON-NLS-2$ u"error_message" : self.errorMessage, #$NON-NLS-1$ u"error_image" : getResourceRegistry().getImagePath(u"images/widgets/error_dialog/error.png") #$NON-NLS-1$ #$NON-NLS-2$ }
def _createImageMap(self): imageList = ZMappedImageList() imageList.addImage(u"template", getResourceRegistry().getBitmap( u"images/dialogs/template/manager/template.png") ) #$NON-NLS-1$ #$NON-NLS-2$ return imageList
def __init__(self, rvalMap, model, systemProfile): self.rvalMap = rvalMap self.model = model self.systemProfile = systemProfile self.selectedIndex = -1 self.importMenuModel = self._createImportMenuModel() title = _extstr(u"manager.WindowTitle") #$NON-NLS-1$ portable = _extstr(u"manager.Portable") #$NON-NLS-1$ if isPortableEnabled(): title = u"%s (%s)" % (title, portable) #$NON-NLS-1$ wx.Frame.__init__(self, None, wx.ID_ANY, title, size=wx.Size(400, 325), style = wx.DEFAULT_FRAME_STYLE) self._createWidgets() self._populateWidgets() self._layoutWidgets() self._bindWidgetEvents() self.CentreOnScreen() self.SetIcons(getResourceRegistry().getIconBundle(ICON_IMAGES)) self.Show(True) # Auto-select the 'default' profile. defaultName = self.model.getDefaultProfileName() if defaultName: self.profilesListView.Select(self._getProfileIndex(defaultName), True) # Now set focus on the profileListView self.profilesListView.SetFocus() # Fire a UI exec event - detect ZBW or WLW on startup fireUIExecEvent(ZMethodRunnable(self.onDetectImport), self)
def _createSplashPanel(self, parent): ver = version.ZVersion() verDate = ZSchemaDateTime(ver.getBuildDate()) panel = wx.Panel(parent, wx.ID_ANY) panel.SetBackgroundColour(wx.WHITE) splashFilename = u"splash.png" #$NON-NLS-1$ if isPortableEnabled(): splashFilename = u"splash_portable.png" #$NON-NLS-1$ bitmap = getResourceRegistry().getBitmap(u"images/splash/%s" % splashFilename) #$NON-NLS-1$ splashImage = ZStaticBitmap(panel, bitmap) versionLabelLabel = wx.StaticText(panel, wx.ID_ANY, u"%s: " % _extstr(u"splash.Version")) #$NON-NLS-1$ #$NON-NLS-2$ versionLabelLabel.SetFont(getDefaultFontBold()) versionLabel = wx.StaticText(panel, wx.ID_ANY, ver.getFullVersionString()) dateLabelLabel = wx.StaticText(panel, wx.ID_ANY, u"%s: " % _extstr(u"splash.BuiltOn")) #$NON-NLS-1$ #$NON-NLS-2$ dateLabelLabel.SetFont(getDefaultFontBold()) dateLabel = wx.StaticText(panel, wx.ID_ANY, verDate.toString(localTime = True)) verAndDateSizer = wx.BoxSizer(wx.HORIZONTAL) verAndDateSizer.Add(versionLabelLabel, 0, wx.EXPAND | wx.RIGHT, 2) verAndDateSizer.Add(versionLabel, 0, wx.EXPAND | wx.RIGHT, 10) verAndDateSizer.Add(dateLabelLabel, 0, wx.EXPAND | wx.RIGHT, 2) verAndDateSizer.Add(dateLabel, 0, wx.EXPAND) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(splashImage, 0, wx.EXPAND) sizer.AddSizer(verAndDateSizer, 0, wx.EXPAND | wx.ALL, 5) panel.SetSizer(sizer) panel.SetAutoLayout(True) return panel
def buildModel(self): resourceReg = getResourceRegistry() # Font toolId = self.addItemWithAction(_extstr(u"blogeditortoolbarmodel.Font"), 10, ZBlogPostFontSettingsAction()) #$NON-NLS-1$ self.setToolDescription(toolId, _extstr(u"blogeditortoolbarmodel.Font_Settings")) #$NON-NLS-1$ self.addToolBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/text_font.png")) #$NON-NLS-1$ self.addToolDisabledBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/text_font_disabled.png")) #$NON-NLS-1$ self.addSeparator(15) # Bold, Italic, Underline, Strike toolId = self.addToggleItemWithAction(_extstr(u"blogeditortoolbarmodel.Bold"), 20, ZBlogRichTextFormatAction(IZRichTextEditControl.ZCAPABILITY_BOLD) ) #$NON-NLS-1$ self.setToolDescription(toolId, _extstr(u"blogeditortoolbarmodel.Bold")) #$NON-NLS-1$ self.addToolBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/text_bold.png")) #$NON-NLS-1$ self.addToolDisabledBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/text_bold_disabled.png")) #$NON-NLS-1$ toolId = self.addToggleItemWithAction(_extstr(u"blogeditortoolbarmodel.Italic"), 25, ZBlogRichTextFormatAction(IZRichTextEditControl.ZCAPABILITY_ITALIC) ) #$NON-NLS-1$ self.setToolDescription(toolId, _extstr(u"blogeditortoolbarmodel.Italic")) #$NON-NLS-1$ self.addToolBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/text_italic.png")) #$NON-NLS-1$ self.addToolDisabledBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/text_italic_disabled.png")) #$NON-NLS-1$ toolId = self.addToggleItemWithAction(_extstr(u"blogeditortoolbarmodel.Underline"), 30, ZBlogRichTextFormatAction(IZRichTextEditControl.ZCAPABILITY_UNDERLINE) ) #$NON-NLS-1$ self.setToolDescription(toolId, _extstr(u"blogeditortoolbarmodel.Underline")) #$NON-NLS-1$ self.addToolBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/text_underline.png")) #$NON-NLS-1$ self.addToolDisabledBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/text_underline_disabled.png")) #$NON-NLS-1$ toolId = self.addToggleItemWithAction(_extstr(u"blogeditortoolbarmodel.Strikethrough"), 35, ZBlogRichTextFormatAction(IZRichTextEditControl.ZCAPABILITY_STRIKETHRU) ) #$NON-NLS-1$ self.setToolDescription(toolId, _extstr(u"blogeditortoolbarmodel.Strikethrough")) #$NON-NLS-1$ self.addToolBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/text_strikethrough.png")) #$NON-NLS-1$ self.addToolDisabledBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/text_strikethrough_disabled.png")) #$NON-NLS-1$ self.addSeparator(40) if self.wysiwyg: self._buildWysiwygEditorModel(resourceReg) else: self._buildXhtmlEditorModel(resourceReg)
def buildModel(self): resourceReg = getResourceRegistry() # Image align imageAlignMenuModel = ZImageAlignMenuModelBuilder().createImageAlignMenuModel() toolId = self.addDropDownItemWithAction(_extstr(u"blogeditortoolbarmodel.Align"), 10, ZBlogPostImageAlignDropDownAction(imageAlignMenuModel)) #$NON-NLS-1$ self.setToolDescription(toolId, _extstr(u"blogeditortoolbarmodel.Align_Image")) #$NON-NLS-1$ self.addToolBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/image_align_left.png")) #$NON-NLS-1$ self.addToolDisabledBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/image_align_left_disabled.png")) #$NON-NLS-1$ # Image border imageBorderMenuModel = ZImageBorderMenuModelBuilder().createImageBorderMenuModel() toolId = self.addDropDownItemWithAction(_extstr(u"blogeditortoolbarmodel.Border"), 20, ZBlogPostImageBorderDropDownAction(imageBorderMenuModel)) #$NON-NLS-1$ self.setToolDescription(toolId, _extstr(u"blogeditortoolbarmodel.Image_border")) #$NON-NLS-1$ self.addToolBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/image_border.png")) #$NON-NLS-1$ self.addToolDisabledBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/image_border_disabled.png")) #$NON-NLS-1$ # Image thumbnail options tnMenuModel = ZImageThumbnailMenuModelBuilder().createImageThumbnailMenuModel() toolId = self.addDropDownItemWithAction(_extstr(u"blogeditortoolbarmodel.Thumbnail"), 30, ZBlogPostCreateThumbnailImageDropDownAction( tnMenuModel )) #$NON-NLS-1$ self.setToolDescription(toolId, _extstr(u"blogeditortoolbarmodel.Create_Thumbnail")) #$NON-NLS-1$ self.addToolBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/image_thumbnail.png")) #$NON-NLS-1$ self.addToolDisabledBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/image_thumbnail_disabled.png")) #$NON-NLS-1$ self.addSeparator(35) # Format Html toolId = self.addDropDownItemWithAction(_extstr(u"blogeditortoolbarmodel.HtmlBlockTags"), 41, ZBlogPostFormatHtmlDropDownAction( ZFormatHtmlMenuModelBuilder(), True )) #$NON-NLS-1$ self.setToolDescription(toolId, _extstr(u"blogeditortoolbarmodel.HtmlBlockTagsDescription")) #$NON-NLS-1$ self.addToolBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/text_heading_1.png")) #$NON-NLS-1$ #self.addToolDisabledBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/insert_html_disabled.png")) #$NON-NLS-1$ toolId = self.addDropDownItemWithAction(_extstr(u"blogeditortoolbarmodel.HtmlTags"), 42, ZBlogPostFormatHtmlDropDownAction( ZFormatHtmlMenuModelBuilder(), False )) #$NON-NLS-1$ self.setToolDescription(toolId, _extstr(u"blogeditortoolbarmodel.HtmlTagsDescription")) #$NON-NLS-1$ self.addToolBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/insert_html.png")) #$NON-NLS-1$ self.addToolDisabledBitmap(toolId, 16, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/insert_html_disabled.png")) #$NON-NLS-1$ self.addSeparator(45)
def __init__(self): self.perspectives = self._loadPerspectives() self.perspectiveId = self._getStartupPerspective() self.perspective = self._createPerspective(self.perspectiveId) self.startupActions = self._loadStartupActions() self.shutdownActions = self._loadShutdownActions() self.iconBundle = getResourceRegistry().getIconBundle(ICON_IMAGES) self.trayIconPrefs = ZRavenTrayIconPrefsAccessor() self.trayIcon = None size = self._getWindowSize() pos = self._getWindowPos() ZBaseWindow.__init__(self, None, u"Zoundry Raven", size = size, pos = pos) #$NON-NLS-1$ userPrefs = getApplicationModel().getUserProfile().getPreferences() isMax = userPrefs.getUserPreferenceBool(IZBlogAppUserPrefsKeys.APPWIN_MAXIMIZED, False) if isMax: self.Maximize() self.SetIcons(self.iconBundle) self.Show(True) self._createTrayIcon() if self.trayIconPrefs.isAlwaysShowTrayIcon(): self._showTrayIcon() self._registerAsSingletonListener() self._doCmdLineBlogThis() fireUIExecEvent(ZStartupActionRunner(self), self)
def __init__(self, izConfigValidationReporter): self.reporter = izConfigValidationReporter self.imageList = ZMappedImageList() registry = getResourceRegistry() self.imageList.addImage(u"%d" % ZValidationReportEntry.INFO, registry.getBitmap(u"images/common/check_whitebg.png")) #$NON-NLS-1$ #$NON-NLS-2$ self.imageList.addImage(u"%d" % ZValidationReportEntry.WARNING, registry.getBitmap(u"images/common/warning_whitebg.png")) #$NON-NLS-1$ #$NON-NLS-2$ self.imageList.addImage(u"%d" % ZValidationReportEntry.ERROR, registry.getBitmap(u"images/common/error_whitebg.png")) #$NON-NLS-1$ #$NON-NLS-2$
def buildTableMenu(self, menuModel, parentId): #@UnusedVariable resourceReg = getResourceRegistry() #parentId = menuModel.addMenu("TableStuff", 1) menuId = menuModel.addMenuItemWithAction(_extstr(u"blogcontenteditortablemenumodel.InsertTable"), 4, ZBlogPostTableCommandsAction(IZXHTMLEditControlTableContext.INSERT_TABLE), parentId) #$NON-NLS-1$ menuModel.setMenuItemBitmap(menuId, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/insert_table.png")) #$NON-NLS-1$ menuModel.addMenuItemWithAction(u"Edit Table Settings", 5, ZBlogPostTableCommandsAction(IZXHTMLEditControlTableContext.EDIT_TABLE_ATTRS), parentId) #$NON-NLS-1$ menuModel.addSeparator(8, parentId) menuModel.addMenuItemWithAction(u"Insert Header", 10, ZBlogPostTableCommandsAction(IZXHTMLEditControlTableContext.INSERT_HEADER), parentId) #$NON-NLS-1$ menuModel.addMenuItemWithAction(u"Insert Footer", 11, ZBlogPostTableCommandsAction(IZXHTMLEditControlTableContext.INSERT_FOOTER), parentId) #$NON-NLS-1$ menuModel.addMenuItemWithAction(u"Insert Caption", 12, ZBlogPostTableCommandsAction(IZXHTMLEditControlTableContext.INSERT_CAPTION), parentId) #$NON-NLS-1$ menuModel.addSeparator(18, parentId) menuModel.addMenuItemWithAction(u"Insert Row Above", 20, ZBlogPostTableCommandsAction(IZXHTMLEditControlTableContext.INSERT_ROW_ABOVE), parentId) #$NON-NLS-1$ menuModel.addMenuItemWithAction(u"Insert Row Below", 22, ZBlogPostTableCommandsAction(IZXHTMLEditControlTableContext.INSERT_ROW_BELOW), parentId) #$NON-NLS-1$ menuModel.addMenuItemWithAction(u"Insert Column Left", 24, ZBlogPostTableCommandsAction(IZXHTMLEditControlTableContext.INSERT_COL_LEFT), parentId) #$NON-NLS-1$ menuModel.addMenuItemWithAction(u"Insert Column Right", 26, ZBlogPostTableCommandsAction(IZXHTMLEditControlTableContext.INSERT_COL_RIGHT),parentId) #$NON-NLS-1$ menuModel.addSeparator(28, parentId) menuModel.addMenuItemWithAction(u"Move Row Above", 30, ZBlogPostTableCommandsAction(IZXHTMLEditControlTableContext.MOVE_ROW_ABOVE), parentId) #$NON-NLS-1$ menuModel.addMenuItemWithAction(u"Move Row Below", 32, ZBlogPostTableCommandsAction(IZXHTMLEditControlTableContext.MOVE_ROW_BELOW), parentId) #$NON-NLS-1$ menuModel.addMenuItemWithAction(u"Move Column Left", 34, ZBlogPostTableCommandsAction(IZXHTMLEditControlTableContext.MOVE_COL_LEFT), parentId) #$NON-NLS-1$ menuModel.addMenuItemWithAction(u"Move Column Right", 36, ZBlogPostTableCommandsAction(IZXHTMLEditControlTableContext.MOVE_COL_RIGHT), parentId) #$NON-NLS-1$ menuModel.addSeparator(38, parentId) menuModel.addMenuItemWithAction(u"Clear Cell", 40, ZBlogPostTableCommandsAction(IZXHTMLEditControlTableContext.CLEAR_CELL), parentId) #$NON-NLS-1$ menuModel.addMenuItemWithAction(u"Delete Row", 42, ZBlogPostTableCommandsAction(IZXHTMLEditControlTableContext.DELETE_ROW), parentId) #$NON-NLS-1$ menuModel.addMenuItemWithAction(u"Delete Column", 42, ZBlogPostTableCommandsAction(IZXHTMLEditControlTableContext.DELETE_COL),parentId) #$NON-NLS-1$ return menuModel # end buildTableMenu() #end ZTableModelBuilder
def _createImageList(self): # FIXME (EPW) Move account and blog icons to a common area and use from there (also chnage navigator) registry = getResourceRegistry() imgList = ZMappedImageList() imgList.addImage(u"account", registry.getBitmap(u"images/perspectives/standard/navigator/account.png")) #$NON-NLS-1$ #$NON-NLS-2$ return imgList
def _createHeaderPanel(self, parent): panel = wx.Panel(parent, wx.ID_ANY) panel.SetBackgroundColour(wx.WHITE) self.headerLink = wx.HyperlinkCtrl(panel, wx.ID_ANY, self._getHeaderTitle(), self._getHeaderHelpURL()) self.headerLink.SetFont(getDefaultFontBold()) self.headerMessage = wx.StaticText(panel, wx.ID_ANY, self._getHeaderMessage()) headerImagePath = self._getHeaderImagePath() if not headerImagePath: headerImagePath = u"images/dialogs/image/header_image.png" #$NON-NLS-1$ self.headerIcon = ZStaticBitmap( panel, getResourceRegistry().getBitmap(headerImagePath)) linkAndMsgSizer = wx.BoxSizer(wx.VERTICAL) linkAndMsgSizer.Add(self.headerLink, 0, wx.ALL, 2) linkAndMsgSizer.Add(self.headerMessage, 1, wx.EXPAND | wx.ALL, 2) sizer = wx.BoxSizer(wx.HORIZONTAL) sizer.AddSizer(linkAndMsgSizer, 1, wx.EXPAND | wx.ALL, 5) sizer.Add(self.headerIcon, 0, wx.EXPAND | wx.ALL, 10) panel.SetAutoLayout(True) panel.SetSizer(sizer) return panel
def _createClearButton(self): registry = getResourceRegistry() clearBmp = registry.getBitmap( u"images/widgets/textbox/clear.png") #$NON-NLS-1$ clearHoverBmp = registry.getBitmap( u"images/widgets/textbox/clear-hover.png") #$NON-NLS-1$ return ZImageButton(self, clearBmp, False, clearHoverBmp, False)
def _createTreeImageList(self): registry = getResourceRegistry() imgList = ZMappedImageList() for img in [u"unpublished", u"account", u"blog", u"posts", u"links", u"images", u"tags"]: #$NON-NLS-1$ #$NON-NLS-2$ #$NON-NLS-3$ #$NON-NLS-4$ #$NON-NLS-5$ #$NON-NLS-6$ #$NON-NLS-7$ #$NON-NLS-8$ imgList.addImage(img, registry.getBitmap(u"images/perspectives/standard/navigator/%s.png" % img)) #$NON-NLS-1$ return imgList
def _createRavenInfoPage(self): self.infoPanel = wx.Panel(self.notebook, wx.ID_ANY) self.infoPanel.SetBackgroundColour(wx.WHITE) self.aboutBmp = getResourceRegistry().getBitmap( u"images/about/about.png") #$NON-NLS-1$ self.aboutImage = ZStaticBitmap(self.infoPanel, self.aboutBmp) ver = version.ZVersion() verDate = ZSchemaDateTime(ver.getBuildDate()) self.versionLabelLabel = wx.StaticText( self.infoPanel, wx.ID_ANY, u"%s: " % _extstr(u"splash.Version")) #$NON-NLS-1$ #$NON-NLS-2$ self.versionLabelLabel.SetFont(getDefaultFontBold()) self.versionLabel = wx.StaticText(self.infoPanel, wx.ID_ANY, ver.getFullVersionString()) self.dateLabelLabel = wx.StaticText( self.infoPanel, wx.ID_ANY, u"%s: " % _extstr(u"splash.BuiltOn")) #$NON-NLS-1$ #$NON-NLS-2$ self.dateLabelLabel.SetFont(getDefaultFontBold()) self.dateLabel = wx.StaticText(self.infoPanel, wx.ID_ANY, verDate.toString(localTime=True)) return self.infoPanel
def __init__(self): self.perspectives = self._loadPerspectives() self.perspectiveId = self._getStartupPerspective() self.perspective = self._createPerspective(self.perspectiveId) self.startupActions = self._loadStartupActions() self.shutdownActions = self._loadShutdownActions() self.iconBundle = getResourceRegistry().getIconBundle(ICON_IMAGES) self.trayIconPrefs = ZRavenTrayIconPrefsAccessor() self.trayIcon = None size = self._getWindowSize() pos = self._getWindowPos() ZBaseWindow.__init__(self, None, u"Zoundry Raven", size=size, pos=pos) #$NON-NLS-1$ userPrefs = getApplicationModel().getUserProfile().getPreferences() isMax = userPrefs.getUserPreferenceBool( IZBlogAppUserPrefsKeys.APPWIN_MAXIMIZED, False) if isMax: self.Maximize() self.SetIcons(self.iconBundle) self.Show(True) self._createTrayIcon() if self.trayIconPrefs.isAlwaysShowTrayIcon(): self._showTrayIcon() self._registerAsSingletonListener() self._doCmdLineBlogThis() fireUIExecEvent(ZStartupActionRunner(self), self)
def buildInsertImageMenuItems(self, menuModel, gravity, parentId): #@UnusedVariable resourceReg = getResourceRegistry() mid = menuModel.addMenuItemWithAction(_extstr(u"blogcontenteditorimagemenumodel.InsertImageFile"), gravity+1, ZBlogPostInsertImageAction(), parentId ) #$NON-NLS-1$ menuModel.setMenuItemBitmap(mid, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/insert_link.png")) #$NON-NLS-1$ mid = menuModel.addMenuItemWithAction(_extstr(u"blogcontenteditorimagemenumodel.InsertImageTag"), gravity+2, ZBlogPostInsertImgTagAction(), parentId ) #$NON-NLS-1$ menuModel.setMenuItemBitmap(mid, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/insert_link.png")) #$NON-NLS-1$
def _setMarkers(self): registry = getResourceRegistry() self._getStcControl().MarkerDefine(IZZStyledTextCtrlMarkers.MARKER_NONE, STC_MARK_EMPTY) #$NON-NLS-1$ #$NON-NLS-2$ self._getStcControl().MarkerDefineBitmap(IZZStyledTextCtrlMarkers.MARKER_OK, registry.getBitmap(u"images/common/ok16x16.gif")) #$NON-NLS-1$ self._getStcControl().MarkerDefineBitmap(IZZStyledTextCtrlMarkers.MARKER_WARN, registry.getBitmap(u"images/common/warning16x16.gif")) #$NON-NLS-1$ self._getStcControl().MarkerDefineBitmap(IZZStyledTextCtrlMarkers.MARKER_ERROR, registry.getBitmap(u"images/common/error16x16.gif")) #$NON-NLS-1$ self._getStcControl().MarkerDefine(IZZStyledTextCtrlMarkers.MARKER_ARROW, STC_MARK_SHORTARROW, u"blue", u"yellow") #$NON-NLS-1$ #$NON-NLS-2$
def _createImageList(self): # FIXME (EPW) Move icons to a common area and use from there (also change navigator) registry = getResourceRegistry() imgList = ZMappedImageList() for img in [u"posts", u"links", u"images", u"tags"]: #$NON-NLS-1$ #$NON-NLS-2$ #$NON-NLS-3$ #$NON-NLS-4$ #$NON-NLS-5$ #$NON-NLS-6$ #$NON-NLS-7$ #$NON-NLS-8$ imgList.addImage(img, registry.getBitmap(u"images/perspectives/standard/navigator/%s.png" % img)) #$NON-NLS-1$ return imgList
def _createImageList(self): # FIXME (EPW) Move icons to a common area and use from there (also change navigator) registry = getResourceRegistry() imgList = ZMappedImageList() for img in [u"posts", u"links", u"images", u"tags"]: #$NON-NLS-1$ #$NON-NLS-2$ #$NON-NLS-3$ #$NON-NLS-4$ #$NON-NLS-5$ #$NON-NLS-6$ #$NON-NLS-7$ #$NON-NLS-8$ imgList.addImage(img, registry.getBitmap(u"images/perspectives/standard/navigator/%s.png" % img)) #$NON-NLS-1$ return imgList
def _createImageList(self): imageList = ZMappedImageList() imageList.addImage( u"blog", getResourceRegistry().getBitmap( u"images/perspectives/standard/navigator/blog.png") ) #$NON-NLS-1$ #$NON-NLS-2$ return imageList
def _updateHeader(self): self.headerLink.SetLabel(self._getHeaderTitle()) self.headerLink.SetURL(self._getHeaderHelpURL()) self.headerMessage.SetLabel(self._getHeaderMessage()) self.headerIcon.setBitmap(getResourceRegistry().getBitmap( self._getHeaderImagePath())) self.headerPanel.Layout() self.headerPanel.Refresh()
def _createHeaderWidgets(self, parent, widgetList): # Register for events before creating the model so that we don't miss any. # Register for events after init'ing WX! self._registerAsListener() self.model = ZNavigatorModel() # Collapse All button bitmap = getResourceRegistry().getBitmap(u"images/perspectives/standard/navigator/collapseAll.png") #$NON-NLS-1$ self.collapseAllButton = ZImageButton(parent, bitmap, False, None, True) self.collapseAllButton.SetToolTipString(_extstr(u"navigator.CollapseAllTooltip")) #$NON-NLS-1$ # Dashboard button bitmap = getResourceRegistry().getBitmap(u"images/perspectives/standard/dashboard.png") #$NON-NLS-1$ self.dashboardButton = ZImageButton(parent, bitmap, False, None, True) self.dashboardButton.SetToolTipString(_extstr(u"navigator.DashboardTooltip")) #$NON-NLS-1$ widgetList.append(self.collapseAllButton) widgetList.append(self.dashboardButton)
def _createWidgets(self): if self.widgetType == ZBlogInfoWidget.TYPE_ADD: registry = getResourceRegistry() bitmap = registry.getBitmap(u"images/common/add.png") #$NON-NLS-1$ self.imgButton = ZImageButton(self, bitmap, False, None, True) self.imgButton.SetToolTipString(_extstr(u"blogchooser.AddBlogTooltip")) #$NON-NLS-1$ bitmap = registry.getBitmap(u"images/common/add_disabled.png") #$NON-NLS-1$ self.imgButton.SetDisabledBitmap(bitmap) elif self.widgetType == ZBlogInfoWidget.TYPE_DEL: registry = getResourceRegistry() bitmap = registry.getBitmap(u"images/common/delete.png") #$NON-NLS-1$ self.imgButton = ZImageButton(self, bitmap, False, None, True) self.imgButton.SetToolTipString(_extstr(u"blogchooser.RemoveBlogTooltip")) #$NON-NLS-1$ self.blogSelectorCombo = ZBlogSelectorCombo(self, self.model) self.separator = wx.StaticLine(self, wx.VERTICAL) self.configureCombo = ZConfigureBlogCombo(self, None)
def _createHeaderWidgets(self, parent, widgetList): choices = self._getSearchBoxChoices() bitmap = getResourceRegistry().getBitmap(u"images/perspectives/standard/contextinfo/linksview/search.png") #$NON-NLS-1$ self.searchTextBox = ZAdvancedTextBox(parent, bitmap, choices, False) self.searchTextBox.setCurrentChoice(SEARCH_TAG) self.searchTextBox.SetSizeHints(220, -1) widgetList.append(self.searchTextBox)
def _createContentWidgets(self, parent): htmlPath = getResourceRegistry().getResourcePath( u"html/perspectives/standard/contextinfo/dashboard.html" ) #$NON-NLS-1$ logoPath = getResourceRegistry().getResourcePath( u"images/perspectives/standard/contextinfo/logo.png") #$NON-NLS-1$ params = { u"dashboard": _extstr(u"dashboard.Dashboard"), #$NON-NLS-1$ #$NON-NLS-2$ u"zoundry_raven": _extstr(u"ZoundryRaven"), #$NON-NLS-1$ #$NON-NLS-2$ u"new_account": _extstr(u"dashboard.NewBlogAccount"), #$NON-NLS-1$ #$NON-NLS-2$ u"new_account_desc": _extstr( u"dashboard.NewBlogAccountDesc"), #$NON-NLS-1$ #$NON-NLS-2$ u"new_media_storage": _extstr(u"dashboard.NewMediaStorage"), #$NON-NLS-1$ #$NON-NLS-2$ u"new_media_storage_desc": _extstr( u"dashboard.NewMediaStorageDesc"), #$NON-NLS-1$ #$NON-NLS-2$ u"settings": _extstr(u"dashboard.Settings"), #$NON-NLS-1$ #$NON-NLS-2$ u"settings_desc": _extstr(u"dashboard.SettingsDesc"), #$NON-NLS-1$ #$NON-NLS-2$ u"logo": logoPath, #$NON-NLS-1$ u"newaccount_imgpath": getResourceRegistry().getResourcePath( u"images/perspectives/standard/contextinfo/dashboard/new_account.png" ), #$NON-NLS-1$ #$NON-NLS-2$ u"newstorage_imgpath": getResourceRegistry().getResourcePath( u"images/perspectives/standard/contextinfo/dashboard/new_storage.png" ), #$NON-NLS-1$ #$NON-NLS-2$ u"settings_imgpath": getResourceRegistry().getResourcePath( u"images/perspectives/standard/contextinfo/dashboard/settings.png" ), #$NON-NLS-1$ #$NON-NLS-2$ } html = loadStaticHtml(htmlPath, params) self.htmlWidget = ZHTMLControl(parent, style=wx.NO_BORDER) self.htmlWidget.SetBorders(0) self.htmlWidget.SetPage(html)
def buildModel(self): registry = getResourceRegistry() for (gravity, actionId, boldFlag, iconPath) in MENU_ITEMS: menuId = self.addMenuItemWithActionId(gravity, actionId, None) self.setMenuItemBold(menuId, boldFlag) if iconPath is not None: bitmap = registry.getBitmap(iconPath) self.setMenuItemBitmap(menuId, bitmap)
def buildEditObjectsMenuItems(self, menuModel, gravity, parentId): resourceReg = getResourceRegistry() label = _extstr(u"blogcontenteditorlinkmenumodel.EditLink") #$NON-NLS-1$ mid = menuModel.addMenuItemWithAction(u"%s\tCtrl+L" % label, gravity, ZBlogPostEditLinkAction(), parentId ) #$NON-NLS-1$ menuModel.setMenuItemBitmap(mid, resourceReg.getBitmap(u"images/editors/blogeditor/designer/toolbar/16x16/insert_link.png")) #$NON-NLS-1$ label = _extstr(u"blogcontenteditorlinkmenumodel.ConvertLink") #$NON-NLS-1$ mid = menuModel.addMenuItemWithAction(u"%s" % label, gravity+1, ZConvertProductLinkAction(), parentId ) #$NON-NLS-1$ menuModel.setMenuItemBitmap(mid, resourceReg.getBitmap(u"images/editors/blogeditor/menu/convert_link.png")) #$NON-NLS-1$
def buildModel(self): registry = getResourceRegistry() for (gravity, actionId, boldFlag, iconPath) in MENU_ITEMS: menuId = self.addMenuItemWithActionId(gravity, actionId, None) self.setMenuItemBold(menuId, boldFlag) if iconPath is not None: bitmap = registry.getBitmap(iconPath) self.setMenuItemBitmap(menuId, bitmap)
def _createTreeImageList(self): registry = getResourceRegistry() imgList = ZMappedImageList() for img in [u"account", u"blog"]: # $NON-NLS-1$ #$NON-NLS-2$ imgList.addImage( img, registry.getBitmap(u"images/perspectives/standard/navigator/%s.png" % img) ) # $NON-NLS-1$ return imgList
def __init__(self, mainWindow): self.mainWindow = mainWindow self.resourceRegistry = getResourceRegistry() self.restoreAction = getApplicationModel().getActionRegistry().findAction(IZBlogAppActionIDs.RESTORE_ACTION) wx.TaskBarIcon.__init__(self) self.menuModel = self._createMenuModel() self._bindWidgetEvents()
def buildCopyLinkLocationMenuItem(self, menuModel, gravity, parentId): resourceReg = getResourceRegistry() mid = menuModel.addMenuItemWithAction( _extstr(u"blogcontenteditorlinkmenumodel.CopyLinkLocation"), gravity, ZBlogPostCopyLinkLocationAction(), parentId) #$NON-NLS-1$ menuModel.setMenuItemBitmap( mid, resourceReg.getBitmap( u"images/common/menu/link/copylinklocation.png")) #$NON-NLS-1$
def _createHeaderWidgets(self, parent, widgetList): bitmap = getResourceRegistry().getBitmap( u"images/perspectives/standard/summary/panel_menu.png" ) #$NON-NLS-1$ self.panelMenuButton = ZImageButton(parent, bitmap, True, None, True) bitmap = getResourceRegistry().getBitmap( u"images/perspectives/standard/summary/use_template.png" ) #$NON-NLS-1$ self.templateToggleButton = ZNoFocusToggleButton(parent, bitmap) widgetList.append(self.templateToggleButton) widgetList.append(self.panelMenuButton) appModel = getApplicationModel() userProfile = appModel.getUserProfile() userPrefs = userProfile.getPreferences() useTemplateInPreview = userPrefs.getUserPreferenceBool( IZBlogAppUserPrefsKeys.POST_PREVIEW_VIEW_USE_TEMPLATE, True) self.templateToggleButton.Toggle(useTemplateInPreview)
def __init__(self): self.columnInfo = [(u"Line",10), (u"Column", 10), (u"Message", 80)] #$NON-NLS-1$ #$NON-NLS-2$ #$NON-NLS-3$ self.validationMessageList = [] self.imageList = ZMappedImageList() registry = getResourceRegistry() self.imageList.addImage(u"%d" % ZXhtmlValidationMessage.SUCCESS, registry.getBitmap(u"images/common/check2_whitebg.png")) #$NON-NLS-1$ #$NON-NLS-2$ self.imageList.addImage(u"%d" % ZXhtmlValidationMessage.INFO, registry.getBitmap(u"images/common/information_whitebg.png")) #$NON-NLS-1$ #$NON-NLS-2$ self.imageList.addImage(u"%d" % ZXhtmlValidationMessage.WARNING, registry.getBitmap(u"images/common/warning_whitebg.png")) #$NON-NLS-1$ #$NON-NLS-2$ self.imageList.addImage(u"%d" % ZXhtmlValidationMessage.ERROR, registry.getBitmap(u"images/common/error_whitebg.png")) #$NON-NLS-1$ #$NON-NLS-2$ self.imageList.addImage(u"%d" % ZXhtmlValidationMessage.FATAL, registry.getBitmap(u"images/common/error_whitebg.png")) #$NON-NLS-1$ #$NON-NLS-2$
def __init__(self, mainWindow): self.mainWindow = mainWindow self.resourceRegistry = getResourceRegistry() self.restoreAction = getApplicationModel().getActionRegistry( ).findAction(IZBlogAppActionIDs.RESTORE_ACTION) wx.TaskBarIcon.__init__(self) self.menuModel = self._createMenuModel() self._bindWidgetEvents()
def _createImageList(self): # FIXME (EPW) Move account and blog icons to a common area and use from there (also chnage navigator) registry = getResourceRegistry() imgList = ZMappedImageList() imgList.addImage(u"blog", registry.getBitmap( u"images/perspectives/standard/navigator/blog.png" )) #$NON-NLS-1$ #$NON-NLS-2$ return imgList
def _populateWidgets(self): params = { u"blog_summary" : _extstr(u"blogsummary.BlogSummary"), #$NON-NLS-1$ #$NON-NLS-2$ u"zoundry_raven" : _extstr(u"ZoundryRaven"), #$NON-NLS-1$ #$NON-NLS-2$ u"configure_blog" : _extstr(u"blogsummary.ConfigureBlog"), #$NON-NLS-1$ #$NON-NLS-2$ u"configure_blog_desc" : _extstr(u"blogsummary.ConfigureBlogDesc"), #$NON-NLS-1$ #$NON-NLS-2$ u"new_post" : _extstr(u"blogsummary.NewPost"), #$NON-NLS-1$ #$NON-NLS-2$ u"new_post_desc" : _extstr(u"blogsummary.NewPostDesc"), #$NON-NLS-1$ #$NON-NLS-2$ u"view_blog" : _extstr(u"blogsummary.ViewBlog"), #$NON-NLS-1$ #$NON-NLS-2$ u"view_blog_desc" : _extstr(u"blogsummary.ViewBlogDesc"), #$NON-NLS-1$ #$NON-NLS-2$ u"blog_name" : self.blog.getName(), #$NON-NLS-1$ u"configure_imgpath" : getResourceRegistry().getImagePath(u"images/perspectives/standard/contextinfo/blog_summary/configure.png"), #$NON-NLS-1$ #$NON-NLS-2$ u"newpost_imgpath" : getResourceRegistry().getImagePath(u"images/perspectives/standard/contextinfo/blog_summary/newpost.png"), #$NON-NLS-1$ #$NON-NLS-2$ u"viewblog_imgpath" : getResourceRegistry().getImagePath(u"images/perspectives/standard/contextinfo/blog_summary/viewblog.png"), #$NON-NLS-1$ #$NON-NLS-2$ } htmlPath = getResourceRegistry().getResourcePath(u"html/perspectives/standard/contextinfo/blog_summary.html") #$NON-NLS-1$ html = loadStaticHtml(htmlPath, params); #$NON-NLS-1$ self.htmlWidget.SetPage(html)
def __init__(self, validator, parent): self.validator = validator self.resourceRegistry = getResourceRegistry() self.isValid = True wx.Panel.__init__(self, parent, wx.ID_ANY) self._createWidgets() self._layoutWidgets() self._bindWidgetEvents() self._validateWidget()