Python wx.FONTWEIGHT_NORMAL Examples

The following are 30 code examples of wx.FONTWEIGHT_NORMAL(). 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: DeviceManager.py    From meerk40t with MIT License 6 votes vote down vote up
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 
Example #2
Source File: About.py    From meerk40t with MIT License 6 votes vote down vote up
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 
Example #3
Source File: FCObjects.py    From wafer_map with GNU General Public License v3.0 6 votes vote down vote up
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 
Example #4
Source File: gui.py    From superpaper with MIT License 6 votes vote down vote up
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() 
Example #5
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 #6
Source File: RotarySettings.py    From meerk40t with MIT License 5 votes vote down vote up
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 
Example #7
Source File: new_properties.py    From wxGlade with MIT License 5 votes vote down vote up
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 #8
Source File: simplebook.py    From wxGlade with MIT License 5 votes vote down vote up
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 
Example #9
Source File: wx_util.py    From pyFileFixity with MIT License 5 votes vote down vote up
def h2(parent, label):
  return _header(parent, label, (wx.FONTFAMILY_DEFAULT, wx.FONTWEIGHT_NORMAL, wx.FONTWEIGHT_NORMAL, False)) 
Example #10
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 #11
Source File: wx_util.py    From pyFileFixity with MIT License 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 #12
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 #13
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 #14
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 #15
Source File: test_sms.py    From openplotter with GNU General Public License v2.0 5 votes vote down vote up
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() 
Example #16
Source File: add_tool10.py    From openplotter with GNU General Public License v2.0 5 votes vote down vote up
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) 
Example #17
Source File: add_tool10.py    From openplotter with GNU General Public License v2.0 5 votes vote down vote up
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) 
Example #18
Source File: wx_util.py    From me-ica with GNU Lesser General Public License v2.1 5 votes vote down vote up
def h2(parent, label):
  return _header(parent, label, (wx.FONTFAMILY_DEFAULT, wx.FONTWEIGHT_NORMAL, wx.FONTWEIGHT_NORMAL, False)) 
Example #19
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 #20
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 #21
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 #22
Source File: FCObjects.py    From wafer_map with GNU General Public License v3.0 4 votes vote down vote up
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 #23
Source File: NMEA_0183_generator.py    From openplotter with GNU General Public License v2.0 4 votes vote down vote up
def __init__(self):

			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=_('NMEA 0183 generator'), size=(690,350))
			
			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)

			wx.StaticBox(self, label=_(' NMEA 0183 '), size=(670, 230), pos=(10, 10))
			self.list_nmea = wx.ListCtrl(self, style=wx.LC_REPORT, size=(565, 200), pos=(15, 30))
			self.list_nmea.InsertColumn(0, _('Sentence'), width=100)
			self.list_nmea.InsertColumn(1, _('Rate'), width=50)
			self.list_nmea.InsertColumn(2, _('Fields'), width=1500)

			self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.edit_nmea, self.list_nmea)
				
			self.add_nmea_button =wx.Button(self, label=_('add'), pos=(585, 30))
			self.Bind(wx.EVT_BUTTON, self.add_nmea, self.add_nmea_button)

			self.delete_nmea_button =wx.Button(self, label=_('delete'), pos=(585, 65))
			self.Bind(wx.EVT_BUTTON, self.delete_nmea, self.delete_nmea_button)

			self.compat_nmea_button =wx.Button(self, label=_('opencpn\ndefault'), pos=(585, 189))
			self.Bind(wx.EVT_BUTTON, self.compat_nmea, self.compat_nmea_button)

			self.diagnostic_nmea_button=wx.Button(self, label=_('NMEA Diagnostic'), pos=(10, 250))
			self.Bind(wx.EVT_BUTTON, self.kplex_diagnostic, self.diagnostic_nmea_button)

			self.diagnostic_sk_button=wx.Button(self, label=_('SK Diagnostic'), pos=(180, 250))
			self.Bind(wx.EVT_BUTTON, self.sk_diagnostic, self.diagnostic_sk_button)


			self.CreateStatusBar()

			self.Centre()

			self.Show(True)

			self.read_sentences() 
Example #24
Source File: SK-simulator.py    From openplotter with GNU General Public License v2.0 4 votes vote down vote up
def __init__(self):
		self.conf = conf
		self.home = home
		self.currentpath = self.home+self.conf.get('GENERAL', 'op_folder')+'/openplotter'

		self.tick=0
		self.deg2rad=0.0174533
		self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

		self.Slider=[]
		self.Slider_v=[]
		self.HSlider=[]
		self.Slider_list=[]
		
		Language(self.conf)
		
		wx.Frame.__init__(self, None, title="SK-Simulator", size=(650,435))
		self.Bind(wx.EVT_CLOSE, self.OnClose)
		self.panel = wx.Panel(self)
		self.vbox = wx.BoxSizer(wx.VERTICAL)

		self.ttimer=500
		self.timer = wx.Timer(self)
		self.Bind(wx.EVT_TIMER, self.timer_act, self.timer)		
		
		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.read_conf()
		
		#self.SK_Slider(0,'navigation.courseOverGroundTrue',0,0,360,self.deg2rad,0)
		for i in self.Slider_list:
			self.SK_Slider_conf(i[0],i[1],i[2],i[3],i[4],i[5],i[6])
		
		self.Bind(wx.EVT_CHECKBOX, self.on_change_checkbox)
		
		allBtn = wx.Button(self.panel, label=_('all'),size=(70, 32), pos=(450, 360))
		allBtn.Bind(wx.EVT_BUTTON, self.allBtn)
		
		noneBtn = wx.Button(self.panel, label=_('none'),size=(70, 32), pos=(550, 360))
		noneBtn.Bind(wx.EVT_BUTTON, self.noneBtn)
		
		HButton = wx.BoxSizer(wx.HORIZONTAL)
		HButton.Add((0,0), 1, wx.ALL|wx.EXPAND, 5)
		HButton.Add(noneBtn, 0, wx.ALL|wx.EXPAND, 5)
		HButton.Add(allBtn, 0, wx.ALL|wx.EXPAND, 5)
		
		self.vbox.Add((0,0), 1, wx.ALL|wx.EXPAND, 5)		
		self.vbox.Add(HButton, 0, wx.ALL|wx.EXPAND, 5)		
		self.panel.SetSizer(self.vbox)				
		
		self.Centre()

		self.Show(True)
		
		self.timer.Start(self.ttimer) 
Example #25
Source File: add_topic.py    From openplotter with GNU General Public License v2.0 4 votes vote down vote up
def __init__(self, edit):

		if edit == 0: title = _('Add MQTT topic')
		else: title = _('Edit MQTT topic')

		wx.Dialog.__init__(self, None, title = title, size=(430, 280))
		self.SetFont(wx.Font(10, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL))

		panel = wx.Panel(self)

		self.topiclabel = wx.StaticText(panel, label=_('Topic'), pos=(10, 10))
		wx.StaticText(panel, label=_('allowed characters: 0-9, a-z, A-Z'), pos=(150, 10))
		self.topic = wx.TextCtrl(panel, size=(410, 30), pos=(10, 30))

		list_type = [_('General'), _('Signal K key input'), _('Signal K delta input')]
		wx.StaticText(panel, label=_('Type'), pos=(10, 70))
		self.type = wx.ComboBox(panel, choices=list_type, style=wx.CB_READONLY, size=(200, 32), pos=(10, 90))
		self.type.Bind(wx.EVT_COMBOBOX, self.onSelect_type)

		self.skkeylabel = wx.StaticText(panel, label=_('Signal K key'), pos=(10, 130))
		self.skkey = wx.TextCtrl(panel, style=wx.CB_READONLY, size=(300, 30), pos=(10, 150))

		self.edit_skkey = wx.Button(panel, label=_('Edit'), pos=(320, 147))
		self.edit_skkey.Bind(wx.EVT_BUTTON, self.onEditSkkey)

		self.skkeylabel.Disable()
		self.skkey.Disable()
		self.edit_skkey.Disable()

		if edit != 0:
			self.topic.SetValue(edit[1][0])
			if edit[1][1] == 0: 
				self.type.SetValue(_('General'))
			elif edit[1][1] == 1:
				self.type.SetValue(_('Signal K key input'))
				self.skkey.SetValue(edit[1][2])
				self.skkeylabel.Enable()
				self.skkey.Enable()
				self.edit_skkey.Enable()
			elif edit[1][1] == 2:
				self.type.SetValue(_('Signal K delta input'))

		cancelBtn = wx.Button(panel, wx.ID_CANCEL, pos=(120, 210))
		okBtn = wx.Button(panel, wx.ID_OK, pos=(230, 210)) 
Example #26
Source File: CAN-USB-stick.py    From openplotter with GNU General Public License v2.0 4 votes vote down vote up
def __init__(self):
			self.ttimer=40
			self.conf = Conf()
			self.home = self.conf.home
			self.currentpath = self.home+self.conf.get('GENERAL', 'op_folder')+'/openplotter'
			
			try:
				self.ser = serial.Serial(self.conf.get('N2K', 'can_usb'), 115200, timeout=0.5)
			except:
				print 'failed to start N2K output setting on '+self.conf.get('N2K', 'can_usb')
				sys.exit(0)
			Language(self.conf)

			Buf_ = (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
			self.Buffer = bytearray(Buf_)
			self.Zustand=6
			self.buffer=0
			self.PGN_list=[]
			self.list_N2K_txt=[]
			self.list_count=[]
			self.p=0

			wx.Frame.__init__(self, None, title="N2K setting", size=(650,435))
			self.Bind(wx.EVT_CLOSE, self.OnClose)
		
			self.timer = wx.Timer(self)
			self.Bind(wx.EVT_TIMER, self.timer_act, self.timer)

			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)
			
			panel = wx.Panel(self, 100)
			wx.StaticText(panel, wx.ID_ANY, label="TX PGN", style=wx.ALIGN_CENTER, pos=(10,5))
			self.list_N2K = CheckListCtrl(panel, 400,260)
			self.list_N2K.SetBackgroundColour((230,230,230))
			self.list_N2K.SetPosition((10, 25))
			self.list_N2K.InsertColumn(0, _('PGN'), width=90)
			self.list_N2K.InsertColumn(1, _('info'), width=200)
			wx.StaticText(panel, wx.ID_ANY, label="enabled transmit PGN:", style=wx.ALIGN_CENTER, pos=(10,300))
			self.printing = wx.StaticText(panel, size=(600, 70), pos=(10, 320))
			
			self.check_b = wx.Button(panel, label=_('check'),size=(70, 32), pos=(550, 20))
			self.Bind(wx.EVT_BUTTON, self.check, self.check_b)
			
			self.apply_b = wx.Button(panel, label=_('apply'),size=(70, 32), pos=(550, 60))
			self.Bind(wx.EVT_BUTTON, self.apply, self.apply_b)
			
			self.Centre()
			self.read_N2K()

			self.timer.Start(self.ttimer)

			self.check(0)
			
			self.Show(True) 
Example #27
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 #28
Source File: frame_merger.py    From iqiyi-parser with MIT License 4 votes vote down vote up
def __init__(self, parent):
        wx.Frame.__init__(self, parent, id=wx.ID_ANY, title=u'FFMPEG 输出窗口', pos=wx.DefaultPosition,
                           size=wx.Size(427, 450), style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL)

        self.SetSizeHints(wx.Size(427, 381), wx.DefaultSize)
        self.SetBackgroundColour(wx.Colour(240, 240, 240))

        sizer = wx.BoxSizer(wx.VERTICAL)

        self.textctrl_output = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size(427, 381),
                                  wx.TE_AUTO_URL | wx.TE_MULTILINE | wx.TE_PROCESS_ENTER | wx.TE_PROCESS_TAB)

        self.textctrl_output.SetFont(wx.Font(8, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "宋体"))

        self.staticline = wx.StaticLine(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL)

        self.text_remain = wx.StaticText(self, wx.ID_ANY, u"估计还剩 00:00:00", wx.DefaultPosition, wx.DefaultSize,
                                            wx.ALIGN_RIGHT)
        self.text_remain.Wrap(-1)

        self.gauge_progress = wx.Gauge(self, wx.ID_ANY, 10000, wx.DefaultPosition, wx.DefaultSize, wx.GA_HORIZONTAL)
        self.gauge_progress.SetValue(0)

        sizer_1 = wx.BoxSizer(wx.HORIZONTAL)

        self.text_percent = wx.StaticText(self, wx.ID_ANY, u"0.0%", wx.DefaultPosition, wx.DefaultSize, 0)
        self.text_percent.Wrap(-1)

        self.text_size = wx.StaticText(self, wx.ID_ANY, u"0kb", wx.DefaultPosition, wx.DefaultSize,
                                            wx.ALIGN_RIGHT)
        self.text_size.Wrap(-1)

        sizer_1.Add(self.text_percent, 1, wx.ALL | wx.EXPAND, 2)
        sizer_1.Add(self.text_size, 1, wx.ALL | wx.EXPAND, 2)

        sizer.Add(self.textctrl_output, 1, wx.ALL | wx.EXPAND, 2)
        sizer.Add(self.staticline, 0, wx.EXPAND | wx.ALL, 5)
        sizer.Add(self.text_remain, 0, wx.ALL | wx.EXPAND, 2)
        sizer.Add(self.gauge_progress, 0, wx.ALL | wx.EXPAND, 2)
        sizer.Add(sizer_1, 0, wx.ALL | wx.EXPAND, 3)

        self.menu_bar = MergerMenuBar(0)
        self.SetMenuBar(self.menu_bar)


        self.SetSizer(sizer)
        self.Layout()

        self.Centre(wx.BOTH)

        self.textctrl_output.Connect(-1, -1, EVT_OUTPUT_APPEND, self.AppendText)
        self.gauge_progress.Connect(-1, -1, EVT_OUTPUT_UPDATE, self.update) 
Example #29
Source File: Controller.py    From meerk40t with MIT License 4 votes vote down vote up
def __set_properties(self):
        # begin wxGlade: Controller.__set_properties
        self.SetTitle(_("Controller"))
        self.button_controller_control.SetBackgroundColour(wx.Colour(102, 255, 102))
        self.button_controller_control.SetFont(
            wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, "Segoe UI"))
        self.button_controller_control.SetToolTip(_("Change the currently performed operation."))
        self.button_controller_control.SetBitmap(icons8_play_50.GetBitmap())
        self.text_controller_status.SetToolTip(_("Displays the controller's current process."))
        self.button_device_connect.SetBackgroundColour(wx.Colour(102, 255, 102))
        self.button_device_connect.SetFont(
            wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, "Segoe UI"))
        self.button_device_connect.SetToolTip(_("Force connection/disconnection from the device."))
        self.button_device_connect.SetBitmap(icons8_connected_50.GetBitmap())
        self.text_connection_status.SetToolTip(_("Connection status"))
        self.text_device.SetToolTip(_("Device being used"))
        self.text_location.SetToolTip(_("Connection location"))
        self.checkbox_limit_buffer.SetToolTip(
            _("Limit the write buffer to a certain amount. Permits on-the-fly command production."))
        self.checkbox_limit_buffer.SetValue(1)
        self.text_buffer_length.SetMinSize((165, 23))
        self.text_buffer_length.SetToolTip(_("Current number of bytes in the write buffer."))
        self.spin_packet_buffer_max.SetToolTip(_("Current maximum write buffer limit."))
        self.button_buffer_viewer.SetMinSize((52, 52))
        self.button_buffer_viewer.SetToolTip(_("View a snapshot of the current buffer"))
        self.packet_count_text.SetMinSize((77, 23))
        self.packet_count_text.SetToolTip(_("Total number of packets sent"))
        self.rejected_packet_count_text.SetMinSize((77, 23))
        self.rejected_packet_count_text.SetToolTip(_("Total number of packets rejected"))
        self.packet_text_text.SetToolTip(_("Last packet information sent"))
        self.text_byte_0.SetMinSize((77, 23))
        self.text_byte_1.SetMinSize((77, 23))
        self.text_desc.SetMinSize((75, 23))
        self.text_desc.SetToolTip(_("The meaning of Byte 1"))
        self.text_byte_2.SetMinSize((77, 23))
        self.text_byte_3.SetMinSize((77, 23))
        self.text_byte_4.SetMinSize((77, 23))
        self.text_byte_5.SetMinSize((77, 23))
        self.button_pause.SetBackgroundColour(wx.Colour(255, 255, 0))
        self.button_pause.SetToolTip(_("Pause/Resume the controller"))
        self.button_pause.SetSize(self.button_pause.GetBestSize())
        self.button_stop.SetBackgroundColour(wx.Colour(127, 0, 0))
        self.button_stop.SetToolTip(_("Emergency stop/reset the controller."))
        self.button_stop.SetSize(self.button_stop.GetBestSize())
        # end wxGlade 
Example #30
Source File: JobInfo.py    From meerk40t with MIT License 4 votes vote down vote up
def __init__(self, *args, **kwds):
        # begin wxGlade: JobInfo.__init__
        kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE | wx.FRAME_TOOL_WINDOW | wx.STAY_ON_TOP
        wx.Frame.__init__(self, *args, **kwds)
        Module.__init__(self)
        self.SetSize((659, 612))
        self.operations_listbox = wx.ListBox(self, wx.ID_ANY, choices=[], style=wx.LB_ALWAYS_SB | wx.LB_SINGLE)
        self.commands_listbox = wx.ListBox(self, wx.ID_ANY, choices=[], style=wx.LB_ALWAYS_SB | wx.LB_SINGLE)
        self.button_job_spooler = wx.BitmapButton(self, wx.ID_ANY, icons8_route_50.GetBitmap())
        self.button_writer_control = wx.Button(self, wx.ID_ANY, _("Start Job"))
        self.button_writer_control.SetBitmap(icons8_laser_beam_52.GetBitmap())
        self.button_writer_control.SetFont(
            wx.Font(15, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, "Segoe UI"))

        # Menu Bar
        self.JobInfo_menubar = wx.MenuBar()
        wxglade_tmp_menu = wx.Menu()
        self.menu_autostart = wxglade_tmp_menu.Append(wx.ID_ANY, _("Start Spooler"), "", wx.ITEM_CHECK)
        self.Bind(wx.EVT_MENU, self.on_check_auto_start_controller, id=self.menu_autostart.GetId())
        self.menu_prehome = wxglade_tmp_menu.Append(wx.ID_ANY, _("Home Before"), "", wx.ITEM_CHECK)
        self.Bind(wx.EVT_MENU, self.on_check_home_before, id=self.menu_prehome.GetId())
        self.menu_autohome = wxglade_tmp_menu.Append(wx.ID_ANY, _("Home After"), "", wx.ITEM_CHECK)
        self.Bind(wx.EVT_MENU, self.on_check_home_after, id=self.menu_autohome.GetId())
        self.menu_autobeep = wxglade_tmp_menu.Append(wx.ID_ANY, _("Beep After"), "", wx.ITEM_CHECK)
        self.Bind(wx.EVT_MENU, self.on_check_beep_after, id=self.menu_autobeep.GetId())
        self.JobInfo_menubar.Append(wxglade_tmp_menu, _("Automatic"))

        wxglade_tmp_menu = wx.Menu()
        t = wxglade_tmp_menu.Append(wx.ID_ANY, _("Home"), "")
        self.Bind(wx.EVT_MENU, self.jobadd_home, id=t.GetId())
        t = wxglade_tmp_menu.Append(wx.ID_ANY, _("Wait"), "")
        self.Bind(wx.EVT_MENU, self.jobadd_wait, id=t.GetId())
        t = wxglade_tmp_menu.Append(wx.ID_ANY, _("Beep"), "")
        self.Bind(wx.EVT_MENU, self.jobadd_beep, id=t.GetId())
        t = wxglade_tmp_menu.Append(wx.ID_ANY, _("Interrupt"), "")
        self.Bind(wx.EVT_MENU, self.jobadd_interrupt, id=t.GetId())
        self.JobInfo_menubar.Append(wxglade_tmp_menu, _("Add"))
        self.SetMenuBar(self.JobInfo_menubar)
        # Menu Bar end

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_LISTBOX, self.on_listbox_operation_click, self.operations_listbox)
        self.Bind(wx.EVT_LISTBOX_DCLICK, self.on_listbox_operation_dclick, self.operations_listbox)
        self.Bind(wx.EVT_LISTBOX, self.on_listbox_commands_click, self.commands_listbox)
        self.Bind(wx.EVT_LISTBOX_DCLICK, self.on_listbox_commands_dclick, self.commands_listbox)
        self.Bind(wx.EVT_BUTTON, self.on_button_start_job, self.button_writer_control)
        self.Bind(wx.EVT_BUTTON, self.on_button_job_spooler, self.button_job_spooler)
        # end wxGlade

        self.Bind(wx.EVT_CLOSE, self.on_close, self)

        # TODO: Move this to Elements
        self.preprocessor = OperationPreprocessor()
        self.operations = []