Example #1
0
	def __init__(self, form, text='checkbox', frame=False, group=None, checked=False, click_accepts=False, var=None):
	
		"""<DOC>
		Constructor
		
		Arguments:
		form -- The parent form.
				
		Keyword arguments:
		text -- Checkbox text (default='checkbox').
		frame -- Indicates whether a frame should be drawn around the widget #
				 (default=False).
		group -- If a group is specified, checking one checkbox from the group #
				 will uncheck all other checkboxes in that group (default=None).
		checked -- The checked state of the checkbox (default=False).
		click_accepts -- Indicates whether a click 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(checked) != bool:
			checked = checked == 'yes'
		if type(click_accepts) != bool:
			click_accepts = click_accepts == 'yes'											
			
		button.__init__(self, form, text, frame=frame, center=False)
		self.type = 'checkbox'
		self.group = group		
		self.box_size = 16
		self.box_pad = self.x_pad
		self.x_pad += self.x_pad + self.box_size
		self.var = var
		self.click_accepts = click_accepts
		self.set_checked(checked)
Example #2
0
	def __init__(self, form, text='checkbox', frame=False, group=None, checked=False, click_accepts=False, var=None):
	
		"""<DOC>
		Constructor
		
		Arguments:
		form -- the parent form
				
		Keyword arguments:
		text -- checkbox text (default='checkbox')		
		frame -- indicates whether a frame should be drawn around the widget
				 (default=False)
		group -- if a group is specified, checking one checkbox from the group
				 will uncheck all other checkboxes in that group (default=None)
		checked -- the checked state of the checkbox (default=False)
		click_accepts -- indicates whether a click 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(checked) != bool:
			checked = checked == 'yes'
		if type(click_accepts) != bool:
			click_accepts = click_accepts == 'yes'											
			
		button.__init__(self, form, text, frame=frame, center=False)
		self.type = 'checkbox'
		self.group = group		
		self.box_size = 16
		self.box_pad = self.x_pad
		self.x_pad += self.x_pad + self.box_size
		self.var = var
		self.click_accepts = click_accepts
		self.set_checked(checked)
Example #3
0
    def __init__(self,
                 form,
                 text=u'checkbox',
                 frame=False,
                 group=None,
                 checked=False,
                 click_accepts=False,
                 var=None):
        """<DOC>
		Constructor.
		
		Arguments:
		form -- The parent form.
				
		Keyword arguments:
		text -- Checkbox text (default=u'checkbox').
		frame -- Indicates whether a frame should be drawn around the widget #
				 (default=False).
		group -- If a group is specified, checking one checkbox from the group #
				 will uncheck all other checkboxes in that group. Checkboxes #
				 that are part of a group cannot be unchecked, except by clicking #
				 on another checkbox in the group. The group keyword also #
				 affects how variables are stored (see the var keyword). #
				 (default=None).
		checked -- The checked state of the checkbox (default=False).
		click_accepts -- Indicates whether a click 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. This variable will contain a semi-colon #
			   separated list of the text of all checked checkboxes in the #
			   same group, or 'no' if no checkbox in the group is checked. For #
			   the purpose of the variable, all checkboxes that are not part #
			   of a group are placed in the same group. For more information #
			   about the use of response variables in forms, see the form #
			   documentation page. (default=None).
		</DOC>"""

        if isinstance(checked, basestring):
            checked = checked == u'yes'
        if isinstance(click_accepts, bool):
            click_accepts = click_accepts == u'yes'
        button.__init__(self, form, text, frame=frame, center=False)
        self.type = u'checkbox'
        self.group = group
        self.box_size = 16
        self.box_pad = self.x_pad
        self.x_pad += self.x_pad + self.box_size
        self.var = var
        self.click_accepts = click_accepts
        self.set_checked(checked)
Example #4
0
	def __init__(self, form, text=u'checkbox', frame=False, group=None, checked=False, click_accepts=False, var=None):
	
		"""<DOC>
		Constructor.
		
		Arguments:
		form -- The parent form.
				
		Keyword arguments:
		text -- Checkbox text (default=u'checkbox').
		frame -- Indicates whether a frame should be drawn around the widget #
				 (default=False).
		group -- If a group is specified, checking one checkbox from the group #
				 will uncheck all other checkboxes in that group. Checkboxes #
				 that are part of a group cannot be unchecked, except by clicking #
				 on another checkbox in the group. The group keyword also #
				 affects how variables are stored (see the var keyword). #
				 (default=None).
		checked -- The checked state of the checkbox (default=False).
		click_accepts -- Indicates whether a click 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. This variable will contain a semi-colon #
			   separated list of the text of all checked checkboxes in the #
			   same group, or 'no' if no checkbox in the group is checked. For #
			   the purpose of the variable, all checkboxes that are not part #
			   of a group are placed in the same group. For more information #
			   about the use of response variables in forms, see the form #
			   documentation page. (default=None).
		</DOC>"""	
		
		if isinstance(checked, basestring):
			checked = checked == u'yes'
		if isinstance(click_accepts, basestring):
			click_accepts = click_accepts == u'yes'
		button.__init__(self, form, text, frame=frame, center=False)
		self.type = u'checkbox'
		self.group = group		
		self.box_size = 16
		self.box_pad = self.x_pad
		self.x_pad += self.x_pad + self.box_size
		self.var = var
		self.click_accepts = click_accepts
		self.set_checked(checked)