Python wx.FONTFAMILY_MODERN Examples
The following are 7
code examples of wx.FONTFAMILY_MODERN().
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: widget_meter.py From RF-Monitor with GNU General Public License v2.0 | 6 votes |
def __init__(self, parent): wx.Panel.__init__(self, parent, size=(-1, 25), style=wx.SUNKEN_BORDER) self._value = LEVEL_MIN self._threshold = LEVEL_MIN self._noise = None font = self.GetFont() font.SetFamily(wx.FONTFAMILY_MODERN) self.SetFont(font) self.SetMinSize((250, 25)) self.Bind(wx.EVT_PAINT, self.__on_paint) self.Bind(wx.EVT_SIZE, self.__on_size) try: self.SetBackgroundStyle(wx.BG_STYLE_PAINT) except AttributeError: pass
Example #2
Source File: charmapdlg.py From trelby with GNU General Public License v2.0 | 5 votes |
def __init__(self, parent): wx.Window.__init__(self, parent, -1) self.selected = None # all valid characters self.chars = "" for i in xrange(256): if util.isValidInputChar(i): self.chars += chr(i) self.cols = 16 self.rows = len(self.chars) // self.cols if len(self.chars) % 16: self.rows += 1 # offset of grid self.offset = 5 # size of a single character cell self.cellSize = 32 # size of the zoomed-in character boxes self.boxSize = 60 self.smallFont = util.createPixelFont(18, wx.FONTFAMILY_SWISS, wx.NORMAL, wx.NORMAL) self.normalFont = util.createPixelFont(self.cellSize - 2, wx.FONTFAMILY_MODERN, wx.NORMAL, wx.BOLD) self.bigFont = util.createPixelFont(self.boxSize - 2, wx.FONTFAMILY_MODERN, wx.NORMAL, wx.BOLD) wx.EVT_PAINT(self, self.OnPaint) wx.EVT_LEFT_DOWN(self, self.OnLeftDown) wx.EVT_MOTION(self, self.OnMotion) wx.EVT_SIZE(self, self.OnSize) util.setWH(self, self.cols * self.cellSize + 2 * self.offset, 460)
Example #3
Source File: runtime_display_panel.py From pyFileFixity with MIT License | 5 votes |
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 #4
Source File: new_properties.py From wxGlade with MIT License | 5 votes |
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)
Example #5
Source File: splash.py From trelby with GNU General Public License v2.0 | 4 votes |
def __init__(self, parent, delay): wx.Frame.__init__( self, parent, -1, "Splash", style = wx.FRAME_FLOAT_ON_PARENT | wx.NO_BORDER) if not SplashWindow.inited: SplashWindow.inited = True wx.Image_AddHandler(wx.JPEGHandler()) self.loadQuotes(parent) self.pickRandomQuote() self.pic = misc.getBitmap("resources/logo.jpg") if self.pic.Ok(): w, h = (self.pic.GetWidth(), self.pic.GetHeight()) else: w, h = (375, 300) util.setWH(self, w, h) self.CenterOnScreen() self.textColor = wx.Colour(0, 0, 0) self.font = util.createPixelFont( 14, wx.FONTFAMILY_MODERN, wx.NORMAL, wx.NORMAL) self.quoteFont = util.createPixelFont( 16, wx.FONTFAMILY_DEFAULT, wx.NORMAL, wx.NORMAL) self.sourceFont = util.createPixelFont( 15, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_ITALIC, wx.NORMAL) if delay != -1: self.timer = wx.Timer(self) wx.EVT_TIMER(self, -1, self.OnTimer) self.timer.Start(delay, True) wx.EVT_LEFT_DOWN(self, self.OnClick) wx.EVT_PAINT(self, self.OnPaint) wx.EVT_CLOSE(self, self.OnCloseWindow)
Example #6
Source File: FCObjects.py From wafer_map with GNU General Public License v3.0 | 4 votes |
def __init__(self, String, XY, Size, Color = "Black", BackgroundColor = None, Family = wx.FONTFAMILY_MODERN, Style = wx.FONTSTYLE_NORMAL, Weight = wx.FONTWEIGHT_NORMAL, Underlined = False, Position = 'tl', Font = None, InForeground = False): DrawObject.__init__(self,InForeground) self.String = String self.XY = N.array( XY, N.float) self.XY.shape = (2,) self.Size = Size self.Color = Color self.BackgroundColor = BackgroundColor self.Family = Family self.Style = Style self.Weight = Weight self.Underlined = Underlined if not Font: self.FaceName = '' else: self.FaceName = Font.GetFaceName() self.Family = Font.GetFamily() self.Style = Font.GetStyle() self.Underlined = Font.GetUnderlined() self.Weight = Font.GetWeight() # Experimental max font size value on wxGTK2: this works OK on # my system. If it's a lot larger, there is a crash, with the # message: # # The application 'FloatCanvasDemo.py' lost its # connection to the display :0.0; most likely the X server was # shut down or you killed/destroyed the application. # # Windows and OS-X seem to be better behaved in this regard. # They may not draw it, but they don't crash either! self.MaxFontSize = 1000 self.MinFontSize = 1 # this can be changed to set a minimum size self.DisappearWhenSmall = True self.ShiftFun = self.ShiftFunDict[Position] self.CalcBoundingBox()
Example #7
Source File: FontTest.py From wxGlade with MIT License | 4 votes |
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