예제 #1
0
 def OnNextArrow(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.nextBarakhariCombo(
             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.nextLetter(
             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))
예제 #2
0
 def OnBaraKhariLetters(self, event):
     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.nextBarakhariCombo(self.currentLesson, -1)
     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.SetPosition((120, 120))
     self.displayText.SetLabel(displayStr)
예제 #3
0
 def OnNextArrow(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.nextBarakhariCombo(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.nextLetter(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))