#NEWLINE# def __init__( self , parent , param , precision = 4 , vary = None , **kws ) : #NEWLINE# #INDENT# self . param = param #NEWLINE# title = ( '  Parameter:  %s  ' % param . name ) #NEWLINE# wx . Dialog . __init__ ( self , parent , wx . ID_ANY , title = title ) #NEWLINE# panel = GridPanel ( self ) #NEWLINE# self . SetFont ( parent . GetFont ( ) ) #NEWLINE# if ( vary is None ) : #NEWLINE# #INDENT# vary = 0 #NEWLINE# if param . vary : #NEWLINE# #INDENT# vary = 1 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( param . expr is not None ) : #NEWLINE# #INDENT# vary = 2 #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# ( minval , maxval ) = ( param . min , param . max ) #NEWLINE# ( stderr , expr ) = ( param . stderr , param . expr ) #NEWLINE# sminval = ( '%s' % minval ) #NEWLINE# smaxval = ( '%s' % maxval ) #NEWLINE# if ( minval in ( None , 'None' , ( - np . inf ) ) ) : #NEWLINE# #INDENT# minval = ( - np . inf ) #NEWLINE# #UNINDENT# if ( maxval in ( None , 'None' , np . inf ) ) : #NEWLINE# #INDENT# maxval = np . inf #NEWLINE# #UNINDENT# if ( stderr is None ) : #NEWLINE# #INDENT# stderr = '' #NEWLINE# #UNINDENT# if ( expr is None ) : #NEWLINE# #INDENT# expr = '' #NEWLINE# #UNINDENT# self . wids = Empty ( ) #NEWLINE# self . wids . vary = Choice ( panel , choices = VARY_CHOICES , action = self . onVaryChoice , size = ( 110 , ( - 1 ) ) ) #NEWLINE# self . wids . vary . SetSelection ( vary ) #NEWLINE# self . wids . val = FloatCtrl ( panel , value = param . value , size = ( 100 , ( - 1 ) ) , precision = precision , minval = minval , maxval = maxval ) #NEWLINE# self . wids . min = FloatCtrl ( panel , value = minval , size = ( 100 , ( - 1 ) ) ) #NEWLINE# self . wids . max = FloatCtrl ( panel , value = maxval , size = ( 100 , ( - 1 ) ) ) #NEWLINE# self . wids . expr = wx . TextCtrl ( panel , value = expr , size = ( 300 , ( - 1 ) ) ) #NEWLINE# self . wids . err = wx . StaticText ( panel , label = ( '%s' % stderr ) ) #NEWLINE# SetTip ( self . wids . expr , 'Mathematical expression to calcutate value' ) #NEWLINE# btnsizer = wx . StdDialogButtonSizer ( ) #NEWLINE# ok_btn = wx . Button ( panel , wx . ID_OK ) #NEWLINE# ok_btn . SetDefault ( ) #NEWLINE# btnsizer . AddButton ( ok_btn ) #NEWLINE# btnsizer . AddButton ( wx . Button ( panel , wx . ID_CANCEL ) ) #NEWLINE# btnsizer . Realize ( ) #NEWLINE# panel . AddText ( ' Name:' , style = LEFT ) #NEWLINE# panel . AddText ( param . name , style = LEFT , colour = '#DD0000' ) #NEWLINE# panel . AddText ( ' Type:' , style = LEFT ) #NEWLINE# panel . Add ( self . wids . vary , style = LEFT ) #NEWLINE# panel . AddText ( ' Value:' , style = LEFT , newrow = True ) #NEWLINE# panel . Add ( self . wids . val , style = LEFT ) #NEWLINE# panel . AddText ( ' Std Error:' , style = LEFT ) #NEWLINE# panel . Add ( self . wids . err , style = LEFT ) #NEWLINE# panel . AddText ( ' Min Value:' , style = LEFT , newrow = True ) #NEWLINE# panel . Add ( self . wids . min , style = LEFT ) #NEWLINE# panel . AddText ( ' Max Value:' , style = LEFT ) #NEWLINE# panel . Add ( self . wids . max , style = LEFT ) #NEWLINE# panel . AddText ( ' Constraint:' , style = LEFT , newrow = True ) #NEWLINE# panel . Add ( self . wids . expr , style = LEFT , dcol = 3 ) #NEWLINE# panel . Add ( HLine ( panel , size = ( 375 , 2 ) ) , dcol = 4 , newrow = True ) #NEWLINE# panel . Add ( btnsizer , dcol = 4 , newrow = True , style = LEFT ) #NEWLINE# panel . pack ( ) #NEWLINE# sizer = wx . BoxSizer ( wx . VERTICAL ) #NEWLINE# sizer . Add ( panel , 0 , 0 , 25 ) #NEWLINE# self . onVaryChoice ( ) #NEWLINE# pack ( self , sizer ) #NEWLINE# bsize = self . GetBestSize ( ) #NEWLINE# self . SetSize ( ( ( bsize [ 0 ] + 10 ) , ( bsize [ 1 ] + 10 ) ) )