📄 show.py
字号:
#Boa:Dialog:Dialog1
import wx
import data
import mythread
def create(parent):
return Dialog1(parent)
[wxID_DIALOG1, wxID_DIALOG1EXIT, wxID_DIALOG1LISTCTRL1, wxID_DIALOG1NUMSUM,
wxID_DIALOG1RESERT, wxID_DIALOG1START, wxID_DIALOG1STATICBOX1,
wxID_DIALOG1STATICBOX2, wxID_DIALOG1STATICTEXT1, wxID_DIALOG1STATICTEXT2,
wxID_DIALOG1STATICTEXT3, wxID_DIALOG1STATICTEXT4, wxID_DIALOG1STATICTEXT5,
wxID_DIALOG1STOP,
] = [wx.NewId() for _init_ctrls in range(14)]
class Len:
def __init__(self, i):
self.len = i
def get_len(self):
return self.len
def reduce(self, i):
self.len = self.len - i
class Dialog1(wx.Dialog):
data = []
da = []
da_oper = []
start_flag = 0
def _init_ctrls(self, prnt):
# generated method, don't edit
wx.Dialog.__init__(self, id=wxID_DIALOG1, name='', parent=prnt,
pos=wx.Point(340, 230), size=wx.Size(400, 340),
style=wx.DEFAULT_DIALOG_STYLE, title='Dialog1')
self.SetClientSize(wx.Size(392, 313))
self.init_left_tree()
self.NumSum = wx.ListBox(choices=self.data, id=wxID_DIALOG1NUMSUM,
name='NumSum', parent=self, pos=wx.Point(16, 19),
size=wx.Size(120, 200), style=0)
self.staticText1 = wx.StaticText(id=wxID_DIALOG1STATICTEXT1,
label='staticText1', name='staticText1', parent=self,
pos=wx.Point(168, 16), size=wx.Size(100, 25),
style=wx.ALIGN_CENTRE)
self.staticText1.SetBackgroundColour(wx.Colour(225, 187, 224))
self.staticText1.SetFont(wx.Font(16, wx.SWISS, wx.NORMAL, wx.NORMAL,
False, 'Tahoma'))
self.staticText1.SetHelpText('')
self.staticText1.SetToolTipString('staticText1')
self.listCtrl1 = wx.ListCtrl(id=wxID_DIALOG1LISTCTRL1, name='listCtrl1',
parent=self, pos=wx.Point(168, 95), size=wx.Size(200, 100),
style=wx.LC_ICON)
self.staticBox1 = wx.StaticBox(id=wxID_DIALOG1STATICBOX1,
label='\xd2\xa1\xba\xc5\xc7\xf8', name='staticBox1', parent=self,
pos=wx.Point(152, 0), size=wx.Size(232, 216), style=0)
self.staticBox2 = wx.StaticBox(id=wxID_DIALOG1STATICBOX2,
label='\xba\xc5\xc2\xeb\xc1\xd0\xb1\xed', name='staticBox2',
parent=self, pos=wx.Point(8, 2), size=wx.Size(136, 220), style=0)
self.staticText2 = wx.StaticText(id=wxID_DIALOG1STATICTEXT2,
label='\xba\xc5\xc2\xeb\xd7\xdc\xca\xfd\xa3\xba',
name='staticText2', parent=self, pos=wx.Point(16, 232),
size=wx.Size(60, 14), style=0)
self.staticText3 = wx.StaticText(id=wxID_DIALOG1STATICTEXT3,
label='\xb3\xe9\xb3\xf6\xca\xfd\xa3\xba', name='staticText3',
parent=self, pos=wx.Point(23, 264), size=wx.Size(48, 14),
style=0)
self.staticText4 = wx.StaticText(id=wxID_DIALOG1STATICTEXT4,
label='staticText4', name='staticText4', parent=self,
pos=wx.Point(80, 232), size=wx.Size(40, 14), style=0)
self.staticText5 = wx.StaticText(id=wxID_DIALOG1STATICTEXT5,
label='staticText5', name='staticText5', parent=self,
pos=wx.Point(80, 264), size=wx.Size(40, 14), style=0)
self.Start = wx.Button(id=wxID_DIALOG1START,
label='\xbf\xaa\xca\xbc\xd2\xa1\xba\xc5', name='Start',
parent=self, pos=wx.Point(160, 232), size=wx.Size(75, 24),
style=0)
self.Start.Bind(wx.EVT_BUTTON, self.OnStartButton, id=wxID_DIALOG1START)
self.Stop = wx.Button(id=wxID_DIALOG1STOP, label='\xcd\xa3\xd6\xb9',
name='Stop', parent=self, pos=wx.Point(288, 232), size=wx.Size(75,
24), style=0)
self.Stop.Bind(wx.EVT_BUTTON, self.OnStopButton, id=wxID_DIALOG1STOP)
self.Resert = wx.Button(id=wxID_DIALOG1RESERT, label='\xb8\xb4\xce\xbb',
name='Resert', parent=self, pos=wx.Point(160, 264),
size=wx.Size(75, 24), style=0)
self.Resert.Bind(wx.EVT_BUTTON, self.OnResertButton,
id=wxID_DIALOG1RESERT)
self.Exit = wx.Button(id=wxID_DIALOG1EXIT, label='\xcd\xcb\xb3\xf6',
name='Exit', parent=self, pos=wx.Point(288, 264), size=wx.Size(75,
24), style=0)
self.Exit.Bind(wx.EVT_BUTTON, self.OnExitButton, id=wxID_DIALOG1EXIT)
def __init__(self, parent):
self._init_ctrls(parent)
def OnStartButton(self, event):
self.threadone = mythread.mythread("1", self.data_temp, self.spe_len, self.staticText1)
self.threadone.start()
event.Skip()
def OnStopButton(self, event):
self.threadone.SetStop()
event.Skip()
def OnResertButton(self, event):
event.Skip()
def OnExitButton(self, event):
event.Skip()
def init_left_tree(self):
self.data_object = data.data()
self.da = self.data_object.get_data()
self.data_temp = []
self.spe_len = Len(self.data_object.get_spe_num())
for elem in self.da:
el = elem.get_data()
self.data.append(el)
self.data_temp.append(elem)
self.da_oper = self.data
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -