Beispiel #1
0
 def OnElevenTwelveLetters(self, event):
     self.currentLesson = "elevenTwelve"
     self.nextWordButton.Show(False)
     self.displayText.SetFont(wx.Font(config.fontSize[6], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontName))
     currentChar, self.charPosition = eUtils.nextLetter(self.currentLesson, -1)
     self.displayType.SetLabel(messages.numbers)
     self.displayText.SetLabel(currentChar)
     imgToDisplayTemp, numberName = eUtils.nextAboveNineImage(self.currentLesson, currentChar)
     self.displayName.SetLabel(numberName)
     self.displayImage.SetBitmap(wx.BitmapFromImage(imgToDisplayTemp))
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))
Beispiel #3
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))