コード例 #1
0
ファイル: text_input.py プロジェクト: Evertox/OpenSesame
	def __init__(self, form, text='', frame=True, center=False, stub='Type here ...', return_accepts=False, var=None):
	
		"""<DOC>
		Constructor
		
		Arguments:
		form -- the parent form		
		
		Keyword arguments:
		text -- the text to start with (default='')
		frame -- indicates whether a frame should be drawn around the widget
				 (default=False)
		center -- indicates whether the text should be centered (default=False)
		stub -- a text string that should be shown whenever the user has not
				entered any text (default='Type here ...')
		return_accepts -- indicates whether a return press should accept and
						  close the form (default=False)
		var -- the name of the experimental variable that should be used to log
			   the widget status (default=None)					
		</DOC>"""
		
		if type(return_accepts) != bool:
			return_accepts = return_accepts == 'yes'								
	
		label.__init__(self, form, text, frame=frame, center=center)
		self.type = 'text_input'		
		self.stub = stub
		self.prompt = '_'
		self.return_accepts = return_accepts
		self.var = var
		self.text = text
		self.set_var(text)
コード例 #2
0
    def __init__(self, form, text=u"", frame=True, center=False, stub=u"Type here ...", return_accepts=False, var=None):

        """<DOC>
		Constructor.
		
		Arguments:
		form -- The parent form.
		
		Keyword arguments:
		text -- The text to start with (default=u'').
		frame -- Indicates whether a frame should be drawn around the widget
				 (default=False).
		center -- Indicates whether the text should be centered (default=False).
		stub -- A text string that should be shown whenever the user has not
				entered any text (default=u'Type here ...').
		return_accepts -- Indicates whether a return press should accept and
						  close the form (default=False).
		var -- The name of the experimental variable that should be used to log
			   the widget status (default=None).				
		</DOC>"""

        if type(return_accepts) != bool:
            return_accepts = return_accepts == u"yes"

        label.__init__(self, form, text, frame=frame, center=center)
        self.type = u"text_input"
        self.stub = self.form.experiment.unistr(stub)
        self.prompt = u"_"
        self.return_accepts = return_accepts
        self.var = var
        self.text = self.form.experiment.unistr(text)
        self.set_var(text)
コード例 #3
0
ファイル: button.py プロジェクト: Evertox/OpenSesame
    def __init__(self, form, text='button', frame=True, center=True, var=None):
        """<DOC>
		Constructor
		
		Arguments:
		form -- the parent form
		
		Keyword arguments:
		text -- button text (default='button')
		frame -- indicates whether a frame should be drawn around the widget
				 (default=False)
		center -- indicates whether the text should be centered (default=False)
		var -- the name of the experimental variable that should be used to log
			   the widget status (default=None)		
		</DOC>"""

        label.__init__(self, form, text, frame=frame, center=center)
        self.type = 'button'
        self.var = var
        self.set_var(False)
コード例 #4
0
ファイル: button.py プロジェクト: Complex501/OpenSesame
	def __init__(self, form, text=u'button', frame=True, center=True, var=None):
	
		"""<DOC>
		Constructor
		
		Arguments:
		form -- The parent form.
		
		Keyword arguments:
		text -- Button text (default='button').
		frame -- Indicates whether a frame should be drawn around the widget
				 (default=False).
		center -- Indicates whether the text should be centered (default=False).
		var -- The name of the experimental variable that should be used to log
			   the widget status (default=None).
		</DOC>"""	
	
		label.__init__(self, form, text, frame=frame, center=center)
		self.type = u'button'
		self.var = var
		self.set_var(False)