Beremiz.py
changeset 590 d3fb687dd0b9
parent 589 22e83880cdd9
child 598 6c919bc1551d
equal deleted inserted replaced
589:22e83880cdd9 590:d3fb687dd0b9
   324     def isatty(self):
   324     def isatty(self):
   325         return false
   325         return false
   326 
   326 
   327 [ID_BEREMIZ, ID_BEREMIZMAINSPLITTER, 
   327 [ID_BEREMIZ, ID_BEREMIZMAINSPLITTER, 
   328  ID_BEREMIZPLCCONFIG, ID_BEREMIZLOGCONSOLE, 
   328  ID_BEREMIZPLCCONFIG, ID_BEREMIZLOGCONSOLE, 
   329  ID_BEREMIZINSPECTOR] = [wx.NewId() for _init_ctrls in range(5)]
   329  ID_BEREMIZINSPECTOR, ID_BUILD] = [wx.NewId() for _init_ctrls in range(6)]
   330 
   330 
   331 [ID_BEREMIZRUNMENUBUILD, ID_BEREMIZRUNMENUSIMULATE, 
   331 [ID_BEREMIZRUNMENUBUILD, ID_BEREMIZRUNMENUSIMULATE, 
   332  ID_BEREMIZRUNMENURUN, ID_BEREMIZRUNMENUSAVELOG, 
   332  ID_BEREMIZRUNMENURUN, ID_BEREMIZRUNMENUSAVELOG, 
   333 ] = [wx.NewId() for _init_coll_EditMenu_Items in range(4)]
   333 ] = [wx.NewId() for _init_coll_EditMenu_Items in range(4)]
   334 
   334 
   407         
   407         
   408     def _init_ctrls(self, prnt):
   408     def _init_ctrls(self, prnt):
   409         IDEFrame._init_ctrls(self, prnt)
   409         IDEFrame._init_ctrls(self, prnt)
   410         
   410         
   411         self.Bind(wx.EVT_MENU, self.OnOpenWidgetInspector, id=ID_BEREMIZINSPECTOR)
   411         self.Bind(wx.EVT_MENU, self.OnOpenWidgetInspector, id=ID_BEREMIZINSPECTOR)
   412         accel = wx.AcceleratorTable([wx.AcceleratorEntry(wx.ACCEL_CTRL|wx.ACCEL_ALT, ord('I'), ID_BEREMIZINSPECTOR)])
   412         self.Bind(wx.EVT_MENU, self.OnBuildProject, id=ID_BUILD)
       
   413         accel = wx.AcceleratorTable([wx.AcceleratorEntry(wx.ACCEL_CTRL|wx.ACCEL_ALT, ord('I'), ID_BEREMIZINSPECTOR),
       
   414                                      wx.AcceleratorEntry(wx.ACCEL_NORMAL, wx.WXK_F11, ID_BUILD)])
   413         self.SetAcceleratorTable(accel)
   415         self.SetAcceleratorTable(accel)
   414         
   416         
   415         self.PLCConfig = wx.ScrolledWindow(id=ID_BEREMIZPLCCONFIG,
   417         self.PLCConfig = wx.ScrolledWindow(id=ID_BEREMIZPLCCONFIG,
   416               name='PLCConfig', parent=self.LeftNoteBook, pos=wx.Point(0, 0),
   418               name='PLCConfig', parent=self.LeftNoteBook, pos=wx.Point(0, 0),
   417               size=wx.Size(-1, -1), style=wx.TAB_TRAVERSAL|wx.SUNKEN_BORDER|wx.HSCROLL|wx.VSCROLL)
   419               size=wx.Size(-1, -1), style=wx.TAB_TRAVERSAL|wx.SUNKEN_BORDER|wx.HSCROLL|wx.VSCROLL)
   469         self.SetIcon(wx.Icon(Bpath( "images", "brz.ico"), wx.BITMAP_TYPE_ICO))
   471         self.SetIcon(wx.Icon(Bpath( "images", "brz.ico"), wx.BITMAP_TYPE_ICO))
   470         
   472         
   471         self.Bind(wx.EVT_CLOSE, self.OnCloseFrame)
   473         self.Bind(wx.EVT_CLOSE, self.OnCloseFrame)
   472         
   474         
   473         self._Refresh(TITLE, TOOLBAR, FILEMENU, EDITMENU, DISPLAYMENU)
   475         self._Refresh(TITLE, TOOLBAR, FILEMENU, EDITMENU, DISPLAYMENU)
       
   476         self.LogConsole.SetFocus()
   474 
   477 
   475     def RiseLogConsole(self):
   478     def RiseLogConsole(self):
   476         self.BottomNoteBook.SetSelection(self.BottomNoteBook.GetPageIndex(self.LogConsole))
   479         self.BottomNoteBook.SetSelection(self.BottomNoteBook.GetPageIndex(self.LogConsole))
   477         
   480         
   478     def RefreshTitle(self):
   481     def RefreshTitle(self):
   521         # one under the cursor, if any, or this frame.
   524         # one under the cursor, if any, or this frame.
   522         wnd = wx.FindWindowAtPointer()
   525         wnd = wx.FindWindowAtPointer()
   523         if not wnd:
   526         if not wnd:
   524             wnd = self
   527             wnd = self
   525         InspectionTool().Show(wnd, True)
   528         InspectionTool().Show(wnd, True)
       
   529 
       
   530     def OnBuildProject(self, evt):
       
   531         if self.PluginRoot is not None:
       
   532             self.PluginRoot._build()
   526 
   533 
   527     def OnLogConsoleDClick(self, event):
   534     def OnLogConsoleDClick(self, event):
   528         wx.CallAfter(self.SearchLineForError)
   535         wx.CallAfter(self.SearchLineForError)
   529         event.Skip()
   536         event.Skip()
   530 
   537 
  1612 if __name__ == '__main__':
  1619 if __name__ == '__main__':
  1613     # Install a exception handle for bug reports
  1620     # Install a exception handle for bug reports
  1614     AddExceptHook(os.getcwd(),updateinfo_url)
  1621     AddExceptHook(os.getcwd(),updateinfo_url)
  1615     
  1622     
  1616     frame = Beremiz(None, projectOpen, buildpath)
  1623     frame = Beremiz(None, projectOpen, buildpath)
       
  1624     splash.Close()
       
  1625     wx.Yield()
  1617     frame.Show()
  1626     frame.Show()
  1618     splash.Close()
       
  1619     app.MainLoop()
  1627     app.MainLoop()