subpanel.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:bonsu 作者: bonsudev 项目源码 文件源码
def __init__(self, parent, subpanel):
        wx.Dialog.__init__(self, parent, title="Calculate Q-vector", size=(300, 180),style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER)
        self.subpanel = subpanel
        vbox = wx.BoxSizer(wx.VERTICAL)
        self.ttheta = NumberObject(self,"2 theta:",self.subpanel.ttheta,80)
        self.ttheta.label.SetToolTipNew("2 theta angle (radians). "+os.linesep+"Note: Diffraction pattern is assumed "+os.linesep+"to be co-ordinate corrected.")
        self.phi = NumberObject(self,"phi:",self.subpanel.phi,80)
        self.phi.label.SetToolTipNew("phi angle (radians). "+os.linesep+"Note: Diffraction pattern is assumed "+os.linesep+"to be co-ordinate corrected.")
        self.waveln = NumberObject(self,"lambda:",self.subpanel.waveln,80)
        self.waveln.label.SetToolTipNew("wavelength (nanometers),")
        vbox.Add(self.ttheta ,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2)
        vbox.Add(self.phi ,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2)
        vbox.Add(self.waveln ,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2)
        self.rb = RadioBoxNew(self, label="Coordinate system", choices=['Global','Detector'],  majorDimension=2, style=wx.RA_SPECIFY_COLS)
        self.rb.SetToolTipNew("Select co-ordinate system for Q-vector. "+os.linesep+"If the Diffraction data is co-ordinate corrected,"+os.linesep+"the global system is appropriate."+os.linesep+"If not, the detector system should be used."+os.linesep+"(i.e. normal to the reflected wave.)")
        vbox.Add(self.rb ,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2)
        vbox.Add((-1,10))
        hbox = wx.BoxSizer(wx.HORIZONTAL)
        self.ok = wx.Button(self, label='Ok', size=(70, 30))
        self.cancel = wx.Button(self, label='Cancel', size=(70, 30))
        hbox.Add(self.ok, 1,flag=wx.EXPAND)
        hbox.Add(self.cancel, 1, flag=wx.EXPAND)
        vbox.Add(hbox ,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2)
        self.SetSizer(vbox)
        self.ok.Bind(wx.EVT_BUTTON, self.OnOk)
        self.cancel.Bind(wx.EVT_BUTTON, self.OnCancel)
        self.Fit()
        self.Layout()
        self.Show()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号