parameters: (self, frame, tree, panel, toolFrame, testWin)
docstring: Set event handlers.
docstring_summary: Set event handlers.
docstring_tokens: Set event handlers .
function: def Install(self, frame, tree, panel, toolFrame, testWin):
          '''Set event handlers.'''
          self.frame = frame
          self.tree = tree
          self.panel = panel
          self.toolFrame = toolFrame
          self.testWin = testWin
          self.lastSearch = None
  
          self.dataElem = wx.CustomDataObject('XRCED_elem')
          self.dataNode = wx.CustomDataObject('XRCED_node')
  
          # Some local members
          self.inUpdateUI = self.inIdle = False
          self.clipboardHasData = False
          
          # Component events
          wx.EVT_MENU_RANGE(frame, Manager.firstId, Manager.lastId,
                            self.OnComponentCreate)
          wx.EVT_MENU_RANGE(frame, Manager.firstId + ID.SHIFT, Manager.lastId + ID.SHIFT,
                            self.OnComponentReplace)
  
          wx.EVT_MENU(frame, ID.REF, self.OnReference)
          wx.EVT_MENU(frame, ID.COMMENT, self.OnComment)
  
          # Other events
          frame.Bind(wx.EVT_IDLE, self.OnIdle)
          frame.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
  #        frame.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown)
  #        wx.EVT_KEY_UP(frame, tools.OnKeyUp)
  #        wx.EVT_ICONIZE(frame, self.OnIconize)
  
          frame.Bind(wx.EVT_ACTIVATE, self.OnFrameActivate)
          if toolFrame:
              toolFrame.Bind(wx.EVT_ACTIVATE, self.OnFrameActivate)
          if frame.miniFrame:
              frame.miniFrame.Bind(wx.EVT_ACTIVATE, self.OnFrameActivate)
          
          # Menubar events
          # File
          frame.Bind(wx.EVT_MENU, self.OnRecentFile, id=wx.ID_FILE1, id2=wx.ID_FILE9)
          wx.EVT_MENU(frame, wx.ID_NEW, self.OnNew)
          wx.EVT_MENU(frame, wx.ID_OPEN, self.OnOpen)
          wx.EVT_MENU(frame, wx.ID_SAVE, self.OnSaveOrSaveAs)
          wx.EVT_MENU(frame, wx.ID_SAVEAS, self.OnSaveOrSaveAs)
          wx.EVT_MENU(frame, frame.ID_GENERATE_PYTHON, self.OnGeneratePython)
          wx.EVT_MENU(frame, wx.ID_PREFERENCES, self.OnPrefs)
          wx.EVT_MENU(frame, wx.ID_EXIT, self.OnExit)
          if frame.miniFrame:
              wx.EVT_MENU(frame.miniFrame, wx.ID_EXIT, self.OnExit)
  
          # Edit
          wx.EVT_MENU(frame, wx.ID_UNDO, self.OnUndo)
          wx.EVT_MENU(frame, wx.ID_REDO, self.OnRedo)
          wx.EVT_MENU(frame, wx.ID_CUT, self.OnCut)
          wx.EVT_MENU(frame, wx.ID_COPY, self.OnCopy)
          wx.EVT_MENU(frame, wx.ID_PASTE, self.OnMenuPaste)
          wx.EVT_MENU(frame, ID.PASTE, self.OnCmdPaste)
          wx.EVT_MENU(frame, ID.PASTE_SIBLING, self.OnPasteSibling)
          wx.EVT_MENU(frame, wx.ID_DELETE, self.OnDelete)
          wx.EVT_MENU(frame, frame.ID_UNSELECT, self.OnUnselect)
          wx.EVT_MENU(frame, frame.ID_TOOL_PASTE, self.OnToolPaste)
          wx.EVT_MENU(frame, wx.ID_FIND, self.OnFind)
          wx.EVT_MENU(frame, frame.ID_FINDAGAIN, self.OnFindAgain)
          wx.EVT_MENU(frame, frame.ID_LOCATE, self.OnLocate)
          wx.EVT_MENU(frame, frame.ID_TOOL_LOCATE, self.OnLocate)
          # View
          wx.EVT_MENU(frame, frame.ID_EMBED_PANEL, self.OnEmbedPanel)
          wx.EVT_MENU(frame, frame.ID_SHOW_TOOLS, self.OnShowTools)
          wx.EVT_MENU(frame, frame.ID_TEST, self.OnTest)
          wx.EVT_MENU(frame, wx.ID_REFRESH, self.OnRefresh)
          wx.EVT_MENU(frame, frame.ID_AUTO_REFRESH, self.OnAutoRefresh)
          wx.EVT_MENU(frame, frame.ID_TEST_HIDE, self.OnTestHide)
          wx.EVT_MENU(frame, frame.ID_SHOW_XML, self.OnShowXML)
          # Move
          wx.EVT_MENU(frame, frame.ID_MOVEUP, self.OnMoveUp)
          wx.EVT_MENU(frame, frame.ID_MOVEDOWN, self.OnMoveDown)
          wx.EVT_MENU(frame, frame.ID_MOVELEFT, self.OnMoveLeft)
          wx.EVT_MENU(frame, frame.ID_MOVERIGHT, self.OnMoveRight)        
          # Help
          wx.EVT_MENU(frame, wx.ID_ABOUT, self.OnHelpAbout)
          wx.EVT_MENU(frame, wx.ID_HELP_CONTENTS, self.OnHelpContents)
          wx.EVT_MENU(frame, frame.ID_README, self.OnHelpReadme)
          if get_debug():
              wx.EVT_MENU(frame, frame.ID_DEBUG_CMD, self.OnDebugCMD)
  
          # Pulldown menu commands
          wx.EVT_MENU(frame, ID.SUBCLASS, self.OnSubclass)
          wx.EVT_MENU(frame, ID.COLLAPSE, self.OnCollapse)
          wx.EVT_MENU(frame, ID.COLLAPSE_ALL, self.OnCollapseAll)
          wx.EVT_MENU(frame, ID.EXPAND, self.OnExpand)
  
          # Update events
          wx.EVT_UPDATE_UI(frame, wx.ID_SAVE, self.OnUpdateUI)
          wx.EVT_UPDATE_UI(frame, wx.ID_CUT, self.OnUpdateUI)
          wx.EVT_UPDATE_UI(frame, wx.ID_COPY, self.OnUpdateUI)
          wx.EVT_UPDATE_UI(frame, wx.ID_PASTE, self.OnUpdateUI)
          wx.EVT_UPDATE_UI(frame, wx.ID_DELETE, self.OnUpdateUI)
          wx.EVT_UPDATE_UI(frame, frame.ID_LOCATE, self.OnUpdateUI)
          wx.EVT_UPDATE_UI(frame, frame.ID_FINDAGAIN, self.OnUpdateUI)
          wx.EVT_UPDATE_UI(frame, frame.ID_TOOL_LOCATE, self.OnUpdateUI)
          wx.EVT_UPDATE_UI(frame, frame.ID_TOOL_PASTE, self.OnUpdateUI)
          wx.EVT_UPDATE_UI(frame, wx.ID_UNDO, self.OnUpdateUI)
          wx.EVT_UPDATE_UI(frame, wx.ID_REDO, self.OnUpdateUI)
          wx.EVT_UPDATE_UI(frame, frame.ID_TEST, self.OnUpdateUI)
          wx.EVT_UPDATE_UI(frame, frame.ID_MOVEUP, self.OnUpdateUI)
          wx.EVT_UPDATE_UI(frame, frame.ID_MOVEDOWN, self.OnUpdateUI)
          wx.EVT_UPDATE_UI(frame, frame.ID_MOVELEFT, self.OnUpdateUI)
          wx.EVT_UPDATE_UI(frame, frame.ID_MOVERIGHT, self.OnUpdateUI)
          wx.EVT_UPDATE_UI(frame, wx.ID_REFRESH, self.OnUpdateUI)
          wx.EVT_UPDATE_UI(frame, frame.ID_SHOW_XML, self.OnUpdateUI)
          wx.EVT_UPDATE_UI(frame, ID.COLLAPSE, self.OnUpdateUI)
          wx.EVT_UPDATE_UI(frame, ID.EXPAND, self.OnUpdateUI)
          wx.EVT_UPDATE_UI(frame, ID.SUBCLASS, self.OnUpdateUI)
  
          wx.EVT_MENU_HIGHLIGHT_ALL(self.frame, self.OnMenuHighlight)
  
          # XMLTree events
          tree.Bind(wx.EVT_LEFT_DOWN, self.OnTreeLeftDown)
          tree.Bind(wx.EVT_RIGHT_DOWN, self.OnTreeRightDown)
          tree.Bind(wx.EVT_TREE_SEL_CHANGING, self.OnTreeSelChanging)
          tree.Bind(wx.EVT_TREE_SEL_CHANGED, self.OnTreeSelChanged)
          tree.Bind(wx.EVT_TREE_ITEM_COLLAPSED, self.OnTreeItemCollapsed)
  
          # AttributePanel events
          panel.nb.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGING, self.OnPanelPageChanging)
          panel.nb.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGED, self.OnPanelPageChanged)
          panel.pinButton.Bind(wx.EVT_BUTTON, self.OnPanelTogglePin)
  
          # Make important keys work when focus is in the panel frame
          self.accels = wx.AcceleratorTable([
              (wx.ACCEL_NORMAL, wx.WXK_F5, frame.ID_TEST),
              (wx.ACCEL_NORMAL, wx.WXK_F6, frame.ID_TEST_HIDE),
              (wx.ACCEL_CTRL, ord('r'), wx.ID_REFRESH),
              ])
          if frame.miniFrame:
              self.frame.miniFrame.SetAcceleratorTable(self.accels)
              # Propagate all menu commands to the frame
              self.frame.miniFrame.Bind(wx.EVT_MENU, lambda evt: frame.ProcessEvent(evt))
  
          # Tool panel events
          toolPanel = g.toolPanel
          toolPanel.tp.Bind(wx.EVT_TOOLBOOK_PAGE_CHANGED, self.OnToolPanelPageChanged)
          wx.EVT_COMMAND_RANGE(toolPanel.tp, Manager.firstId, Manager.lastId,
                               wx.wxEVT_COMMAND_BUTTON_CLICKED,
                               self.OnComponentTool)
          if toolFrame:
              toolFrame.Bind(wx.EVT_CLOSE, self.OnCloseToolFrame)
function_tokens: def Install ( self , frame , tree , panel , toolFrame , testWin ) : self . frame = frame self . tree = tree self . panel = panel self . toolFrame = toolFrame self . testWin = testWin self . lastSearch = None self . dataElem = wx . CustomDataObject ( 'XRCED_elem' ) self . dataNode = wx . CustomDataObject ( 'XRCED_node' ) # Some local members self . inUpdateUI = self . inIdle = False self . clipboardHasData = False # Component events wx . EVT_MENU_RANGE ( frame , Manager . firstId , Manager . lastId , self . OnComponentCreate ) wx . EVT_MENU_RANGE ( frame , Manager . firstId + ID . SHIFT , Manager . lastId + ID . SHIFT , self . OnComponentReplace ) wx . EVT_MENU ( frame , ID . REF , self . OnReference ) wx . EVT_MENU ( frame , ID . COMMENT , self . OnComment ) # Other events frame . Bind ( wx . EVT_IDLE , self . OnIdle ) frame . Bind ( wx . EVT_CLOSE , self . OnCloseWindow ) #        frame.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown) #        wx.EVT_KEY_UP(frame, tools.OnKeyUp) #        wx.EVT_ICONIZE(frame, self.OnIconize) frame . Bind ( wx . EVT_ACTIVATE , self . OnFrameActivate ) if toolFrame : toolFrame . Bind ( wx . EVT_ACTIVATE , self . OnFrameActivate ) if frame . miniFrame : frame . miniFrame . Bind ( wx . EVT_ACTIVATE , self . OnFrameActivate ) # Menubar events # File frame . Bind ( wx . EVT_MENU , self . OnRecentFile , id = wx . ID_FILE1 , id2 = wx . ID_FILE9 ) wx . EVT_MENU ( frame , wx . ID_NEW , self . OnNew ) wx . EVT_MENU ( frame , wx . ID_OPEN , self . OnOpen ) wx . EVT_MENU ( frame , wx . ID_SAVE , self . OnSaveOrSaveAs ) wx . EVT_MENU ( frame , wx . ID_SAVEAS , self . OnSaveOrSaveAs ) wx . EVT_MENU ( frame , frame . ID_GENERATE_PYTHON , self . OnGeneratePython ) wx . EVT_MENU ( frame , wx . ID_PREFERENCES , self . OnPrefs ) wx . EVT_MENU ( frame , wx . ID_EXIT , self . OnExit ) if frame . miniFrame : wx . EVT_MENU ( frame . miniFrame , wx . ID_EXIT , self . OnExit ) # Edit wx . EVT_MENU ( frame , wx . ID_UNDO , self . OnUndo ) wx . EVT_MENU ( frame , wx . ID_REDO , self . OnRedo ) wx . EVT_MENU ( frame , wx . ID_CUT , self . OnCut ) wx . EVT_MENU ( frame , wx . ID_COPY , self . OnCopy ) wx . EVT_MENU ( frame , wx . ID_PASTE , self . OnMenuPaste ) wx . EVT_MENU ( frame , ID . PASTE , self . OnCmdPaste ) wx . EVT_MENU ( frame , ID . PASTE_SIBLING , self . OnPasteSibling ) wx . EVT_MENU ( frame , wx . ID_DELETE , self . OnDelete ) wx . EVT_MENU ( frame , frame . ID_UNSELECT , self . OnUnselect ) wx . EVT_MENU ( frame , frame . ID_TOOL_PASTE , self . OnToolPaste ) wx . EVT_MENU ( frame , wx . ID_FIND , self . OnFind ) wx . EVT_MENU ( frame , frame . ID_FINDAGAIN , self . OnFindAgain ) wx . EVT_MENU ( frame , frame . ID_LOCATE , self . OnLocate ) wx . EVT_MENU ( frame , frame . ID_TOOL_LOCATE , self . OnLocate ) # View wx . EVT_MENU ( frame , frame . ID_EMBED_PANEL , self . OnEmbedPanel ) wx . EVT_MENU ( frame , frame . ID_SHOW_TOOLS , self . OnShowTools ) wx . EVT_MENU ( frame , frame . ID_TEST , self . OnTest ) wx . EVT_MENU ( frame , wx . ID_REFRESH , self . OnRefresh ) wx . EVT_MENU ( frame , frame . ID_AUTO_REFRESH , self . OnAutoRefresh ) wx . EVT_MENU ( frame , frame . ID_TEST_HIDE , self . OnTestHide ) wx . EVT_MENU ( frame , frame . ID_SHOW_XML , self . OnShowXML ) # Move wx . EVT_MENU ( frame , frame . ID_MOVEUP , self . OnMoveUp ) wx . EVT_MENU ( frame , frame . ID_MOVEDOWN , self . OnMoveDown ) wx . EVT_MENU ( frame , frame . ID_MOVELEFT , self . OnMoveLeft ) wx . EVT_MENU ( frame , frame . ID_MOVERIGHT , self . OnMoveRight ) # Help wx . EVT_MENU ( frame , wx . ID_ABOUT , self . OnHelpAbout ) wx . EVT_MENU ( frame , wx . ID_HELP_CONTENTS , self . OnHelpContents ) wx . EVT_MENU ( frame , frame . ID_README , self . OnHelpReadme ) if get_debug ( ) : wx . EVT_MENU ( frame , frame . ID_DEBUG_CMD , self . OnDebugCMD ) # Pulldown menu commands wx . EVT_MENU ( frame , ID . SUBCLASS , self . OnSubclass ) wx . EVT_MENU ( frame , ID . COLLAPSE , self . OnCollapse ) wx . EVT_MENU ( frame , ID . COLLAPSE_ALL , self . OnCollapseAll ) wx . EVT_MENU ( frame , ID . EXPAND , self . OnExpand ) # Update events wx . EVT_UPDATE_UI ( frame , wx . ID_SAVE , self . OnUpdateUI ) wx . EVT_UPDATE_UI ( frame , wx . ID_CUT , self . OnUpdateUI ) wx . EVT_UPDATE_UI ( frame , wx . ID_COPY , self . OnUpdateUI ) wx . EVT_UPDATE_UI ( frame , wx . ID_PASTE , self . OnUpdateUI ) wx . EVT_UPDATE_UI ( frame , wx . ID_DELETE , self . OnUpdateUI ) wx . EVT_UPDATE_UI ( frame , frame . ID_LOCATE , self . OnUpdateUI ) wx . EVT_UPDATE_UI ( frame , frame . ID_FINDAGAIN , self . OnUpdateUI ) wx . EVT_UPDATE_UI ( frame , frame . ID_TOOL_LOCATE , self . OnUpdateUI ) wx . EVT_UPDATE_UI ( frame , frame . ID_TOOL_PASTE , self . OnUpdateUI ) wx . EVT_UPDATE_UI ( frame , wx . ID_UNDO , self . OnUpdateUI ) wx . EVT_UPDATE_UI ( frame , wx . ID_REDO , self . OnUpdateUI ) wx . EVT_UPDATE_UI ( frame , frame . ID_TEST , self . OnUpdateUI ) wx . EVT_UPDATE_UI ( frame , frame . ID_MOVEUP , self . OnUpdateUI ) wx . EVT_UPDATE_UI ( frame , frame . ID_MOVEDOWN , self . OnUpdateUI ) wx . EVT_UPDATE_UI ( frame , frame . ID_MOVELEFT , self . OnUpdateUI ) wx . EVT_UPDATE_UI ( frame , frame . ID_MOVERIGHT , self . OnUpdateUI ) wx . EVT_UPDATE_UI ( frame , wx . ID_REFRESH , self . OnUpdateUI ) wx . EVT_UPDATE_UI ( frame , frame . ID_SHOW_XML , self . OnUpdateUI ) wx . EVT_UPDATE_UI ( frame , ID . COLLAPSE , self . OnUpdateUI ) wx . EVT_UPDATE_UI ( frame , ID . EXPAND , self . OnUpdateUI ) wx . EVT_UPDATE_UI ( frame , ID . SUBCLASS , self . OnUpdateUI ) wx . EVT_MENU_HIGHLIGHT_ALL ( self . frame , self . OnMenuHighlight ) # XMLTree events tree . Bind ( wx . EVT_LEFT_DOWN , self . OnTreeLeftDown ) tree . Bind ( wx . EVT_RIGHT_DOWN , self . OnTreeRightDown ) tree . Bind ( wx . EVT_TREE_SEL_CHANGING , self . OnTreeSelChanging ) tree . Bind ( wx . EVT_TREE_SEL_CHANGED , self . OnTreeSelChanged ) tree . Bind ( wx . EVT_TREE_ITEM_COLLAPSED , self . OnTreeItemCollapsed ) # AttributePanel events panel . nb . Bind ( wx . EVT_NOTEBOOK_PAGE_CHANGING , self . OnPanelPageChanging ) panel . nb . Bind ( wx . EVT_NOTEBOOK_PAGE_CHANGED , self . OnPanelPageChanged ) panel . pinButton . Bind ( wx . EVT_BUTTON , self . OnPanelTogglePin ) # Make important keys work when focus is in the panel frame self . accels = wx . AcceleratorTable ( [ ( wx . ACCEL_NORMAL , wx . WXK_F5 , frame . ID_TEST ) , ( wx . ACCEL_NORMAL , wx . WXK_F6 , frame . ID_TEST_HIDE ) , ( wx . ACCEL_CTRL , ord ( 'r' ) , wx . ID_REFRESH ) , ] ) if frame . miniFrame : self . frame . miniFrame . SetAcceleratorTable ( self . accels ) # Propagate all menu commands to the frame self . frame . miniFrame . Bind ( wx . EVT_MENU , lambda evt : frame . ProcessEvent ( evt ) ) # Tool panel events toolPanel = g . toolPanel toolPanel . tp . Bind ( wx . EVT_TOOLBOOK_PAGE_CHANGED , self . OnToolPanelPageChanged ) wx . EVT_COMMAND_RANGE ( toolPanel . tp , Manager . firstId , Manager . lastId , wx . wxEVT_COMMAND_BUTTON_CLICKED , self . OnComponentTool ) if toolFrame : toolFrame . Bind ( wx . EVT_CLOSE , self . OnCloseToolFrame )