Beispiel #1
0
 def OnPreviousArrow(self, event):
     currentChar, self.charPosition = eUtils.previousLetter(
         self.currentLesson, self.charPosition)
     self.imgInfo[0] = self.charPosition
     self.imgInfo[1] = 0
     time = ''
     if self.charPosition < 9:
         time = "0" + str(self.charPosition + 1) + " : " + "00"
     else:
         time = str(self.charPosition + 1) + " : " + "00"
     self.displayTime.SetLabel(time)
     imgToDisplay, imgNameToDisplay, self.imgInfo = eUtils.nextImage(
         self.currentLesson, self.imgInfo)
     timeText = str(
         currentChar
     ) + " -" + imgNameToDisplay + "_ " + self.tempBackString[0]
     timeTextEng = str(self.charPosition +
                       1) + "  " + self.tempBackString[1]
     self.displayText.SetLabel(timeText)
     self.displayTextEng.SetLabel(timeTextEng)
     if imgToDisplay != '':
         self.displayImage.SetBitmap(
             wx.Bitmap(imgToDisplay, wx.BITMAP_TYPE_PNG))
     else:
         self.displayImage.SetBitmap(
             wx.Bitmap(self.blankImg, wx.BITMAP_TYPE_PNG))
Beispiel #2
0
 def OnPreviousArrow(self, event):
     if self.currentLesson == "barakhari":
         displayStr = messages.heading + "\n"
         self.currentLesson = "barakhari"
         self.displayType.SetLabel(messages.barakhari)
         self.displayImage.Show(False)
         self.displayName.Show(False)
         self.nextWordButton.Show(False)
         charSplit = lambda currentStr: currentStr.split("-")
         currentChar, self.charPosition = eUtils.previousBarakhariCombo(
             self.currentLesson, self.charPosition)
         self.displayText.SetFont(
             wx.Font(config.fontSizeForBarakhari[0], wx.SWISS, wx.NORMAL,
                     wx.NORMAL, False, config.fontName))
         for i in currentChar:
             chars = charSplit(i)
             displayStr = displayStr + (
                 chars[0] + "  " + messages.plusSign + "  " + chars[1] +
                 "  " + messages.plusSign + "  " + chars[2] + "  " +
                 messages.equalSign + "    " + chars[3])
             displayStr = displayStr + "\n"
         self.displayText.SetLabel(displayStr)
     else:
         currentChar, self.charPosition = eUtils.previousLetter(
             self.currentLesson, self.charPosition)
         self.displayText.SetLabel(currentChar)
         self.imgInfo[0] = self.charPosition
         self.imgInfo[1] = 0
         if self.currentLesson not in ['elevenTwelve']:
             imgToDisplay, imgNameToDisplay, self.imgInfo = eUtils.nextImage(
                 self.currentLesson, self.imgInfo)
             self.displayName.SetLabel(imgNameToDisplay)
             if imgToDisplay != '':
                 self.displayImage.SetBitmap(
                     wx.Bitmap(imgToDisplay, wx.BITMAP_TYPE_PNG))
                 self.nextWordButton.Show(True)
             else:
                 self.displayImage.SetBitmap(
                     wx.Bitmap(self.blankImg, wx.BITMAP_TYPE_PNG))
                 self.nextWordButton.Show(False)
             if self.currentLesson == "oneTwo":
                 self.nextWordButton.Show(False)
         if self.currentLesson == "elevenTwelve":
             self.nextWordButton.Show(False)
             imgToDisplayTemp, numberName = eUtils.nextAboveNineImage(
                 self.currentLesson, currentChar)
             self.displayName.SetLabel(numberName)
             self.displayImage.SetBitmap(
                 wx.BitmapFromImage(imgToDisplayTemp))
 def OnPreviousArrow(self, event):
     currentChar, self.charPosition = eUtils.previousLetter(self.currentLesson, self.charPosition)
     self.imgInfo[0] = self.charPosition
     self.imgInfo[1] = 0
     time = ''
     if self.charPosition < 9:
         time = "0" + str(self.charPosition + 1) + " : " + "00"
     else:
         time = str(self.charPosition + 1) + " : " + "00"
     self.displayTime.SetLabel(time)
     imgToDisplay, imgNameToDisplay, self.imgInfo = eUtils.nextImage(self.currentLesson, self.imgInfo)
     timeText = str(currentChar) + " -" + imgNameToDisplay + "_ " + self.tempBackString[0]
     timeTextEng = str(self.charPosition + 1) + "  " + self.tempBackString[1]
     self.displayText.SetLabel(timeText)
     self.displayTextEng.SetLabel(timeTextEng)
     if imgToDisplay != '':
         self.displayImage.SetBitmap(wx.Bitmap(imgToDisplay, wx.BITMAP_TYPE_PNG))
     else:
         self.displayImage.SetBitmap(wx.Bitmap(self.blankImg, wx.BITMAP_TYPE_PNG))
Beispiel #4
0
 def OnPreviousArrow(self, event):
     if self.currentLesson == "barakhari":
         displayStr = messages.heading + "\n"
         self.currentLesson = "barakhari"
         self.displayType.SetLabel(messages.barakhari)
         self.displayImage.Show(False)
         self.displayName.Show(False)
         self.nextWordButton.Show(False)
         charSplit = lambda currentStr : currentStr.split("-")
         currentChar, self.charPosition = eUtils.previousBarakhariCombo(self.currentLesson, self.charPosition)
         self.displayText.SetFont(wx.Font(config.fontSizeForBarakhari[0], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontName))
         for i in currentChar: 
             chars = charSplit(i)
             displayStr = displayStr + (chars[0] + "  " + messages.plusSign + "  " + chars[1] + "  " + messages.plusSign + "  " + chars[2] + "  " + messages.equalSign + "    " + chars[3])
             displayStr = displayStr + "\n"            
         self.displayText.SetLabel(displayStr)
     else:
         currentChar, self.charPosition = eUtils.previousLetter(self.currentLesson, self.charPosition)
         self.displayText.SetLabel(currentChar)
         self.imgInfo[0] = self.charPosition
         self.imgInfo[1] = 0
         if self.currentLesson not in ['elevenTwelve']:
             imgToDisplay, imgNameToDisplay, self.imgInfo = eUtils.nextImage(self.currentLesson, self.imgInfo)
             self.displayName.SetLabel(imgNameToDisplay)
             if imgToDisplay != '':
                 self.displayImage.SetBitmap(wx.Bitmap(imgToDisplay, wx.BITMAP_TYPE_PNG))
                 self.nextWordButton.Show(True)
             else:
                 self.displayImage.SetBitmap(wx.Bitmap(self.blankImg, wx.BITMAP_TYPE_PNG))
                 self.nextWordButton.Show(False)
             if self.currentLesson == "oneTwo":
                 self.nextWordButton.Show(False)
         if self.currentLesson == "elevenTwelve":
             self.nextWordButton.Show(False)
             imgToDisplayTemp, numberName = eUtils.nextAboveNineImage(self.currentLesson, currentChar)
             self.displayName.SetLabel(numberName)
             self.displayImage.SetBitmap(wx.BitmapFromImage(imgToDisplayTemp))