Beispiel #1
0
    def __init__(self, parent, id, mainWin, mainPanel, currentLesson):
        if wx.Platform != "__WXGTK__":
            statText = wx.StaticText
        else:
            statText = statTex.GenStaticText
        self.mainWin = mainWin
        self.mainPanel = mainPanel
        self.currentLesson = currentLesson
        self.buttonPressed = 20
        self.question = ""
        self.fontSize = config.fontSize[5]
        self.eventQueue = []

        self.question, self.answerList = nGUtils.nextCharMatchQuestion(self.currentLesson)
        self.checkNumberSet()

        if currentLesson == "aaa":
            self.fontSize = config.fontSize[4]
        if currentLesson == "kaKha":
            self.fontSize = config.fontSize[4]
        if currentLesson == "oneTwo":
            self.fontSize = config.fontSize[5]

        self.displayPanel = wx.Panel(parent, -1, (0, 0), (800, 600))
        self.displayPanel.SetBackgroundColour(config.backgroundColour)

        self.displayText = statText(self.displayPanel, -1, self.question, (20, 70), style=wx.ALIGN_CENTRE)
        self.displayText.SetFont(wx.Font(self.fontSize, wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontName))
        self.displayText.SetBackgroundColour(config.backgroundColour)

        displayImg = wx.Bitmap(join(config.coreImagesPath, "divider.png"), wx.BITMAP_TYPE_PNG)
        self.displayImage = wx.StaticBitmap(
            self.displayPanel, -1, displayImg, (200, 80), (displayImg.GetWidth(), displayImg.GetHeight())
        )

        self.displayText1 = statText(self.displayPanel, 1, self.answerList[0], (270, 70), style=wx.ALIGN_CENTRE)
        self.displayText1.SetFont(wx.Font(self.fontSize, wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontName))
        self.displayText1.SetBackgroundColour(config.backgroundColour)
        self.displayText1.Bind(wx.EVT_LEFT_DOWN, self.OnAns1, id=1)

        self.displayText2 = statText(self.displayPanel, 2, self.answerList[1], (430, 70), style=wx.ALIGN_CENTRE)
        self.displayText2.SetFont(wx.Font(self.fontSize, wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontName))
        self.displayText2.SetBackgroundColour(config.backgroundColour)
        self.displayText2.Bind(wx.EVT_LEFT_DOWN, self.OnAns2, id=2)

        self.displayText3 = statText(self.displayPanel, 3, self.answerList[2], (590, 70), style=wx.ALIGN_CENTRE)
        self.displayText3.SetFont(wx.Font(self.fontSize, wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontName))
        self.displayText3.SetBackgroundColour(config.backgroundColour)
        self.displayText3.Bind(wx.EVT_LEFT_DOWN, self.OnAns3, id=3)

        answerImg = wx.Bitmap(join(config.coreImagesPath, "ansBlank.png"), wx.BITMAP_TYPE_PNG)
        self.answerImage = wx.StaticBitmap(self.displayPanel, -1, answerImg, (150, 300), (180, 140))
        self.answerImage.SetBackgroundColour(config.backgroundColour)

        nextQuestionImg = wx.Bitmap(join(config.buttonsPath, "nextQuestion.png"), wx.BITMAP_TYPE_PNG)
        self.nextQuestionButton = wx.BitmapButton(self.displayPanel, 4, nextQuestionImg, (460, 320), style=wx.NO_BORDER)
        self.nextQuestionButton.SetBackgroundColour(config.backgroundColour)
        self.nextQuestionButton.Bind(wx.EVT_BUTTON, self.OnNextQuestion, id=4)

        bottomMenu.bottomMenu([self.displayPanel], parent, self.mainWin, "threeButton", self.mainPanel)
Beispiel #2
0
 def OnNextQuestion(self, event=None):
     if len(self.eventQueue) != 0:
         self.eventQueue[0].SetBackgroundColour(config.backgroundColour)
         self.eventQueue[0].SetLabel(self.eventQueue[0].GetLabel())
     self.eventQueue = []
     self.answerImage.SetBitmap(wx.Bitmap(join(config.coreImagesPath, "ansBlank.png"), wx.BITMAP_TYPE_PNG))
     self.question, self.answerList = nGUtils.nextCharMatchQuestion(self.currentLesson)
     self.checkNumberSet()
     self.displayText.SetLabel(self.question)
     self.displayText1.SetLabel(self.answerList[0])
     self.displayText2.SetLabel(self.answerList[1])
     self.displayText3.SetLabel(self.answerList[2])
Beispiel #3
0
 def OnNextQuestion(self, event=None):
     if len(self.eventQueue) != 0:
         self.eventQueue[0].SetBackgroundColour(config.backgroundColour)
         self.eventQueue[0].SetLabel(self.eventQueue[0].GetLabel())
     self.eventQueue = []
     self.answerImage.SetBitmap(
         wx.Bitmap(join(config.coreImagesPath, 'ansBlank.png'),
                   wx.BITMAP_TYPE_PNG))
     self.question, self.answerList = nGUtils.nextCharMatchQuestion(
         self.currentLesson)
     self.checkNumberSet()
     self.displayText.SetLabel(self.question)
     self.displayText1.SetLabel(self.answerList[0])
     self.displayText2.SetLabel(self.answerList[1])
     self.displayText3.SetLabel(self.answerList[2])
Beispiel #4
0
    def __init__(self, parent, id, mainWin, mainPanel, currentLesson):
        if wx.Platform != "__WXGTK__":
            statText = wx.StaticText
        else:
            statText = statTex.GenStaticText
        self.mainWin = mainWin
        self.mainPanel = mainPanel
        self.currentLesson = currentLesson
        self.buttonPressed = 20
        self.question = ''
        self.fontSize = config.fontSize[5]
        self.eventQueue = []

        self.question, self.answerList = nGUtils.nextCharMatchQuestion(
            self.currentLesson)
        self.checkNumberSet()

        if currentLesson == 'aaa': self.fontSize = config.fontSize[4]
        if currentLesson == 'kaKha': self.fontSize = config.fontSize[4]
        if currentLesson == 'oneTwo': self.fontSize = config.fontSize[5]

        self.displayPanel = wx.Panel(parent, -1, (0, 0), (800, 600))
        self.displayPanel.SetBackgroundColour(config.backgroundColour)

        self.displayText = statText(self.displayPanel,
                                    -1,
                                    self.question, (20, 70),
                                    style=wx.ALIGN_CENTRE)
        self.displayText.SetFont(
            wx.Font(self.fontSize, wx.SWISS, wx.NORMAL, wx.NORMAL, False,
                    config.fontName))
        self.displayText.SetBackgroundColour(config.backgroundColour)

        displayImg = wx.Bitmap(join(config.coreImagesPath, 'divider.png'),
                               wx.BITMAP_TYPE_PNG)
        self.displayImage = wx.StaticBitmap(
            self.displayPanel, -1, displayImg, (200, 80),
            (displayImg.GetWidth(), displayImg.GetHeight()))

        self.displayText1 = statText(self.displayPanel,
                                     1,
                                     self.answerList[0], (270, 70),
                                     style=wx.ALIGN_CENTRE)
        self.displayText1.SetFont(
            wx.Font(self.fontSize, wx.SWISS, wx.NORMAL, wx.NORMAL, False,
                    config.fontName))
        self.displayText1.SetBackgroundColour(config.backgroundColour)
        self.displayText1.Bind(wx.EVT_LEFT_DOWN, self.OnAns1, id=1)

        self.displayText2 = statText(self.displayPanel,
                                     2,
                                     self.answerList[1], (430, 70),
                                     style=wx.ALIGN_CENTRE)
        self.displayText2.SetFont(
            wx.Font(self.fontSize, wx.SWISS, wx.NORMAL, wx.NORMAL, False,
                    config.fontName))
        self.displayText2.SetBackgroundColour(config.backgroundColour)
        self.displayText2.Bind(wx.EVT_LEFT_DOWN, self.OnAns2, id=2)

        self.displayText3 = statText(self.displayPanel,
                                     3,
                                     self.answerList[2], (590, 70),
                                     style=wx.ALIGN_CENTRE)
        self.displayText3.SetFont(
            wx.Font(self.fontSize, wx.SWISS, wx.NORMAL, wx.NORMAL, False,
                    config.fontName))
        self.displayText3.SetBackgroundColour(config.backgroundColour)
        self.displayText3.Bind(wx.EVT_LEFT_DOWN, self.OnAns3, id=3)

        answerImg = wx.Bitmap(join(config.coreImagesPath, 'ansBlank.png'),
                              wx.BITMAP_TYPE_PNG)
        self.answerImage = wx.StaticBitmap(self.displayPanel, -1, answerImg,
                                           (150, 300), (180, 140))
        self.answerImage.SetBackgroundColour(config.backgroundColour)

        nextQuestionImg = wx.Bitmap(
            join(config.buttonsPath, 'nextQuestion.png'), wx.BITMAP_TYPE_PNG)
        self.nextQuestionButton = wx.BitmapButton(self.displayPanel,
                                                  4,
                                                  nextQuestionImg, (460, 320),
                                                  style=wx.NO_BORDER)
        self.nextQuestionButton.SetBackgroundColour(config.backgroundColour)
        self.nextQuestionButton.Bind(wx.EVT_BUTTON, self.OnNextQuestion, id=4)

        bottomMenu.bottomMenu([self.displayPanel], parent, self.mainWin,
                              'threeButton', self.mainPanel)