Exemplo n.º 1
0
    def __init__(self, parent, dbfile, cleanup=0):
        gridlib.Grid.__init__(self, parent, -1)

        if cleanup == 0:
            ds = Sql.DataStore(dbfile)
            cleanup = ds.GetLastCleanupRound()
            ds.Close()
        #print 'grid using cleanup #', cleanup
        table = CustomDataTable(cleanup, dbfile)

        # The second parameter means that the grid is to take ownership of the
        # table and will destroy it when done.  Otherwise you would need to keep
        # a reference to it and call it's Destroy method later.
        self.SetTable(table, True)

        self.SetRowLabelSize(0)  #hides row labels row
        #self.SetMargins(0,0)
        self.EnableEditing(False)
        self.EnableDragColMove(False)
        self.EnableDragColSize(False)
        self.EnableDragRowSize(False)
        self.EnableDragGridSize(False)
        self.FormatCells()

        self.AutoSizeColumns(True)
        self.AutoSizeRows(True)
        self.Bind(gridlib.EVT_GRID_CELL_LEFT_CLICK, self.onCellSelect)
Exemplo n.º 2
0
    def __init__(self, cleanupNumber, dbfile):
        gridlib.PyGridTableBase.__init__(self)
        self.DataStore = Sql.DataStore(dbfile)
        self.GetData(cleanupNumber)

        self.dataTypes = [
            gridlib.GRID_VALUE_DATETIME, gridlib.GRID_VALUE_STRING,
            gridlib.GRID_VALUE_STRING, gridlib.GRID_VALUE_STRING,
            gridlib.GRID_VALUE_STRING
        ]

        self.DataStore.Close()
Exemplo n.º 3
0
 def compileDiveFolders(self):
     #print 'compiling dive folders for kml'
     self.diveFolders = ""  #clear existing
     ds = Sql.DataStore(self.DiveRTdbFile)
     for each in ds.GetKMLData():
         folderBegin = self._diveFolders % each[0]
         self.diveFolders += folderBegin
         for ea in each[1]:
             placemark = self._divePlacemark % ea
             self.diveFolders += placemark
         self.diveFolders += "</Folder>\n"
     ds.Close()