parameters: (self, evt)
docstring: Open and Close Folders as Needed
          @param evt: wx.stc.StyledTextEvent
docstring_summary: Open and Close Folders as Needed
          @param evt: wx.stc.StyledTextEvent
docstring_tokens: Open and Close Folders as Needed @param evt : wx . stc . StyledTextEvent
function: def OnMarginClick(self, evt):
          """Open and Close Folders as Needed
          @param evt: wx.stc.StyledTextEvent
  
          """
          margin_num = evt.GetMargin()
          if margin_num == ed_basestc.FOLD_MARGIN:
              if evt.GetShift() and \
                 (evt.GetControl() or (wx.Platform == '__WXMAC__' and evt.GetAlt())):
                  self.FoldAll()
              else:
                  line_clicked = self.LineFromPosition(evt.GetPosition())
                  level = self.GetFoldLevel(line_clicked)
                  if level & wx.stc.STC_FOLDLEVELHEADERFLAG:
  
                      # Expand node and all Subnodes
                      if evt.GetShift():
                          self.SetFoldExpanded(line_clicked, True)
                          self.Expand(line_clicked, True, True, 100, level)
                      elif evt.GetControl() or \
                          (wx.Platform == '__WXMAC__' and evt.GetAlt()):
                          # Contract all subnodes of clicked one
                          # Note: using Alt as Ctrl can not be received for
                          # clicks on mac (Scintilla Bug).
                          if self.GetFoldExpanded(line_clicked):
                              self.SetFoldExpanded(line_clicked, False)
                              self.Expand(line_clicked, False, True, 0, level)
                          else:
                              # Expand all subnodes
                              self.SetFoldExpanded(line_clicked, True)
                              self.Expand(line_clicked, True, True, 100, level)
                      else:
                          self.ToggleFold(line_clicked)
          elif margin_num == ed_basestc.MARK_MARGIN:
              # Bookmarks ect...
              line_clicked = self.LineFromPosition(evt.GetPosition())
              # Hook for client code to interact with margin clicks
              data = dict(stc=self, line=line_clicked)
              ed_msg.PostMessage(ed_msg.EDMSG_UI_STC_MARGIN_CLICK, msgdata=data)
              if not data.get('handled', False):
                  # Default to internal bookmark handling
                  if ed_marker.Bookmark().IsSet(self, line_clicked):
                      self.RemoveBookmark(line_clicked)
                  else:
                      self.AddBookmark(line_clicked)
function_tokens: def OnMarginClick ( self , evt ) : margin_num = evt . GetMargin ( ) if margin_num == ed_basestc . FOLD_MARGIN : if evt . GetShift ( ) and ( evt . GetControl ( ) or ( wx . Platform == '__WXMAC__' and evt . GetAlt ( ) ) ) : self . FoldAll ( ) else : line_clicked = self . LineFromPosition ( evt . GetPosition ( ) ) level = self . GetFoldLevel ( line_clicked ) if level & wx . stc . STC_FOLDLEVELHEADERFLAG : # Expand node and all Subnodes if evt . GetShift ( ) : self . SetFoldExpanded ( line_clicked , True ) self . Expand ( line_clicked , True , True , 100 , level ) elif evt . GetControl ( ) or ( wx . Platform == '__WXMAC__' and evt . GetAlt ( ) ) : # Contract all subnodes of clicked one # Note: using Alt as Ctrl can not be received for # clicks on mac (Scintilla Bug). if self . GetFoldExpanded ( line_clicked ) : self . SetFoldExpanded ( line_clicked , False ) self . Expand ( line_clicked , False , True , 0 , level ) else : # Expand all subnodes self . SetFoldExpanded ( line_clicked , True ) self . Expand ( line_clicked , True , True , 100 , level ) else : self . ToggleFold ( line_clicked ) elif margin_num == ed_basestc . MARK_MARGIN : # Bookmarks ect... line_clicked = self . LineFromPosition ( evt . GetPosition ( ) ) # Hook for client code to interact with margin clicks data = dict ( stc = self , line = line_clicked ) ed_msg . PostMessage ( ed_msg . EDMSG_UI_STC_MARGIN_CLICK , msgdata = data ) if not data . get ( 'handled' , False ) : # Default to internal bookmark handling if ed_marker . Bookmark ( ) . IsSet ( self , line_clicked ) : self . RemoveBookmark ( line_clicked ) else : self . AddBookmark ( line_clicked )