-
Notifications
You must be signed in to change notification settings - Fork 0
/
gui.py
executable file
·103 lines (86 loc) · 3.61 KB
/
gui.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# generated by wxGlade 0.9.6 on Tue Oct 4 21:13:25 2022
#
import wx
# begin wxGlade: dependencies
# end wxGlade
# begin wxGlade: extracode
# end wxGlade
class MyFrame(wx.Frame):
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.SetSize((690, 250))
# Menu Bar
self.frame_menubar = wx.MenuBar()
wxglade_tmp_menu = wx.Menu()
wxglade_tmp_menu.Append(wx.ID_ANY, "&New", "")
wxglade_tmp_menu.Append(wx.ID_ANY, "&Save", "")
wxglade_tmp_menu.Append(wx.ID_ANY, "&Export", "")
wxglade_tmp_menu.Append(wx.ID_ANY, "&Save as", "")
wxglade_tmp_menu.AppendSeparator()
wxglade_tmp_menu.Append(wx.ID_ANY, "E&xit", "")
self.frame_menubar.Append(wxglade_tmp_menu, "&File")
wxglade_tmp_menu = wx.Menu()
wxglade_tmp_menu.Append(wx.ID_ANY, "&about frame2D", "")
self.frame_menubar.Append(wxglade_tmp_menu, "&About")
self.SetMenuBar(self.frame_menubar)
# Menu Bar end
self.text_ctrl_1 = wx.TextCtrl(self, wx.ID_ANY, "")
self.button_1 = wx.Button(self, wx.ID_ANY, u"…")
self.panel_1 = wx.Panel(self, wx.ID_ANY)
self.button_3 = wx.Button(self, wx.ID_ANY, "Run")
self.button_4 = wx.Button(self, wx.ID_ANY, "Cancel")
self.__set_properties()
self.__do_layout()
self.Bind(wx.EVT_BUTTON, self.OnChooseTargetFile, self.button_1)
self.Bind(wx.EVT_BUTTON, self.OnExec, self.button_3)
self.Bind(wx.EVT_BUTTON, self.OnCancel, self.button_4)
# end wxGlade
def __set_properties(self):
# begin wxGlade: MyFrame.__set_properties
self.SetTitle("MnGen")
self.SetBackgroundColour(wx.Colour(47, 47, 47))
self.SetForegroundColour(wx.Colour(0, 0, 0))
# end wxGlade
def __do_layout(self):
# begin wxGlade: MyFrame.__do_layout
sizer_1 = wx.BoxSizer(wx.VERTICAL)
sizer_5 = wx.BoxSizer(wx.HORIZONTAL)
sizer_2 = wx.BoxSizer(wx.HORIZONTAL)
label_1 = wx.StaticText(self, wx.ID_ANY, "Input file", style=wx.ALIGN_CENTER)
label_1.SetForegroundColour(wx.Colour(192, 192, 192))
sizer_2.Add(label_1, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5)
sizer_2.Add(self.text_ctrl_1, 2, wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5)
sizer_2.Add(self.button_1, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5)
sizer_1.Add(sizer_2, 1, wx.EXPAND, 0)
sizer_5.Add(self.panel_1, 1, wx.EXPAND, 0)
sizer_5.Add(self.button_3, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5)
sizer_5.Add(self.button_4, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5)
sizer_1.Add(sizer_5, 1, wx.EXPAND, 0)
self.SetSizer(sizer_1)
self.Layout()
# end wxGlade
def OnChooseTargetFile(self, event): # wxGlade: MyFrame.<event_handler>
print("Event handler 'OnChooseTargetFile' not implemented!")
event.Skip()
def OnExec(self, event): # wxGlade: MyFrame.<event_handler>
print("Event handler 'OnExec' not implemented!")
event.Skip()
def OnCancel(self, event): # wxGlade: MyFrame.<event_handler>
print("Event handler 'OnCancel' not implemented!")
event.Skip()
# end of class MyFrame
class MyApp(wx.App):
def OnInit(self):
self.frame = MyFrame(None, wx.ID_ANY, "")
self.SetTopWindow(self.frame)
self.frame.Show()
return True
# end of class MyApp
if __name__ == "__main__":
app = MyApp(0)
app.MainLoop()