def getTextLine(self): """ Create text line (without ending \n) which contains the data in this entry. """ return re_sub_escape(uniWithNone(self.title)) + u";" + \ uniWithNone(self.flags) + u";" + uniWithNone(self.iconDesc) + \ u"=" + uniWithNone(self.value)
def __init__(self, parent, ID, entry, title=None, pos=wx.DefaultPosition, size=wx.DefaultSize): """ entry -- FavoriteWikisEntry """ d = wx.PreDialog() self.PostCreate(d) self.parent = parent self.entry = entry self.value = None res = wx.xrc.XmlResource.Get() res.LoadOnDialog(self, self.parent, "AddWikiToFavoriteWikisDialog") self.ctrls = XrcControls(self) if title is not None: self.SetTitle(title) # Create list of controls which should enabled only if checkbox # "show in toolbar" is checked self.dependingOnShowInToolbar = (self.ctrls.spinIconPosition, self.ctrls.tfIcon, self.ctrls.btnSelectIcon) toolbarPos = self.entry.getToolbarPosition() title, shortcut = splitFill(uniWithNone(self.entry.title), u"\t", 1) self.ctrls.tfTitle.SetValue(title) self.ctrls.tfShortcut.SetValue(shortcut) self.ctrls.tfPathOrUrl.SetValue(uniWithNone(self.entry.value)) self.ctrls.cbOpenInNewWindow.SetValue(u"n" in self.entry.flags) self.ctrls.cbShowInToolbar.SetValue(toolbarPos != -1) self.ctrls.spinIconPosition.SetValue(toolbarPos) self.ctrls.tfIcon.SetValue(uniWithNone(self.entry.iconDesc)) self.ctrls.btnOk.SetId(wx.ID_OK) self.ctrls.btnCancel.SetId(wx.ID_CANCEL) self.OnShowInToolbar(None) # Fixes focus bug under Linux self.SetFocus() wx.EVT_BUTTON(self, wx.ID_OK, self.OnOk) wx.EVT_BUTTON(self, GUI_ID.btnSelectPath, self.OnSelectPath) wx.EVT_BUTTON(self, GUI_ID.btnSelectIcon, self.OnSelectIcon) wx.EVT_CHECKBOX(self, GUI_ID.cbShowInToolbar, self.OnShowInToolbar)
def __init__(self, parent, ID, entry, title=None, pos=wx.DefaultPosition, size=wx.DefaultSize): """ entry -- FavoriteWikisEntry """ d = wx.PreDialog() self.PostCreate(d) self.parent = parent self.entry = entry self.value = None res = wx.xrc.XmlResource.Get() res.LoadOnDialog(self, self.parent, "AddWikiToFavoriteWikisDialog") self.ctrls = XrcControls(self) if title is not None: self.SetTitle(title) # Create list of controls which should enabled only if checkbox # "show in toolbar" is checked self.dependingOnShowInToolbar = ( self.ctrls.spinIconPosition, self.ctrls.tfIcon, self.ctrls.btnSelectIcon ) toolbarPos = self.entry.getToolbarPosition() title, shortcut = splitFill(uniWithNone(self.entry.title), u"\t", 1) self.ctrls.tfTitle.SetValue(title) self.ctrls.tfShortcut.SetValue(shortcut) self.ctrls.tfPathOrUrl.SetValue(uniWithNone(self.entry.value)) self.ctrls.cbOpenInNewWindow.SetValue(u"n" in self.entry.flags) self.ctrls.cbShowInToolbar.SetValue(toolbarPos != -1) self.ctrls.spinIconPosition.SetValue(toolbarPos) self.ctrls.tfIcon.SetValue(uniWithNone(self.entry.iconDesc)) self.ctrls.btnOk.SetId(wx.ID_OK) self.ctrls.btnCancel.SetId(wx.ID_CANCEL) self.OnShowInToolbar(None) # Fixes focus bug under Linux self.SetFocus() wx.EVT_BUTTON(self, wx.ID_OK, self.OnOk) wx.EVT_BUTTON(self, GUI_ID.btnSelectPath, self.OnSelectPath) wx.EVT_BUTTON(self, GUI_ID.btnSelectIcon, self.OnSelectIcon) wx.EVT_CHECKBOX(self, GUI_ID.cbShowInToolbar, self.OnShowInToolbar)