代码拉取完成,页面将自动刷新
同步操作将从 Akai_akari/SmartEdu 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
import wx
import wx.xrc
import json
import result_panel
class CheckFrame(wx.Frame):
def __init__(self, p):
wx.Frame.__init__(self, parent=p, id=wx.ID_ANY, title="上传图片", size=wx.Size(600, 300))
wx.Frame.SetMinSize(self, wx.Size(600, 300))
wx.Frame.SetMaxSize(self, wx.Size(600, 300))
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)
box = wx.BoxSizer(wx.HORIZONTAL)
box.AddSpacer(55)
self.Text6 = wx.StaticText(self.m_panel, wx.ID_ANY, u"选择需要上传的文件")
self.Text6.SetFont(wx.Font(12, 74, 90, 90, False, "微软雅黑"))
box.Add(self.Text6, 1, wx.ALIGN_CENTER | wx.ALL, 5)
self.m_filePicker = wx.FilePickerCtrl(self.m_panel, wx.ID_ANY)
box.Add(self.m_filePicker, 1, wx.ALIGN_CENTER | wx.LEFT, 5)
box.AddSpacer(55)
box_back.Add(box, 1, wx.EXPAND, 5)
# 绑定确定和取消
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.Check_start, 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 Check_start(self, event):
# check函数
# 结果图片保存的路径传到result_path
# result_path = save_path()
result_path = "result/background.png"
self.Destroy()
result = result_panel.ResultFrame(None, result_path)
check_app = wx.App(False)
result.Show(True)
check_app.MainLoop()
def Cancel(self, event):
self.Destroy()
def main():
app = wx.App(False)
frame = CheckFrame(None)
frame.Show(True)
app.MainLoop()
if __name__ == "__main__":
main()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。