Python wx.FONTWEIGHT_BOLD Examples

The following are 21 code examples of wx.FONTWEIGHT_BOLD(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module wx , or try the search function .
Example #1
Source File: AnimatedWindow.py    From EventGhost with GNU General Public License v2.0 6 votes vote down vote up
def __init__(self, parent):
        wx.PyWindow.__init__(self, parent)
        self.font = wx.Font(
            40, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_ITALIC, wx.FONTWEIGHT_BOLD
        )
        self.SetBackgroundColour((255, 255, 255))
        self.logo1 = GetInternalBitmap("opensource-55x48")
        self.logo2 = GetInternalBitmap("python-powered")
        self.logo3 = GetInternalBitmap("logo2")
        self.image = GetInternalImage("logo")
        self.bmpWidth = self.image.GetWidth()
        self.bmpHeight = self.image.GetHeight()
        self.time = clock()
        self.count = 0
        self.Bind(wx.EVT_SIZE, self.OnSize)
        self.Bind(wx.EVT_TIMER, self.UpdateDrawing)
        self.OnSize(None)
        self.timer = wx.Timer(self)
        self.timer.Start(10) 
Example #2
Source File: PanelClass.py    From wxGlade with MIT License 6 votes vote down vote up
def __init__(self, *args, **kwds):
        # begin wxGlade: DebugPanel.__init__
        kwds["style"] = kwds.get("style", 0) | wx.TAB_TRAVERSAL
        wx.Panel.__init__(self, *args, **kwds)
        self.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, 0, ""))

        sizer_2 = wx.StaticBoxSizer(wx.StaticBox(self, wx.ID_ANY, "sizer_2"), wx.VERTICAL)

        sizer_2.Add((0, 0), 0, 0, 0)

        self.SetSizer(sizer_2)

        self.Layout()
        # end wxGlade

# end of class DebugPanel 
Example #3
Source File: wx_util.py    From me-ica with GNU Lesser General Public License v2.1 5 votes vote down vote up
def make_bold(statictext):
  pointsize = statictext.GetFont().GetPointSize()
  font = wx.Font(pointsize, wx.FONTFAMILY_DEFAULT,
                 wx.FONTWEIGHT_NORMAL, wx.FONTWEIGHT_BOLD, False)
  statictext.SetFont(font) 
Example #4
Source File: Bling.py    From BitTorrent with GNU General Public License v3.0 5 votes vote down vote up
def add_row(self, sizer, name, header, value=""):
        h = wx.StaticText(self.panel, label=header)
        f = h.GetFont()
        f.SetWeight(wx.FONTWEIGHT_BOLD)
        h.SetFont(f)
        sizer.Add(h)

        st = wx.StaticText(self.panel, label=value)
        sizer.Add(st)

        self.stats[name] = st 
Example #5
Source File: DownloadManager.py    From BitTorrent with GNU General Public License v3.0 5 votes vote down vote up
def CreatePopupMenu(self):
        menu = wx.Menu()
        if self.frame.IsShown():
            toggle_label = _("Hide %s")
        else:
            toggle_label = _("Show %s")

        if False:
            toggle_item = wx.MenuItem(parentMenu=menu,
                                      id=self.TBMENU_TOGGLE,
                                      text=toggle_label%app_name,
                                      kind=wx.ITEM_NORMAL)
            font = toggle_item.GetFont()
            font.SetWeight(wx.FONTWEIGHT_BOLD)
            toggle_item.SetFont(font)
            #toggle_item.SetFont(wx.Font(
            #    pointSize=8,
            #    family=wx.FONTFAMILY_DEFAULT,
            #    style=wx.FONTSTYLE_NORMAL,
            #    weight=wx.FONTWEIGHT_BOLD))
            menu.AppendItem(toggle_item)
            menu.AppendItem(wx.MenuItem(parentMenu=menu,
                                        id=self.TBMENU_CLOSE,
                                        text = _("Quit %s")%app_name,
                                        kind=wx.ITEM_NORMAL))
        else:
            menu.Append(self.TBMENU_TOGGLE, toggle_label%app_name)
            menu.Append(self.TBMENU_CLOSE,  _("Quit %s")%app_name)

        return menu 
Example #6
Source File: __init__.py    From BitTorrent with GNU General Public License v3.0 5 votes vote down vote up
def add_label(self, label):
        h = ElectroStaticText(self.parent_widget, label=label)
        f = h.GetFont()
        f.SetWeight(wx.FONTWEIGHT_BOLD)
        h.SetFont(f)
        self.Add(h) 
Example #7
Source File: wx_util.py    From pyFileFixity with MIT License 5 votes vote down vote up
def h1(parent, label):
  return _header(parent, label, (wx.FONTFAMILY_DEFAULT, wx.FONTWEIGHT_NORMAL, wx.FONTWEIGHT_BOLD, False)) 
Example #8
Source File: wx_util.py    From pyFileFixity with MIT License 5 votes vote down vote up
def h0(parent, label):
  text = wx.StaticText(parent, label=label)
  font_size = text.GetFont().GetPointSize()
  font = wx.Font(font_size * 1.4, *(wx.FONTFAMILY_DEFAULT, wx.FONTWEIGHT_NORMAL, wx.FONTWEIGHT_BOLD, False))
  text.SetFont(font)
  return text 
Example #9
Source File: styling.py    From pyFileFixity with MIT License 5 votes vote down vote up
def H1(parent, label):
  text = wx.StaticText(parent, label=label)
  font_size = text.GetFont().GetPointSize()
  font = wx.Font(font_size * 1.2, wx.FONTFAMILY_DEFAULT, wx.FONTWEIGHT_NORMAL, wx.FONTWEIGHT_BOLD, False)
  text.SetFont(font)
  return text 
Example #10
Source File: styling.py    From pyFileFixity with MIT License 5 votes vote down vote up
def _bold_static_text(parent, text_label):
  text = wx.StaticText(parent, label=text_label)
  font_size = text.GetFont().GetPointSize()
  bold = wx.Font(font_size, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)
  text.SetFont(bold)
  return text 
Example #11
Source File: styling.py    From pyFileFixity with MIT License 5 votes vote down vote up
def MakeBold(statictext):
  pointsize = statictext.GetFont().GetPointSize()
  font = wx.Font(pointsize, wx.FONTFAMILY_DEFAULT,
                 wx.FONTWEIGHT_NORMAL, wx.FONTWEIGHT_BOLD, False)
  statictext.SetFont(font) 
Example #12
Source File: basic_config_panel.py    From pyFileFixity with MIT License 5 votes vote down vote up
def _bold_static_text(self, text_label):
    text = wx.StaticText(self, label=text_label)
    font_size = text.GetFont().GetPointSize()
    bold = wx.Font(font_size, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)
    text.SetFont(bold)
    return text 
Example #13
Source File: runtime_display_panel.py    From pyFileFixity with MIT License 5 votes vote down vote up
def _init_components(self):
    self.text = wx.StaticText(self, label=i18n._("status"))
    self.cmd_textbox = wx.TextCtrl(
      self, -1, "",
      style=wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_RICH)
    if self.build_spec.get('monospace_display'):
      pointsize = self.cmd_textbox.GetFont().GetPointSize()
      font = wx.Font(pointsize, wx.FONTFAMILY_MODERN,
                   wx.FONTWEIGHT_NORMAL, wx.FONTWEIGHT_BOLD, False)
      self.cmd_textbox.SetFont(font) 
Example #14
Source File: wx_util.py    From me-ica with GNU Lesser General Public License v2.1 5 votes vote down vote up
def h1(parent, label):
  return _header(parent, label, (wx.FONTFAMILY_DEFAULT, wx.FONTWEIGHT_NORMAL, wx.FONTWEIGHT_BOLD, False)) 
Example #15
Source File: wx_util.py    From me-ica with GNU Lesser General Public License v2.1 5 votes vote down vote up
def h0(parent, label):
  text = wx.StaticText(parent, label=label)
  font_size = text.GetFont().GetPointSize()
  font = wx.Font(font_size * 1.4, *(wx.FONTFAMILY_DEFAULT, wx.FONTWEIGHT_NORMAL, wx.FONTWEIGHT_BOLD, False))
  text.SetFont(font)
  return text 
Example #16
Source File: runtime_display_panel.py    From me-ica with GNU Lesser General Public License v2.1 5 votes vote down vote up
def set_font_style(self, style):
    pointsize = self.cmd_textbox.GetFont().GetPointSize()
    font = wx.Font(pointsize, style,
                 wx.FONTWEIGHT_NORMAL, wx.FONTWEIGHT_BOLD, False)
    self.cmd_textbox.SetFont(font) 
Example #17
Source File: options.py    From IkaLog with Apache License 2.0 4 votes vote down vote up
def _init_frame(self):
        if self.frame:
            return

        self.frame = wx.Frame(
            self.ikalog_gui.frame, wx.ID_ANY, _("Options"), size=(640, 500))

        self.notebook = wx.Notebook(self.frame, wx.ID_ANY)

        # Apply button
        button_apply = wx.Button(self.frame, wx.ID_ANY, _(u'Apply'))

        # Use a bold font.
        apply_font = button_apply.GetFont()
        apply_font.SetWeight(wx.FONTWEIGHT_BOLD)
        button_apply.SetFont(apply_font)

        button_cancel = wx.Button(self.frame, wx.ID_ANY, _(u'Cancel'))
        button_load_default = wx.Button(
            self.frame, wx.ID_ANY, _(u'Load default'))

        buttons_sizer = wx.BoxSizer(wx.HORIZONTAL)
        buttons_sizer.Add(button_apply)
        buttons_sizer.Add(button_cancel)
        buttons_sizer.Add(button_load_default)

        top_sizer = wx.BoxSizer(wx.VERTICAL)
        top_sizer.Add(self.notebook)
        top_sizer.Add(buttons_sizer)

        self.frame.SetSizer(top_sizer)

        # Set event handlers for buttons.
        button_apply.Bind(wx.EVT_BUTTON, self.on_button_apply)
        button_cancel.Bind(wx.EVT_BUTTON, self.on_button_cancel)
        button_load_default.Bind(wx.EVT_BUTTON, self.on_button_load_default)

        outputs = [self.ikalog_gui.capture] + self.ikalog_gui.outputs
        self._init_outputs(outputs)

        # self.capture.panel is a part of self.frame. This Bind propagates
        # capture's source change to the preview.
        self.ikalog_gui.capture.panel.Bind(
            EVT_INPUT_INITIALIZED, self.ikalog_gui.on_input_initialized)

        # Refresh UI of each plugin.
        self.ikalog_gui.engine.call_plugins(
            'on_config_load_from_context', debug=True) 
Example #18
Source File: FontTest.py    From wxGlade with MIT License 4 votes vote down vote up
def __init__(self, *args, **kwds):
        # begin wxGlade: MyFrame.__init__
        kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE
        wx.Frame.__init__(self, *args, **kwds)
        self.SetSize((400, 300))
        self.SetTitle("frame")

        sizer_1 = wx.BoxSizer(wx.VERTICAL)

        self.text_ctrl_1 = wx.TextCtrl(self, wx.ID_ANY, "Some Input", style=wx.TE_READONLY)
        self.text_ctrl_1.SetBackgroundColour(wx.Colour(0, 255, 127))
        self.text_ctrl_1.SetForegroundColour(wx.Colour(255, 0, 0))
        self.text_ctrl_1.SetFont(wx.Font(16, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, 0, ""))
        self.text_ctrl_1.SetFocus()
        sizer_1.Add(self.text_ctrl_1, 1, wx.ALL | wx.EXPAND, 5)

        label_1 = wx.StaticText(self, wx.ID_ANY, "label_1")
        sizer_1.Add(label_1, 0, 0, 0)

        label_2 = wx.StaticText(self, wx.ID_ANY, "label_2")
        label_2.SetFont(wx.Font(8, wx.FONTFAMILY_DECORATIVE, wx.FONTSTYLE_SLANT, wx.FONTWEIGHT_LIGHT, 0, ""))
        sizer_1.Add(label_2, 0, 0, 0)

        label_3 = wx.StaticText(self, wx.ID_ANY, "label_3")
        label_3.SetFont(wx.Font(8, wx.FONTFAMILY_ROMAN, wx.FONTSTYLE_ITALIC, wx.FONTWEIGHT_BOLD, 0, ""))
        sizer_1.Add(label_3, 0, 0, 0)

        label_4 = wx.StaticText(self, wx.ID_ANY, "label_4")
        label_4.SetFont(wx.Font(8, wx.FONTFAMILY_SCRIPT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, ""))
        sizer_1.Add(label_4, 0, 0, 0)

        label_5 = wx.StaticText(self, wx.ID_ANY, "label_5")
        label_5.SetFont(wx.Font(10, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, ""))
        sizer_1.Add(label_5, 0, 0, 0)

        label_6 = wx.StaticText(self, wx.ID_ANY, "label_6")
        label_6.SetFont(wx.Font(12, wx.FONTFAMILY_MODERN, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 1, ""))
        sizer_1.Add(label_6, 0, 0, 0)

        self.SetSizer(sizer_1)

        self.Layout()
        # end wxGlade

# end of class MyFrame 
Example #19
Source File: HeaderBox.py    From EventGhost with GNU General Public License v2.0 4 votes vote down vote up
def __init__(self, parent, name="", text="", icon=None, url = None):
        text = REPLACE_BR_TAG.sub('\n', text)
        text = REMOVE_HTML_PATTERN.sub('', text).strip()
        if text == name:
            text = ""
        self.parent = parent
        wx.PyWindow.__init__(self, parent, -1)
        self.SetBackgroundColour(
            wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOW)
        )

        nameBox = wx.StaticText(self, -1, name)
        font = wx.Font(8, wx.SWISS, wx.NORMAL, wx.FONTWEIGHT_BOLD)
        nameBox.SetFont(font)

        self.text = '<html><body bgcolor="%s" text="%s">%s</body></html>' % (
            self.GetBackgroundColour().GetAsString(wx.C2S_HTML_SYNTAX),
            self.GetForegroundColour().GetAsString(wx.C2S_HTML_SYNTAX),
            text
        )
        if url:
            self.text = eg.Utils.AppUrl(self.text, url)
        descBox = eg.HtmlWindow(self, style=wx.html.HW_NO_SELECTION)
        descBox.SetBorders(1)
        descBox.SetFonts("Arial", "Times New Roman", [8, 8, 8, 8, 8, 8, 8])
        descBox.Bind(wx.html.EVT_HTML_LINK_CLICKED, self.OnLinkClicked)
        self.descBox = descBox

        staticBitmap = wx.StaticBitmap(self)
        staticBitmap.SetIcon(icon.GetWxIcon())

        mainSizer = eg.HBoxSizer(
            ((4, 4)),
            (staticBitmap, 0, wx.TOP, 5),
            ((4, 4)),
            (eg.VBoxSizer(
                ((4, 4)),
                (eg.HBoxSizer(
                    (nameBox, 1, wx.EXPAND | wx.ALIGN_BOTTOM),
                ), 0, wx.EXPAND | wx.TOP, 2),
                (descBox, 1, wx.EXPAND | wx.LEFT | wx.RIGHT, 8),
            ), 1, wx.EXPAND),
        )
        # odd sequence to setup the window, but all other ways seem
        # to wrap the text wrong
        self.SetSizer(mainSizer)
        self.SetAutoLayout(True)
        mainSizer.Fit(self)
        mainSizer.Layout()
        self.Layout()
        self.Bind(wx.EVT_SIZE, self.OnSize) 
Example #20
Source File: AboutDialog.py    From EventGhost with GNU General Public License v2.0 4 votes vote down vote up
def __init__(self, parent):
        wx.Panel.__init__(self, parent, style=wx.SUNKEN_BORDER)
        backgroundColour = (255, 255, 255)
        self.SetBackgroundColour(backgroundColour)
        hypelink1 = eg.HyperLinkCtrl(
            self,
            wx.ID_ANY,
            eg.text.MainFrame.Menu.WebHomepage.replace("&", ""),
            URL="http://www.eventghost.net/"
        )
        font = hypelink1.GetFont()
        font.SetPointSize(11)
        font.SetWeight(wx.FONTWEIGHT_BOLD)
        hypelink1.SetFont(font)
        hypelink2 = eg.HyperLinkCtrl(
            self,
            wx.ID_ANY,
            eg.text.MainFrame.Menu.WebForum.replace("&", ""),
            URL="http://www.eventghost.net/forum/"
        )
        hypelink2.SetFont(font)
        hypelink3 = eg.HyperLinkCtrl(
            self,
            wx.ID_ANY,
            eg.text.MainFrame.Menu.WebWiki.replace("&", ""),
            URL="http://www.eventghost.net/mediawiki/"
        )
        hypelink3.SetFont(font)

        animatedWindow = eg.AnimatedWindow(self)
        animatedWindow.SetBackgroundColour(backgroundColour)

        sizer = eg.VBoxSizer(
            (eg.HBoxSizer(
                ((5, 5), 1),
                (hypelink1, 0, wx.EXPAND, 15),
                ((5, 5), 1),
                (hypelink2, 0, wx.EXPAND, 15),
                ((5, 5), 1),
                (hypelink3, 0, wx.EXPAND, 15),
                ((5, 5), 1),
            ), 0, wx.ALIGN_CENTER | wx.EXPAND | wx.TOP, 15),
            (animatedWindow, 1, wx.ALIGN_CENTER | wx.ALL | wx.EXPAND, 10),
        )
        self.SetSizerAndFit(sizer) 
Example #21
Source File: AboutDialog.py    From OpenPLC_Editor with GNU General Public License v3.0 4 votes vote down vote up
def __init__(self, parent, info):
        title = _("About") + " " + info.Name
        wx.Dialog.__init__(self, parent, title=title)
        self.info = info

        if parent and parent.GetIcon():
            self.SetIcon(parent.GetIcon())

        image = None
        if self.info.Icon:
            bitmap = wx.BitmapFromIcon(self.info.Icon)
            image = wx.StaticBitmap(self, bitmap=bitmap)

        name = wx.StaticText(self, label="%s %s" % (info.Name, info.Version))
        description = wx.StaticText(self, label=info.Description)
        description.Wrap(400)
        copyright = wx.StaticText(self, label=info.Copyright)
        url = HyperLinkCtrl(self, label=info.WebSite[0], URL=info.WebSite[1])

        font = name.GetClassDefaultAttributes().font
        font.SetWeight(wx.FONTWEIGHT_BOLD)
        font.SetPointSize(18)
        name.SetFont(font)

        credits = wx.Button(self, id=wx.ID_ABOUT, label=_("C&redits"))
        license = wx.Button(self, label=_("&License"))
        close = wx.Button(self, id=wx.ID_CANCEL, label=_("&Close"))

        btnSizer = wx.BoxSizer(wx.HORIZONTAL)
        btnSizer.Add(credits, flag=wx.CENTER | wx.LEFT | wx.RIGHT, border=5)
        btnSizer.Add(license, flag=wx.CENTER | wx.RIGHT, border=5)
        btnSizer.Add(close, flag=wx.CENTER | wx.RIGHT, border=5)

        sizer = wx.BoxSizer(wx.VERTICAL)
        if image:
            sizer.Add(image, flag=wx.CENTER | wx.TOP | wx.BOTTOM, border=5)
        sizer.Add(name, flag=wx.CENTER | wx.BOTTOM, border=10)
        sizer.Add(description, flag=wx.CENTER | wx.BOTTOM, border=10)
        sizer.Add(copyright, flag=wx.CENTER | wx.BOTTOM, border=10)
        sizer.Add(url, flag=wx.CENTER | wx.BOTTOM, border=15)
        sizer.Add(btnSizer, flag=wx.CENTER | wx.BOTTOM, border=5)

        container = wx.BoxSizer(wx.VERTICAL)
        container.Add(sizer, flag=wx.ALL, border=10)
        self.SetSizer(container)
        self.Layout()
        self.Fit()
        self.Centre()
        self.Show(True)
        self.SetEscapeId(close.GetId())

        credits.Bind(wx.EVT_BUTTON, self.on_credits)
        license.Bind(wx.EVT_BUTTON, self.on_license)
        close.Bind(wx.EVT_BUTTON, lambda evt: self.Destroy())