def OnInit(self): # wx.InitAllImageHandlers() self.gg = GuiGlue() #singleton self.gg.initConfig() myMainFrame = ortho.gui.MainFrame(None, -1, "") self.SetTopWindow(myMainFrame) myMainFrame.Show() return 1
def __init__(self, *args, **kwds): # begin wxGlade: MyGladedPanel.__init__ kwds["style"] = wx.TAB_TRAVERSAL wx.Panel.__init__(self, *args, **kwds) self.title_lbl = wx.StaticText(self, -1, u"Exercice d'orthographe pour Eléa", style=wx.ALIGN_CENTRE) self.reponse_lbl = wx.StaticText(self, -1, u"Réponse: ", style=wx.ALIGN_RIGHT) self.responseCtrl = wx.TextCtrl(self, -1, "", style=wx.TE_PROCESS_ENTER | wx.TE_RICH) self.resultat_lbl = wx.TextCtrl(self, -1, "", style=wx.TE_READONLY | wx.TE_MULTILINE) self.start_btn = wx.Button(self, -1, u"Démarrer!") self.repeat_btn = wx.Button(self, -1, u"Répéter") self.next_btn = wx.Button(self, -1, "Suivant") self.score_lbl = wx.StaticText(self, -1, "Score") self.end_btn = wx.Button(self, -1, "Terminer l'exercice") self.mode = 0 #default mode: Exam self.correct = 0 #for training self.wrong = 0 #for training too self.__set_properties() self.__do_layout() self.Bind(wx.EVT_TEXT_ENTER, self.onNextClickExam, self.responseCtrl) self.Bind(wx.EVT_BUTTON, self.onStartClick, self.start_btn) self.Bind(wx.EVT_BUTTON, self.onRepeatClick, self.repeat_btn) self.Bind(wx.EVT_BUTTON, self.onNextClickExam, self.next_btn) self.Bind(wx.EVT_BUTTON, self.onQuit, self.end_btn) # end wxGlade self.timer = wx.Timer(self, -1) self.redStyle = wx.TextAttr(wx.RED) self.greenStyle = wx.TextAttr(wx.Colour(0, 255, 0)) self.bravoSound = Word( "bravo", os.path.normpath( os.path.dirname(__file__) + "/../../resources/bravo.wav")) self.errorSound = Word( "error", os.path.normpath( os.path.dirname(__file__) + "/../../resources/error.wav")) self.gg = GuiGlue() #singleton
def __init__(self, *args, **kwds): kwds["style"] = wx.DEFAULT_DIALOG_STYLE wx.Dialog.__init__(self, *args, **kwds) self.gg = GuiGlue() #singleton # Lessons selector self.availableLessons = sorted(self.gg.searchLessons(),key=lambda lesson: lesson[0]) self.lessonsCheckBoxes = [(wx.CheckBox(self, -1, lesson[0]), lesson[0], lesson[1]) for lesson in self.availableLessons] self.__do_layout() self.Bind(wx.EVT_BUTTON, self.onOK, id=wx.ID_OK) self.Bind(wx.EVT_BUTTON, self.onCancel, id=wx.ID_CANCEL) self.Bind(wx.EVT_BUTTON, self.onSelectAll, self.selectAll_btn) self.Bind(wx.EVT_BUTTON, self.onInvertSelect, self.invertSelect_btn) self.Bind(wx.EVT_RADIOBOX, self.onModeSelect, self.rmode)