示例#1
0
    def OnSimpleMinusButton(self, event):
        self.currentLesson = "simpleMinus"
        self.displayLabel0.Show(True)
        self.displayLabel1.Show(True)
        self.displayLabel2.Show(True)
        self.arithmeticSignLabel.Show(True)
        self.equalToLabel.Show(True)
        self.displayLabel3.Show(True)
        self.displayLabel5.Show(True)
        self.displayLabel7.Show(True)
        self.displayLabel4.Show(True)
        self.displayLabel6.Show(True)
        self.displayLabel9.Show(True)
        self.displayLabel11.Show(True)
        self.displayLabel0.SetLabel(messages.number)
        self.displayLabel1.SetLabel(messages.numberToMinus)
        self.displayLabel2.SetLabel(messages.afterArithmetic)
        self.arithmeticSignLabel.SetLabel("-")
        self.currentNumber, self.numberArithmetic, self.nextNumber = arithmeticUtils.nextNumberArithmetic(self.currentLesson)
        self.displayLabel3.SetLabel(self.mreplace(str(self.currentNumber), "engToNep"))
        self.displayLabel4.SetLabel("-")
        self.displayLabel9.SetLabel("-")
        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)])
示例#2
0
    def OnSimpleMinusButton(self, event):
        self.currentLesson = "simpleMinus"
        self.displayLabel1.SetLabel(messages.numberToMinus)
        self.displayLabel2.SetLabel(messages.afterArithmetic)
        self.arithmeticSignLabel.SetLabel("-")
        self.currentNumber, self.numberArithmetic, self.nextNumber = arithmeticUtils.nextNumberArithmetic(
            self.currentLesson)
        self.displayLabel3.SetLabel(
            self.mreplace(str(self.currentNumber), "engToNep"))
        self.displayLabel4.SetLabel("-")
        self.displayLabel9.SetLabel("-")
        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)])
示例#3
0
 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)
     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)])
示例#4
0
    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)])