def __init__(self, *args, **kwds): # begin wxGlade: MyDialog1.__init__ kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_DIALOG_STYLE wx.Dialog.__init__(self, *args, **kwds) self.config = AppConfig() self.tmdata = eval(self.config.c.get('config', 'symbols')) self.checkbox_2 = wx.CheckBox(self, wx.ID_ANY, u"+(加法)") self.checkbox_3 = wx.CheckBox(self, wx.ID_ANY, u"-(减法)") self.checkbox_4 = wx.CheckBox(self, wx.ID_ANY, u"×(乘法)") self.checkbox_5 = wx.CheckBox(self, wx.ID_ANY, u"÷(除法)") self.checkbox_6 = wx.CheckBox(self, wx.ID_ANY, u"+(加法)") self.checkbox_7 = wx.CheckBox(self, wx.ID_ANY, u"-(减法)") self.checkbox_8 = wx.CheckBox(self, wx.ID_ANY, u"×(乘法)") self.checkbox_9 = wx.CheckBox(self, wx.ID_ANY, u"÷(除法)") self.checkbox_10 = wx.CheckBox(self, wx.ID_ANY, u"+(加法)") self.checkbox_11 = wx.CheckBox(self, wx.ID_ANY, u"-(减法)") self.checkbox_12 = wx.CheckBox(self, wx.ID_ANY, u"×(乘法)") self.checkbox_13 = wx.CheckBox(self, wx.ID_ANY, u"÷(除法)") self.button_9 = wx.Button(self, wx.ID_ANY, u"提交修改") self.button_9.Bind(wx.EVT_BUTTON, self.onButton_9) self.button_10 = wx.Button(self, wx.ID_ANY, u"关闭窗口") self.button_10.Bind(wx.EVT_BUTTON, self.onButton_10) self.ret = 0 # 运算符号选择设置Dialog返回值 self.__set_properties() self.__do_layout()
def __init__(self, *args, **kwds): # begin wxGlade: MyDialog.__init__ kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_DIALOG_STYLE wx.Dialog.__init__(self, *args, **kwds) self.config = AppConfig() tmdata = eval(self.config.c.get('config', 'multistep')) self.text_ctrl_6 = wx.TextCtrl(self, wx.ID_ANY, '{0}'.format(tmdata[0][0])) self.text_ctrl_7 = wx.TextCtrl(self, wx.ID_ANY, '{0}'.format(tmdata[0][1])) self.text_ctrl_8 = wx.TextCtrl(self, wx.ID_ANY, '{0}'.format(tmdata[1][0])) self.text_ctrl_9 = wx.TextCtrl(self, wx.ID_ANY, '{0}'.format(tmdata[1][1])) self.text_ctrl_10 = wx.TextCtrl(self, wx.ID_ANY, '{0}'.format(tmdata[2][0])) self.text_ctrl_11 = wx.TextCtrl(self, wx.ID_ANY, '{0}'.format(tmdata[2][1])) self.text_ctrl_12 = wx.TextCtrl(self, wx.ID_ANY, '{0}'.format(tmdata[3][0])) self.text_ctrl_13 = wx.TextCtrl(self, wx.ID_ANY, '{0}'.format(tmdata[3][1])) self.text_ctrl_14 = wx.TextCtrl(self, wx.ID_ANY, '{0}'.format(tmdata[4][0])) self.text_ctrl_15 = wx.TextCtrl(self, wx.ID_ANY, '{0}'.format(tmdata[4][1])) self.button_9 = wx.Button(self, wx.ID_ANY, u"提交修改") self.button_9.Bind(wx.EVT_BUTTON, self.onButton_9) self.button_10 = wx.Button(self, wx.ID_ANY, u"关闭窗口") self.button_10.Bind(wx.EVT_BUTTON, self.onButton_10) self.ret = 0 # 算数项设置Dialog返回值 self.__set_properties() self.__do_layout()
def __init__(self, *args, **kwds): # begin wxGlade: MyFrame.__init__ kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE wx.Frame.__init__(self, *args, **kwds) self.multistep = [[1, 20], [1, 20], [1, 20], [1, 20], [1, 20]] # 默认算数项值 self.symbols = [[1, 2], [1, 2], [1, 2]] # 默认运算符号值 self.psm_list = [] # 最终需要打印的所有口算题卷子 self.psm_type = [] # 口算题详细配置参数 self.psm_title = [] # 口算卷子标题 self.psm_info = "" # 卷内容提示语 self.config = AppConfig() #程序配置文件对象 self.radio_box_1 = wx.RadioBox(self, wx.ID_ANY, u"运算类型选择", choices=[u"加法", u"减法", u"乘法", u"除法"], majorDimension=1, style=wx.RA_SPECIFY_ROWS) self.radio_box_2 = wx.RadioBox(self, wx.ID_ANY, u"选择几步运算", choices=[u"一步", u"二步", u"三步"], majorDimension=1, style=wx.RA_SPECIFY_ROWS) self.radio_box_3 = wx.RadioBox(self, wx.ID_ANY, u"题型设置", choices=[u"求结果", u"求算数项"], majorDimension=1, style=wx.RA_SPECIFY_ROWS) self.button_1 = wx.Button(self, wx.ID_ANY, u"运算项及结果范围设置") self.button_1.Bind(wx.EVT_BUTTON, self.onRET1) self.button_2 = wx.Button(self, wx.ID_ANY, u"运算符号设置") self.button_2.Bind(wx.EVT_BUTTON, self.onRET2) self.checkbox_1 = wx.CheckBox(self, wx.ID_ANY, u"使用括号") self.radio_box_4 = wx.RadioBox(self, wx.ID_ANY, u"加法设置", choices=[u"随机进位", u"加法进位", u"没有进位"], majorDimension=1, style=wx.RA_SPECIFY_ROWS) self.radio_box_5 = wx.RadioBox(self, wx.ID_ANY, u"减法设置", choices=[u"随机退位", u"减法退位", u"没有退位"], majorDimension=1, style=wx.RA_SPECIFY_ROWS) self.text_ctrl_16 = wx.TextCtrl(self, wx.ID_ANY, "20", style=wx.TE_CENTRE) self.button_6 = wx.Button(self, wx.ID_ANY, u"添加口算题") self.button_7 = wx.Button(self, wx.ID_ANY, u"清空口算题") self.text_ctrl_1 = wx.TextCtrl(self, wx.ID_ANY, "") self.text_ctrl_2 = wx.TextCtrl(self, wx.ID_ANY, "5", style=wx.TE_CENTRE) self.text_ctrl_3 = wx.TextCtrl(self, wx.ID_ANY, "3", style=wx.TE_CENTRE) self.text_ctrl_4 = wx.TextCtrl(self, wx.ID_ANY, u"小学生口算题") self.text_ctrl_5 = wx.TextCtrl( self, wx.ID_ANY, u"姓名:__________ 日期:____月____日 时间:________ 对题:____道", style=wx.TE_LEFT) self.button_8 = wx.Button(self, wx.ID_ANY, u"点此生成口算题打印文档") self.app_title = "基于Python开发的小学生口算题生成器" self.info_tit = "还没添加任何口算题到卷子中,请点击添加口算题按钮开始添加口算题!" # 当前口算题卷子包含内容 self.__set_properties() self.__do_layout() self.button_6.Bind(wx.EVT_BUTTON, self.createPSM) self.button_7.Bind(wx.EVT_BUTTON, self.cleanPSM) self.button_8.Bind(wx.EVT_BUTTON, self.producePSM) self.radio_box_1.Bind(wx.EVT_RADIOBOX, self.saveSignum) self.radio_box_2.Bind(wx.EVT_RADIOBOX, self.saveStep) self.radio_box_3.Bind(wx.EVT_RADIOBOX, self.saveIs_Result) self.radio_box_4.Bind(wx.EVT_RADIOBOX, self.saveAdd) self.radio_box_5.Bind(wx.EVT_RADIOBOX, self.saveSub) self.checkbox_1.Bind(wx.EVT_CHECKBOX, self.saveIs_Bracket) self.text_ctrl_2.Bind(wx.EVT_TEXT, self.saveJuanzishu) self.text_ctrl_3.Bind(wx.EVT_TEXT, self.saveLieshu) self.text_ctrl_4.Bind(wx.EVT_TEXT, self.saveJz_title) self.text_ctrl_5.Bind(wx.EVT_TEXT, self.saveInf_title) self.text_ctrl_16.Bind(wx.EVT_TEXT, self.saveNumber)