Python wx.BITMAP_TYPE_ICO Examples
The following are 21
code examples of wx.BITMAP_TYPE_ICO().
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: daily.py From Bruno with MIT License | 6 votes |
def __init__(self): wx.Frame.__init__(self, None, pos=wx.DefaultPosition, size=wx.Size(450, 100), style=wx.MINIMIZE_BOX | wx.SYSTEM_MENU | wx.CAPTION | wx.CLOSE_BOX | wx.CLIP_CHILDREN, title="BRUNO") panel = wx.Panel(self) ico = wx.Icon('boy.ico', wx.BITMAP_TYPE_ICO) self.SetIcon(ico) my_sizer = wx.BoxSizer(wx.VERTICAL) lbl = wx.StaticText(panel, label="Bienvenido Sir. How can I help you?") my_sizer.Add(lbl, 0, wx.ALL, 5) self.txt = wx.TextCtrl(panel, style=wx.TE_PROCESS_ENTER, size=(400, 30)) self.txt.SetFocus() self.txt.Bind(wx.EVT_TEXT_ENTER, self.OnEnter) my_sizer.Add(self.txt, 0, wx.ALL, 5) panel.SetSizer(my_sizer) self.Show() speak.Speak('''Welcome back Sir, Broono at your service.''')
Example #2
Source File: __init__.py From BitTorrent with GNU General Public License v3.0 | 6 votes |
def OnInit(self): self.running = True if profile: try: os.unlink(prof_file_name) except: pass self.prof = Profiler() self.prof.enable() wx.the_app = self self._DoIterationId = wx.NewEventType() self.Connect(-1, -1, self._DoIterationId, self._doIteration) self.evt = wx.PyEvent() self.evt.SetEventType(self._DoIterationId) self.event_queue = [] # this breaks TreeListCtrl, and I'm too lazy to figure out why #wx.IdleEvent_SetMode(wx.IDLE_PROCESS_SPECIFIED) # this fixes 24bit-color toolbar buttons wx.SystemOptions_SetOptionInt("msw.remap", 0) icon_path = os.path.join(image_root, 'bittorrent.ico') self.icon = wx.Icon(icon_path, wx.BITMAP_TYPE_ICO) return True
Example #3
Source File: chronolapse.py From chronolapse with MIT License | 6 votes |
def __init__(self, parent, MainFrame, workingdir): wx.TaskBarIcon.__init__(self) self.parentApp = parent self.MainFrame = MainFrame self.wx_id = wx.NewId() if ON_WINDOWS: icon_file = os.path.join( os.path.abspath(workingdir), 'chronolapse.ico' ) else: icon_file = os.path.join( os.path.abspath(workingdir), 'chronolapse_24.ico' ) self.SetIcon(wx.Icon(icon_file, wx.BITMAP_TYPE_ICO), 'Chronolapse') self.CreateMenu()
Example #4
Source File: systray.py From p2ptv-pi with MIT License | 6 votes |
def __init__(self, wxapp, bgapp, iconfilename): wx.TaskBarIcon.__init__(self) self.bgapp = bgapp self.wxapp = wxapp self.icons = wx.IconBundle() self.icon = wx.Icon(iconfilename, wx.BITMAP_TYPE_ICO) self.icons.AddIcon(self.icon) self.Bind(wx.EVT_TASKBAR_LEFT_UP, self.OnLeftClicked) if sys.platform != 'darwin': self.SetIcon(self.icon, self.bgapp.appname) else: menuBar = wx.MenuBar() filemenu = wx.Menu() item = filemenu.Append(-1, 'E&xit', 'Terminate the program') self.Bind(wx.EVT_MENU, self.OnExit, item) wx.App.SetMacExitMenuItemId(item.GetId())
Example #5
Source File: PLCOpenEditor.py From OpenPLC_Editor with GNU General Public License v3.0 | 5 votes |
def __init__(self, parent, fileOpen=None): """ Constructor of the PLCOpenEditor class. :param parent: The parent window. :param fileOpen: The filepath to open if no controler defined (default: None). """ self.icon = wx.Icon(os.path.join(beremiz_dir, "images", "poe.ico"), wx.BITMAP_TYPE_ICO) IDEFrame.__init__(self, parent) result = None # Open the filepath if defined if fileOpen is not None: fileOpen = DecodeFileSystemPath(fileOpen, False) if os.path.isfile(fileOpen): # Create a new controller controler = PLCControler() result = controler.OpenXMLFile(fileOpen) self.Controler = controler self.LibraryPanel.SetController(controler) self.ProjectTree.Enable(True) self.PouInstanceVariablesPanel.SetController(controler) self._Refresh(PROJECTTREE, POUINSTANCEVARIABLESPANEL, LIBRARYTREE) # Define PLCOpenEditor icon self.SetIcon(self.icon) self.Bind(wx.EVT_CLOSE, self.OnCloseFrame) self._Refresh(TITLE, EDITORTOOLBAR, FILEMENU, EDITMENU, DISPLAYMENU) if result is not None: (num, line) = result self.ShowErrorMessage(_("PLC syntax error at line {a1}:\n{a2}").format(a1=num, a2=line))
Example #6
Source File: base_window.py From me-ica with GNU Lesser General Public License v2.1 | 5 votes |
def _init_properties(self): # self.SetTitle(self.build_spec['program_name']) # self.SetSize(self.build_spec['default_size']) # # self.SetMinSize((400, 300)) self.icon = wx.Icon(image_repository.program_icon, wx.BITMAP_TYPE_ICO) self.SetIcon(self.icon)
Example #7
Source File: networkedit.py From CANFestivino with GNU Lesser General Public License v2.1 | 5 votes |
def __init__(self, parent, nodelist = None, projectOpen = None): if nodelist is None: NetworkEditorTemplate.__init__(self, NodeList(NodeManager()), self, True) else: NetworkEditorTemplate.__init__(self, nodelist, self, False) self._init_ctrls(parent) self.HtmlFrameOpened = [] icon = wx.Icon(os.path.join(ScriptDirectory,"networkedit.ico"),wx.BITMAP_TYPE_ICO) self.SetIcon(icon) if self.ModeSolo: if projectOpen: result = self.NodeList.LoadProject(projectOpen) if not result: self.NodeList.SetCurrentSelected(0) self.RefreshNetworkNodes() self.RefreshProfileMenu() else: self.NodeList = None else: self.NodeList.SetCurrentSelected(0) self.RefreshNetworkNodes() self.RefreshProfileMenu() self.NetworkNodes.SetFocus() self.RefreshBufferState() self.RefreshTitle() self.RefreshMainMenu()
Example #8
Source File: objdictedit.py From CANFestivino with GNU Lesser General Public License v2.1 | 5 votes |
def __init__(self, parent, manager = None, filesOpen = []): if manager is None: NodeEditorTemplate.__init__(self, NodeManager(), self, True) else: NodeEditorTemplate.__init__(self, manager, self, False) self._init_ctrls(parent) self.HtmlFrameOpened = [] icon = wx.Icon(os.path.join(ScriptDirectory,"networkedit.ico"),wx.BITMAP_TYPE_ICO) self.SetIcon(icon) if self.ModeSolo: for filepath in filesOpen: result = self.Manager.OpenFileInCurrent(os.path.abspath(filepath)) if isinstance(result, (IntType, LongType)): new_editingpanel = EditingPanel(self.FileOpened, self, self.Manager) new_editingpanel.SetIndex(result) self.FileOpened.AddPage(new_editingpanel, "") else: for index in self.Manager.GetBufferIndexes(): new_editingpanel = EditingPanel(self.FileOpened, self, self.Manager) new_editingpanel.SetIndex(index) self.FileOpened.AddPage(new_editingpanel, "") if self.Manager.GetBufferNumber() > 0: window = self.FileOpened.GetPage(0) if window: self.Manager.ChangeCurrentNode(window.GetIndex()) self.FileOpened.SetSelection(0) if self.Manager.CurrentDS302Defined(): self.EditMenu.Enable(ID_OBJDICTEDITEDITMENUDS302PROFILE, True) else: self.EditMenu.Enable(ID_OBJDICTEDITEDITMENUDS302PROFILE, False) self.RefreshEditMenu() self.RefreshBufferState() self.RefreshProfileMenu() self.RefreshTitle() self.RefreshMainMenu()
Example #9
Source File: display_main.py From pyFileFixity with MIT License | 5 votes |
def _init_properties(self): self.SetMinSize((400, 300)) self.icon = wx.Icon(image_store.icon, wx.BITMAP_TYPE_ICO) self.SetIcon(self.icon)
Example #10
Source File: base_window.py From pyFileFixity with MIT License | 5 votes |
def _init_properties(self): self.SetTitle(self.build_spec['program_name']) self.SetSize(self.build_spec['default_size']) # self.SetMinSize((400, 300)) self.icon = wx.Icon(image_repository.icon, wx.BITMAP_TYPE_ICO) self.SetIcon(self.icon)
Example #11
Source File: createlivestream_wx.py From p2ptv-pi with MIT License | 5 votes |
def __init__(self, wxapp, bgapp, iconfilename): wx.TaskBarIcon.__init__(self) self.bgapp = bgapp self.wxapp = wxapp self.icons = wx.IconBundle() self.icon = wx.Icon(iconfilename, wx.BITMAP_TYPE_ICO) self.icons.AddIcon(self.icon) if sys.platform != 'darwin': self.SetIcon(self.icon, self.bgapp.appname) else: menuBar = wx.MenuBar() filemenu = wx.Menu() item = filemenu.Append(-1, 'E&xit', 'Terminate the program') self.Bind(wx.EVT_MENU, self.OnExit, item) wx.App.SetMacExitMenuItemId(item.GetId())
Example #12
Source File: guiminer.py From poclbm with GNU General Public License v3.0 | 5 votes |
def get_icon_bundle(): """Return the Bitcoin program icon bundle.""" return wx.IconBundleFromFile(os.path.join(get_module_path(), "logo.ico"), wx.BITMAP_TYPE_ICO)
Example #13
Source File: ReaderToolbar.py From pyscard with GNU Lesser General Public License v2.1 | 5 votes |
def __init__(self, parent): """Constructor, creating the reader toolbar.""" wx.ToolBar.__init__( self, parent, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.SIMPLE_BORDER | wx.TB_HORIZONTAL | wx.TB_FLAT | wx.TB_TEXT, name='Reader Toolbar') # create bitmaps for toolbar tsize = (16, 16) if None != ICO_READER: bmpReader = wx.Bitmap(ICO_READER, wx.BITMAP_TYPE_ICO) else: bmpReader = wx.ArtProvider_GetBitmap( wx.ART_HELP_BOOK, wx.ART_OTHER, tsize) if None != ICO_SMARTCARD: bmpCard = wx.Bitmap(ICO_SMARTCARD, wx.BITMAP_TYPE_ICO) else: bmpCard = wx.ArtProvider_GetBitmap( wx.ART_HELP_BOOK, wx.ART_OTHER, tsize) self.readercombobox = ReaderComboBox(self) # create and add controls self.AddSimpleTool( 10, bmpReader, "Select smart card reader", "Select smart card reader") self.AddControl(self.readercombobox) self.AddSeparator() self.AddSimpleTool( 20, bmpCard, "Connect to smartcard", "Connect to smart card") self.AddSeparator() self.Realize()
Example #14
Source File: CardAndReaderTreePanel.py From pyscard with GNU Lesser General Public License v2.1 | 5 votes |
def __init__(self, parent, ID=wx.NewId(), pos=wx.DefaultPosition, size=wx.DefaultSize, style=0, clientpanel=None): """Constructor. Initializes a smartcard or reader tree control.""" wx.TreeCtrl.__init__( self, parent, ID, pos, size, wx.TR_SINGLE | wx.TR_NO_BUTTONS) self.clientpanel = clientpanel self.parent = parent isz = (16, 16) il = wx.ImageList(isz[0], isz[1]) self.capindex = il.Add( wx.ArtProvider_GetBitmap(wx.ART_HELP_BOOK, wx.ART_OTHER, isz)) self.fldrindex = il.Add( wx.ArtProvider_GetBitmap(wx.ART_FOLDER, wx.ART_OTHER, isz)) self.fldropenindex = il.Add( wx.ArtProvider_GetBitmap(wx.ART_FILE_OPEN, wx.ART_OTHER, isz)) if None != ICO_SMARTCARD: self.cardimageindex = il.Add( wx.Bitmap(ICO_SMARTCARD, wx.BITMAP_TYPE_ICO)) if None != ICO_READER: self.readerimageindex = il.Add( wx.Bitmap(ICO_READER, wx.BITMAP_TYPE_ICO)) self.il = il self.SetImageList(self.il)
Example #15
Source File: test_sms.py From openplotter with GNU General Public License v2.0 | 5 votes |
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: chronolapse.py From chronolapse with MIT License | 4 votes |
def setup(self): # bind OnClose method self.Bind(wx.EVT_CLOSE, self.OnClose) # save path to folder where chronolapse is currently running self.CHRONOLAPSEPATH = os.path.dirname( os.path.abspath(sys.argv[0])) # set X to close to taskbar -- windows only # http://code.activestate.com/recipes/475155/ self.TBFrame = TaskBarFrame(None, self, -1, " ", self.CHRONOLAPSEPATH) self.TBFrame.Show(False) # webcam self.cam = None # image countdown self.countdown = 60 try: self.countdown = float(self.getConfig('frequency', default=60)) except ValueError: pass # create timer self.timer = Timer(self.timerCallBack) # constants self.VERSION = VERSION self.DOCFILE = 'manual.html' self.VERSION_CHECK_PATH = 'http://chronolapse.com/versioncheck/' # fill in codecs available video_codecs = [ 'mpeg4', 'msmpeg4', 'msmpeg4v2', 'wmv1', 'mjpeg', 'h263p'] self.videocodeccombo.SetItems(video_codecs) self.videocodeccombo.SetStringSelection( self.getConfig('video_codec', default=video_codecs[0]) ) # check version self.checkVersion() # for idle checking (win only) self.last_event_info = None # load icon - #TODO: embed with base64? if ON_WINDOWS: icon_file = os.path.join(self.CHRONOLAPSEPATH, 'chronolapse.ico') else: icon_file = os.path.join(self.CHRONOLAPSEPATH, 'chronolapse_24.ico') if os.path.isfile(icon_file): self.SetIcon(wx.Icon(icon_file, wx.BITMAP_TYPE_ICO)) else: logging.warning( 'Could not find %s' % icon_file) # autostart if self.settings.autostart: self.startCapturePressed(None)
Example #17
Source File: NMEA_0183_generator.py From openplotter with GNU General Public License v2.0 | 4 votes |
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 #18
Source File: SDR_AIS_fine_cal.py From openplotter with GNU General Public License v2.0 | 4 votes |
def __init__(self): self.option=sys.argv[1] 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=_('Fine calibration'), size=(500,300)) 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.gain=self.conf.get('AIS-SDR', 'gain') self.ppm=self.conf.get('AIS-SDR', 'ppm') self.channel=self.conf.get('AIS-SDR', 'gsm_channel') wx.StaticText(self, label=_('gain: ').decode('utf8')+self.gain, pos=(10, 70)) wx.StaticText(self, label=_('ppm: ').decode('utf8')+self.ppm, pos=(100, 70)) self.output = wx.TextCtrl(self, style=wx.TE_MULTILINE|wx.TE_READONLY|wx.TE_DONTWRAP, size=(480,110), pos=(10,90)) self.button_close =wx.Button(self, label=_('Close'), pos=(300, 210)) self.Bind(wx.EVT_BUTTON, self.close, self.button_close) self.button_calculate =wx.Button(self, label=_('Calculate'), pos=(400, 210)) self.Bind(wx.EVT_BUTTON, self.calculate, self.button_calculate) if self.option=='c': self.text.SetLabel(_('Press Calculate and wait for the system to calculate the ppm value with\nthe selected channel. Put the obtained value in "Correction (ppm)" field\nand enable SDR-AISreception. Estimated time: 1 min.')) wx.StaticText(self, label=_('channel: ').decode('utf8')+self.channel, pos=(200, 70)) if self.option=='b': self.text.SetLabel(_('Press Calculate and wait for the system to check the band. Write down\nthe strongest channel (power). If you do not find any channel try another\nband. Estimated time: 5 min.')) self.Centre()
Example #19
Source File: wxcef.py From Librian with Mozilla Public License 2.0 | 4 votes |
def __init__(self, url, icon, title, size): self.browser = None # Must ignore X11 errors like 'BadWindow' and others by # installing X11 error handlers. This must be done after # wx was intialized. if LINUX: cef.WindowUtils.InstallX11ErrorHandlers() global g_count_windows g_count_windows += 1 if WINDOWS: # noinspection PyUnresolvedReferences, PyArgumentList logging.debug("[wxpython.py] System DPI settings: %s" % str(cef.DpiAware.GetSystemDpi())) if hasattr(wx, "GetDisplayPPI"): logging.debug("[wxpython.py] wx.GetDisplayPPI = %s" % wx.GetDisplayPPI()) logging.debug("[wxpython.py] wx.GetDisplaySize = %s" % wx.GetDisplaySize()) logging.debug("[wxpython.py] MainFrame DPI scaled size: %s" % str(size)) wx.Frame.__init__(self, parent=None, id=wx.ID_ANY, title=title) # wxPython will set a smaller size when it is bigger # than desktop size. logging.debug("[wxpython.py] MainFrame actual size: %s" % self.GetSize()) ic = wx.Icon(icon, wx.BITMAP_TYPE_ICO) self.SetIcon(ic) self.Bind(wx.EVT_CLOSE, self.OnClose) # Set wx.WANTS_CHARS style for the keyboard to work. # This style also needs to be set for all parent controls. self.browser_panel = wx.Panel(self, size=tuple(size)) self.browser_panel.Bind(wx.EVT_SIZE, self.OnSize) wx.Window.Fit(self) if MAC: # Make the content view for the window have a layer. # This will make all sub-views have layers. This is # necessary to ensure correct layer ordering of all # child views and their layers. This fixes Window # glitchiness during initial loading on Mac (Issue #371). NSApp.windows()[0].contentView().setWantsLayer_(True) if LINUX: self.Show() self.embed_browser(url) else: self.embed_browser(url) self.Show()
Example #20
Source File: SK-simulator.py From openplotter with GNU General Public License v2.0 | 4 votes |
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 #21
Source File: CAN-USB-stick.py From openplotter with GNU General Public License v2.0 | 4 votes |
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)