def construct(self): Text = lambda s: wx.StaticText(self,-1,_(s)) self.line1 = Text(_('Would you like to merge these contacts?')) self.line1.Font = CopyFont(self.line1.Font,weight = wx.BOLD) self.line2 = Text(_('They will appear as one item on your buddy list.')) self.sep = wx.StaticLine(self,-1) self.alias_label = wx.StaticText(self, -1, _('Alias:')) self.alias_label.Font = CopyFont(self.alias_label.Font,weight = wx.BOLD) # Decide on an alias: don't use the alias property from the metacontact # because that falls through to the best available one. alias = self.find_alias_suggestion() self.alias_text = wx.TextCtrl(self, -1, alias if alias else '', validator=LengthLimit(255)) s = self.save = wx.Button(self, wx.ID_SAVE, _('&Save')) # save s.SetDefault() s.Bind(wx.EVT_BUTTON, self.Parent.on_save) if REQUIRE_ALIAS: self.alias_text.Bind(wx.EVT_TEXT, lambda e: self.save.Enable(self.alias_text.Value!='')) self.save.Enable(self.alias_text.Value != '') self.cancel = wx.Button(self, wx.ID_CANCEL, _('&Cancel')) # cancel self.line4 = Text(_('Drag and drop to rearrange:')) self.line4.Font = CopyFont(self.line4.Font,weight = wx.BOLD) self.contacts_list = MetaListEditor(self,self.contacts,self.update_contacts_list)
def ApplyStyle(self): 'Sets the style at the cursor.' tc = self.tc style = self.bitalic.active weight = self.bbold.active underline = self.bunderline.active font= CopyFont(self.fontdd.GetClientData(self.fontdd.GetSelection()), pointSize = int(self.bsize.label), style = wx.ITALIC if style else wx.NORMAL, weight = wx.FONTWEIGHT_BOLD if weight else wx.NORMAL, underline = underline) tc.Font = font tc.SetFont(font) fgc = tc.ForegroundColour tc.ForegroundColour = wx.BLACK tc.ForegroundColour=fgc if self.prefmode or self.aimprofile: wx.CallAfter(self.SaveStyle) self.tc.SetFocus()
def ApplyStyleGUIless(self, flag=None): tc = self.tc font = tc.GetFont() fontsize = font.GetPointSize() weight = font.Weight == wx.FONTWEIGHT_BOLD style = font.Style == wx.FONTSTYLE_ITALIC underline = font.Underlined if flag == 'bold': weight = not weight if flag == 'italic': style = not style if flag == 'underline': underline = not underline font= CopyFont(font, pointSize = fontsize, style = wx.ITALIC if style else wx.NORMAL, weight = wx.FONTWEIGHT_BOLD if weight else wx.NORMAL, underline = underline) # setting the font twices fixes a bug. tc.Font = font tc.SetFont(font) fgc = tc.ForegroundColour tc.ForegroundColour = wx.BLACK tc.ForegroundColour = fgc if self.prefmode or self.aimprofile: wx.CallAfter(self.SaveStyle) self.tc.SetFocus()
def UpdateSkin(self): """ The usual update skin """ key = self.skinkey s = lambda k, d=None: skin.get('%s.%s' % (key, k), d) self.bg = s('backgrounds.account', lambda: SkinColor(wx.WHITE)) self.majorfont = s('Fonts.Account', default_font) self.minorfont = s('Fonts.StateAndLink', default_font) self.linkfont = CopyFont(self.minorfont, underline=True) self.majorfc = s('FontColors.Account', wx.BLACK) self.statefc = s('FontColors.State', lambda: wx.Colour(125, 125, 125)) self.linkfc = s('FontColors.Link', wx.BLUE) self.closeicon = [None] * 3 self.closeicon[0] = s( 'Icons.Close', skin.get('AppDefaults.removeicon')).ResizedSmaller(16) self.closeicon[1] = s('Icons.CloseHover', self.closeicon[0]).ResizedSmaller(16) self.closeicon[2] = s('Icons.CloseDown', self.closeicon[1]).ResizedSmaller(16) self.liconsize = s('ServiceIconSize', 16) self.padding = s('Padding', lambda: wx.Point(3, 3)) self.stateicon = self.account.statusicon.ResizedSmaller(16) self.licon = self.account.serviceicon.Resized(self.liconsize) if self.initover: self.CalcLayout()
def build_details_social(self,sizer,row): types = ('alerts','feed', 'indicators') hsz = BoxSizer(wx.HORIZONTAL) d = self.details add = lambda c,s,*a: (d.add(c),s.Add(c,*a)) for i, key in enumerate(types): checks = self.checks.get(key,()) if not checks: continue sz = BoxSizer(wx.VERTICAL) tx = StaticText(self, -1, _('{show_topic}:').format(show_topic = self.protocolinfo['show_%s_label' % key]), style = wx.ALIGN_LEFT) from gui.textutil import CopyFont tx.Font = CopyFont(tx.Font, weight = wx.BOLD) add(tx, sz, 0, wx.BOTTOM, tx.GetDefaultBorder()) for chk in checks: add(chk, sz, 0, ALL, chk.GetDefaultBorder()) hsz.Add(sz,0) # if i != len(types)-1: hsz.AddSpacer(15) self.Sizer.Add(hsz,0,wx.BOTTOM | wx.LEFT,10) self.build_details_default(sizer, row)
def UpdateSkin(self): self.padding = wx.Point(4, 4) self.headerfont = skin.get('infobox.fonts.header', lambda: default_font()) self.linkfont = CopyFont(skin.get('infobox.fonts.link', lambda: default_font()), underline=True) self.elinkfont = CopyFont(self.linkfont, weight=wx.FONTWEIGHT_BOLD) self.headerfc = skin.get('infobox.fontcolors.navbarheader', lambda: wx.BLACK) self.linkfc = skin.get('infobox.fontcolors.navbarlink', lambda: wx.BLUE) linkposx = self.padding[0] * 2 + 16 linkposy = self.headerfont.Height + 2 * self.padding[1] self.linkage.SetPosition((linkposx, linkposy)) for link in self.linkage: link.NormalColour = link.HoverColour = link.VisitedColour = self.linkfc link.Font = self.linkfont self.linkage.Layout() elink = self.extralinkage if elink: elink.NormalColour = elink.HoverColour = elink.VisitedColour = self.linkfc elink.Font = self.elinkfont elink.Size = elink.BestSize elinkposx = self.Size.width - self.padding[0] - elink.BestSize.width elink.SetPosition((elinkposx, linkposy)) self.bg = skin.get('infobox.backgrounds.header', lambda: SkinColor(wx.Color(225, 255, 225))) # self.sep = skin.get('infobox.longseparatorimage', None) self.Size = self.MinSize = wx.Size( -1, self.headerfont.Height + self.linkfont.Height + self.padding.y * 4) # + self.sep.Size.height
def __init__(self, parent, list2sort, prettynames=None, listcallback=None, title=_("Arrange Panels"), listclass=VisualListEditorList, ischecked=None): wx.Dialog.__init__(self, parent, -1, title, style=self.dialog_style) Bind = self.Bind Bind(wx.EVT_CLOSE, self.Done) # construct panel = wx.Panel(self) text = wx.StaticText(panel, -1, _('Drag and drop to reorder'), style=ALIGN_CENTER) text.Font = CopyFont(text.Font, weight=wx.BOLD) self.vle = vle = listclass(panel, list2sort, prettynames, listcallback, ischecked=ischecked) Bind(wx.EVT_KEY_DOWN, self.OnKeyDown) self.vle.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown) hline = wx.StaticLine(panel, style=LI_HORIZONTAL) done = wx.Button(panel, -1, _('Done')) done.Bind(wx.EVT_BUTTON, self.Done) # layout main_sizer = self.Sizer = wx.BoxSizer(VERTICAL) main_sizer.Add(panel, 1, EXPAND) s = panel.Sizer = wx.BoxSizer(VERTICAL) border_size = 6 s.AddMany([(text, 0, EXPAND | ALL, border_size), (vle, 1, EXPAND | TOPLESS, border_size), (hline, 0, EXPAND | TOPLESS, border_size), (done, 0, EXPAND | TOPLESS, border_size)]) self.Fit()
def UpdateSkin(self): """ The Usual """ key = 'infobox' if skin.get(key,False): s = lambda k,d: skin.get('%s.%s'%(key,k),d) else: s = lambda k,d: d self.padding = s('padding', lambda: wx.Point(2, 2)) self.labelf = s('fonts.title',lambda: default_font()) self.labelfc = s('fontcolors.title', wx.BLACK) self.linkf = CopyFont(s('fonts.link',lambda: default_font()), underline=True) self.linkfc = s('fontcolors.link', wx.BLUE) self.bg = s('backgrounds.email', lambda: SkinColor(wx.WHITE))
def __init__(self, *a, **k): wx.Frame.__init__(self, *a, **k) self._panel = p = wx.Panel(self, -1) self._text = _AutoCombo(p, -1, style=wx.TE_PROCESS_ENTER) listvals = self.get_values() self.list = AnyList(p, data=listvals, row_control=PrivacyListRow, style=8, draggable_items=False) self.list.BackgroundColour = wx.WHITE self.populate_combo() self.add_btn = wx.Button(p, -1, _('Add'), style=wx.BU_EXACTFIT) self.add_btn.MinSize = wx.Size(-1, 0) if platformName != 'mac': self.add_btn.Font = CopyFont(self.add_btn.Font, weight=wx.BOLD) else: self.add_btn.SetWindowVariant(wx.WINDOW_VARIANT_SMALL) tb_sz = HSizer() tb_sz.Add(self._text, 1, ALIGN_CENTER_VERTICAL) tb_sz.Add(self.add_btn, 0, EXPAND | ALL | ALIGN_CENTER_VERTICAL) p.Sizer = sz = VSizer() sz.Add(tb_sz, 0, EXPAND | ALL, border=3) sz.Add(self.list, 1, EXPAND | ALL, border=3) self.add_btn.Bind(wx.EVT_BUTTON, self._add_clicked) self._text.Bind(wx.EVT_TEXT, self.set_btn_enable) self._text.Bind(wx.EVT_TEXT_ENTER, self._add_clicked) self.set_btn_enable() self.Layout()
def UpdateSkin(self): s = skin.get self.padding = s('infobox.padding', lambda: wx.Point(4, 4)) self.headerfont = s('infobox.fonts.header', default_font) self.titlefont = s('infobox.fonts.title', default_font) self.majorfont = s('infobox.fonts.major', default_font) self.minorfont = s('infobox.fonts.minor', default_font) self.linkfont = CopyFont(s('infobox.fonts.link', default_font), underline=True) fc = s('infobox.fontcolors') g = fc.get self.titlefc = g('title', BLACK) self.majorfc = g('major', wx.BLACK) self.minorfc = g('minor', wx.Color(128, 128, 128)) self.linkfc = g('link', wx.BLUE) self.hovertitlefc = g('emailhovertitle', self.titlefc) self.hovermajorfc = g('emailhovermajor', self.majorfc) self.hoverminorfc = g('emailhoverminor', self.minorfc) self.hoverlinkfc = g('emailhoverlink', self.linkfc) for link in self.linkage: link.NormalColour = link.HoverColour = link.VisitedColour = self.hoverlinkfc link.Font = self.linkfont self.linkage.Layout() if self.errorlink: self.errorlink.Font = self.Parent.Font self.errorlink.VisitedColour = self.errorlink.HoverColour = self.errorlink.NormalColour = s( 'infobox.linkcolor', lambda: wx.BLUE) self.bg = s('infobox.backgrounds.email', lambda: SkinColor(wx.WHITE)) self.selbg = s('infobox.backgrounds.emailhover', lambda: SkinColor(wx.Color(225, 255, 225))) self.sep = s('infobox.shortseparatorimage', None)
import wx from gui.textutil import CopyFont,default_font from gui.uberwidgets.pseudosizer import PseudoSizer from gui.uberwidgets.cleartext import ClearText from gui.uberwidgets.clearlink import ClearLink from util.primitives.funcs import Delegate a=wx.PySimpleApp() f=wx.Frame(None,size=(450,450)) f.Font=CopyFont(default_font(),pointSize=15) p=wx.Panel(f) p.Sizer=wx.BoxSizer(wx.HORIZONTAL) #l=ClearLink(p,-1,'Super link of epic proportions','google.com') #l.VisitedColour=wx.BLUE #x=ClearLink(p,-1,'Mega Tokyo','megatokyo.com') #y=ClearLink(p,-1,'Errant Story','errantstory.com') #z=ClearLink(p,-1,'VG Cats','vgcats.com') #t=PseudoSizer() #t.Add(x) #t.Add(y) #t.Add(z) #t=ClearText(p,label='Test') #t.SetPosition((0,50)) st= """Dreams come true: Capcom has confirmed that Harvey Birdman: Attorney At Law, their game based on the hilarious Adult Swim cartoon courtroom comedy, will come to Wii as............ well.""" # #Capcom also said that all three versions -- Wii, PS2, and PSP -- will hit retail on November 13. If you want motion control with your lawyering, you'll have to pay up, as the Wii version will run you $40 while the Sony versions only cost $30.