def __init__(self, parent, id, mainPanel): self.currentLesson = "trafficSign" self.currentPosition = 0 self.mainWin = mainPanel self.currentSSpath = config.trafficSignImagesPath self.blankImg = join(config.coreImagesPath, 'blank.png') self.menuPanel = wx.Panel(parent, -1, (0, 0), (800, 100)) self.menuPanel.SetBackgroundColour(config.backgroundColour) self.menuPanel.SetFocus() self.displayPanel = wx.Panel(parent, -1, (0, 100), (800, 500)) self.displayPanel.SetBackgroundColour(config.backgroundColour) self.displayPanel.SetFocus() self.displayText = wx.StaticText(self.displayPanel, -1, loadData.trafficSignNepali[self.currentPosition], (80, 140), style = wx.ALIGN_CENTRE) self.displayText.SetFont(wx.Font(config.fontSize[1], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontName)) currentImg = join(self.currentSSpath, (loadData.trafficSignEnglish[self.currentPosition] + ".png")) displayImg = wx.Bitmap(currentImg, wx.BITMAP_TYPE_PNG) self.displayImage = wx.StaticBitmap(self.displayPanel, -1, displayImg, (500,140), (displayImg.GetWidth(), displayImg.GetHeight())) previousArrowImg = wx.Bitmap(join(config.coreImagesPath,'previousArrow.png'), wx.BITMAP_TYPE_PNG) self.previousArrowButton = wx.BitmapButton(self.displayPanel, 5, previousArrowImg, (50,0), style = wx.NO_BORDER) self.previousArrowButton.SetBackgroundColour(config.backgroundColour) self.previousArrowButton.Bind(wx.EVT_BUTTON, self.OnPreviousArrow, id=5) nextArrowImg = wx.Bitmap(join(config.coreImagesPath,'nextArrow.png'), wx.BITMAP_TYPE_PNG) self.nextArrowButton = wx.BitmapButton(self.displayPanel, 6, nextArrowImg, (650,0), style = wx.NO_BORDER) self.nextArrowButton.SetBackgroundColour(config.backgroundColour) self.nextArrowButton.Bind(wx.EVT_BUTTON, self.OnNextArrow, id=6) bottomMenu.bottomMenu([self.displayPanel, self.menuPanel], parent, self.mainWin, 'twoButton')
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)
def __init__(self, parent, id, mainWin, mainPanel, currentLesson): self.mainWin = mainWin self.mainPanel = mainPanel self.currentLesson = currentLesson self.question = '' self.fontSize = config.fontSize[5] self.question, self.questionImg, self.answerList = nGUtils.nextRecognizeAndSearchQuestion( self.currentLesson) self.displayPanel = wx.Panel(parent, -1, (0, 0), (800, 600)) self.displayPanel.SetBackgroundColour(config.backgroundColour) questionImg = wx.Bitmap(self.questionImg, wx.BITMAP_TYPE_PNG) self.questionImage = wx.StaticBitmap( self.displayPanel, wx.ID_ANY, questionImg, (280, 30), (questionImg.GetWidth(), questionImg.GetHeight())) self.questionImage.SetBackgroundColour(config.backgroundColour) self.wordAnswerList = wordAnswerList.wordAnswerList( self.displayPanel, self.question, self.answerList, self.currentLesson) nextQuestionImg = wx.Bitmap( join(config.buttonsPath, 'nextQuestion.png'), wx.BITMAP_TYPE_PNG) self.nextQuestionButton = wx.BitmapButton(self.displayPanel, 4, nextQuestionImg, (460, 400), 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)
def __init__(self, parent, id, mainWin, mainPanel, currentLesson): self.mainWin = mainWin self.mainPanel = mainPanel self.currentLesson = currentLesson self.buttonPressed = 20 self.question = '' self.fontSize = config.fontSize[5] temp = 0 self.question, self.questionImg, self.totalList = nGUtils.nextCountClickQuestion(self.currentLesson) 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) questionImg = wx.Bitmap(self.questionImg, wx.BITMAP_TYPE_PNG) self.questionImage = wx.StaticBitmap(self.displayPanel, wx.ID_ANY, questionImg, (280,40), (questionImg.GetWidth(), questionImg.GetHeight())) self.numberAnswerList = numberAnswerList.numberAnswerList(self.displayPanel, self.question, self.totalList) nextQuestionImg = wx.Bitmap(join(config.buttonsPath,'nextQuestion.png'), wx.BITMAP_TYPE_PNG) self.nextQuestionButton = wx.BitmapButton(self.displayPanel, 4, nextQuestionImg, (460,400), 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)
def __init__(self, parent, id, mainWin, mainPanel, currentLesson, gameType): self.mainWin = mainWin self.mainPanel = mainPanel self.currentLesson = currentLesson answer, answerList, answerImgList = 0, [], [] self.answerImageList = '' self.gameType = gameType self.displayPanel = wx.Panel(parent, -1, (0, 0), (800, 600)) self.displayPanel.SetBackgroundColour(config.backgroundColour) if (self.currentLesson == "animals" or self.currentLesson == "colour") and self.gameType == "Img": answer, answerImgList =findDifferenceUtils.nextFindDifferenceQuestion(self.currentLesson, self.gameType) answerImgList = resizeImage(answerImgList, 65) if self.currentLesson == "colour": answer, answerImgList = self.rotateImage(answer, answerImgList) else: pass self.answerImageList = findDifferenceImageAnswerList.imageAnswerList(self.displayPanel, answer, answerImgList) elif (self.currentLesson == "kaKha" or self.currentLesson == "aaa") and self.gameType == "Char": answer, answerList = findDifferenceUtils.nextFindDifferenceQuestionWithoutImage(self.currentLesson, self.gameType) self.answerImageList = findDifferenceAnswerList.charAnswerList(self.displayPanel, answer, answerList) elif (self.currentLesson == "kaKha" or self.currentLesson == "aaa") and self.gameType == "Img": answer, answerImgList =findDifferenceUtils.nextFindDifferenceQuestion(self.currentLesson, self.gameType) answerImgList = resizeImage(answerImgList, 65) self.answerImageList = findDifferenceImageAnswerList.imageAnswerList(self.displayPanel, answer, answerImgList) nextQuestionImg = wx.Bitmap(join(config.buttonsPath,'nextQuestion.png'), wx.BITMAP_TYPE_PNG) self.nextQuestionButton = wx.BitmapButton(self.displayPanel, 4, nextQuestionImg, (460,400), 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)
def __init__(self, parent, id, mainWin, mainPanel, currentLesson): self.mainWin = mainWin self.mainPanel = mainPanel self.currentLesson = currentLesson self.answer = '' self.fontSize = config.fontSize[5] self.answer, self.questionList, self.questionImgList = nGUtils.nextSearchAndRecognizeQuestion(self.currentLesson) self.questionImgList = resizeImage(self.questionImgList, 50) if currentLesson == 'colour': self.fontSize = config.fontSize[2] if currentLesson == 'animals': self.fontSize = config.fontSize[2] self.displayPanel = wx.Panel(parent, -1, (0, 0), (800, 600)) self.displayPanel.SetBackgroundColour(config.backgroundColour) self.imageAnswerList = imageAnswerList.imageAnswerList(self.displayPanel, self.answer, self.questionList, self.questionImgList) self.displayText0 = wx.StaticText(self.displayPanel, 1, self.answer, (300, 220), style = wx.ALIGN_CENTRE) self.displayText0.SetFont(wx.Font(self.fontSize, wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontName)) nextQuestionImg = wx.Bitmap(join(config.buttonsPath,'nextQuestion.png'), wx.BITMAP_TYPE_PNG) self.nextQuestionButton = wx.BitmapButton(self.displayPanel, 4, nextQuestionImg, (460,400), 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)
def __init__(self, parent, id, mainPanel): if wx.Platform != "__WXGTK__": imgBmp = wx.StaticBitmap else: imgBmp = statbmp.GenStaticBitmap self.currentImg = '' self.currentPosition = 0 self.mainWin = mainPanel self.currentSSpath = config.notesImagesPath self.blankImg = join(config.coreImagesPath, 'blank220.png') self.dataListEnglish = loadData.notesNameEnglish self.dataListNepali = loadData.notesNameNepali self.menuPanel = wx.Panel(parent, wx.ID_ANY, (0, 0), (800, 100)) self.menuPanel.SetBackgroundColour(config.backgroundColour) notesImg = wx.Bitmap(join(config.buttonsPath,'learnNotes.png'), wx.BITMAP_TYPE_PNG) self.notesButton = wx.BitmapButton(self.menuPanel, wx.ID_ANY, notesImg, (50,10), style = wx.NO_BORDER) self.notesButton.SetBackgroundColour(config.backgroundColour) self.notesButton.Bind(wx.EVT_BUTTON, self.OnNotesButton, id=self.notesButton.GetId()) coinsImg = wx.Bitmap(join(config.buttonsPath,'learnCoins.png'), wx.BITMAP_TYPE_PNG) self.coinsButton = wx.BitmapButton(self.menuPanel, wx.ID_ANY, coinsImg, (200,10), style = wx.NO_BORDER) self.coinsButton.SetBackgroundColour(config.backgroundColour) self.coinsButton.Bind(wx.EVT_BUTTON, self.OnCoinsButton, id=self.coinsButton.GetId()) self.displayPanel = wx.Panel(parent, -1, (0, 100), (800, 500)) self.displayPanel.SetBackgroundColour(config.backgroundColour) self.displayPanel.SetFocus() self.displayType = wx.StaticText(self.displayPanel, -1, messages.notes, (270, 10), style = wx.ALIGN_CENTRE) self.displayType.SetFont(wx.Font(config.fontSize[2], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontName)) self.displayType.SetBackgroundColour(config.backgroundColour) self.displayText = wx.StaticText(self.displayPanel, -1, self.dataListNepali[self.currentPosition], (50, 100), style = wx.ALIGN_CENTRE) self.displayText.SetFont(wx.Font(config.fontSize[2], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontName)) self.displayText.SetBackgroundColour(config.backgroundColour) self.frontBackText = wx.StaticText(self.displayPanel, wx.ID_ANY, messages.back, (490, 59), style = wx.ALIGN_CENTRE) self.frontBackText.SetFont(wx.Font(config.fontSize[0], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontName)) self.frontBackText.SetBackgroundColour(config.backgroundColour) currentImg = join(self.currentSSpath, (self.dataListEnglish[self.currentPosition] + ".png")) self.currentImg = currentImg displayImg = wx.Bitmap(currentImg, wx.BITMAP_TYPE_PNG) self.displayImage = imgBmp(self.displayPanel, -1, displayImg, (330,110), (displayImg.GetWidth(), displayImg.GetHeight())) self.displayImage.Bind(wx.EVT_LEFT_DOWN, self.OnChangeFace, id=self.displayImage.GetId()) self.displayImage.SetBackgroundColour(config.backgroundColour) previousArrowImg = wx.Bitmap(join(config.coreImagesPath,'previousArrow.png'), wx.BITMAP_TYPE_PNG) self.previousArrowButton = wx.BitmapButton(self.displayPanel, 6, previousArrowImg, (50,0), style = wx.NO_BORDER) self.previousArrowButton.SetBackgroundColour(config.backgroundColour) self.previousArrowButton.Bind(wx.EVT_BUTTON, self.OnPreviousArrow, id=6) nextArrowImg = wx.Bitmap(join(config.coreImagesPath,'nextArrow.png'), wx.BITMAP_TYPE_PNG) self.nextArrowButton = wx.BitmapButton(self.displayPanel, 7, nextArrowImg, (650,0), style = wx.NO_BORDER) self.nextArrowButton.SetBackgroundColour(config.backgroundColour) self.nextArrowButton.Bind(wx.EVT_BUTTON, self.OnNextArrow, id=7) bottomMenu.bottomMenu([self.displayPanel, self.menuPanel], parent, self.mainWin, 'twoButton')
def __init__(self, parent, id, mainWin, mainPanel, currentLesson): if wx.Platform != "__WXGTK__": statbmp = wx.StaticBitmap else: statbmp = statbp.GenStaticBitmap self.mainWin = mainWin self.mainPanel = mainPanel self.currentLesson = currentLesson self.buttonPressed = 20 self.question = '' self.eventQueue = [] self.question, self.answerList, self.answerImageList = nGUtils.nextImageMatchQuestion(self.currentLesson) self.fontSize = config.fontSize[4] if currentLesson == 'aaa': self.fontSize = config.fontSize[4] if currentLesson == 'kaKha': self.fontSize = config.fontSize[4] if currentLesson == 'oneTwo': self.fontSize = config.fontSize[5] if currentLesson == 'time': self.fontSize = config.fontSize[4] self.displayPanel = wx.Panel(parent, -1, (0, 0), (800, 600)) self.displayPanel.SetBackgroundColour(config.backgroundColour) self.displayText = wx.StaticText(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.displayImage.SetBackgroundColour(config.backgroundColour) ansImg1 = wx.Bitmap(self.answerImageList[0], wx.BITMAP_TYPE_PNG) self.answerImage1 = statbmp(self.displayPanel, 1, ansImg1, (260,90), (ansImg1.GetWidth(), ansImg1.GetHeight())) self.answerImage1.SetBackgroundColour(config.backgroundColour) self.answerImage1.Bind(wx.EVT_LEFT_DOWN, self.OnAns1, id=1) ansImg2 = wx.Bitmap(self.answerImageList[1], wx.BITMAP_TYPE_PNG) self.answerImage2 = statbmp(self.displayPanel, 2, ansImg2, (440,90), (ansImg2.GetWidth(), ansImg2.GetHeight())) self.answerImage2.SetBackgroundColour(config.backgroundColour) self.answerImage2.Bind(wx.EVT_LEFT_DOWN, self.OnAns2, id=2) ansImg3 = wx.Bitmap(self.answerImageList[2], wx.BITMAP_TYPE_PNG) self.answerImage3 = statbmp(self.displayPanel, 3, ansImg3, (620,90), (ansImg3.GetWidth(), ansImg3.GetHeight())) self.answerImage3.SetBackgroundColour(config.backgroundColour) self.answerImage3.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)
def __init__(self, parent, id, mainPanel, currentLesson): self.currentLesson = currentLesson self.charPosition = 0 self.mainWin = mainPanel self.parent = parent self.imgInfo = [0,0] #track img displayed. [0] for letter-img and [1] for within same letter self.blankImg = join(config.coreImagesPath, 'blank.png') buttonImages = [] if self.currentLesson == "colour": buttonImages.append('recognizeAndSearch.png') buttonImages.append('searchAndRecognize.png') buttonImages.append('findDifference.png') buttonImages.append('matchPairs.png') if self.currentLesson == "animals": buttonImages.append('recognizeAndSearch.png') buttonImages.append('searchAndRecognize.png') buttonImages.append('findDifference.png') buttonImages.append('matchPairs.png') self.mainPanel = wx.Panel(parent, -1, (0, 0), (800, 600)) self.mainPanel.SetBackgroundColour(config.backgroundColour) if buttonImages[0] != '': recAndSearchImg = wx.Bitmap(join(config.buttonsPath, buttonImages[0]), wx.BITMAP_TYPE_PNG) self.recAndSearchButton = wx.BitmapButton(self.mainPanel, wx.ID_ANY, recAndSearchImg, (40,100), style = wx.NO_BORDER) self.recAndSearchButton.SetBackgroundColour(config.backgroundColour) self.recAndSearchButton.Bind(wx.EVT_BUTTON, self.OnRecAndSearchGame, id=self.recAndSearchButton.GetId()) else: pass if buttonImages[1] != '': searchAndRecImg = wx.Bitmap(join(config.buttonsPath, buttonImages[1]), wx.BITMAP_TYPE_PNG) self.searchAndRecButton = wx.BitmapButton(self.mainPanel, wx.ID_ANY, searchAndRecImg, (300,100), style = wx.NO_BORDER) self.searchAndRecButton.SetBackgroundColour(config.backgroundColour) self.searchAndRecButton.Bind(wx.EVT_BUTTON, self.OnSearchAndRecGame, id=self.searchAndRecButton.GetId()) else: pass if buttonImages[2] != '': findDifferenceImg = wx.Bitmap(join(config.buttonsPath, buttonImages[2]), wx.BITMAP_TYPE_PNG) self.findDifferenceButton = wx.BitmapButton(self.mainPanel, wx.ID_ANY, findDifferenceImg, (550,100), style = wx.NO_BORDER) self.findDifferenceButton.SetBackgroundColour(config.backgroundColour) self.findDifferenceButton.Bind(wx.EVT_BUTTON, self.OnFindDifferenceGame, id=self.findDifferenceButton.GetId()) else: pass if buttonImages[3] != '': matchPairsImg = wx.Bitmap(join(config.buttonsPath, buttonImages[3]), wx.BITMAP_TYPE_PNG) self.matchPairsButton = wx.BitmapButton(self.mainPanel, wx.ID_ANY, matchPairsImg, (40,200), style = wx.NO_BORDER) self.matchPairsButton.SetBackgroundColour(config.backgroundColour) self.matchPairsButton.Bind(wx.EVT_BUTTON, self.OnMatchPairsGame, id=self.matchPairsButton.GetId()) else: pass bottomMenu.bottomMenu([self.mainPanel], parent, self.mainWin, 'twoButton')
def __init__(self, parent, id, mainPanel): self.currentLesson = "trafficSign" self.currentPosition = 0 self.mainWin = mainPanel self.currentSSpath = config.trafficSignImagesPath self.blankImg = join(config.coreImagesPath, 'blank.png') self.menuPanel = wx.Panel(parent, -1, (0, 0), (800, 100)) self.menuPanel.SetBackgroundColour(config.backgroundColour) self.menuPanel.SetFocus() self.displayPanel = wx.Panel(parent, -1, (0, 100), (800, 500)) self.displayPanel.SetBackgroundColour(config.backgroundColour) self.displayPanel.SetFocus() self.displayText = wx.StaticText( self.displayPanel, -1, loadData.trafficSignNepali[self.currentPosition], (80, 140), style=wx.ALIGN_CENTRE) self.displayText.SetFont( wx.Font(config.fontSize[1], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontName)) currentImg = join( self.currentSSpath, (loadData.trafficSignEnglish[self.currentPosition] + ".png")) displayImg = wx.Bitmap(currentImg, wx.BITMAP_TYPE_PNG) self.displayImage = wx.StaticBitmap( self.displayPanel, -1, displayImg, (500, 140), (displayImg.GetWidth(), displayImg.GetHeight())) previousArrowImg = wx.Bitmap( join(config.coreImagesPath, 'previousArrow.png'), wx.BITMAP_TYPE_PNG) self.previousArrowButton = wx.BitmapButton(self.displayPanel, 5, previousArrowImg, (50, 0), style=wx.NO_BORDER) self.previousArrowButton.SetBackgroundColour(config.backgroundColour) self.previousArrowButton.Bind(wx.EVT_BUTTON, self.OnPreviousArrow, id=5) nextArrowImg = wx.Bitmap(join(config.coreImagesPath, 'nextArrow.png'), wx.BITMAP_TYPE_PNG) self.nextArrowButton = wx.BitmapButton(self.displayPanel, 6, nextArrowImg, (650, 0), style=wx.NO_BORDER) self.nextArrowButton.SetBackgroundColour(config.backgroundColour) self.nextArrowButton.Bind(wx.EVT_BUTTON, self.OnNextArrow, id=6) bottomMenu.bottomMenu([self.displayPanel, self.menuPanel], parent, self.mainWin, 'twoButton')
def __init__(self, parent, id, mainPanel): self.currentLesson = "time" self.charPosition = 0 self.mainWin = mainPanel self.imgInfo = [0,0] self.blankImg = join(config.coreImagesPath, 'blank.png') self.tempBackString = messages.timeBackString currentChar, self.charPosition = eUtils.nextLetter(self.currentLesson, -1) imgToDisplay, imgNameToDisplay, self.imgInfo = eUtils.nextImage(self.currentLesson, self.imgInfo) self.menuPanel = wx.Panel(parent, -1, (0, 0), (800, 100)) self.menuPanel.SetBackgroundColour(config.backgroundColour) self.menuPanel.SetFocus() self.displayPanel = wx.Panel(parent, -1, (0, 100), (800, 500)) self.displayPanel.SetBackgroundColour(config.backgroundColour) self.displayPanel.SetFocus() timeText = str(currentChar) + " -" + imgNameToDisplay + "_ " + self.tempBackString[0] timeTextEng = str(self.charPosition + 1) + " " + self.tempBackString[1] self.timeText = wx.StaticText(self.displayPanel, -1, messages.timeTitleString, (50, 100), style = wx.ALIGN_CENTRE) self.timeText.SetFont(wx.Font(config.fontSize[0], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontName)) self.displayText = wx.StaticText(self.displayPanel, -1, timeText, (120, 140), style = wx.ALIGN_CENTRE) self.displayText.SetFont(wx.Font(config.fontSize[1], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontName)) self.displayTextEng = wx.StaticText(self.displayPanel, -1, timeTextEng, (120, 200), style = wx.ALIGN_CENTRE) self.displayTextEng.SetFont(wx.Font(config.fontSize[1], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontNameEnglish)) displayImg = wx.Bitmap(imgToDisplay, wx.BITMAP_TYPE_PNG) self.displayImage = wx.StaticBitmap(self.displayPanel, -1, displayImg, (500,120), (displayImg.GetWidth(), displayImg.GetHeight())) time = '' if self.charPosition < 9: time = "0" + str(self.charPosition + 1) + " : " + "00" else: time = str(self.charPosition + 1) + " : " + "00" self.displayTime = wx.StaticText(self.displayPanel, -1, time, (500, 290), style = wx.ALIGN_CENTRE) self.displayTime.SetFont(wx.Font(config.fontSize[1], wx.SWISS, wx.NORMAL, wx.NORMAL, False, '7 segment')) previousArrowImg = wx.Bitmap(join(config.coreImagesPath,'previousArrow.png'), wx.BITMAP_TYPE_PNG) self.previousArrowButton = wx.BitmapButton(self.displayPanel, 5, previousArrowImg, (50,0), style = wx.NO_BORDER) self.previousArrowButton.SetBackgroundColour(config.backgroundColour) self.previousArrowButton.Bind(wx.EVT_BUTTON, self.OnPreviousArrow, id=5) nextArrowImg = wx.Bitmap(join(config.coreImagesPath,'nextArrow.png'), wx.BITMAP_TYPE_PNG) self.nextArrowButton = wx.BitmapButton(self.displayPanel, 6, nextArrowImg, (650,0), style = wx.NO_BORDER) self.nextArrowButton.SetBackgroundColour(config.backgroundColour) self.nextArrowButton.Bind(wx.EVT_BUTTON, self.OnNextArrow, id=6) bottomMenu.bottomMenu([self.displayPanel, self.menuPanel], parent, self.mainWin, 'twoButton')
def __init__(self, parent, id, mainWin, mainPanel, currentLesson, gameType): self.mainWin = mainWin self.mainPanel = mainPanel self.currentLesson = currentLesson answer, answerList, answerImgList = 0, [], [] self.answerImageList = '' self.gameType = gameType self.displayPanel = wx.Panel(parent, -1, (0, 0), (800, 600)) self.displayPanel.SetBackgroundColour(config.backgroundColour) if (self.currentLesson == "animals" or self.currentLesson == "colour") and self.gameType == "Img": answer, answerImgList = findDifferenceUtils.nextFindDifferenceQuestion( self.currentLesson, self.gameType) answerImgList = resizeImage(answerImgList, 65) if self.currentLesson == "colour": answer, answerImgList = self.rotateImage(answer, answerImgList) else: pass self.answerImageList = findDifferenceImageAnswerList.imageAnswerList( self.displayPanel, answer, answerImgList) elif (self.currentLesson == "kaKha" or self.currentLesson == "aaa") and self.gameType == "Char": answer, answerList = findDifferenceUtils.nextFindDifferenceQuestionWithoutImage( self.currentLesson, self.gameType) self.answerImageList = findDifferenceAnswerList.charAnswerList( self.displayPanel, answer, answerList) elif (self.currentLesson == "kaKha" or self.currentLesson == "aaa") and self.gameType == "Img": answer, answerImgList = findDifferenceUtils.nextFindDifferenceQuestion( self.currentLesson, self.gameType) answerImgList = resizeImage(answerImgList, 65) self.answerImageList = findDifferenceImageAnswerList.imageAnswerList( self.displayPanel, answer, answerImgList) nextQuestionImg = wx.Bitmap( join(config.buttonsPath, 'nextQuestion.png'), wx.BITMAP_TYPE_PNG) self.nextQuestionButton = wx.BitmapButton(self.displayPanel, 4, nextQuestionImg, (460, 400), 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)
def __init__(self, parent, id, mainWin, mainPanel, currentLesson): self.mainWin = mainWin self.mainPanel = mainPanel self.currentLesson = currentLesson self.questionList, self.questionImgList, self.answerList, self.answerNepaliList = nGUtils.nextMatchImageCharQuestion(self.currentLesson) self.displayPanel = wx.Panel(parent, -1, (0, 0), (800, 600)) self.displayPanel.SetBackgroundColour(config.backgroundColour) self.memoryImageCharAnswerList = memoryImageCharAnswerList.memoryImageCharAnswerList(self.displayPanel, self.questionList, self.questionImgList, self.answerList, self.answerNepaliList, self.currentLesson) nextQuestionImg = wx.Bitmap(join(config.buttonsPath,'nextQuestion.png'), wx.BITMAP_TYPE_PNG) self.nextQuestionButton = wx.BitmapButton(self.displayPanel, 4, nextQuestionImg, (460,400), 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)
def __init__(self, parent, id, mainPanel): self.currentPosition = 0 self.mainWin = mainPanel self.currentSSpath = config.colourImagesPath self.blankImg = join(config.coreImagesPath, "blank220.png") self.dataListEnglish = loadData.colourNameEnglish self.dataListNepali = loadData.colourNameNepali self.menuPanel = wx.Panel(parent, -1, (0, 0), (800, 100)) self.menuPanel.SetBackgroundColour(config.backgroundColour) self.displayPanel = wx.Panel(parent, -1, (0, 100), (800, 500)) self.displayPanel.SetBackgroundColour(config.backgroundColour) self.displayType = wx.StaticText(self.displayPanel, -1, messages.colours, (270, 10), style=wx.ALIGN_CENTRE) self.displayType.SetFont(wx.Font(config.fontSize[2], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontName)) self.displayType.SetBackgroundColour(config.backgroundColour) self.displayText = wx.StaticText( self.displayPanel, -1, self.dataListNepali[self.currentPosition], (50, 100), style=wx.ALIGN_CENTRE ) self.displayText.SetFont(wx.Font(config.fontSize[2], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontName)) self.displayText.SetBackgroundColour(config.backgroundColour) currentImg = join(self.currentSSpath, (self.dataListEnglish[self.currentPosition] + ".png")) displayImg = wx.Bitmap(currentImg, wx.BITMAP_TYPE_PNG) self.displayImage = wx.StaticBitmap( self.displayPanel, -1, displayImg, (500, 100), (displayImg.GetWidth(), displayImg.GetHeight()) ) self.displayImage.SetBackgroundColour(config.backgroundColour) previousArrowImg = wx.Bitmap(join(config.coreImagesPath, "previousArrow.png"), wx.BITMAP_TYPE_PNG) self.previousArrowButton = wx.BitmapButton(self.displayPanel, 6, previousArrowImg, (50, 0), style=wx.NO_BORDER) self.previousArrowButton.SetBackgroundColour(config.backgroundColour) self.previousArrowButton.Bind(wx.EVT_BUTTON, self.OnPreviousArrow, id=6) nextArrowImg = wx.Bitmap(join(config.coreImagesPath, "nextArrow.png"), wx.BITMAP_TYPE_PNG) self.nextArrowButton = wx.BitmapButton(self.displayPanel, 7, nextArrowImg, (650, 0), style=wx.NO_BORDER) self.nextArrowButton.SetBackgroundColour(config.backgroundColour) self.nextArrowButton.Bind(wx.EVT_BUTTON, self.OnNextArrow, id=7) bottomMenu.bottomMenu([self.displayPanel, self.menuPanel], parent, self.mainWin, "twoButton")
def __init__(self, parent, id, mainWin, mainPanel, currentLesson): self.mainWin = mainWin self.mainPanel = mainPanel self.currentLesson = currentLesson self.buttonPressed = 20 self.question = '' self.fontSize = config.fontSize[5] temp = 0 self.question, self.answerList, self.totalList = nGUtils.nextCharFillQuestion(self.currentLesson) 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) temp = self.answerList.index(self.question) self.answerList[temp] = u'\u00A4' self.displayText1 = wx.StaticText(self.displayPanel, 1, self.answerList[0], (120, 40), 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.displayText2 = wx.StaticText(self.displayPanel, 2, self.answerList[1], (280, 40), 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.displayText3 = wx.StaticText(self.displayPanel, 3, self.answerList[2], (440, 40), 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.numberAnswerList = numberAnswerList.numberAnswerList(self.displayPanel, self.question, self.totalList) nextQuestionImg = wx.Bitmap(join(config.buttonsPath,'nextQuestion.png'), wx.BITMAP_TYPE_PNG) self.nextQuestionButton = wx.BitmapButton(self.displayPanel, 4, nextQuestionImg, (460,400), 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)
def __init__(self, parent, id, mainWin, mainPanel, currentLesson): self.mainWin = mainWin self.mainPanel = mainPanel self.currentLesson = currentLesson self.answer = '' self.fontSize = config.fontSize[5] self.answer, self.questionList, self.questionImgList = nGUtils.nextSearchAndRecognizeQuestion( self.currentLesson) self.questionImgList = resizeImage(self.questionImgList, 50) if currentLesson == 'colour': self.fontSize = config.fontSize[2] if currentLesson == 'animals': self.fontSize = config.fontSize[2] self.displayPanel = wx.Panel(parent, -1, (0, 0), (800, 600)) self.displayPanel.SetBackgroundColour(config.backgroundColour) self.imageAnswerList = imageAnswerList.imageAnswerList( self.displayPanel, self.answer, self.questionList, self.questionImgList) self.displayText0 = wx.StaticText(self.displayPanel, 1, self.answer, (300, 220), style=wx.ALIGN_CENTRE) self.displayText0.SetFont( wx.Font(self.fontSize, wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontName)) nextQuestionImg = wx.Bitmap( join(config.buttonsPath, 'nextQuestion.png'), wx.BITMAP_TYPE_PNG) self.nextQuestionButton = wx.BitmapButton(self.displayPanel, 4, nextQuestionImg, (460, 400), 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)
def __init__(self, parent, id, mainWin, mainPanel, currentLesson): self.mainWin = mainWin self.mainPanel = mainPanel self.currentLesson = currentLesson self.question = '' self.fontSize = config.fontSize[5] self.question, self.questionImg, self.answerList = nGUtils.nextRecognizeAndSearchQuestion(self.currentLesson) self.displayPanel = wx.Panel(parent, -1, (0, 0), (800, 600)) self.displayPanel.SetBackgroundColour(config.backgroundColour) questionImg = wx.Bitmap(self.questionImg, wx.BITMAP_TYPE_PNG) self.questionImage = wx.StaticBitmap(self.displayPanel, wx.ID_ANY, questionImg, (280,30), (questionImg.GetWidth(), questionImg.GetHeight())) self.questionImage.SetBackgroundColour(config.backgroundColour) self.wordAnswerList = wordAnswerList.wordAnswerList(self.displayPanel, self.question, self.answerList, self.currentLesson) nextQuestionImg = wx.Bitmap(join(config.buttonsPath,'nextQuestion.png'), wx.BITMAP_TYPE_PNG) self.nextQuestionButton = wx.BitmapButton(self.displayPanel, 4, nextQuestionImg, (460,400), 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)
def __init__(self, parent, id, mainPanel): self.englishNumberArray = [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' ] self.nepaliNumberArray = loadDataArithmetic.numberStr self.currentNumber = 0 self.nextNumber = 0 self.numberArithmetic = 0 self.currentLesson = "oneMore" self.mainWin = mainPanel self.menuPanel = wx.Panel(parent, wx.ID_ANY, (0, 0), (800, 100)) self.menuPanel.SetBackgroundColour(config.backgroundColour) oneMoreImg = wx.Bitmap(join(config.buttonsPath, 'oneMore.png'), wx.BITMAP_TYPE_PNG) self.oneMoreButton = wx.BitmapButton(self.menuPanel, wx.ID_ANY, oneMoreImg, (50, 10), style=wx.NO_BORDER) self.oneMoreButton.SetBackgroundColour(config.backgroundColour) self.oneMoreButton.Bind(wx.EVT_BUTTON, self.OnOneMoreButton, id=self.oneMoreButton.GetId()) oneLessImg = wx.Bitmap(join(config.buttonsPath, 'oneLess.png'), wx.BITMAP_TYPE_PNG) self.oneLessButton = wx.BitmapButton(self.menuPanel, wx.ID_ANY, oneLessImg, (200, 10), style=wx.NO_BORDER) self.oneLessButton.SetBackgroundColour(config.backgroundColour) self.oneLessButton.Bind(wx.EVT_BUTTON, self.OnOneLessButton, id=self.oneLessButton.GetId()) simplePlusImg = wx.Bitmap(join(config.buttonsPath, 'simplePlus.png'), wx.BITMAP_TYPE_PNG) self.simplePlusButton = wx.BitmapButton(self.menuPanel, wx.ID_ANY, simplePlusImg, (350, 10), style=wx.NO_BORDER) self.simplePlusButton.SetBackgroundColour(config.backgroundColour) self.simplePlusButton.Bind(wx.EVT_BUTTON, self.OnSimplePlusButton, id=self.simplePlusButton.GetId()) simpleMinusImg = wx.Bitmap(join(config.buttonsPath, 'simpleMinus.png'), wx.BITMAP_TYPE_PNG) self.simpleMinusButton = wx.BitmapButton(self.menuPanel, wx.ID_ANY, simpleMinusImg, (500, 10), style=wx.NO_BORDER) self.simpleMinusButton.SetBackgroundColour(config.backgroundColour) self.simpleMinusButton.Bind(wx.EVT_BUTTON, self.OnSimpleMinusButton, id=self.simpleMinusButton.GetId()) self.displayPanel = wx.Panel(parent, wx.ID_ANY, (0, 100), (800, 500)) self.displayPanel.SetBackgroundColour(config.backgroundColour) self.displayLabel0 = wx.StaticText(self.displayPanel, wx.ID_ANY, messages.number, (80, 110), style=wx.ALIGN_CENTRE) self.displayLabel0.SetFont( wx.Font(config.fontSize[0], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontName)) self.displayLabel1 = wx.StaticText(self.displayPanel, wx.ID_ANY, messages.oneMoreLabel, (320, 110), style=wx.ALIGN_CENTRE) self.displayLabel1.SetFont( wx.Font(config.fontSize[0], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontName)) self.displayLabel2 = wx.StaticText(self.displayPanel, wx.ID_ANY, messages.upNumberLabel, (540, 110), style=wx.ALIGN_CENTRE) self.displayLabel2.SetFont( wx.Font(config.fontSize[0], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontName)) self.nextNumber, self.currentNumber = arithmeticUtils.nextNumber( self.currentLesson, self.currentNumber) self.displayLabel3 = wx.StaticText(self.displayPanel, wx.ID_ANY, self.mreplace( str(self.currentNumber), "engToNep"), (80, 160), style=wx.ALIGN_CENTRE) self.displayLabel3.SetFont( wx.Font(config.fontSize[0], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontNameArithmetic)) self.displayLabel4 = wx.StaticText(self.displayPanel, wx.ID_ANY, " + ", (220, 160), style=wx.ALIGN_CENTRE) self.displayLabel4.SetFont( wx.Font(config.fontSize[0], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontNameArithmetic)) self.displayLabel5 = wx.StaticText(self.displayPanel, wx.ID_ANY, self.mreplace(str(1), "engToNep"), (360, 160), style=wx.ALIGN_CENTRE) self.displayLabel5.SetFont( wx.Font(config.fontSize[0], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontNameArithmetic)) self.displayLabel6 = wx.StaticText(self.displayPanel, wx.ID_ANY, " = ", (470, 160), style=wx.ALIGN_CENTRE) self.displayLabel6.SetFont( wx.Font(config.fontSize[0], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontNameArithmetic)) self.displayLabel7 = wx.StaticText(self.displayPanel, wx.ID_ANY, self.mreplace( str(self.nextNumber), "engToNep"), (580, 160), style=wx.ALIGN_CENTRE) self.displayLabel7.SetFont( wx.Font(config.fontSize[0], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontNameArithmetic)) ###Display the image based arithmetic currentImg = arithmeticUtils.nextImage(self.currentLesson, self.currentNumber) nextImg = arithmeticUtils.nextImage(self.currentLesson, self.nextNumber) currentNumberImg = wx.BitmapFromImage(currentImg) self.currentNumberImage = wx.StaticBitmap( self.displayPanel, -1, currentNumberImg, (50, 230), (currentNumberImg.GetWidth(), currentNumberImg.GetHeight())) self.arithmeticSignLabel = wx.StaticText(self.displayPanel, wx.ID_ANY, " + ", (220, 230), style=wx.ALIGN_CENTRE) self.arithmeticSignLabel.SetFont( wx.Font(config.fontSize[0], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontNameArithmetic)) nextImg = arithmeticUtils.nextImage(self.currentLesson, 1) numberArithmeticImg = wx.BitmapFromImage(nextImg) self.numberArithmeticImage = wx.StaticBitmap( self.displayPanel, -1, numberArithmeticImg, (360, 230), (numberArithmeticImg.GetWidth(), numberArithmeticImg.GetHeight())) self.equalToLabel = wx.StaticText(self.displayPanel, wx.ID_ANY, " = ", (470, 230), style=wx.ALIGN_CENTRE) self.equalToLabel.SetFont( wx.Font(config.fontSize[0], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontNameArithmetic)) nextNumberImg = wx.BitmapFromImage(nextImg) self.nextNumberImage = wx.StaticBitmap( self.displayPanel, -1, nextNumberImg, (570, 230), (nextNumberImg.GetWidth(), nextNumberImg.GetHeight())) self.displayLabel8 = wx.StaticText(self.displayPanel, wx.ID_ANY, loadDataArithmetic.numberNames[int( self.currentNumber)], (80, 330), style=wx.ALIGN_CENTRE) self.displayLabel8.SetFont( wx.Font(config.fontSize[0], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontName)) self.displayLabel9 = wx.StaticText(self.displayPanel, wx.ID_ANY, " + ", (220, 310), style=wx.ALIGN_CENTRE) self.displayLabel9.SetFont( wx.Font(config.fontSize[0], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontNameArithmetic)) self.displayLabel10 = wx.StaticText(self.displayPanel, wx.ID_ANY, loadDataArithmetic.numberNames[1], (360, 330), style=wx.ALIGN_CENTRE) self.displayLabel10.SetFont( wx.Font(config.fontSize[0], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontName)) self.displayLabel11 = wx.StaticText(self.displayPanel, wx.ID_ANY, " = ", (470, 310), style=wx.ALIGN_CENTRE) self.displayLabel11.SetFont( wx.Font(config.fontSize[0], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontNameArithmetic)) self.displayLabel12 = wx.StaticText(self.displayPanel, wx.ID_ANY, loadDataArithmetic.numberNames[int( self.nextNumber)], (580, 330), style=wx.ALIGN_CENTRE) self.displayLabel12.SetFont( wx.Font(config.fontSize[0], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontName)) ###End of image based arithmetic previousArrowImg = wx.Bitmap( join(config.coreImagesPath, 'previousArrow.png'), wx.BITMAP_TYPE_PNG) self.previousArrowButton = wx.BitmapButton(self.displayPanel, wx.ID_ANY, previousArrowImg, (50, 0), style=wx.NO_BORDER) self.previousArrowButton.SetBackgroundColour(config.backgroundColour) self.previousArrowButton.Bind(wx.EVT_BUTTON, self.OnPreviousArrow, id=self.previousArrowButton.GetId()) nextArrowImg = wx.Bitmap(join(config.coreImagesPath, 'nextArrow.png'), wx.BITMAP_TYPE_PNG) self.nextArrowButton = wx.BitmapButton(self.displayPanel, wx.ID_ANY, nextArrowImg, (650, 0), style=wx.NO_BORDER) self.nextArrowButton.SetBackgroundColour(config.backgroundColour) self.nextArrowButton.Bind(wx.EVT_BUTTON, self.OnNextArrow, id=self.nextArrowButton.GetId()) bottomMenu.bottomMenu([self.displayPanel, self.menuPanel], parent, self.mainWin, 'twoButton')
def __init__(self, parent, id, mainPanel): self.englishNumberArray = ['0','1','2','3','4','5','6','7','8','9'] self.nepaliNumberArray = loadDataArithmetic.numberStr self.currentNumber = 0 self.nextNumber = 0 self.numberArithmetic = 0 self.currentLesson = "oneMore" self.mainWin = mainPanel self.menuPanel = wx.Panel(parent, wx.ID_ANY, (0, 0), (800, 100)) self.menuPanel.SetBackgroundColour(config.backgroundColour) oneMoreImg = wx.Bitmap(join(config.buttonsPath,'oneMore.png'), wx.BITMAP_TYPE_PNG) self.oneMoreButton = wx.BitmapButton(self.menuPanel, wx.ID_ANY, oneMoreImg, (5,10), style = wx.NO_BORDER) self.oneMoreButton.SetBackgroundColour(config.backgroundColour) self.oneMoreButton.Bind(wx.EVT_BUTTON, self.OnOneMoreButton, id=self.oneMoreButton.GetId()) oneLessImg = wx.Bitmap(join(config.buttonsPath,'oneLess.png'), wx.BITMAP_TYPE_PNG) self.oneLessButton = wx.BitmapButton(self.menuPanel, wx.ID_ANY, oneLessImg, (135,10), style = wx.NO_BORDER) self.oneLessButton.SetBackgroundColour(config.backgroundColour) self.oneLessButton.Bind(wx.EVT_BUTTON, self.OnOneLessButton, id=self.oneLessButton.GetId()) moreLessImg = wx.Bitmap(join(config.buttonsPath,'moreLess.png'), wx.BITMAP_TYPE_PNG) self.moreLessButton = wx.BitmapButton(self.menuPanel, wx.ID_ANY, moreLessImg, (265,10), style = wx.NO_BORDER) self.moreLessButton.SetBackgroundColour(config.backgroundColour) self.moreLessButton.Bind(wx.EVT_BUTTON, self.OnMoreLessButton, id=self.moreLessButton.GetId()) bigSmallImg = wx.Bitmap(join(config.buttonsPath,'bigSmall.png'), wx.BITMAP_TYPE_PNG) self.bigSmallButton = wx.BitmapButton(self.menuPanel, wx.ID_ANY, bigSmallImg, (400,10), style = wx.NO_BORDER) self.bigSmallButton.SetBackgroundColour(config.backgroundColour) self.bigSmallButton.Bind(wx.EVT_BUTTON, self.OnBigSmallButton, id=self.bigSmallButton.GetId()) simplePlusImg = wx.Bitmap(join(config.buttonsPath,'simplePlus.png'), wx.BITMAP_TYPE_PNG) self.simplePlusButton = wx.BitmapButton(self.menuPanel, wx.ID_ANY, simplePlusImg, (535,10), style = wx.NO_BORDER) self.simplePlusButton.SetBackgroundColour(config.backgroundColour) self.simplePlusButton.Bind(wx.EVT_BUTTON, self.OnSimplePlusButton, id=self.simplePlusButton.GetId()) simpleMinusImg = wx.Bitmap(join(config.buttonsPath,'simpleMinus.png'), wx.BITMAP_TYPE_PNG) self.simpleMinusButton = wx.BitmapButton(self.menuPanel, wx.ID_ANY, simpleMinusImg, (665,10), style = wx.NO_BORDER) self.simpleMinusButton.SetBackgroundColour(config.backgroundColour) self.simpleMinusButton.Bind(wx.EVT_BUTTON, self.OnSimpleMinusButton, id=self.simpleMinusButton.GetId()) self.displayPanel = wx.Panel(parent, wx.ID_ANY, (0, 100), (800, 500)) self.displayPanel.SetBackgroundColour(config.backgroundColour) self.displayLabel0 = wx.StaticText(self.displayPanel, wx.ID_ANY, messages.number, (80, 110), style = wx.ALIGN_CENTRE) self.displayLabel0.SetFont(wx.Font(config.fontSize[0], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontName)) self.displayLabel1 = wx.StaticText(self.displayPanel, wx.ID_ANY, messages.oneMoreLabel, (320, 110), style = wx.ALIGN_CENTRE) self.displayLabel1.SetFont(wx.Font(config.fontSize[0], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontName)) self.displayLabel2 = wx.StaticText(self.displayPanel, wx.ID_ANY, messages.upNumberLabel, (540, 110), style = wx.ALIGN_CENTRE) self.displayLabel2.SetFont(wx.Font(config.fontSize[0], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontName)) self.nextNumber, self.currentNumber = arithmeticUtils.nextNumber(self.currentLesson, self.currentNumber) self.displayLabel3 = wx.StaticText(self.displayPanel, wx.ID_ANY, self.mreplace(str(self.currentNumber), "engToNep"), (80, 160), style = wx.ALIGN_CENTRE) self.displayLabel3.SetFont(wx.Font(config.fontSize[0], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontNameArithmetic)) self.displayLabel4 = wx.StaticText(self.displayPanel, wx.ID_ANY, " + ", (220, 160), style = wx.ALIGN_CENTRE) self.displayLabel4.SetFont(wx.Font(config.fontSize[0], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontNameArithmetic)) self.displayLabel5 = wx.StaticText(self.displayPanel, wx.ID_ANY, self.mreplace(str(1), "engToNep"), (360, 160), style = wx.ALIGN_CENTRE) self.displayLabel5.SetFont(wx.Font(config.fontSize[0], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontNameArithmetic)) self.displayLabel6 = wx.StaticText(self.displayPanel, wx.ID_ANY, " = ", (470, 160), style = wx.ALIGN_CENTRE) self.displayLabel6.SetFont(wx.Font(config.fontSize[0], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontNameArithmetic)) self.displayLabel7 = wx.StaticText(self.displayPanel, wx.ID_ANY, self.mreplace(str(self.nextNumber), "engToNep"), (580, 160), style = wx.ALIGN_CENTRE) self.displayLabel7.SetFont(wx.Font(config.fontSize[0], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontNameArithmetic)) ###Display the image based arithmetic currentImg = arithmeticUtils.nextImage(self.currentLesson, self.currentNumber) nextImg = arithmeticUtils.nextImage(self.currentLesson, self.nextNumber) currentNumberImg = wx.BitmapFromImage(currentImg) self.currentNumberImage = wx.StaticBitmap(self.displayPanel, -1, currentNumberImg, (50,230), (currentNumberImg.GetWidth(), currentNumberImg.GetHeight())) self.arithmeticSignLabel = wx.StaticText(self.displayPanel, wx.ID_ANY, " + ", (220, 230), style = wx.ALIGN_CENTRE) self.arithmeticSignLabel.SetFont(wx.Font(config.fontSize[0], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontNameArithmetic)) nextImg = arithmeticUtils.nextImage(self.currentLesson, 1) numberArithmeticImg = wx.BitmapFromImage(nextImg) self.numberArithmeticImage = wx.StaticBitmap(self.displayPanel, -1, numberArithmeticImg, (360,230), (numberArithmeticImg.GetWidth(), numberArithmeticImg.GetHeight())) self.equalToLabel = wx.StaticText(self.displayPanel, wx.ID_ANY, " = ", (470, 230), style = wx.ALIGN_CENTRE) self.equalToLabel.SetFont(wx.Font(config.fontSize[0], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontNameArithmetic)) nextNumberImg = wx.BitmapFromImage(nextImg) self.nextNumberImage = wx.StaticBitmap(self.displayPanel, -1, nextNumberImg, (570,230), (nextNumberImg.GetWidth(), nextNumberImg.GetHeight())) self.displayLabel8 = wx.StaticText(self.displayPanel, wx.ID_ANY, loadDataArithmetic.numberNames[int(self.currentNumber)], (80, 330), style = wx.ALIGN_CENTRE) self.displayLabel8.SetFont(wx.Font(config.fontSize[0], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontName)) self.displayLabel9 = wx.StaticText(self.displayPanel, wx.ID_ANY, " + ", (220, 310), style = wx.ALIGN_CENTRE) self.displayLabel9.SetFont(wx.Font(config.fontSize[0], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontNameArithmetic)) self.displayLabel10 = wx.StaticText(self.displayPanel, wx.ID_ANY, loadDataArithmetic.numberNames[1], (360, 330), style = wx.ALIGN_CENTRE) self.displayLabel10.SetFont(wx.Font(config.fontSize[0], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontName)) self.displayLabel11 = wx.StaticText(self.displayPanel, wx.ID_ANY, " = ", (470, 310), style = wx.ALIGN_CENTRE) self.displayLabel11.SetFont(wx.Font(config.fontSize[0], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontNameArithmetic)) self.displayLabel12 = wx.StaticText(self.displayPanel, wx.ID_ANY, loadDataArithmetic.numberNames[int(self.nextNumber)], (580, 330), style = wx.ALIGN_CENTRE) self.displayLabel12.SetFont(wx.Font(config.fontSize[0], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontName)) ###End of image based arithmetic previousArrowImg = wx.Bitmap(join(config.coreImagesPath,'previousArrow.png'), wx.BITMAP_TYPE_PNG) self.previousArrowButton = wx.BitmapButton(self.displayPanel, wx.ID_ANY, previousArrowImg, (50,0), style = wx.NO_BORDER) self.previousArrowButton.SetBackgroundColour(config.backgroundColour) self.previousArrowButton.Bind(wx.EVT_BUTTON, self.OnPreviousArrow, id=self.previousArrowButton.GetId()) nextArrowImg = wx.Bitmap(join(config.coreImagesPath,'nextArrow.png'), wx.BITMAP_TYPE_PNG) self.nextArrowButton = wx.BitmapButton(self.displayPanel, wx.ID_ANY, nextArrowImg, (650,0), style = wx.NO_BORDER) self.nextArrowButton.SetBackgroundColour(config.backgroundColour) self.nextArrowButton.Bind(wx.EVT_BUTTON, self.OnNextArrow, id=self.nextArrowButton.GetId()) bottomMenu.bottomMenu([self.displayPanel, self.menuPanel], parent, self.mainWin, 'twoButton')
def __init__(self, parent, id, mainPanel, currentLesson): self.currentLesson = currentLesson self.charPosition = 0 self.mainWin = mainPanel self.parent = parent self.imgInfo = [ 0, 0 ] #track img displayed. [0] for letter-img and [1] for within same letter self.blankImg = join(config.coreImagesPath, 'blank.png') buttonImages = [] if self.currentLesson == "oneTwo": buttonImages.append('numberNumber.png') buttonImages.append('numberImage.png') buttonImages.append('imageNumber.png') buttonImages.append('numberFill.png') buttonImages.append('countClick.png') buttonImages.append('searchAndRecognize.png') buttonImages.append('') buttonImages.append('') buttonImages.append('') buttonImages.append('matchPairs.png') buttonImages.append('memoryPairs.png') elif self.currentLesson == "kaKha": buttonImages.append('letterLetter.png') buttonImages.append('letterImage.png') buttonImages.append('imageLetter.png') buttonImages.append('') buttonImages.append('') buttonImages.append('searchAndRecognize.png') buttonImages.append('') buttonImages.append('findDifferenceChar.png') buttonImages.append('findDifference.png') buttonImages.append('matchPairs.png') buttonImages.append('memoryPairs.png') elif self.currentLesson == "aaa": buttonImages.append('letterLetter.png') buttonImages.append('letterImage.png') buttonImages.append('imageLetter.png') buttonImages.append('') buttonImages.append('') buttonImages.append('searchAndRecognize.png') buttonImages.append('') buttonImages.append('findDifferenceChar.png') buttonImages.append('findDifference.png') buttonImages.append('matchPairs.png') buttonImages.append('memoryPairs.png') elif self.currentLesson == "time": buttonImages.append('') buttonImages.append('timeImage.png') buttonImages.append('timeChar.png') buttonImages.append('') buttonImages.append('') buttonImages.append('searchAndRecognize.png') buttonImages.append('recognizeAndSearch.png') buttonImages.append('') buttonImages.append('') buttonImages.append('matchPairs.png') buttonImages.append('memoryPairs.png') self.mainPanel = wx.Panel(parent, -1, (0, 0), (800, 600)) self.mainPanel.SetBackgroundColour(config.backgroundColour) if buttonImages[0] != '': numberNumberImg = wx.Bitmap( join(config.buttonsPath, buttonImages[0]), wx.BITMAP_TYPE_PNG) self.numberNumberButton = wx.BitmapButton(self.mainPanel, 1, numberNumberImg, (40, 100), style=wx.NO_BORDER) self.numberNumberButton.SetBackgroundColour( config.backgroundColour) self.numberNumberButton.Bind(wx.EVT_BUTTON, self.OnCharCharGame, id=1) else: pass if buttonImages[1] != '': numberImageImg = wx.Bitmap( join(config.buttonsPath, buttonImages[1]), wx.BITMAP_TYPE_PNG) self.numberImageButton = wx.BitmapButton(self.mainPanel, 2, numberImageImg, (300, 100), style=wx.NO_BORDER) self.numberImageButton.SetBackgroundColour(config.backgroundColour) self.numberImageButton.Bind(wx.EVT_BUTTON, self.OnCharImageGame, id=2) else: pass if buttonImages[2] != '': imageNumberImg = wx.Bitmap( join(config.buttonsPath, buttonImages[2]), wx.BITMAP_TYPE_PNG) self.imageNumberButton = wx.BitmapButton(self.mainPanel, 3, imageNumberImg, (560, 100), style=wx.NO_BORDER) self.imageNumberButton.SetBackgroundColour(config.backgroundColour) self.imageNumberButton.Bind(wx.EVT_BUTTON, self.OnImageCharGame, id=3) else: pass if buttonImages[3] != '': numberFillImg = wx.Bitmap( join(config.buttonsPath, buttonImages[3]), wx.BITMAP_TYPE_PNG) self.numberFillButton = wx.BitmapButton(self.mainPanel, 4, numberFillImg, (40, 200), style=wx.NO_BORDER) self.numberFillButton.SetBackgroundColour(config.backgroundColour) self.numberFillButton.Bind(wx.EVT_BUTTON, self.OnNumberFillGame, id=4) else: pass if buttonImages[4] != '': countClickImg = wx.Bitmap( join(config.buttonsPath, buttonImages[4]), wx.BITMAP_TYPE_PNG) self.countClickButton = wx.BitmapButton(self.mainPanel, 5, countClickImg, (300, 200), style=wx.NO_BORDER) self.countClickButton.SetBackgroundColour(config.backgroundColour) self.countClickButton.Bind(wx.EVT_BUTTON, self.OnCountClickGame, id=5) else: pass if buttonImages[5] != '': searchAndRecognizeImg = wx.Bitmap( join(config.buttonsPath, buttonImages[5]), wx.BITMAP_TYPE_PNG) self.searchAndRecognizeButton = wx.BitmapButton( self.mainPanel, 6, searchAndRecognizeImg, (560, 200), style=wx.NO_BORDER) self.searchAndRecognizeButton.SetBackgroundColour( config.backgroundColour) self.searchAndRecognizeButton.Bind(wx.EVT_BUTTON, self.OnSearchAndRecognizeGame, id=6) else: pass if buttonImages[6] != '': recognizeAndSearchImg = wx.Bitmap( join(config.buttonsPath, buttonImages[6]), wx.BITMAP_TYPE_PNG) self.recognizeAndSearchButton = wx.BitmapButton( self.mainPanel, 7, recognizeAndSearchImg, (300, 200), style=wx.NO_BORDER) self.recognizeAndSearchButton.SetBackgroundColour( config.backgroundColour) self.recognizeAndSearchButton.Bind(wx.EVT_BUTTON, self.OnRecognizeAndSearchGame, id=7) else: pass if buttonImages[7] != '': findDifferenceCharImg = wx.Bitmap( join(config.buttonsPath, buttonImages[7]), wx.BITMAP_TYPE_PNG) self.findDifferenceCharButton = wx.BitmapButton( self.mainPanel, 8, findDifferenceCharImg, (40, 200), style=wx.NO_BORDER) self.findDifferenceCharButton.SetBackgroundColour( config.backgroundColour) self.findDifferenceCharButton.Bind(wx.EVT_BUTTON, self.OnFindDifferenceCharGame, id=8) else: pass if buttonImages[8] != '': findDifferenceImg = wx.Bitmap( join(config.buttonsPath, buttonImages[8]), wx.BITMAP_TYPE_PNG) self.findDifferenceButton = wx.BitmapButton(self.mainPanel, 9, findDifferenceImg, (300, 200), style=wx.NO_BORDER) self.findDifferenceButton.SetBackgroundColour( config.backgroundColour) self.findDifferenceButton.Bind(wx.EVT_BUTTON, self.OnFindDifferenceGame, id=9) else: pass if buttonImages[9] != '': matchPairsImg = wx.Bitmap( join(config.buttonsPath, buttonImages[9]), wx.BITMAP_TYPE_PNG) self.matchPairsButton = wx.BitmapButton(self.mainPanel, 10, matchPairsImg, (40, 300), style=wx.NO_BORDER) self.matchPairsButton.SetBackgroundColour(config.backgroundColour) self.matchPairsButton.Bind(wx.EVT_BUTTON, self.OnMatchPairsGame, id=10) else: pass if buttonImages[10] != '': memoryPairsImg = wx.Bitmap( join(config.buttonsPath, buttonImages[10]), wx.BITMAP_TYPE_PNG) self.memoryPairsButton = wx.BitmapButton(self.mainPanel, 11, memoryPairsImg, (300, 300), style=wx.NO_BORDER) self.memoryPairsButton.SetBackgroundColour(config.backgroundColour) self.memoryPairsButton.Bind(wx.EVT_BUTTON, self.OnMemoryPairsGame, id=11) else: pass bottomMenu.bottomMenu([self.mainPanel], parent, self.mainWin, 'twoButton')
def __init__(self, parent, id, mainWin, mainPanel, currentLesson): self.mainWin = mainWin self.mainPanel = mainPanel self.currentLesson = currentLesson self.buttonPressed = 20 self.question = '' self.fontSize = config.fontSize[5] temp = 0 self.question, self.answerList, self.totalList = nGUtils.nextCharFillQuestion( self.currentLesson) 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) temp = self.answerList.index(self.question) self.answerList[temp] = u'\u00A4' self.displayText1 = wx.StaticText(self.displayPanel, 1, self.answerList[0], (120, 40), 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.displayText2 = wx.StaticText(self.displayPanel, 2, self.answerList[1], (280, 40), 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.displayText3 = wx.StaticText(self.displayPanel, 3, self.answerList[2], (440, 40), 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.numberAnswerList = numberAnswerList.numberAnswerList( self.displayPanel, self.question, self.totalList) nextQuestionImg = wx.Bitmap( join(config.buttonsPath, 'nextQuestion.png'), wx.BITMAP_TYPE_PNG) self.nextQuestionButton = wx.BitmapButton(self.displayPanel, 4, nextQuestionImg, (460, 400), 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)
def __init__(self, parent, id, mainPanel): self.currentLesson = "kaKha" self.charPosition = 0 self.mainWin = mainPanel self.imgInfo = [ 0, 0 ] #track img displayed. [0] for letter-img and [1] for within same letter self.blankImg = join(config.coreImagesPath, 'blank.png') currentChar, self.charPosition = eUtils.nextLetter( self.currentLesson, wx.ID_ANY) imgToDisplay, imgNameToDisplay, self.imgInfo = eUtils.nextImage( self.currentLesson, self.imgInfo) self.menuPanel = wx.Panel(parent, wx.ID_ANY, (0, 0), (800, 100)) self.menuPanel.SetBackgroundColour(config.backgroundColour) self.menuPanel.SetFocus() self.displayPanel = wx.Panel(parent, wx.ID_ANY, (0, 100), (800, 500)) self.displayPanel.SetBackgroundColour(config.backgroundColour) self.displayPanel.SetFocus() aaaImg = wx.Bitmap(join(config.buttonsPath, 'aaa.png'), wx.BITMAP_TYPE_PNG) self.aaaButton = wx.BitmapButton(self.menuPanel, wx.ID_ANY, aaaImg, (50, 10), style=wx.NO_BORDER) self.aaaButton.SetBackgroundColour(config.backgroundColour) self.aaaButton.Bind(wx.EVT_BUTTON, self.OnAaaLetters, id=self.aaaButton.GetId()) kaKhaImg = wx.Bitmap(join(config.buttonsPath, 'kakha.png'), wx.BITMAP_TYPE_PNG) self.kaKhaButton = wx.BitmapButton(self.menuPanel, wx.ID_ANY, kaKhaImg, (200, 10), style=wx.NO_BORDER) self.kaKhaButton.SetBackgroundColour(config.backgroundColour) self.kaKhaButton.Bind(wx.EVT_BUTTON, self.OnKaKhaLetters, id=self.kaKhaButton.GetId()) baraKhariImg = wx.Bitmap(join(config.buttonsPath, 'baraKhari.png'), wx.BITMAP_TYPE_PNG) self.baraKhariButton = wx.BitmapButton(self.menuPanel, wx.ID_ANY, baraKhariImg, (350, 10), style=wx.NO_BORDER) self.baraKhariButton.SetBackgroundColour(config.backgroundColour) self.baraKhariButton.Bind(wx.EVT_BUTTON, self.OnBaraKhariLetters, id=self.baraKhariButton.GetId()) oneTwoImg = wx.Bitmap(join(config.buttonsPath, '12.png'), wx.BITMAP_TYPE_PNG) self.oneTwoButton = wx.BitmapButton(self.menuPanel, wx.ID_ANY, oneTwoImg, (500, 10), style=wx.NO_BORDER) self.oneTwoButton.SetBackgroundColour(config.backgroundColour) self.oneTwoButton.Bind(wx.EVT_BUTTON, self.OnOneTwoLetters, id=self.oneTwoButton.GetId()) elevenTwelveImg = wx.Bitmap( join(config.buttonsPath, 'elevenTwelve.png'), wx.BITMAP_TYPE_PNG) self.elevenTwelveButton = wx.BitmapButton(self.menuPanel, wx.ID_ANY, elevenTwelveImg, (650, 10), style=wx.NO_BORDER) self.elevenTwelveButton.SetBackgroundColour(config.backgroundColour) self.elevenTwelveButton.Bind(wx.EVT_BUTTON, self.OnElevenTwelveLetters, id=self.elevenTwelveButton.GetId()) self.displayType = wx.StaticText(self.displayPanel, wx.ID_ANY, messages.byanjanBarna, (270, 10), style=wx.ALIGN_CENTRE) self.displayType.SetFont( wx.Font(config.fontSize[2], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontName)) self.displayText = wx.StaticText(self.displayPanel, wx.ID_ANY, currentChar, (50, 90), style=wx.ALIGN_CENTRE) self.displayText.SetFont( wx.Font(config.fontSize[6], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontName)) self.displayName = wx.StaticText(self.displayPanel, wx.ID_ANY, imgNameToDisplay, (600, 110), style=wx.ALIGN_CENTRE) self.displayName.SetFont( wx.Font(config.fontSize[0], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontName)) displayImg = wx.Bitmap(imgToDisplay, wx.BITMAP_TYPE_PNG) self.displayImage = wx.StaticBitmap( self.displayPanel, wx.ID_ANY, displayImg, (500, 150), (displayImg.GetWidth(), displayImg.GetHeight())) previousArrowImg = wx.Bitmap( join(config.coreImagesPath, 'previousArrow.png'), wx.BITMAP_TYPE_PNG) self.previousArrowButton = wx.BitmapButton(self.displayPanel, wx.ID_ANY, previousArrowImg, (50, 0), style=wx.NO_BORDER) self.previousArrowButton.SetBackgroundColour(config.backgroundColour) self.previousArrowButton.Bind(wx.EVT_BUTTON, self.OnPreviousArrow, id=self.previousArrowButton.GetId()) nextArrowImg = wx.Bitmap(join(config.coreImagesPath, 'nextArrow.png'), wx.BITMAP_TYPE_PNG) self.nextArrowButton = wx.BitmapButton(self.displayPanel, wx.ID_ANY, nextArrowImg, (650, 0), style=wx.NO_BORDER) self.nextArrowButton.SetBackgroundColour(config.backgroundColour) self.nextArrowButton.Bind(wx.EVT_BUTTON, self.OnNextArrow, id=self.nextArrowButton.GetId()) nextWordImg = wx.Bitmap(join(config.buttonsPath, 'vocabButton.png'), wx.BITMAP_TYPE_PNG) self.nextWordButton = wx.BitmapButton(self.displayPanel, wx.ID_ANY, nextWordImg, (500, 320), style=wx.NO_BORDER) self.nextWordButton.SetBackgroundColour(config.backgroundColour) self.nextWordButton.Bind(wx.EVT_BUTTON, self.OnNextWord, id=self.nextWordButton.GetId()) bottomMenu.bottomMenu([self.displayPanel, self.menuPanel], parent, self.mainWin, 'twoButton')
def __init__(self, parent, id, mainPanel, currentLesson): self.currentLesson = currentLesson self.charPosition = 0 self.mainWin = mainPanel self.parent = parent self.imgInfo = [0,0] #track img displayed. [0] for letter-img and [1] for within same letter self.blankImg = join(config.coreImagesPath, 'blank.png') buttonImages = [] if self.currentLesson == "oneTwo": buttonImages.append('numberNumber.png') buttonImages.append('numberImage.png') buttonImages.append('imageNumber.png') buttonImages.append('numberFill.png') buttonImages.append('countClick.png') buttonImages.append('searchAndRecognize.png') buttonImages.append('') buttonImages.append('') buttonImages.append('') buttonImages.append('matchPairs.png') elif self.currentLesson == "kaKha": buttonImages.append('letterLetter.png') buttonImages.append('letterImage.png') buttonImages.append('imageLetter.png') buttonImages.append('') buttonImages.append('') buttonImages.append('searchAndRecognize.png') buttonImages.append('') buttonImages.append('findDifferenceChar.png') buttonImages.append('findDifference.png') buttonImages.append('matchPairs.png') elif self.currentLesson == "aaa": buttonImages.append('letterLetter.png') buttonImages.append('letterImage.png') buttonImages.append('imageLetter.png') buttonImages.append('') buttonImages.append('') buttonImages.append('searchAndRecognize.png') buttonImages.append('') buttonImages.append('findDifferenceChar.png') buttonImages.append('findDifference.png') buttonImages.append('matchPairs.png') elif self.currentLesson == "time": buttonImages.append('') buttonImages.append('timeImage.png') buttonImages.append('timeChar.png') buttonImages.append('') buttonImages.append('') buttonImages.append('searchAndRecognize.png') buttonImages.append('recognizeAndSearch.png') buttonImages.append('') buttonImages.append('') buttonImages.append('matchPairs.png') self.mainPanel = wx.Panel(parent, -1, (0, 0), (800, 600)) self.mainPanel.SetBackgroundColour(config.backgroundColour) if buttonImages[0] != '': numberNumberImg = wx.Bitmap(join(config.buttonsPath, buttonImages[0]), wx.BITMAP_TYPE_PNG) self.numberNumberButton = wx.BitmapButton(self.mainPanel, 1, numberNumberImg, (40,100), style = wx.NO_BORDER) self.numberNumberButton.SetBackgroundColour(config.backgroundColour) self.numberNumberButton.Bind(wx.EVT_BUTTON, self.OnCharCharGame, id=1) else: pass if buttonImages[1] != '': numberImageImg = wx.Bitmap(join(config.buttonsPath, buttonImages[1]), wx.BITMAP_TYPE_PNG) self.numberImageButton = wx.BitmapButton(self.mainPanel, 2, numberImageImg, (300,100), style = wx.NO_BORDER) self.numberImageButton.SetBackgroundColour(config.backgroundColour) self.numberImageButton.Bind(wx.EVT_BUTTON, self.OnCharImageGame, id=2) else: pass if buttonImages[2] != '': imageNumberImg = wx.Bitmap(join(config.buttonsPath, buttonImages[2]), wx.BITMAP_TYPE_PNG) self.imageNumberButton = wx.BitmapButton(self.mainPanel, 3, imageNumberImg, (560,100), style = wx.NO_BORDER) self.imageNumberButton.SetBackgroundColour(config.backgroundColour) self.imageNumberButton.Bind(wx.EVT_BUTTON, self.OnImageCharGame, id=3) else: pass if buttonImages[3] != '': numberFillImg = wx.Bitmap(join(config.buttonsPath, buttonImages[3]), wx.BITMAP_TYPE_PNG) self.numberFillButton = wx.BitmapButton(self.mainPanel, 4, numberFillImg, (40,200), style = wx.NO_BORDER) self.numberFillButton.SetBackgroundColour(config.backgroundColour) self.numberFillButton.Bind(wx.EVT_BUTTON, self.OnNumberFillGame, id=4) else: pass if buttonImages[4] != '': countClickImg = wx.Bitmap(join(config.buttonsPath, buttonImages[4]), wx.BITMAP_TYPE_PNG) self.countClickButton = wx.BitmapButton(self.mainPanel, 5, countClickImg, (300,200), style = wx.NO_BORDER) self.countClickButton.SetBackgroundColour(config.backgroundColour) self.countClickButton.Bind(wx.EVT_BUTTON, self.OnCountClickGame, id=5) else: pass if buttonImages[5] != '': searchAndRecognizeImg = wx.Bitmap(join(config.buttonsPath, buttonImages[5]), wx.BITMAP_TYPE_PNG) self.searchAndRecognizeButton = wx.BitmapButton(self.mainPanel, 6, searchAndRecognizeImg, (560,200), style = wx.NO_BORDER) self.searchAndRecognizeButton.SetBackgroundColour(config.backgroundColour) self.searchAndRecognizeButton.Bind(wx.EVT_BUTTON, self.OnSearchAndRecognizeGame, id=6) else: pass if buttonImages[6] != '': recognizeAndSearchImg = wx.Bitmap(join(config.buttonsPath, buttonImages[6]), wx.BITMAP_TYPE_PNG) self.recognizeAndSearchButton = wx.BitmapButton(self.mainPanel, 7, recognizeAndSearchImg, (300,200), style = wx.NO_BORDER) self.recognizeAndSearchButton.SetBackgroundColour(config.backgroundColour) self.recognizeAndSearchButton.Bind(wx.EVT_BUTTON, self.OnRecognizeAndSearchGame, id=7) else: pass if buttonImages[7] != '': findDifferenceCharImg = wx.Bitmap(join(config.buttonsPath, buttonImages[7]), wx.BITMAP_TYPE_PNG) self.findDifferenceCharButton = wx.BitmapButton(self.mainPanel, 8, findDifferenceCharImg, (40,200), style = wx.NO_BORDER) self.findDifferenceCharButton.SetBackgroundColour(config.backgroundColour) self.findDifferenceCharButton.Bind(wx.EVT_BUTTON, self.OnFindDifferenceCharGame, id=8) else: pass if buttonImages[8] != '': findDifferenceImg = wx.Bitmap(join(config.buttonsPath, buttonImages[8]), wx.BITMAP_TYPE_PNG) self.findDifferenceButton = wx.BitmapButton(self.mainPanel, 9, findDifferenceImg, (300,200), style = wx.NO_BORDER) self.findDifferenceButton.SetBackgroundColour(config.backgroundColour) self.findDifferenceButton.Bind(wx.EVT_BUTTON, self.OnFindDifferenceGame, id=9) else: pass if buttonImages[9] != '': matchPairsImg = wx.Bitmap(join(config.buttonsPath, buttonImages[9]), wx.BITMAP_TYPE_PNG) self.matchPairsButton = wx.BitmapButton(self.mainPanel, 10, matchPairsImg, (40,300), style = wx.NO_BORDER) self.matchPairsButton.SetBackgroundColour(config.backgroundColour) self.matchPairsButton.Bind(wx.EVT_BUTTON, self.OnMatchPairsGame, id=10) else: pass bottomMenu.bottomMenu([self.mainPanel], parent, self.mainWin, 'twoButton')
def __init__(self, parent, id, mainPanel): self.currentPosition = 0 self.mainWin = mainPanel self.currentSSpath = config.animalImagesPath self.blankImg = join(config.coreImagesPath, 'blank220.png') self.dataListEnglish = loadData.animalNameEnglish self.dataListNepali = loadData.animalNameNepali self.menuPanel = wx.Panel(parent, -1, (0, 0), (800, 100)) self.menuPanel.SetBackgroundColour(config.backgroundColour) animalImg = wx.Bitmap(join(config.buttonsPath, 'animal.png'), wx.BITMAP_TYPE_PNG) self.animalButton = wx.BitmapButton(self.menuPanel, 1, animalImg, (50, 10), style=wx.NO_BORDER) self.animalButton.SetBackgroundColour(config.backgroundColour) self.animalButton.Bind(wx.EVT_BUTTON, self.OnAnimalButton, id=1) birdImg = wx.Bitmap(join(config.buttonsPath, 'bird.png'), wx.BITMAP_TYPE_PNG) self.birdButton = wx.BitmapButton(self.menuPanel, 2, birdImg, (200, 10), style=wx.NO_BORDER) self.birdButton.SetBackgroundColour(config.backgroundColour) self.birdButton.Bind(wx.EVT_BUTTON, self.OnBirdButton, id=2) insectImg = wx.Bitmap(join(config.buttonsPath, 'insect.png'), wx.BITMAP_TYPE_PNG) self.insectButton = wx.BitmapButton(self.menuPanel, 3, insectImg, (350, 10), style=wx.NO_BORDER) self.insectButton.SetBackgroundColour(config.backgroundColour) self.insectButton.Bind(wx.EVT_BUTTON, self.OnInsectButton, id=3) domesticImg = wx.Bitmap( join(config.buttonsPath, 'domesticAnimals.png'), wx.BITMAP_TYPE_PNG) self.domesticButton = wx.BitmapButton(self.menuPanel, 4, domesticImg, (500, 10), style=wx.NO_BORDER) self.domesticButton.SetBackgroundColour(config.backgroundColour) self.domesticButton.Bind(wx.EVT_BUTTON, self.OnDomesticButton, id=4) wildImg = wx.Bitmap(join(config.buttonsPath, 'wildAnimals.png'), wx.BITMAP_TYPE_PNG) self.wildButton = wx.BitmapButton(self.menuPanel, 5, wildImg, (650, 10), style=wx.NO_BORDER) self.wildButton.SetBackgroundColour(config.backgroundColour) self.wildButton.Bind(wx.EVT_BUTTON, self.OnWildButton, id=5) self.displayPanel = wx.Panel(parent, -1, (0, 100), (800, 500)) self.displayPanel.SetBackgroundColour(config.backgroundColour) self.displayPanel.SetFocus() self.displayType = wx.StaticText(self.displayPanel, -1, messages.animal, (270, 10), style=wx.ALIGN_CENTRE) self.displayType.SetFont( wx.Font(config.fontSize[2], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontName)) self.displayType.SetBackgroundColour(config.backgroundColour) self.displayText = wx.StaticText( self.displayPanel, -1, self.dataListNepali[self.currentPosition], (50, 100), style=wx.ALIGN_CENTRE) self.displayText.SetFont( wx.Font(config.fontSize[2], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontName)) self.displayText.SetBackgroundColour(config.backgroundColour) currentImg = join( self.currentSSpath, (self.dataListEnglish[self.currentPosition] + ".png")) displayImg = wx.Bitmap(currentImg, wx.BITMAP_TYPE_PNG) self.displayImage = wx.StaticBitmap( self.displayPanel, -1, displayImg, (500, 100), (displayImg.GetWidth(), displayImg.GetHeight())) self.displayImage.SetBackgroundColour(config.backgroundColour) previousArrowImg = wx.Bitmap( join(config.coreImagesPath, 'previousArrow.png'), wx.BITMAP_TYPE_PNG) self.previousArrowButton = wx.BitmapButton(self.displayPanel, 6, previousArrowImg, (50, 0), style=wx.NO_BORDER) self.previousArrowButton.SetBackgroundColour(config.backgroundColour) self.previousArrowButton.Bind(wx.EVT_BUTTON, self.OnPreviousArrow, id=6) nextArrowImg = wx.Bitmap(join(config.coreImagesPath, 'nextArrow.png'), wx.BITMAP_TYPE_PNG) self.nextArrowButton = wx.BitmapButton(self.displayPanel, 7, nextArrowImg, (650, 0), style=wx.NO_BORDER) self.nextArrowButton.SetBackgroundColour(config.backgroundColour) self.nextArrowButton.Bind(wx.EVT_BUTTON, self.OnNextArrow, id=7) bottomMenu.bottomMenu([self.displayPanel, self.menuPanel], parent, self.mainWin, 'twoButton')
def __init__(self, redirect=False, filename=None): wx.App.__init__(self, redirect, filename) self.mainFrame = wx.Frame(None, wx.ID_ANY, title = 'eBarnamala', pos =(0, 0), size = (800, 600)) self.mainFrame.SetIcon(wx.Icon(join(config.iconsPath,'eBarnamalaIcon.ico'), wx.BITMAP_TYPE_ICO)) self.mainFrame.SetBackgroundColour(config.backgroundColour) if wx.Platform != "__WXGTK__": cursorImg = wx.Bitmap(join(config.cursorPath, 'basicArrow.png'), wx.BITMAP_TYPE_PNG) cursorImg = cursorImg.ConvertToImage() cursorImg.ConvertAlphaToMask(220) cursor = wx.CursorFromImage(cursorImg) self.mainFrame.SetCursor(cursor) else: cursor = wx.StockCursor(wx.CURSOR_ARROW) self.mainFrame.SetCursor(cursor) self.mainPanel = wx.Panel(self.mainFrame, wx.ID_ANY, (0, 0), (800, 600)) self.mainPanel.SetBackgroundColour(config.backgroundColour) learnLettersImg = wx.Bitmap(join(config.buttonsPath,'learnLetters.png'), wx.BITMAP_TYPE_PNG) self.learnLettersButton = wx.BitmapButton(self.mainPanel, wx.ID_ANY, learnLettersImg, (40,368), style = wx.NO_BORDER) self.learnLettersButton.SetBackgroundColour(config.backgroundColour) self.learnLettersButton.Bind(wx.EVT_BUTTON, self.OnLearnLetters, id=self.learnLettersButton.GetId()) learnTimeImg = wx.Bitmap(join(config.buttonsPath,'learnTime.png'), wx.BITMAP_TYPE_PNG) self.learnTimeButton = wx.BitmapButton(self.mainPanel, wx.ID_ANY, learnTimeImg, (40,316), style = wx.NO_BORDER) self.learnTimeButton.SetBackgroundColour(config.backgroundColour) self.learnTimeButton.Bind(wx.EVT_BUTTON, self.OnLearnTime, id=self.learnTimeButton.GetId()) learnAnimalsImg = wx.Bitmap(join(config.buttonsPath,'learnAnimals.png'), wx.BITMAP_TYPE_PNG) self.learnAnimalsButton = wx.BitmapButton(self.mainPanel, wx.ID_ANY, learnAnimalsImg, (40,264), style = wx.NO_BORDER) self.learnAnimalsButton.SetBackgroundColour(config.backgroundColour) self.learnAnimalsButton.Bind(wx.EVT_BUTTON, self.OnLearnAnimals, id=self.learnAnimalsButton.GetId()) learnTrafficSignsImg = wx.Bitmap(join(config.buttonsPath,'trafficSigns.png'), wx.BITMAP_TYPE_PNG) self.learnTrafficSignsButton = wx.BitmapButton(self.mainPanel, wx.ID_ANY, learnTrafficSignsImg, (40,212), style = wx.NO_BORDER) self.learnTrafficSignsButton.SetBackgroundColour(config.backgroundColour) self.learnTrafficSignsButton.Bind(wx.EVT_BUTTON, self.OnLearnTrafficSigns, id=self.learnTrafficSignsButton.GetId()) learnColoursImg = wx.Bitmap(join(config.buttonsPath,'colours.png'), wx.BITMAP_TYPE_PNG) self.learnColoursButton = wx.BitmapButton(self.mainPanel, wx.ID_ANY, learnColoursImg, (40,160), style = wx.NO_BORDER) self.learnColoursButton.SetBackgroundColour(config.backgroundColour) self.learnColoursButton.Bind(wx.EVT_BUTTON, self.OnLearnColours, id=self.learnColoursButton.GetId()) learnMoneyImg = wx.Bitmap(join(config.buttonsPath,'learnMoney.png'), wx.BITMAP_TYPE_PNG) self.learnMoneyButton = wx.BitmapButton(self.mainPanel, wx.ID_ANY, learnMoneyImg, (40,110), style = wx.NO_BORDER) self.learnMoneyButton.SetBackgroundColour(config.backgroundColour) self.learnMoneyButton.Bind(wx.EVT_BUTTON, self.OnLearnMoney, id=self.learnMoneyButton.GetId()) arithmeticImg = wx.Bitmap(join(config.buttonsPath,'arithmetic.png'), wx.BITMAP_TYPE_PNG) self.arithmeticButton = wx.BitmapButton(self.mainPanel, wx.ID_ANY, arithmeticImg, (40,60), style = wx.NO_BORDER) self.arithmeticButton.SetBackgroundColour(config.backgroundColour) self.arithmeticButton.Bind(wx.EVT_BUTTON, self.OnLearnArithmetic, id=self.arithmeticButton.GetId()) numberActivitiesImg = wx.Bitmap(join(config.buttonsPath,'playNumbers.png'), wx.BITMAP_TYPE_PNG) self.numberActivitiesButton = wx.BitmapButton(self.mainPanel, wx.ID_ANY, numberActivitiesImg, (220,368), style = wx.NO_BORDER) self.numberActivitiesButton.SetBackgroundColour(config.backgroundColour) self.numberActivitiesButton.Bind(wx.EVT_BUTTON, self.OnNumberActivities, id=self.numberActivitiesButton.GetId()) sworActivitiesImg = wx.Bitmap(join(config.buttonsPath,'playSwor.png'), wx.BITMAP_TYPE_PNG) self.sworActivitiesButton = wx.BitmapButton(self.mainPanel, wx.ID_ANY, sworActivitiesImg, (220,316), style = wx.NO_BORDER) self.sworActivitiesButton.SetBackgroundColour(config.backgroundColour) self.sworActivitiesButton.Bind(wx.EVT_BUTTON, self.OnSworActivities, id=self.sworActivitiesButton.GetId()) byanjanActivitiesImg = wx.Bitmap(join(config.buttonsPath,'playByanjan.png'), wx.BITMAP_TYPE_PNG) self.byanjanActivitiesButton = wx.BitmapButton(self.mainPanel, wx.ID_ANY, byanjanActivitiesImg, (220,264), style = wx.NO_BORDER) self.byanjanActivitiesButton.SetBackgroundColour(config.backgroundColour) self.byanjanActivitiesButton.Bind(wx.EVT_BUTTON, self.OnByanjanActivities, id=self.byanjanActivitiesButton.GetId()) timeActivitiesImg = wx.Bitmap(join(config.buttonsPath,'time.png'), wx.BITMAP_TYPE_PNG) self.timeActivitiesButton = wx.BitmapButton(self.mainPanel, wx.ID_ANY, timeActivitiesImg, (220,212), style = wx.NO_BORDER) self.timeActivitiesButton.SetBackgroundColour(config.backgroundColour) self.timeActivitiesButton.Bind(wx.EVT_BUTTON, self.OnTimeActivities, id=self.timeActivitiesButton.GetId()) colourActivitiesImg = wx.Bitmap(join(config.buttonsPath,'playColours.png'), wx.BITMAP_TYPE_PNG) self.colourActivitiesButton = wx.BitmapButton(self.mainPanel, wx.ID_ANY, colourActivitiesImg, (220,160), style = wx.NO_BORDER) self.colourActivitiesButton.SetBackgroundColour(config.backgroundColour) self.colourActivitiesButton.Bind(wx.EVT_BUTTON, self.OnColourActivities, id=self.colourActivitiesButton.GetId()) animalActivitiesImg = wx.Bitmap(join(config.buttonsPath,'playAnimals.png'), wx.BITMAP_TYPE_PNG) self.animalActivitiesButton = wx.BitmapButton(self.mainPanel, wx.ID_ANY, animalActivitiesImg, (220,110), style = wx.NO_BORDER) self.animalActivitiesButton.SetBackgroundColour(config.backgroundColour) self.animalActivitiesButton.Bind(wx.EVT_BUTTON, self.OnAnimalActivities, id=self.animalActivitiesButton.GetId()) splashImg = wx.Bitmap(config.splashImage, wx.BITMAP_TYPE_PNG) self.splashImage = wx.StaticBitmap(self.mainPanel, wx.ID_ANY, splashImg, (420,110), (splashImg.GetWidth(), splashImg.GetHeight())) bottomMenu.bottomMenu([self.mainPanel], self.mainFrame, self.mainPanel, 'oneButton') self.mainFrame.Show(True)
def __init__(self, parent, id, mainPanel): self.currentPosition = 0 self.mainWin = mainPanel self.currentSSpath = config.animalImagesPath self.blankImg = join(config.coreImagesPath, "blank220.png") self.dataListEnglish = loadData.animalNameEnglish self.dataListNepali = loadData.animalNameNepali self.menuPanel = wx.Panel(parent, -1, (0, 0), (800, 100)) self.menuPanel.SetBackgroundColour(config.backgroundColour) animalImg = wx.Bitmap(join(config.buttonsPath, "animal.png"), wx.BITMAP_TYPE_PNG) self.animalButton = wx.BitmapButton(self.menuPanel, 1, animalImg, (50, 10), style=wx.NO_BORDER) self.animalButton.SetBackgroundColour(config.backgroundColour) self.animalButton.Bind(wx.EVT_BUTTON, self.OnAnimalButton, id=1) birdImg = wx.Bitmap(join(config.buttonsPath, "bird.png"), wx.BITMAP_TYPE_PNG) self.birdButton = wx.BitmapButton(self.menuPanel, 2, birdImg, (200, 10), style=wx.NO_BORDER) self.birdButton.SetBackgroundColour(config.backgroundColour) self.birdButton.Bind(wx.EVT_BUTTON, self.OnBirdButton, id=2) insectImg = wx.Bitmap(join(config.buttonsPath, "insect.png"), wx.BITMAP_TYPE_PNG) self.insectButton = wx.BitmapButton(self.menuPanel, 3, insectImg, (350, 10), style=wx.NO_BORDER) self.insectButton.SetBackgroundColour(config.backgroundColour) self.insectButton.Bind(wx.EVT_BUTTON, self.OnInsectButton, id=3) domesticImg = wx.Bitmap(join(config.buttonsPath, "domesticAnimals.png"), wx.BITMAP_TYPE_PNG) self.domesticButton = wx.BitmapButton(self.menuPanel, 4, domesticImg, (500, 10), style=wx.NO_BORDER) self.domesticButton.SetBackgroundColour(config.backgroundColour) self.domesticButton.Bind(wx.EVT_BUTTON, self.OnDomesticButton, id=4) wildImg = wx.Bitmap(join(config.buttonsPath, "wildAnimals.png"), wx.BITMAP_TYPE_PNG) self.wildButton = wx.BitmapButton(self.menuPanel, 5, wildImg, (650, 10), style=wx.NO_BORDER) self.wildButton.SetBackgroundColour(config.backgroundColour) self.wildButton.Bind(wx.EVT_BUTTON, self.OnWildButton, id=5) self.displayPanel = wx.Panel(parent, -1, (0, 100), (800, 500)) self.displayPanel.SetBackgroundColour(config.backgroundColour) self.displayPanel.SetFocus() self.displayType = wx.StaticText(self.displayPanel, -1, messages.animal, (270, 10), style=wx.ALIGN_CENTRE) self.displayType.SetFont(wx.Font(config.fontSize[2], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontName)) self.displayType.SetBackgroundColour(config.backgroundColour) self.displayText = wx.StaticText( self.displayPanel, -1, self.dataListNepali[self.currentPosition], (50, 100), style=wx.ALIGN_CENTRE ) self.displayText.SetFont(wx.Font(config.fontSize[2], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontName)) self.displayText.SetBackgroundColour(config.backgroundColour) currentImg = join(self.currentSSpath, (self.dataListEnglish[self.currentPosition] + ".png")) displayImg = wx.Bitmap(currentImg, wx.BITMAP_TYPE_PNG) self.displayImage = wx.StaticBitmap( self.displayPanel, -1, displayImg, (500, 100), (displayImg.GetWidth(), displayImg.GetHeight()) ) self.displayImage.SetBackgroundColour(config.backgroundColour) previousArrowImg = wx.Bitmap(join(config.coreImagesPath, "previousArrow.png"), wx.BITMAP_TYPE_PNG) self.previousArrowButton = wx.BitmapButton(self.displayPanel, 6, previousArrowImg, (50, 0), style=wx.NO_BORDER) self.previousArrowButton.SetBackgroundColour(config.backgroundColour) self.previousArrowButton.Bind(wx.EVT_BUTTON, self.OnPreviousArrow, id=6) nextArrowImg = wx.Bitmap(join(config.coreImagesPath, "nextArrow.png"), wx.BITMAP_TYPE_PNG) self.nextArrowButton = wx.BitmapButton(self.displayPanel, 7, nextArrowImg, (650, 0), style=wx.NO_BORDER) self.nextArrowButton.SetBackgroundColour(config.backgroundColour) self.nextArrowButton.Bind(wx.EVT_BUTTON, self.OnNextArrow, id=7) bottomMenu.bottomMenu([self.displayPanel, self.menuPanel], parent, self.mainWin, "twoButton")
def __init__(self, parent, id, mainPanel, currentLesson): self.currentLesson = currentLesson self.charPosition = 0 self.mainWin = mainPanel self.parent = parent self.imgInfo = [ 0, 0 ] #track img displayed. [0] for letter-img and [1] for within same letter self.blankImg = join(config.coreImagesPath, 'blank.png') buttonImages = [] if self.currentLesson == "colour": buttonImages.append('recognizeAndSearch.png') buttonImages.append('searchAndRecognize.png') buttonImages.append('findDifference.png') buttonImages.append('matchPairs.png') if self.currentLesson == "animals": buttonImages.append('recognizeAndSearch.png') buttonImages.append('searchAndRecognize.png') buttonImages.append('findDifference.png') buttonImages.append('matchPairs.png') self.mainPanel = wx.Panel(parent, -1, (0, 0), (800, 600)) self.mainPanel.SetBackgroundColour(config.backgroundColour) if buttonImages[0] != '': recAndSearchImg = wx.Bitmap( join(config.buttonsPath, buttonImages[0]), wx.BITMAP_TYPE_PNG) self.recAndSearchButton = wx.BitmapButton(self.mainPanel, wx.ID_ANY, recAndSearchImg, (40, 100), style=wx.NO_BORDER) self.recAndSearchButton.SetBackgroundColour( config.backgroundColour) self.recAndSearchButton.Bind(wx.EVT_BUTTON, self.OnRecAndSearchGame, id=self.recAndSearchButton.GetId()) else: pass if buttonImages[1] != '': searchAndRecImg = wx.Bitmap( join(config.buttonsPath, buttonImages[1]), wx.BITMAP_TYPE_PNG) self.searchAndRecButton = wx.BitmapButton(self.mainPanel, wx.ID_ANY, searchAndRecImg, (300, 100), style=wx.NO_BORDER) self.searchAndRecButton.SetBackgroundColour( config.backgroundColour) self.searchAndRecButton.Bind(wx.EVT_BUTTON, self.OnSearchAndRecGame, id=self.searchAndRecButton.GetId()) else: pass if buttonImages[2] != '': findDifferenceImg = wx.Bitmap( join(config.buttonsPath, buttonImages[2]), wx.BITMAP_TYPE_PNG) self.findDifferenceButton = wx.BitmapButton(self.mainPanel, wx.ID_ANY, findDifferenceImg, (550, 100), style=wx.NO_BORDER) self.findDifferenceButton.SetBackgroundColour( config.backgroundColour) self.findDifferenceButton.Bind( wx.EVT_BUTTON, self.OnFindDifferenceGame, id=self.findDifferenceButton.GetId()) else: pass if buttonImages[3] != '': matchPairsImg = wx.Bitmap( join(config.buttonsPath, buttonImages[3]), wx.BITMAP_TYPE_PNG) self.matchPairsButton = wx.BitmapButton(self.mainPanel, wx.ID_ANY, matchPairsImg, (40, 200), style=wx.NO_BORDER) self.matchPairsButton.SetBackgroundColour(config.backgroundColour) self.matchPairsButton.Bind(wx.EVT_BUTTON, self.OnMatchPairsGame, id=self.matchPairsButton.GetId()) else: pass bottomMenu.bottomMenu([self.mainPanel], parent, self.mainWin, 'twoButton')
def __init__(self, parent, id, mainPanel): self.currentLesson = "kaKha" self.charPosition = 0 self.mainWin = mainPanel self.imgInfo = [0,0] #track img displayed. [0] for letter-img and [1] for within same letter self.blankImg = join(config.coreImagesPath, 'blank.png') currentChar, self.charPosition = eUtils.nextLetter(self.currentLesson, wx.ID_ANY) imgToDisplay, imgNameToDisplay, self.imgInfo = eUtils.nextImage(self.currentLesson, self.imgInfo) self.menuPanel = wx.Panel(parent, wx.ID_ANY, (0, 0), (800, 100)) self.menuPanel.SetBackgroundColour(config.backgroundColour) self.menuPanel.SetFocus() self.displayPanel = wx.Panel(parent, wx.ID_ANY, (0, 100), (800, 500)) self.displayPanel.SetBackgroundColour(config.backgroundColour) self.displayPanel.SetFocus() aaaImg = wx.Bitmap(join(config.buttonsPath,'aaa.png'), wx.BITMAP_TYPE_PNG) self.aaaButton = wx.BitmapButton(self.menuPanel, wx.ID_ANY, aaaImg, (50,10), style = wx.NO_BORDER) self.aaaButton.SetBackgroundColour(config.backgroundColour) self.aaaButton.Bind(wx.EVT_BUTTON, self.OnAaaLetters, id=self.aaaButton.GetId()) kaKhaImg = wx.Bitmap(join(config.buttonsPath,'kakha.png'), wx.BITMAP_TYPE_PNG) self.kaKhaButton = wx.BitmapButton(self.menuPanel, wx.ID_ANY, kaKhaImg, (200,10), style = wx.NO_BORDER) self.kaKhaButton.SetBackgroundColour(config.backgroundColour) self.kaKhaButton.Bind(wx.EVT_BUTTON, self.OnKaKhaLetters, id=self.kaKhaButton.GetId()) baraKhariImg = wx.Bitmap(join(config.buttonsPath,'baraKhari.png'), wx.BITMAP_TYPE_PNG) self.baraKhariButton = wx.BitmapButton(self.menuPanel, wx.ID_ANY, baraKhariImg, (350,10), style = wx.NO_BORDER) self.baraKhariButton.SetBackgroundColour(config.backgroundColour) self.baraKhariButton.Bind(wx.EVT_BUTTON, self.OnBaraKhariLetters, id=self.baraKhariButton.GetId()) oneTwoImg = wx.Bitmap(join(config.buttonsPath,'12.png'), wx.BITMAP_TYPE_PNG) self.oneTwoButton = wx.BitmapButton(self.menuPanel, wx.ID_ANY, oneTwoImg, (500,10), style = wx.NO_BORDER) self.oneTwoButton.SetBackgroundColour(config.backgroundColour) self.oneTwoButton.Bind(wx.EVT_BUTTON, self.OnOneTwoLetters, id=self.oneTwoButton.GetId()) elevenTwelveImg = wx.Bitmap(join(config.buttonsPath,'elevenTwelve.png'), wx.BITMAP_TYPE_PNG) self.elevenTwelveButton = wx.BitmapButton(self.menuPanel, wx.ID_ANY, elevenTwelveImg, (650,10), style = wx.NO_BORDER) self.elevenTwelveButton.SetBackgroundColour(config.backgroundColour) self.elevenTwelveButton.Bind(wx.EVT_BUTTON, self.OnElevenTwelveLetters, id=self.elevenTwelveButton.GetId()) self.displayType = wx.StaticText(self.displayPanel, wx.ID_ANY, messages.byanjanBarna, (270, 10), style = wx.ALIGN_CENTRE) self.displayType.SetFont(wx.Font(config.fontSize[2], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontName)) self.displayText = wx.StaticText(self.displayPanel, wx.ID_ANY, currentChar, (50, 90), style = wx.ALIGN_CENTRE) self.displayText.SetFont(wx.Font(config.fontSize[6], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontName)) self.displayName = wx.StaticText(self.displayPanel, wx.ID_ANY, imgNameToDisplay, (600, 110), style = wx.ALIGN_CENTRE) self.displayName.SetFont(wx.Font(config.fontSize[0], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontName)) displayImg = wx.Bitmap(imgToDisplay, wx.BITMAP_TYPE_PNG) self.displayImage = wx.StaticBitmap(self.displayPanel, wx.ID_ANY, displayImg, (500,150), (displayImg.GetWidth(), displayImg.GetHeight())) previousArrowImg = wx.Bitmap(join(config.coreImagesPath,'previousArrow.png'), wx.BITMAP_TYPE_PNG) self.previousArrowButton = wx.BitmapButton(self.displayPanel, wx.ID_ANY, previousArrowImg, (50,0), style = wx.NO_BORDER) self.previousArrowButton.SetBackgroundColour(config.backgroundColour) self.previousArrowButton.Bind(wx.EVT_BUTTON, self.OnPreviousArrow, id=self.previousArrowButton.GetId()) nextArrowImg = wx.Bitmap(join(config.coreImagesPath,'nextArrow.png'), wx.BITMAP_TYPE_PNG) self.nextArrowButton = wx.BitmapButton(self.displayPanel, wx.ID_ANY, nextArrowImg, (650,0), style = wx.NO_BORDER) self.nextArrowButton.SetBackgroundColour(config.backgroundColour) self.nextArrowButton.Bind(wx.EVT_BUTTON, self.OnNextArrow, id=self.nextArrowButton.GetId()) nextWordImg = wx.Bitmap(join(config.buttonsPath,'vocabButton.png'), wx.BITMAP_TYPE_PNG) self.nextWordButton = wx.BitmapButton(self.displayPanel, wx.ID_ANY, nextWordImg, (500,320), style = wx.NO_BORDER) self.nextWordButton.SetBackgroundColour(config.backgroundColour) self.nextWordButton.Bind(wx.EVT_BUTTON, self.OnNextWord, id=self.nextWordButton.GetId()) bottomMenu.bottomMenu([self.displayPanel, self.menuPanel], parent, self.mainWin, 'twoButton')
def __init__(self, parent, id, mainPanel): self.currentPosition = 0 self.mainWin = mainPanel self.currentSSpath = config.colourImagesPath self.blankImg = join(config.coreImagesPath, 'blank220.png') self.dataListEnglish = loadData.colourNameEnglish self.dataListNepali = loadData.colourNameNepali self.menuPanel = wx.Panel(parent, -1, (0, 0), (800, 100)) self.menuPanel.SetBackgroundColour(config.backgroundColour) self.displayPanel = wx.Panel(parent, -1, (0, 100), (800, 500)) self.displayPanel.SetBackgroundColour(config.backgroundColour) self.displayType = wx.StaticText(self.displayPanel, -1, messages.colours, (270, 10), style=wx.ALIGN_CENTRE) self.displayType.SetFont( wx.Font(config.fontSize[2], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontName)) self.displayType.SetBackgroundColour(config.backgroundColour) self.displayText = wx.StaticText( self.displayPanel, -1, self.dataListNepali[self.currentPosition], (50, 100), style=wx.ALIGN_CENTRE) self.displayText.SetFont( wx.Font(config.fontSize[2], wx.SWISS, wx.NORMAL, wx.NORMAL, False, config.fontName)) self.displayText.SetBackgroundColour(config.backgroundColour) currentImg = join( self.currentSSpath, (self.dataListEnglish[self.currentPosition] + ".png")) displayImg = wx.Bitmap(currentImg, wx.BITMAP_TYPE_PNG) self.displayImage = wx.StaticBitmap( self.displayPanel, -1, displayImg, (500, 100), (displayImg.GetWidth(), displayImg.GetHeight())) self.displayImage.SetBackgroundColour(config.backgroundColour) previousArrowImg = wx.Bitmap( join(config.coreImagesPath, 'previousArrow.png'), wx.BITMAP_TYPE_PNG) self.previousArrowButton = wx.BitmapButton(self.displayPanel, 6, previousArrowImg, (50, 0), style=wx.NO_BORDER) self.previousArrowButton.SetBackgroundColour(config.backgroundColour) self.previousArrowButton.Bind(wx.EVT_BUTTON, self.OnPreviousArrow, id=6) nextArrowImg = wx.Bitmap(join(config.coreImagesPath, 'nextArrow.png'), wx.BITMAP_TYPE_PNG) self.nextArrowButton = wx.BitmapButton(self.displayPanel, 7, nextArrowImg, (650, 0), style=wx.NO_BORDER) self.nextArrowButton.SetBackgroundColour(config.backgroundColour) self.nextArrowButton.Bind(wx.EVT_BUTTON, self.OnNextArrow, id=7) bottomMenu.bottomMenu([self.displayPanel, self.menuPanel], parent, self.mainWin, 'twoButton')
def __init__(self, redirect=False, filename=None): wx.App.__init__(self, redirect, filename) self.mainFrame = wx.Frame(None, wx.ID_ANY, title='eBarnamala', pos=(0, 0), size=(800, 600)) self.mainFrame.SetIcon( wx.Icon(join(config.iconsPath, 'eBarnamalaIcon.ico'), wx.BITMAP_TYPE_ICO)) self.mainFrame.SetBackgroundColour(config.backgroundColour) if wx.Platform != "__WXGTK__": cursorImg = wx.Bitmap(join(config.cursorPath, 'basicArrow.png'), wx.BITMAP_TYPE_PNG) cursorImg = cursorImg.ConvertToImage() cursorImg.ConvertAlphaToMask(220) cursor = wx.CursorFromImage(cursorImg) self.mainFrame.SetCursor(cursor) else: cursor = wx.StockCursor(wx.CURSOR_ARROW) self.mainFrame.SetCursor(cursor) self.mainPanel = wx.Panel(self.mainFrame, wx.ID_ANY, (0, 0), (800, 600)) self.mainPanel.SetBackgroundColour(config.backgroundColour) learnLettersImg = wx.Bitmap( join(config.buttonsPath, 'learnLetters.png'), wx.BITMAP_TYPE_PNG) self.learnLettersButton = wx.BitmapButton(self.mainPanel, wx.ID_ANY, learnLettersImg, (40, 368), style=wx.NO_BORDER) self.learnLettersButton.SetBackgroundColour(config.backgroundColour) self.learnLettersButton.Bind(wx.EVT_BUTTON, self.OnLearnLetters, id=self.learnLettersButton.GetId()) learnTimeImg = wx.Bitmap(join(config.buttonsPath, 'learnTime.png'), wx.BITMAP_TYPE_PNG) self.learnTimeButton = wx.BitmapButton(self.mainPanel, wx.ID_ANY, learnTimeImg, (40, 316), style=wx.NO_BORDER) self.learnTimeButton.SetBackgroundColour(config.backgroundColour) self.learnTimeButton.Bind(wx.EVT_BUTTON, self.OnLearnTime, id=self.learnTimeButton.GetId()) learnAnimalsImg = wx.Bitmap( join(config.buttonsPath, 'learnAnimals.png'), wx.BITMAP_TYPE_PNG) self.learnAnimalsButton = wx.BitmapButton(self.mainPanel, wx.ID_ANY, learnAnimalsImg, (40, 264), style=wx.NO_BORDER) self.learnAnimalsButton.SetBackgroundColour(config.backgroundColour) self.learnAnimalsButton.Bind(wx.EVT_BUTTON, self.OnLearnAnimals, id=self.learnAnimalsButton.GetId()) learnTrafficSignsImg = wx.Bitmap( join(config.buttonsPath, 'trafficSigns.png'), wx.BITMAP_TYPE_PNG) self.learnTrafficSignsButton = wx.BitmapButton(self.mainPanel, wx.ID_ANY, learnTrafficSignsImg, (40, 212), style=wx.NO_BORDER) self.learnTrafficSignsButton.SetBackgroundColour( config.backgroundColour) self.learnTrafficSignsButton.Bind( wx.EVT_BUTTON, self.OnLearnTrafficSigns, id=self.learnTrafficSignsButton.GetId()) learnColoursImg = wx.Bitmap(join(config.buttonsPath, 'colours.png'), wx.BITMAP_TYPE_PNG) self.learnColoursButton = wx.BitmapButton(self.mainPanel, wx.ID_ANY, learnColoursImg, (40, 160), style=wx.NO_BORDER) self.learnColoursButton.SetBackgroundColour(config.backgroundColour) self.learnColoursButton.Bind(wx.EVT_BUTTON, self.OnLearnColours, id=self.learnColoursButton.GetId()) learnMoneyImg = wx.Bitmap(join(config.buttonsPath, 'learnMoney.png'), wx.BITMAP_TYPE_PNG) self.learnMoneyButton = wx.BitmapButton(self.mainPanel, wx.ID_ANY, learnMoneyImg, (40, 110), style=wx.NO_BORDER) self.learnMoneyButton.SetBackgroundColour(config.backgroundColour) self.learnMoneyButton.Bind(wx.EVT_BUTTON, self.OnLearnMoney, id=self.learnMoneyButton.GetId()) arithmeticImg = wx.Bitmap(join(config.buttonsPath, 'arithmetic.png'), wx.BITMAP_TYPE_PNG) self.arithmeticButton = wx.BitmapButton(self.mainPanel, wx.ID_ANY, arithmeticImg, (40, 60), style=wx.NO_BORDER) self.arithmeticButton.SetBackgroundColour(config.backgroundColour) self.arithmeticButton.Bind(wx.EVT_BUTTON, self.OnLearnArithmetic, id=self.arithmeticButton.GetId()) numberActivitiesImg = wx.Bitmap( join(config.buttonsPath, 'playNumbers.png'), wx.BITMAP_TYPE_PNG) self.numberActivitiesButton = wx.BitmapButton(self.mainPanel, wx.ID_ANY, numberActivitiesImg, (220, 368), style=wx.NO_BORDER) self.numberActivitiesButton.SetBackgroundColour( config.backgroundColour) self.numberActivitiesButton.Bind( wx.EVT_BUTTON, self.OnNumberActivities, id=self.numberActivitiesButton.GetId()) sworActivitiesImg = wx.Bitmap(join(config.buttonsPath, 'playSwor.png'), wx.BITMAP_TYPE_PNG) self.sworActivitiesButton = wx.BitmapButton(self.mainPanel, wx.ID_ANY, sworActivitiesImg, (220, 316), style=wx.NO_BORDER) self.sworActivitiesButton.SetBackgroundColour(config.backgroundColour) self.sworActivitiesButton.Bind(wx.EVT_BUTTON, self.OnSworActivities, id=self.sworActivitiesButton.GetId()) byanjanActivitiesImg = wx.Bitmap( join(config.buttonsPath, 'playByanjan.png'), wx.BITMAP_TYPE_PNG) self.byanjanActivitiesButton = wx.BitmapButton(self.mainPanel, wx.ID_ANY, byanjanActivitiesImg, (220, 264), style=wx.NO_BORDER) self.byanjanActivitiesButton.SetBackgroundColour( config.backgroundColour) self.byanjanActivitiesButton.Bind( wx.EVT_BUTTON, self.OnByanjanActivities, id=self.byanjanActivitiesButton.GetId()) timeActivitiesImg = wx.Bitmap(join(config.buttonsPath, 'time.png'), wx.BITMAP_TYPE_PNG) self.timeActivitiesButton = wx.BitmapButton(self.mainPanel, wx.ID_ANY, timeActivitiesImg, (220, 212), style=wx.NO_BORDER) self.timeActivitiesButton.SetBackgroundColour(config.backgroundColour) self.timeActivitiesButton.Bind(wx.EVT_BUTTON, self.OnTimeActivities, id=self.timeActivitiesButton.GetId()) colourActivitiesImg = wx.Bitmap( join(config.buttonsPath, 'playColours.png'), wx.BITMAP_TYPE_PNG) self.colourActivitiesButton = wx.BitmapButton(self.mainPanel, wx.ID_ANY, colourActivitiesImg, (220, 160), style=wx.NO_BORDER) self.colourActivitiesButton.SetBackgroundColour( config.backgroundColour) self.colourActivitiesButton.Bind( wx.EVT_BUTTON, self.OnColourActivities, id=self.colourActivitiesButton.GetId()) animalActivitiesImg = wx.Bitmap( join(config.buttonsPath, 'playAnimals.png'), wx.BITMAP_TYPE_PNG) self.animalActivitiesButton = wx.BitmapButton(self.mainPanel, wx.ID_ANY, animalActivitiesImg, (220, 110), style=wx.NO_BORDER) self.animalActivitiesButton.SetBackgroundColour( config.backgroundColour) self.animalActivitiesButton.Bind( wx.EVT_BUTTON, self.OnAnimalActivities, id=self.animalActivitiesButton.GetId()) splashImg = wx.Bitmap(config.splashImage, wx.BITMAP_TYPE_PNG) self.splashImage = wx.StaticBitmap( self.mainPanel, wx.ID_ANY, splashImg, (420, 110), (splashImg.GetWidth(), splashImg.GetHeight())) bottomMenu.bottomMenu([self.mainPanel], self.mainFrame, self.mainPanel, 'oneButton') self.mainFrame.Show(True)
def __init__(self, parent, id, mainWin, mainPanel, currentLesson): if wx.Platform != "__WXGTK__": statbmp = wx.StaticBitmap else: statbmp = statbp.GenStaticBitmap self.mainWin = mainWin self.mainPanel = mainPanel self.currentLesson = currentLesson self.buttonPressed = 20 self.question = '' self.eventQueue = [] self.question, self.answerList, self.answerImageList = nGUtils.nextImageMatchQuestion( self.currentLesson) self.fontSize = config.fontSize[4] if currentLesson == 'aaa': self.fontSize = config.fontSize[4] if currentLesson == 'kaKha': self.fontSize = config.fontSize[4] if currentLesson == 'oneTwo': self.fontSize = config.fontSize[5] if currentLesson == 'time': self.fontSize = config.fontSize[4] self.displayPanel = wx.Panel(parent, -1, (0, 0), (800, 600)) self.displayPanel.SetBackgroundColour(config.backgroundColour) self.displayText = wx.StaticText(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.displayImage.SetBackgroundColour(config.backgroundColour) ansImg1 = wx.Bitmap(self.answerImageList[0], wx.BITMAP_TYPE_PNG) self.answerImage1 = statbmp(self.displayPanel, 1, ansImg1, (260, 90), (ansImg1.GetWidth(), ansImg1.GetHeight())) self.answerImage1.SetBackgroundColour(config.backgroundColour) self.answerImage1.Bind(wx.EVT_LEFT_DOWN, self.OnAns1, id=1) ansImg2 = wx.Bitmap(self.answerImageList[1], wx.BITMAP_TYPE_PNG) self.answerImage2 = statbmp(self.displayPanel, 2, ansImg2, (440, 90), (ansImg2.GetWidth(), ansImg2.GetHeight())) self.answerImage2.SetBackgroundColour(config.backgroundColour) self.answerImage2.Bind(wx.EVT_LEFT_DOWN, self.OnAns2, id=2) ansImg3 = wx.Bitmap(self.answerImageList[2], wx.BITMAP_TYPE_PNG) self.answerImage3 = statbmp(self.displayPanel, 3, ansImg3, (620, 90), (ansImg3.GetWidth(), ansImg3.GetHeight())) self.answerImage3.SetBackgroundColour(config.backgroundColour) self.answerImage3.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)