def OnBigSmallButton(self, event): self.currentLesson = "bigSmall" self.arithmeticSignLabel.Show(False) self.equalToLabel.Show(False) self.displayLabel3.Show(True) self.displayLabel5.Show(True) self.displayLabel7.Show(True) self.displayLabel4.Show(False) self.displayLabel6.Show(False) self.displayLabel9.Show(False) self.displayLabel11.Show(False) self.currentNumber, self.numberArithmetic, self.nextNumber = arithmeticUtils.nextNumberBigSmall() bigPosition, smallPosition = arithmeticUtils.findBigSmallPosition(self.currentNumber, self.numberArithmetic, self.nextNumber) self.displayBigSmall(bigPosition, smallPosition) self.displayLabel3.SetLabel(self.mreplace(str(self.currentNumber), "engToNep")) self.displayLabel5.SetLabel(self.mreplace(str(self.numberArithmetic), "engToNep")) self.displayLabel7.SetLabel(self.mreplace(str(self.nextNumber), "engToNep")) currentImg = arithmeticUtils.nextImage(self.currentLesson, self.currentNumber) numberArithmeticImg = arithmeticUtils.nextImage(self.currentLesson, self.numberArithmetic) nextImg = arithmeticUtils.nextImage(self.currentLesson, self.nextNumber) self.currentNumberImage.SetBitmap(wx.BitmapFromImage(currentImg)) self.numberArithmeticImage.SetBitmap(wx.BitmapFromImage(numberArithmeticImg)) self.nextNumberImage.SetBitmap(wx.BitmapFromImage(nextImg)) self.displayLabel8.SetLabel(loadDataArithmetic.numberNames[int(self.currentNumber)]) self.displayLabel10.SetLabel(loadDataArithmetic.numberNames[int(self.numberArithmetic)]) self.displayLabel12.SetLabel(loadDataArithmetic.numberNames[int(self.nextNumber)])
def OnMoreLessButton(self, event): self.currentLesson = "moreLess" self.arithmeticSignLabel.Show(False) self.equalToLabel.Show(False) self.displayLabel3.Show(False) self.displayLabel5.Show(False) self.displayLabel7.Show(False) self.displayLabel4.Show(False) self.displayLabel6.Show(False) self.displayLabel9.Show(False) self.displayLabel11.Show(False) self.currentNumber, self.numberArithmetic, self.nextNumber = arithmeticUtils.nextNumberBigSmall( ) bigPosition, smallPosition = arithmeticUtils.findBigSmallPosition( self.currentNumber, self.numberArithmetic, self.nextNumber) self.displayBigSmall(bigPosition, smallPosition) currentImg = arithmeticUtils.nextImage(self.currentLesson, self.currentNumber) numberArithmeticImg = arithmeticUtils.nextImage( self.currentLesson, self.numberArithmetic) nextImg = arithmeticUtils.nextImage(self.currentLesson, self.nextNumber) self.currentNumberImage.SetBitmap(wx.BitmapFromImage(currentImg)) self.numberArithmeticImage.SetBitmap( wx.BitmapFromImage(numberArithmeticImg)) self.nextNumberImage.SetBitmap(wx.BitmapFromImage(nextImg)) self.displayLabel8.SetLabel(loadDataArithmetic.numberNames[int( self.currentNumber)]) self.displayLabel10.SetLabel(loadDataArithmetic.numberNames[int( self.numberArithmetic)]) self.displayLabel12.SetLabel(loadDataArithmetic.numberNames[int( self.nextNumber)])
def OnNextArrow(self, event): mathSign = '' if self.currentLesson == "oneLess": mathSign = loadDataArithmetic.mathSign[2] if self.numberForOneLess < 20: self.numberForOneLess = self.numberForOneLess + 1 else: self.numberForOneLess = 1 self.nextNumber = self.numberForOneLess else: mathSign = loadDataArithmetic.mathSign[0] if (self.currentLesson == "oneMore") or (self.currentLesson == "oneLess"): self.nextNumber, self.currentNumber = arithmeticUtils.nextNumber( self.currentLesson, self.nextNumber) self.displayLabel5.SetLabel(self.mreplace(str(1), "engToNep")) self.displayLabel10.SetLabel(loadDataArithmetic.numberNames[1]) numberArithmeticImg = arithmeticUtils.nextImage( self.currentLesson, 1) if (self.currentLesson == "simplePlus") or (self.currentLesson == "simpleMinus"): self.currentNumber, self.numberArithmetic, self.nextNumber = arithmeticUtils.nextNumberArithmetic( self.currentLesson) self.displayLabel5.SetLabel( self.mreplace(str(self.numberArithmetic), "engToNep")) self.displayLabel10.SetLabel(loadDataArithmetic.numberNames[int( self.numberArithmetic)]) numberArithmeticImg = arithmeticUtils.nextImage( self.currentLesson, self.numberArithmetic) if (self.currentLesson == "bigSmall") or (self.currentLesson == "moreLess"): self.currentNumber, self.numberArithmetic, self.nextNumber = arithmeticUtils.nextNumberBigSmall( ) bigPosition, smallPosition = arithmeticUtils.findBigSmallPosition( self.currentNumber, self.numberArithmetic, self.nextNumber) self.displayBigSmall(bigPosition, smallPosition) self.displayLabel5.SetLabel( self.mreplace(str(self.numberArithmetic), "engToNep")) self.displayLabel10.SetLabel(loadDataArithmetic.numberNames[int( self.numberArithmetic)]) numberArithmeticImg = arithmeticUtils.nextImage( self.currentLesson, self.numberArithmetic) self.displayLabel3.SetLabel( self.mreplace(str(self.currentNumber), "engToNep")) self.displayLabel7.SetLabel( self.mreplace(str(self.nextNumber), "engToNep")) currentImg = arithmeticUtils.nextImage(self.currentLesson, self.currentNumber) nextImg = arithmeticUtils.nextImage(self.currentLesson, self.nextNumber) self.currentNumberImage.SetBitmap(wx.BitmapFromImage(currentImg)) self.numberArithmeticImage.SetBitmap( wx.BitmapFromImage(numberArithmeticImg)) self.nextNumberImage.SetBitmap(wx.BitmapFromImage(nextImg)) self.displayLabel8.SetLabel(loadDataArithmetic.numberNames[int( self.currentNumber)]) self.displayLabel12.SetLabel(loadDataArithmetic.numberNames[int( self.nextNumber)])
def OnNextArrow(self, event): mathSign = '' if self.currentLesson == "oneLess": mathSign = loadDataArithmetic.mathSign[2] if self.numberForOneLess < 20: self.numberForOneLess = self.numberForOneLess + 1 else: self.numberForOneLess = 1 self.nextNumber = self.numberForOneLess else: mathSign = loadDataArithmetic.mathSign[0] if (self.currentLesson == "oneMore") or (self.currentLesson == "oneLess"): self.nextNumber, self.currentNumber = arithmeticUtils.nextNumber(self.currentLesson, self.nextNumber) self.displayLabel5.SetLabel(self.mreplace(str(1), "engToNep")) self.displayLabel10.SetLabel(loadDataArithmetic.numberNames[1]) numberArithmeticImg = arithmeticUtils.nextImage(self.currentLesson, 1) if (self.currentLesson == "simplePlus") or (self.currentLesson == "simpleMinus"): self.currentNumber, self.numberArithmetic, self.nextNumber = arithmeticUtils.nextNumberArithmetic(self.currentLesson) self.displayLabel5.SetLabel(self.mreplace(str(self.numberArithmetic),"engToNep")) self.displayLabel10.SetLabel(loadDataArithmetic.numberNames[int(self.numberArithmetic)]) numberArithmeticImg = arithmeticUtils.nextImage(self.currentLesson, self.numberArithmetic) if (self.currentLesson == "bigSmall") or (self.currentLesson == "moreLess"): self.currentNumber, self.numberArithmetic, self.nextNumber = arithmeticUtils.nextNumberBigSmall() bigPosition, smallPosition = arithmeticUtils.findBigSmallPosition(self.currentNumber, self.numberArithmetic, self.nextNumber) self.displayBigSmall(bigPosition, smallPosition) self.displayLabel5.SetLabel(self.mreplace(str(self.numberArithmetic),"engToNep")) self.displayLabel10.SetLabel(loadDataArithmetic.numberNames[int(self.numberArithmetic)]) numberArithmeticImg = arithmeticUtils.nextImage(self.currentLesson, self.numberArithmetic) self.displayLabel3.SetLabel(self.mreplace(str(self.currentNumber), "engToNep")) self.displayLabel7.SetLabel(self.mreplace(str(self.nextNumber), "engToNep")) currentImg = arithmeticUtils.nextImage(self.currentLesson, self.currentNumber) nextImg = arithmeticUtils.nextImage(self.currentLesson, self.nextNumber) self.currentNumberImage.SetBitmap(wx.BitmapFromImage(currentImg)) self.numberArithmeticImage.SetBitmap(wx.BitmapFromImage(numberArithmeticImg)) self.nextNumberImage.SetBitmap(wx.BitmapFromImage(nextImg)) self.displayLabel8.SetLabel(loadDataArithmetic.numberNames[int(self.currentNumber)]) self.displayLabel12.SetLabel(loadDataArithmetic.numberNames[int(self.nextNumber)])