multisplit
[iramuteq] / sheet.py
1 # -*- coding: utf-8 -*-
2 #Author: Pierre Ratinaud
3 #Copyright (c) 2008-2020 Pierre Ratinaud
4 #modification pour python 3 : Laurent Mérat, 6x7 - mai 2020
5 #License: GNU/GPL
6
7 #------------------------------------
8 # import des modules wx
9 #------------------------------------
10 from wx.lib import sheet
11
12 # utilisé seulement dans layout.py
13
14
15 class MySheet(sheet.CSheet):
16
17     def __init__(self, parent):
18         sheet.CSheet.__init__(self, parent)
19         self.parent=parent
20         self.row = self.col = 0
21
22     def OnGridSelectCell(self, event):
23         self.row, self.col = event.GetRow(), event.GetCol()
24         value =  self.GetColLabelValue(self.col) + self.GetRowLabelValue(self.row)
25         event.Skip()
26         
27     def Populate(self,content):
28         nrow=len(content)
29         self.SetNumberRows(nrow)
30         ncol=len(content[1])
31         self.SetNumberCols(ncol)
32         for y in range(0,nrow):
33             for i in range(0,ncol):
34                 self.SetCellValue(y,i,str(content[y][i]))