#NEWLINE# def FoldAll( self ) : #NEWLINE# #INDENT# lineCount = self . GetLineCount ( ) #NEWLINE# expanding = True #NEWLINE# for lineNum in range ( self ) : #NEWLINE# #INDENT# if ( self . GetFoldLevel ( lineNum ) & stc . STC_FOLDLEVELHEADERFLAG ) : #NEWLINE# #INDENT# expanding = ( not self . GetFoldExpanded ( lineNum ) ) #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# lineNum = 0 #NEWLINE# while ( lineNum < lineCount ) : #NEWLINE# #INDENT# level = self . GetFoldLevel ( lineNum ) #NEWLINE# if ( ( level & stc . STC_FOLDLEVELHEADERFLAG ) and ( ( level & stc . STC_FOLDLEVELNUMBERMASK ) == stc . STC_FOLDLEVELBASE ) ) : #NEWLINE# #INDENT# if expanding : #NEWLINE# #INDENT# self . SetFoldExpanded ( lineNum , True ) #NEWLINE# lineNum = self . Expand ( lineNum , True ) #NEWLINE# lineNum = ( lineNum - 1 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# lastChild = self . GetLastChild ( lineNum , ( - 1 ) ) #NEWLINE# self . SetFoldExpanded ( lineNum , False ) #NEWLINE# if ( lastChild > lineNum ) : #NEWLINE# #INDENT# self . HideLines ( ( lineNum + 1 ) , lastChild ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# lineNum = ( lineNum + 1 )