-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathStockDlg.py
35 lines (23 loc) · 875 Bytes
/
StockDlg.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
import wx
import cad
import Stock
from SolidsDlg import SolidsDlg
class StockDlg(SolidsDlg):
def __init__(self, object, title = 'Stock'):
SolidsDlg.__init__(self, object, title)
def SetPictureByName(self, name):
self.SetPictureByNameAndFolder(name, 'stock')
def SetPictureByNameAndFolder(self, name, folder):
if self.picture:
self.picture.SetPicture(wx.GetApp().cam_dir + '/bitmaps/' + folder + '/' + name + '.png')
def Do(object):
dlg = StockDlg(object)
while True:
result = dlg.ShowModal()
if result == wx.ID_OK:
dlg.GetData()
return True
elif result == dlg.btnSolidsPick.GetId():
dlg.PickSolids()
else:
return False