本文整理汇总了Python中wx.FONTSTYLE_NORMAL属性的典型用法代码示例。如果您正苦于以下问题:Python wx.FONTSTYLE_NORMAL属性的具体用法?Python wx.FONTSTYLE_NORMAL怎么用?Python wx.FONTSTYLE_NORMAL使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类wx
的用法示例。
在下文中一共展示了wx.FONTSTYLE_NORMAL属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ComputeFontScale
# 需要导入模块: import wx [as 别名]
# 或者: from wx import FONTSTYLE_NORMAL [as 别名]
def ComputeFontScale():
"""
Compute the font scale.
A global variable to hold the scaling from pixel size to point size.
"""
global FontScale
dc = wx.ScreenDC()
dc.SetFont(wx.Font(16, wx.FONTFAMILY_ROMAN, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL))
E = dc.GetTextExtent("X")
FontScale = 16/E[1]
del dc
# why do we do this here, causes a Sphinx build crash
#ComputeFontScale()
## fixme: This should probably be re-factored into a class
示例2: draw_monitor_numbers
# 需要导入模块: import wx [as 别名]
# 或者: from wx import FONTSTYLE_NORMAL [as 别名]
def draw_monitor_numbers(self, use_ppi_px):
font = wx.Font(24, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)
font_clr = wx.Colour(60, 60, 60, alpha=wx.ALPHA_OPAQUE)
for st_bmp in self.preview_img_list:
bmp = st_bmp.GetBitmap()
dc = wx.MemoryDC(bmp)
text = str(self.preview_img_list.index(st_bmp))
dc.SetTextForeground(font_clr)
dc.SetFont(font)
dc.DrawText(text, 5, 5)
del dc
st_bmp.SetBitmap(bmp)
if use_ppi_px:
self.draw_monitor_sizes()
示例3: draw_monitor_sizes
# 需要导入模块: import wx [as 别名]
# 或者: from wx import FONTSTYLE_NORMAL [as 别名]
def draw_monitor_sizes(self):
font = wx.Font(24, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_LIGHT)
font_clr = wx.Colour(60, 60, 60, alpha=wx.ALPHA_OPAQUE)
for st_bmp, img_sz, dsp in zip(self.preview_img_list,
self.img_rel_sizes,
self.display_sys.disp_list):
bmp = st_bmp.GetBitmap()
dc = wx.MemoryDC(bmp)
text = str(dsp.diagonal_size()[1]) + '"'
dc.SetTextForeground(font_clr)
dc.SetFont(font)
# bmp_w, bmp_h = dc.GetSize()
bmp_w, bmp_h = img_sz
text_w, text_h = dc.GetTextExtent(text)
pos_w = bmp_w - text_w - 5
pos_h = 5
dc.DrawText(text, pos_w, pos_h)
del dc
st_bmp.SetBitmap(bmp)
示例4: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import FONTSTYLE_NORMAL [as 别名]
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
示例5: __do_layout
# 需要导入模块: import wx [as 别名]
# 或者: from wx import FONTSTYLE_NORMAL [as 别名]
def __do_layout(self):
# begin wxGlade: About.__do_layout
sizer_1 = wx.BoxSizer(wx.VERTICAL)
sizer_2 = wx.BoxSizer(wx.HORIZONTAL)
sizer_3 = wx.BoxSizer(wx.VERTICAL)
sizer_3.Add(self.bitmap_button_1, 1, 0, 0)
self.meerk40t_about_version_text.SetFont(wx.Font(10, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, "Segoe UI"))
sizer_3.Add(self.meerk40t_about_version_text, 0, 0, 0)
sizer_2.Add(sizer_3, 1, wx.EXPAND, 0)
meerk40t_about_text_header = wx.StaticText(self, wx.ID_ANY, "MeerK40t is a free MIT Licensed open source project for lasering on K40 Devices.\n\nParticipation in the project is highly encouraged. Past participation, and continuing participation is graciously thanked. This program is mostly the brainchild of Tatarize, who sincerely hopes his contributions will be but the barest trickle that becomes a raging river.")
meerk40t_about_text_header.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, "Segoe UI"))
sizer_2.Add(meerk40t_about_text_header, 2, wx.EXPAND, 0)
sizer_1.Add(sizer_2, 1, wx.EXPAND, 0)
meerk40t_about_text = wx.StaticText(self, wx.ID_ANY, "Thanks.\nLi Huiyu for their controller. \nScorch for lighting our path.\nAlois Zingl for his wonderful Bresenham plotting algorithms.\n@joerlane and all the MeerKittens, past and present, great and small.\n\nIcon8 for their great icons ( https://icons8.com/ ) used throughout the project.\nThe works of countless developers who made everything possible.\nRegebro for his svg.path module.\nThe SVG Working Group.\nHackers (in the general sense).")
meerk40t_about_text.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, "Segoe UI"))
sizer_1.Add(meerk40t_about_text, 2, wx.EXPAND, 0)
self.SetSizer(sizer_1)
self.Layout()
self.Centre()
# end wxGlade
示例6: __set_properties
# 需要导入模块: import wx [as 别名]
# 或者: from wx import FONTSTYLE_NORMAL [as 别名]
def __set_properties(self):
# begin wxGlade: DeviceManager.__set_properties
self.SetTitle("Device Manager")
self.devices_list.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, "Segoe UI"))
self.devices_list.AppendColumn(_("Id"), format=wx.LIST_FORMAT_LEFT, width=72)
self.devices_list.AppendColumn(_("Driver"), format=wx.LIST_FORMAT_LEFT, width=119)
self.devices_list.AppendColumn(_("State"), format=wx.LIST_FORMAT_LEFT, width=127)
self.devices_list.AppendColumn(_("Location"), format=wx.LIST_FORMAT_LEFT, width=258)
self.devices_list.AppendColumn(_("Boot"), format=wx.LIST_FORMAT_LEFT, width=51)
self.new_device_button.SetToolTip(_("Add a new device"))
self.new_device_button.SetSize(self.new_device_button.GetBestSize())
self.remove_device_button.SetToolTip(_("Remove selected device"))
self.remove_device_button.SetSize(self.remove_device_button.GetBestSize())
self.device_properties_button.SetToolTip(_("View Device Properties"))
self.device_properties_button.SetSize(self.device_properties_button.GetBestSize())
self.move_item_up_button.SetToolTip(_("Move device up"))
self.move_item_up_button.SetSize(self.move_item_up_button.GetBestSize())
self.move_item_down_button.SetToolTip(_("Move device down"))
self.move_item_down_button.SetSize(self.move_item_down_button.GetBestSize())
# end wxGlade
示例7: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import FONTSTYLE_NORMAL [as 别名]
def __init__(self):
wx.Dialog.__init__(self, None, title=_('Standalone tool'), size=(130,230))
self.SetFont(wx.Font(10, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL))
panel = wx.Panel(self)
self.settings_b = wx.Button(panel,label=_('settings') , pos=(20, 20))
self.start_b = wx.Button(panel, label=_('start'), pos=(20, 60))
self.stop_b = wx.Button(panel, label=_('stop'), pos=(20, 100))
self.cancel_b = wx.Button(panel, label=_('cancel'), pos=(20, 140))
self.Bind(wx.EVT_BUTTON, self.on_Button)
示例8: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import FONTSTYLE_NORMAL [as 别名]
def __init__(self):
self.ButtonNr = 1
wx.Dialog.__init__(self, None, title=_('Add individual name to serial port'), size=(130, 230))
self.SetFont(wx.Font(10, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL))
panel = wx.Panel(self)
self.settings_b = wx.Button(panel, label=_('settings'), pos=(20, 20))
self.start_b = wx.Button(panel, label=_('start'), pos=(20, 60))
self.stop_b = wx.Button(panel, label=_('stop'), pos=(20, 100))
self.cancel_b = wx.Button(panel, label=_('cancel'), pos=(20, 140))
self.Bind(wx.EVT_BUTTON, self.on_Button)
示例9: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import FONTSTYLE_NORMAL [as 别名]
def __init__(self):
self.option=sys.argv[1]
self.text_sms=sys.argv[2]
self.text_sms=unicode(self.text_sms,'utf-8')
self.phone=sys.argv[3]
self.conf = Conf()
self.home = self.conf.home
self.currentpath = self.home+self.conf.get('GENERAL', 'op_folder')+'/openplotter'
Language(self.conf)
wx.Frame.__init__(self, None, title=_('Test SMS'), size=(500,260))
self.SetFont(wx.Font(10, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL))
self.icon = wx.Icon(self.currentpath+'/openplotter.ico', wx.BITMAP_TYPE_ICO)
self.SetIcon(self.icon)
self.CreateStatusBar()
self.text=wx.StaticText(self, label=_('Error'), pos=(10, 10))
self.output = wx.TextCtrl(self, style=wx.TE_MULTILINE|wx.TE_READONLY|wx.TE_DONTWRAP, size=(480,110), pos=(10,50))
self.button_close =wx.Button(self, label=_('Close'), pos=(300, 170))
self.Bind(wx.EVT_BUTTON, self.close, self.button_close)
self.button_calculate =wx.Button(self, label=_('Start'), pos=(400, 170))
self.Bind(wx.EVT_BUTTON, self.calculate, self.button_calculate)
if self.option=='i':
self.text.SetLabel(_('Press start to check the settings and connect to the GSM device'))
if self.option=='t':
self.text.SetLabel(_('Press start to send the text "').decode('utf8')+self.text_sms+_('"\nto the number "').decode('utf8')+self.phone+'"')
self.Centre()
示例10: _bold_static_text
# 需要导入模块: import wx [as 别名]
# 或者: from wx import FONTSTYLE_NORMAL [as 别名]
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
示例11: _bold_static_text
# 需要导入模块: import wx [as 别名]
# 或者: from wx import FONTSTYLE_NORMAL [as 别名]
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
示例12: CreatePopupMenu
# 需要导入模块: import wx [as 别名]
# 或者: from wx import FONTSTYLE_NORMAL [as 别名]
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
示例13: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import FONTSTYLE_NORMAL [as 别名]
def __init__(self, *args, **kwds):
# begin wxGlade: MySimplebook.__init__
kwds["style"] = kwds.get("style", 0) | wx.NB_TOP
wx.Simplebook.__init__(self, *args, **kwds)
self.notebook_1_pane_1 = wx.Panel(self, wx.ID_ANY)
self.AddPage(self.notebook_1_pane_1, "notebook_1_pane_1")
sizer_2 = wx.BoxSizer(wx.VERTICAL)
label_1 = wx.StaticText(self.notebook_1_pane_1, wx.ID_ANY, "Page 1 of Simplebook")
label_1.SetFont(wx.Font(20, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, ""))
sizer_2.Add(label_1, 0, wx.ALIGN_CENTER | wx.ALL, 20)
self.button_1 = wx.Button(self.notebook_1_pane_1, wx.ID_ANY, "Show page 2")
self.button_1.SetFont(wx.Font(16, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, ""))
sizer_2.Add(self.button_1, 1, wx.ALL | wx.EXPAND, 20)
self.notebook_1_notebook_1_pane_2 = wx.Panel(self, wx.ID_ANY)
self.AddPage(self.notebook_1_notebook_1_pane_2, "notebook_1_pane_2")
sizer_3 = wx.BoxSizer(wx.VERTICAL)
label_2 = wx.StaticText(self.notebook_1_notebook_1_pane_2, wx.ID_ANY, "Page 2 of Simplebook")
label_2.SetFont(wx.Font(20, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, ""))
sizer_3.Add(label_2, 0, wx.ALIGN_CENTER | wx.ALL, 20)
self.button_2 = wx.Button(self.notebook_1_notebook_1_pane_2, wx.ID_ANY, "Show page 1")
self.button_2.SetFont(wx.Font(16, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, ""))
sizer_3.Add(self.button_2, 1, wx.ALL | wx.EXPAND, 20)
self.notebook_1_notebook_1_pane_2.SetSizer(sizer_3)
self.notebook_1_pane_1.SetSizer(sizer_2)
self.Bind(wx.EVT_BUTTON, lambda event: self.ChangeSelection(1), self.button_1)
self.Bind(wx.EVT_BUTTON, lambda event: self.ChangeSelection(0), self.button_2)
# end wxGlade
# end of class MySimplebook
示例14: create_editor
# 需要导入模块: import wx [as 别名]
# 或者: from wx import FONTSTYLE_NORMAL [as 别名]
def create_editor(self, panel, sizer):
# we want a monospaced font
TextProperty.create_editor(self, panel, sizer)
font = wx.Font(9, wx.FONTFAMILY_MODERN, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)
self.text.SetFont(font)
示例15: __set_properties
# 需要导入模块: import wx [as 别名]
# 或者: from wx import FONTSTYLE_NORMAL [as 别名]
def __set_properties(self):
# begin wxGlade: RotarySettings.__set_properties
self.SetTitle("RotarySettings")
self.checkbox_rotary.SetFont(
wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, "Segoe UI"))
self.checkbox_rotary.SetToolTip(_("Use Rotary Settings"))
self.spin_rotary_scaley.SetMinSize((80, 23))
self.spin_rotary_scaley.SetToolTip(_("Rotary Scale Factor X"))
self.spin_rotary_scaley.Enable(False)
self.spin_rotary_scaley.SetIncrement(0.01)
self.spin_rotary_scalex.SetMinSize((80, 23))
self.spin_rotary_scalex.SetToolTip(_("Rotary Scale Factor X"))
self.spin_rotary_scalex.Enable(False)
self.spin_rotary_scalex.SetIncrement(0.01)
self.checkbox_rotary_loop.SetFont(
wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, "Segoe UI"))
self.checkbox_rotary_loop.SetToolTip(_("Use Rotary Settings"))
self.spin_rotary_rotation.SetMinSize((80, 23))
self.spin_rotary_rotation.SetToolTip(_("Steps required for a full rotation"))
self.spin_rotary_rotation.Enable(False)
self.spin_rotary_roller_circumference.SetMinSize((80, 23))
self.spin_rotary_roller_circumference.SetToolTip(_("Circumference of roller"))
self.spin_rotary_roller_circumference.Enable(False)
self.spin_rotary_roller_circumference.SetIncrement(0.01)
self.spin_rotary_object_circumference.SetMinSize((80, 23))
self.spin_rotary_object_circumference.SetToolTip(_("Circumference of object in rotary"))
self.spin_rotary_object_circumference.Enable(False)
self.spin_rotary_object_circumference.SetIncrement(0.01)
# end wxGlade