BeremizIDE.py
changeset 1742 92932cd370a4
parent 1741 dd94b9a68c61
child 1744 69dfdb26f600
equal deleted inserted replaced
1741:dd94b9a68c61 1742:92932cd370a4
   113             self.lock.release()
   113             self.lock.release()
   114             current_time = gettime()
   114             current_time = gettime()
   115             self.TimerAccessLock.acquire()
   115             self.TimerAccessLock.acquire()
   116             if self.LastRefreshTimer:
   116             if self.LastRefreshTimer:
   117                 self.LastRefreshTimer.cancel()
   117                 self.LastRefreshTimer.cancel()
   118                 self.LastRefreshTimer=None
   118                 self.LastRefreshTimer = None
   119             self.TimerAccessLock.release()
   119             self.TimerAccessLock.release()
   120             if current_time - self.LastRefreshTime > REFRESH_PERIOD and self.RefreshLock.acquire(False):
   120             if current_time - self.LastRefreshTime > REFRESH_PERIOD and self.RefreshLock.acquire(False):
   121                 self._should_write()
   121                 self._should_write()
   122             else:
   122             else:
   123                 self.TimerAccessLock.acquire()
   123                 self.TimerAccessLock.acquire()
   146     def _write(self):
   146     def _write(self):
   147         if self.output:
   147         if self.output:
   148             self.output.Freeze()
   148             self.output.Freeze()
   149             self.lock.acquire()
   149             self.lock.acquire()
   150             for s, style in self.stack:
   150             for s, style in self.stack:
   151                 if style is None: style=self.black_white
   151                 if style is None: style = self.black_white
   152                 if style != self.black_white:
   152                 if style != self.black_white:
   153                     self.output.StartStyling(self.output.GetLength(), 0xff)
   153                     self.output.StartStyling(self.output.GetLength(), 0xff)
   154 
   154 
   155                 # Temporary deactivate read only mode on StyledTextCtrl for
   155                 # Temporary deactivate read only mode on StyledTextCtrl for
   156                 # adding text. It seems that text modifications, even
   156                 # adding text. It seems that text modifications, even
   282     def _init_coll_AddMenu_Items(self, parent):
   282     def _init_coll_AddMenu_Items(self, parent):
   283         IDEFrame._init_coll_AddMenu_Items(self, parent, False)
   283         IDEFrame._init_coll_AddMenu_Items(self, parent, False)
   284         self._RecursiveAddMenuItems(parent, GetAddMenuItems())
   284         self._RecursiveAddMenuItems(parent, GetAddMenuItems())
   285 
   285 
   286     def _init_coll_HelpMenu_Items(self, parent):
   286     def _init_coll_HelpMenu_Items(self, parent):
   287         handler=lambda event: {
   287         handler = lambda event: {
   288             wx.MessageBox(version.GetCommunityHelpMsg(), _(u'Community support'), wx.OK | wx.ICON_INFORMATION)
   288             wx.MessageBox(version.GetCommunityHelpMsg(), _(u'Community support'), wx.OK | wx.ICON_INFORMATION)
   289         }
   289         }
   290         id = wx.NewId()
   290         id = wx.NewId()
   291         parent.Append(help='', id=id, kind=wx.ITEM_NORMAL, text=_(u'Community support'))
   291         parent.Append(help='', id=id, kind=wx.ITEM_NORMAL, text=_(u'Community support'))
   292         self.Bind(wx.EVT_MENU, handler, id=id)
   292         self.Bind(wx.EVT_MENU, handler, id=id)
   875         try:
   875         try:
   876             defaultpath = DecodeFileSystemPath(self.Config.Read("lastopenedfolder"))
   876             defaultpath = DecodeFileSystemPath(self.Config.Read("lastopenedfolder"))
   877         except:
   877         except:
   878             defaultpath = os.path.expanduser("~")
   878             defaultpath = os.path.expanduser("~")
   879 
   879 
   880         dialog = wx.DirDialog(self, _("Choose a project"), defaultpath, style=wx.DEFAULT_DIALOG_STYLE|
   880         dialog = wx.DirDialog(self, _("Choose a project"), defaultpath, style=wx.DEFAULT_DIALOG_STYLE |
   881                                                                                wx.RESIZE_BORDER)
   881                                                                                wx.RESIZE_BORDER)
   882         if dialog.ShowModal() == wx.ID_OK:
   882         if dialog.ShowModal() == wx.ID_OK:
   883             self.OpenProject(dialog.GetPath())
   883             self.OpenProject(dialog.GetPath())
   884         dialog.Destroy()
   884         dialog.Destroy()
   885 
   885