CodeFileTreeNode.py
author Laurent Bessard
Wed, 08 May 2013 23:31:12 +0200
changeset 1101 5a0b439cf576
parent 1100 1f46424c6220
child 1124 b1705000eba1
permissions -rw-r--r--
Fixed search in CodeFileEditor STC panel
145
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
     1
import os
401
8106a853a7c7 Adding support for displaying plugins available variable into Beremiz plugin tree
laurent
parents: 361
diff changeset
     2
from xml.dom import minidom
8106a853a7c7 Adding support for displaying plugins available variable into Beremiz plugin tree
laurent
parents: 361
diff changeset
     3
import cPickle
8106a853a7c7 Adding support for displaying plugins available variable into Beremiz plugin tree
laurent
parents: 361
diff changeset
     4
8106a853a7c7 Adding support for displaying plugins available variable into Beremiz plugin tree
laurent
parents: 361
diff changeset
     5
from xmlclass import *
8106a853a7c7 Adding support for displaying plugins available variable into Beremiz plugin tree
laurent
parents: 361
diff changeset
     6
1096
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
     7
from PLCControler import UndoBuffer
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
     8
from editors.CodeFileEditor import SECTIONS_NAMES
630
91b2ae63ea3d Including external tools for editing plugin informations into Beremiz window
laurent
parents: 610
diff changeset
     9
1096
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    10
CodeFileClasses = GenerateClassesFromXSD(os.path.join(os.path.dirname(__file__), "code_file.xsd"))
145
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
    11
1096
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    12
class CodeFile:
656
c1792dfc8c7e Fixing bug integrated plugin editors not closed when removing corresponding plugin
laurent
parents: 651
diff changeset
    13
    
31
33b38700d0db added basic C Code extention plugin
etisserant
parents:
diff changeset
    14
    def __init__(self):
1096
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    15
        filepath = self.CodeFileName()
145
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
    16
        
1096
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    17
        self.CodeFile = CodeFileClasses["CodeFile"]()
145
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
    18
        if os.path.isfile(filepath):
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
    19
            xmlfile = open(filepath, 'r')
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
    20
            tree = minidom.parse(xmlfile)
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
    21
            xmlfile.close()
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
    22
            
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
    23
            for child in tree.childNodes:
1100
1f46424c6220 Added support for compatibility with older version of c_ext
Laurent Bessard
parents: 1096
diff changeset
    24
                if child.nodeType == tree.ELEMENT_NODE and child.nodeName in ["CodeFile", "CFile"]:
1096
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    25
                    self.CodeFile.loadXMLTree(child, ["xmlns", "xmlns:xsi", "xsi:schemaLocation"])
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    26
                    self.CreateCodeFileBuffer(True)
145
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
    27
        else:
1096
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    28
            self.CreateCodeFileBuffer(False)
718
5d4dc150b956 refactoring
Edouard Tisserant
parents: 717
diff changeset
    29
            self.OnCTNSave()
145
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
    30
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
    31
    def GetBaseTypes(self):
718
5d4dc150b956 refactoring
Edouard Tisserant
parents: 717
diff changeset
    32
        return self.GetCTRoot().GetBaseTypes()
145
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
    33
1096
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    34
    def GetDataTypes(self, basetypes = False):
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    35
        return self.GetCTRoot().GetDataTypes(basetypes=basetypes)
145
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
    36
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
    37
    def SetVariables(self, variables):
1096
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    38
        self.CodeFile.variables.setvariable([])
145
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
    39
        for var in variables:
1096
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    40
            variable = CodeFileClasses["variables_variable"]()
145
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
    41
            variable.setname(var["Name"])
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
    42
            variable.settype(var["Type"])
1096
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    43
            variable.setinitial(var["Initial"])
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    44
            self.CodeFile.variables.appendvariable(variable)
145
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
    45
    
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
    46
    def GetVariables(self):
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
    47
        datas = []
1096
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    48
        for var in self.CodeFile.variables.getvariable():
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    49
            datas.append({"Name" : var.getname(), "Type" : var.gettype(), "Initial" : var.getinitial()})
145
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
    50
        return datas
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
    51
1096
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    52
    def SetTextParts(self, parts):
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    53
        for section, code_object in zip(
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    54
            SECTIONS_NAMES,
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    55
            [self.CodeFile.includes,
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    56
             self.CodeFile.globals,
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    57
             self.CodeFile.initFunction,
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    58
             self.CodeFile.cleanUpFunction,
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    59
             self.CodeFile.retrieveFunction,
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    60
             self.CodeFile.publishFunction]):
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    61
            code_object.settext(parts[section])
145
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
    62
        
1096
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    63
    def GetTextParts(self):
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    64
        parts = {}
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    65
        for section, code_object in zip(
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    66
            SECTIONS_NAMES,
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    67
            [self.CodeFile.includes,
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    68
             self.CodeFile.globals,
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    69
             self.CodeFile.initFunction,
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    70
             self.CodeFile.cleanUpFunction,
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    71
             self.CodeFile.retrieveFunction,
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    72
             self.CodeFile.publishFunction]):
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    73
            parts[section] = code_object.gettext()
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    74
        return parts
630
91b2ae63ea3d Including external tools for editing plugin informations into Beremiz window
laurent
parents: 610
diff changeset
    75
                
718
5d4dc150b956 refactoring
Edouard Tisserant
parents: 717
diff changeset
    76
    def CTNTestModified(self):
1096
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    77
        return self.ChangesToSave or not self.CodeFileIsSaved()    
630
91b2ae63ea3d Including external tools for editing plugin informations into Beremiz window
laurent
parents: 610
diff changeset
    78
1061
02f371f3e063 Fixed Save As... function in Beremiz
Laurent Bessard
parents: 953
diff changeset
    79
    def OnCTNSave(self, from_project_path=None):
1096
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    80
        filepath = self.CodeFileName()
145
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
    81
        
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
    82
        text = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n"
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
    83
        extras = {"xmlns":"http://www.w3.org/2001/XMLSchema",
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
    84
                  "xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance",
1100
1f46424c6220 Added support for compatibility with older version of c_ext
Laurent Bessard
parents: 1096
diff changeset
    85
                  "xsi:schemaLocation" : "code_file.xsd"}
1096
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    86
        text += self.CodeFile.generateXMLText("CodeFile", 0, extras)
145
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
    87
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
    88
        xmlfile = open(filepath,"w")
430
5981ad8547f5 Allowing unicode characters to be used in comments
laurent
parents: 427
diff changeset
    89
        xmlfile.write(text.encode("utf-8"))
145
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
    90
        xmlfile.close()
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
    91
        
1096
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    92
        self.MarkCodeFileAsSaved()
31
33b38700d0db added basic C Code extention plugin
etisserant
parents:
diff changeset
    93
        return True
33b38700d0db added basic C Code extention plugin
etisserant
parents:
diff changeset
    94
1095
a73fde048749 Move C_ext file for merging with py_ext
Laurent Bessard
parents: 1061
diff changeset
    95
    def CTNGlobalInstances(self):
a73fde048749 Move C_ext file for merging with py_ext
Laurent Bessard
parents: 1061
diff changeset
    96
        current_location = self.GetCurrentLocation()
1096
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    97
        return [(variable.getname(),
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    98
                 variable.gettype(),
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
    99
                 variable.getinitial())
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
   100
                for variable in self.CodeFile.variables.variable]
656
c1792dfc8c7e Fixing bug integrated plugin editors not closed when removing corresponding plugin
laurent
parents: 651
diff changeset
   101
145
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
   102
#-------------------------------------------------------------------------------
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
   103
#                      Current Buffering Management Functions
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
   104
#-------------------------------------------------------------------------------
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
   105
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
   106
    """
1096
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
   107
    Return a copy of the codefile model
145
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
   108
    """
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
   109
    def Copy(self, model):
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
   110
        return cPickle.loads(cPickle.dumps(model))
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
   111
1096
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
   112
    def CreateCodeFileBuffer(self, saved):
658
94417ab25510 Fixing some issues in c_ext plugin
laurent
parents: 656
diff changeset
   113
        self.Buffering = False
1096
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
   114
        self.CodeFileBuffer = UndoBuffer(cPickle.dumps(self.CodeFile), saved)
651
cbeb769b0a56 Adding support for unifying grid table control elements
laurent
parents: 630
diff changeset
   115
1096
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
   116
    def BufferCodeFile(self):
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
   117
        self.CodeFileBuffer.Buffering(cPickle.dumps(self.CodeFile))
145
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
   118
    
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
   119
    def StartBuffering(self):
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
   120
        self.Buffering = True
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
   121
        
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
   122
    def EndBuffering(self):
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
   123
        if self.Buffering:
1096
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
   124
            self.CodeFileBuffer.Buffering(cPickle.dumps(self.CodeFile))
145
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
   125
            self.Buffering = False
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
   126
    
1096
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
   127
    def MarkCodeFileAsSaved(self):
651
cbeb769b0a56 Adding support for unifying grid table control elements
laurent
parents: 630
diff changeset
   128
        self.EndBuffering()
1096
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
   129
        self.CodeFileBuffer.CurrentSaved()
651
cbeb769b0a56 Adding support for unifying grid table control elements
laurent
parents: 630
diff changeset
   130
    
1096
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
   131
    def CodeFileIsSaved(self):
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
   132
        return self.CodeFileBuffer.IsCurrentSaved() and not self.Buffering
658
94417ab25510 Fixing some issues in c_ext plugin
laurent
parents: 656
diff changeset
   133
        
145
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
   134
    def LoadPrevious(self):
651
cbeb769b0a56 Adding support for unifying grid table control elements
laurent
parents: 630
diff changeset
   135
        self.EndBuffering()
1096
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
   136
        self.CodeFile = cPickle.loads(self.CodeFileBuffer.Previous())
145
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
   137
    
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
   138
    def LoadNext(self):
1096
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
   139
        self.CodeFile = cPickle.loads(self.CodeFileBuffer.Next())
145
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
   140
    
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
   141
    def GetBufferState(self):
1096
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
   142
        first = self.CodeFileBuffer.IsFirst() and not self.Buffering
c9ace6a881c9 Fixed CFileEditor replacing folding panels by variable panel and STC
Laurent Bessard
parents: 1095
diff changeset
   143
        last = self.CodeFileBuffer.IsLast()
145
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
   144
        return not first, not last
94855f7b08a9 Improving c_ext plugin by adding an XML file format for saving C files and an graphical interface for editing this file
lbessard
parents: 137
diff changeset
   145