1 Star 0 Fork 2

武斌/SmartEdu_1

forked from Akai_akari/SmartEdu 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
check_panel.py 2.51 KB
一键复制 编辑 原始数据 按行查看 历史
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()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/guai128/smart-edu_1.git
[email protected]:guai128/smart-edu_1.git
guai128
smart-edu_1
SmartEdu_1
master

搜索帮助