if self.logDir :
self.logFiles = glob(pjoin(self.logDir, '*.log'))
self.logFiles.sort()
if self.logDir :
self.logFiles = glob(pjoin(self.logDir, '*.log'))
self.logFiles.sort()
- self.dataFrame.grid(row=0, column=0, sticky=NW)
+ self.dataFrame.grid(row=0, column=0, sticky=NW)
+ self.nav.setFileList(self.logFiles)
command = self.inc)
self.nextBtn.grid(row=0, column=2)
command = self.inc)
self.nextBtn.grid(row=0, column=2)
- def dec(self) :
- self.index = self.index - self.step
- self.caption.set('%d / %d' % (self.index, self.to))
+ def refreshStates(self) :
if self.index == self.from_ :
self.backBtn.configure(state=DISABLED)
if self.index == self.from_ :
self.backBtn.configure(state=DISABLED)
+ else :
+ self.backBtn.configure(state=NORMAL)
+
if self.index < self.to :
self.nextBtn.configure(state=NORMAL)
if self.index < self.to :
self.nextBtn.configure(state=NORMAL)
+ else :
+ self.nextBtn.configure(state=DISABLED)
+
+ self.caption.set('%d / %d' % (self.index, self.to))
+
+
+ def dec(self) :
+ self.index = self.index - self.step
+ self.refreshStates()
def inc(self) :
self.index = self.index + self.step
def inc(self) :
self.index = self.index + self.step
- self.caption.set('%d / %d' % (self.index, self.to))
- if self.index == self.to :
- self.nextBtn.configure(state=DISABLED)
- if self.index > self.from_ :
- self.backBtn.configure(state=NORMAL)
+ self.refreshStates()
+
+ def setFileList(self, fileList) :
+ self.fileList = fileList
+ self.from_ = 1
+ self.to = len(self.fileList)
+ self.index = 1
+ self.refreshStates()
+
+ def getFile(self) :
+ return self.fileList[self.index - 1]
class Identification(Frame) :
def __init__(self, master=None) :
Frame.__init__(self, master)
class Identification(Frame) :
def __init__(self, master=None) :
Frame.__init__(self, master)
+ self.fileName = StringVar()
self.createWidgets()
def createWidgets(self) :
self.createWidgets()
def createWidgets(self) :
+ fileLbl = Label(self, text='Fichier :')
+ fileLbl.grid(row=0, column=0)
+
+ fileNameLbl = Label(self, textvariable=self.fileName)
+
nameLbl = Label(self, text='Patient :')
nameLbl = Label(self, text='Patient :')
- nameLbl.grid(row=0, column=0)
+ nameLbl.grid(row=1, column=0)
self.nameEntry = Entry(self, width=40)
self.nameEntry = Entry(self, width=40)
- self.nameEntry.grid(row=0, column=1)
+ self.nameEntry.grid(row=1, column=1)
commentsLbl = Label(self, text='Commentaires :')
commentsLbl = Label(self, text='Commentaires :')
- commentsLbl.grid(row=1, column=0)
+ commentsLbl.grid(row=2, column=0)
self.commentsText = Text(self, width=40, height=4, undo=True, wrap=WORD)
self.commentsText = Text(self, width=40, height=4, undo=True, wrap=WORD)
- self.commentsText.grid(row=1, column=1)
+ self.commentsText.grid(row=2, column=1)