代码拉取完成,页面将自动刷新
同步操作将从 Akai_akari/SmartEdu 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
import wx
import wx.xrc
import json
class ResultFrame(wx.Frame):
def __init__(self, p, res_image):
wx.Frame.__init__(self, parent=p, id=wx.ID_ANY, title="批改结果", size=wx.Size(800, 800))
self.res_image = res_image
icon_obj = wx.Icon(name="image/tubiao.png", type=wx.BITMAP_TYPE_PNG)
self.SetIcon(icon_obj)
with open("Data.json", 'rb') as f:
params = json.load(f)
first_colour = tuple(params['background_color'])
f.close()
self.SetBackgroundColour(colour=first_colour)
self.m_panel = wx.Panel(self, wx.ID_ANY)
self.m_panel.SetBackgroundColour(colour=first_colour)
box_back = wx.BoxSizer(wx.VERTICAL)
self.m_panel.SetSizer(box_back)
self.m_panel.Layout()
box_back.Fit(self.m_panel)
self.Centre(wx.BOTH)
# 结果显示
self.result = wx.StaticText(self.m_panel, wx.ID_ANY, u"批改结果为:")
self.result.SetFont(wx.Font(35, 70, 90, 90, False, "微软雅黑"))
box_back.Add(self.result, 1, wx.ALIGN_CENTER | wx.ALL, 5)
# 图片
self.pho = wx.StaticBitmap(self.m_panel, wx.ID_ANY, wx.Bitmap(self.res_image, wx.BITMAP_TYPE_ANY))
box_back.Add(self.pho, 5, wx.EXPAND, 1)
# 绑定确定和取消
m_sdbSizer = wx.StdDialogButtonSizer()
self.m_sdbSizerSave = wx.Button(self.m_panel, wx.ID_SAVE, label='保存')
m_sdbSizer.AddButton(self.m_sdbSizerSave)
self.Bind(wx.EVT_BUTTON, self.Save, self.m_sdbSizerSave)
self.m_sdbSizerCancel = wx.Button(self.m_panel, wx.ID_CANCEL, label='取消')
m_sdbSizer.AddButton(self.m_sdbSizerCancel)
m_sdbSizer.Realize()
self.Bind(wx.EVT_BUTTON, self.Cancel, self.m_sdbSizerCancel)
box_back.Add(m_sdbSizer, 1, wx.EXPAND, 5)
def Save(self, event):
self.Destroy()
def Cancel(self, event):
self.Destroy()
def main():
app = wx.App(False)
frame = ResultFrame(None, "image/background.png")
frame.Show(True)
app.MainLoop()
if __name__ == "__main__":
main()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。