IDEFrame.py
changeset 2242 492c1c046c82
parent 2233 32445e3c9cfc
child 2243 02f03bd7639e
equal deleted inserted replaced
2241:e762e234181d 2242:492c1c046c82
    70 
    70 
    71 # Define PLCOpenEditor DisplayMenu extra items id
    71 # Define PLCOpenEditor DisplayMenu extra items id
    72 [
    72 [
    73     ID_PLCOPENEDITORDISPLAYMENURESETPERSPECTIVE,
    73     ID_PLCOPENEDITORDISPLAYMENURESETPERSPECTIVE,
    74     ID_PLCOPENEDITORDISPLAYMENUSWITCHPERSPECTIVE,
    74     ID_PLCOPENEDITORDISPLAYMENUSWITCHPERSPECTIVE,
    75 ] = [wx.NewId() for _init_coll_DisplayMenu_Items in range(2)]
    75     ID_PLCOPENEDITORDISPLAYMENUFULLSCREEN,
       
    76 ] = [wx.NewId() for _init_coll_DisplayMenu_Items in range(3)]
    76 
    77 
    77 # -------------------------------------------------------------------------------
    78 # -------------------------------------------------------------------------------
    78 #                            EditorToolBar definitions
    79 #                            EditorToolBar definitions
    79 # -------------------------------------------------------------------------------
    80 # -------------------------------------------------------------------------------
    80 
    81 
   425                                None,
   426                                None,
   426                                (wx.ID_CUT, "cut", _(u'Cut'), None),
   427                                (wx.ID_CUT, "cut", _(u'Cut'), None),
   427                                (wx.ID_COPY, "copy", _(u'Copy'), None),
   428                                (wx.ID_COPY, "copy", _(u'Copy'), None),
   428                                (wx.ID_PASTE, "paste", _(u'Paste'), None),
   429                                (wx.ID_PASTE, "paste", _(u'Paste'), None),
   429                                None,
   430                                None,
   430                                (ID_PLCOPENEDITOREDITMENUSEARCHINPROJECT, "find", _(u'Search in Project'), None)])
   431                                (ID_PLCOPENEDITOREDITMENUSEARCHINPROJECT, "find", _(u'Search in Project'), None),
       
   432                                (ID_PLCOPENEDITORDISPLAYMENUFULLSCREEN, "fullscreen", _(u'Toggle fullscreen mode'), None)])
   431 
   433 
   432     def _init_coll_DisplayMenu_Items(self, parent):
   434     def _init_coll_DisplayMenu_Items(self, parent):
   433         AppendMenu(parent, help='', id=wx.ID_REFRESH,
   435         AppendMenu(parent, help='', id=wx.ID_REFRESH,
   434                    kind=wx.ITEM_NORMAL, text=_(u'Refresh') + '\tCTRL+R')
   436                    kind=wx.ITEM_NORMAL, text=_(u'Refresh') + '\tCTRL+R')
   435         if self.EnableDebug:
   437         if self.EnableDebug:
   445             self.Bind(wx.EVT_MENU, self.GenerateZoomFunction(idx), id=new_id)
   447             self.Bind(wx.EVT_MENU, self.GenerateZoomFunction(idx), id=new_id)
   446 
   448 
   447         parent.AppendSeparator()
   449         parent.AppendSeparator()
   448         AppendMenu(parent, help='', id=ID_PLCOPENEDITORDISPLAYMENUSWITCHPERSPECTIVE,
   450         AppendMenu(parent, help='', id=ID_PLCOPENEDITORDISPLAYMENUSWITCHPERSPECTIVE,
   449                    kind=wx.ITEM_NORMAL, text=_(u'Switch perspective') + '\tF12')
   451                    kind=wx.ITEM_NORMAL, text=_(u'Switch perspective') + '\tF12')
   450         self.Bind(wx.EVT_MENU, self.SwitchFullScrMode, id=ID_PLCOPENEDITORDISPLAYMENUSWITCHPERSPECTIVE)
   452         self.Bind(wx.EVT_MENU, self.SwitchPerspective, id=ID_PLCOPENEDITORDISPLAYMENUSWITCHPERSPECTIVE)
       
   453 
       
   454         AppendMenu(parent, help='', id=ID_PLCOPENEDITORDISPLAYMENUFULLSCREEN,
       
   455                    kind=wx.ITEM_NORMAL, text=_(u'Full screen') + '\tShift-F12')
       
   456         self.Bind(wx.EVT_MENU, self.SwitchFullScrMode, id=ID_PLCOPENEDITORDISPLAYMENUFULLSCREEN)
   451 
   457 
   452         AppendMenu(parent, help='', id=ID_PLCOPENEDITORDISPLAYMENURESETPERSPECTIVE,
   458         AppendMenu(parent, help='', id=ID_PLCOPENEDITORDISPLAYMENURESETPERSPECTIVE,
   453                    kind=wx.ITEM_NORMAL, text=_(u'Reset Perspective'))
   459                    kind=wx.ITEM_NORMAL, text=_(u'Reset Perspective'))
   454         self.Bind(wx.EVT_MENU, self.OnResetPerspective, id=ID_PLCOPENEDITORDISPLAYMENURESETPERSPECTIVE)
   460         self.Bind(wx.EVT_MENU, self.OnResetPerspective, id=ID_PLCOPENEDITORDISPLAYMENURESETPERSPECTIVE)
   455 
   461 
  1482 
  1488 
  1483     def GetTabsOpenedDClickFunction(self, tabctrl):
  1489     def GetTabsOpenedDClickFunction(self, tabctrl):
  1484         def OnTabsOpenedDClick(event):
  1490         def OnTabsOpenedDClick(event):
  1485             pos = event.GetPosition()
  1491             pos = event.GetPosition()
  1486             if tabctrl.TabHitTest(pos.x, pos.y, None):
  1492             if tabctrl.TabHitTest(pos.x, pos.y, None):
  1487                 self.SwitchFullScrMode(event)
  1493                 self.SwitchPerspective(event)
  1488             event.Skip()
  1494             event.Skip()
  1489         return OnTabsOpenedDClick
  1495         return OnTabsOpenedDClick
  1490 
  1496 
  1491     def SwitchFullScrMode(self, evt):
  1497     def SwitchPerspective(self, evt):
  1492         pane = self.AUIManager.GetPane(self.TabsOpened)
  1498         pane = self.AUIManager.GetPane(self.TabsOpened)
  1493         if pane.IsMaximized():
  1499         if pane.IsMaximized():
  1494             self.AUIManager.RestorePane(pane)
  1500             self.AUIManager.RestorePane(pane)
  1495         else:
  1501         else:
  1496             self.AUIManager.MaximizePane(pane)
  1502             self.AUIManager.MaximizePane(pane)
  1497         self.AUIManager.Update()
  1503         self.AUIManager.Update()
       
  1504 
       
  1505     def SwitchFullScrMode(self, evt):
       
  1506         show = not self.IsFullScreen()
       
  1507         self.ShowFullScreen(show)
  1498 
  1508 
  1499     # -------------------------------------------------------------------------------
  1509     # -------------------------------------------------------------------------------
  1500     #                         Types Tree Management Functions
  1510     #                         Types Tree Management Functions
  1501     # -------------------------------------------------------------------------------
  1511     # -------------------------------------------------------------------------------
  1502 
  1512