-
Notifications
You must be signed in to change notification settings - Fork 0
/
packdialog.py
67 lines (57 loc) · 2.78 KB
/
packdialog.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
import wx
class PackDialog(wx.Dialog):
def __init__(self, *args, **kw):
super(PackDialog, self).__init__(*args, **kw)
self.InitUI()
self.SetSize((560, 200))
self.dir = ''
def InitUI(self):
self.rootpanel = wx.Panel(self)
vbox = wx.BoxSizer(wx.VERTICAL)
hbox1 = wx.BoxSizer(wx.HORIZONTAL)
hbox2 = wx.BoxSizer(wx.HORIZONTAL)
hbox3 = wx.BoxSizer(wx.HORIZONTAL)
hbox4 = wx.BoxSizer(wx.HORIZONTAL)
label = wx.StaticText(self.rootpanel,label='Pack To')
vbox.Add(label,0,flag=wx.LEFT | wx.TOP | wx.EXPAND,border = 15)
panel2 = wx.Panel(self.rootpanel)
self.addressCb = wx.ComboBox(panel2, -1, size=(50, -1))
self.addressCb.Enable(False)
self.bt = wx.Button(panel2,-1,label='...',size=(30,25))
self.savedname = wx.TextCtrl(panel2,-1,size=(90, 24))
hbox1.Add(self.bt, 0, flag= wx.TOP, border=5)
hbox1.Add(self.addressCb,1,flag = wx.TOP | wx.LEFT | wx.RIGHT,border=5)
hbox1.Add(self.savedname, 0, flag=wx.TOP, border=5)
hbox1.Add(wx.StaticText(panel2,label='.PAK'), 0, flag=wx.LEFT | wx.TOP | wx.ALIGN_CENTER, border=5)
panel2.SetSizer(hbox1)
vbox.Add(panel2,0,flag=wx.LEFT | wx.RIGHT | wx.EXPAND,border = 15)
panel3 = wx.Panel(self.rootpanel)
self.btOk = wx.Button(panel3,-1,label='Ok',size=(-1,30))
self.btClose = wx.Button(panel3, -1, label='Close',size=(-1,30))
hbox2.Add(self.btOk,0,flag=wx.TOP | wx.RIGHT,border=7)
hbox2.Add(self.btClose,flag=wx.TOP | wx.LEFT,border=7)
panel3.SetSizer(hbox2)
vbox.Add(panel3, 0, flag=wx.LEFT | wx.RIGHT | wx.ALIGN_RIGHT, border=15)
panel4 = wx.Panel(self.rootpanel)
status = wx.StaticText(panel4, label="STATUS:")
self.percentlabel = wx.StaticText(panel4, label="0.00%")
hbox3.Add(status,0)
hbox3.Add(self.percentlabel,0,flag=wx.LEFT,border=7)
panel4.SetSizer(hbox3)
vbox.Add(panel4, 0, flag=wx.LEFT | wx.TOP | wx.EXPAND, border=15)
panel5 = wx.Panel(self.rootpanel)
self.statusbar = wx.Gauge(panel5,range=100,style = wx.GA_SMOOTH)
hbox4.Add(self.statusbar,1,flag=wx.TOP,border=5)
panel5.SetSizer(hbox4)
vbox.Add(panel5, 0, flag=wx.LEFT | wx.RIGHT | wx.EXPAND, border=15)
self.rootpanel.SetSizer(vbox)
self.btClose.Bind(wx.EVT_BUTTON,self.OnClose)
self.bt.Bind(wx.EVT_BUTTON,self.OnOpenDir)
def OnClose(self, e):
self.Destroy()
def OnOpenDir(self,e):
dlg = wx.DirDialog(self, "Choose A Directory")
if dlg.ShowModal() == wx.ID_OK:
self.dir = dlg.GetPath()
self.addressCb.SetLabel(self.dir)
dlg.Destroy()