parameters: (self)
docstring: Fold Tree In or Out
          @postcondition: code tree is folded open or closed
docstring_summary: Fold Tree In or Out
          @postcondition: code tree is folded open or closed
docstring_tokens: Fold Tree In or Out @postcondition : code tree is folded open or closed
function: def FoldAll(self):
          """Fold Tree In or Out
          @postcondition: code tree is folded open or closed
  
          """
          line_count = self.GetLineCount()
          expanding = True
  
          # find out if we are folding or unfolding
          for line_num in range(line_count):
              if self.GetFoldLevel(line_num) & wx.stc.STC_FOLDLEVELHEADERFLAG:
                  expanding = not self.GetFoldExpanded(line_num)
                  break
          line_num = 0
  
          while line_num < line_count:
              level = self.GetFoldLevel(line_num)
  
              if level & wx.stc.STC_FOLDLEVELHEADERFLAG and \
                 (level & wx.stc.STC_FOLDLEVELNUMBERMASK) == \
                 wx.stc.STC_FOLDLEVELBASE:
  
                  if expanding:
                      self.SetFoldExpanded(line_num, True)
                      line_num = self.Expand(line_num, True) - 1
                  else:
                      last_child = self.GetLastChild(line_num, -1)
                      self.SetFoldExpanded(line_num, False)
  
                      if last_child > line_num:
                          self.HideLines(line_num + 1, last_child)
              line_num = line_num + 1
function_tokens: def FoldAll ( self ) : line_count = self . GetLineCount ( ) expanding = True # find out if we are folding or unfolding for line_num in range ( line_count ) : if self . GetFoldLevel ( line_num ) & wx . stc . STC_FOLDLEVELHEADERFLAG : expanding = not self . GetFoldExpanded ( line_num ) break line_num = 0 while line_num < line_count : level = self . GetFoldLevel ( line_num ) if level & wx . stc . STC_FOLDLEVELHEADERFLAG and ( level & wx . stc . STC_FOLDLEVELNUMBERMASK ) == wx . stc . STC_FOLDLEVELBASE : if expanding : self . SetFoldExpanded ( line_num , True ) line_num = self . Expand ( line_num , True ) - 1 else : last_child = self . GetLastChild ( line_num , - 1 ) self . SetFoldExpanded ( line_num , False ) if last_child > line_num : self . HideLines ( line_num + 1 , last_child ) line_num = line_num + 1