Пример #1
0
    def __init__(self, form, text='label', frame=False, center=True):
        """<DOC>
		Constructor.
		
		Arguments:
		form -- The parent form.

		Keyword arguments:
		text -- A string of text (default='label').
		frame -- Indicates whether a frame should be drawn around the widget #
				 (default=False).
		center -- Indicates whether the text should be centered (default=True).
		</DOC>"""

        if type(frame) != bool:
            frame = frame == u'yes'
        if type(center) != bool:
            center = center == u'yes'

        widget.__init__(self, form)
        self.type = u'label'
        self.text = text
        self.frame = frame
        self.center = center
        self.x_pad = 8
        self.y_pad = 8
        self.tab_str = u'    '  # Replace tab characters by four spaces
Пример #2
0
    def __init__(self, parent, title="", caption="", buttons=Ok, width=0, height=0, auto_spawn=True):
        widget.__init__(self, 'dialogbox', width, height)

        self.auto_spawn = auto_spawn

        self.button_width = 60
        self.button_height = 20
        self.button_offset = 10

        self.title_bar_height = 20

        self.font = font.get_font()
        self.buttons = buttons

        self.__buttons = []

        self.parent = parent

        if self.width == 0 and self.height == 0:
            #applying default dimension
            self.width = self.DefaultWidth
            self.height = self.DefaultHeight

        self.caption = caption
        self.title = title

        self.dialog_action = None
        self.__generate_buttons()

        if self.auto_spawn:
            self.spawn()
Пример #3
0
	def __init__(self, form, nodes=5, click_accepts=False, var=None):
	
		"""<DOC>
		Constructor.
		
		Arguments:
		form -- The parent form.
		
		Keyword arguments:
		nodes -- The number of nodes or a list of node identifiers (e.g., #
				 ['yes', 'no', 'maybe']. If a list is passed the rating scale #
				 will have labels, otherwise it will just have boxes #
				 (default=5).
		click_accepts -- Indicates whether the form should close when a value #
						 is selected (default=False).
		var -- The name of the experimental variable that should be used to log #
			   the widget status (default=None).
		</DOC>"""	
		
		if type(click_accepts) != bool:
			click_accepts = click_accepts == 'yes'					
		
		widget.__init__(self, form)
		self.type = 'rating_scale'
		self.box_size = 16
		self.click_accepts = click_accepts
		self.pos_list = []
		self.var = var
		if type(nodes) == int:
			self.nodes = ['']*nodes
		elif type(nodes) in (str, unicode):
			self.nodes = nodes.split(';')
		else:
			self.nodes = nodes
		self.set_value(None)
Пример #4
0
	def __init__(self, form, text='label', frame=False, center=True):

		"""<DOC>
		Constructor

		Arguments:
		form -- the parent form

		Keyword arguments:
		text -- a string of text (default='label')
		frame -- indicates whether a frame should be drawn around the widget
				 (default=False)
		center -- indicates whether the text should be centered (default=True)
		</DOC>"""

		if type(frame) != bool:
			frame = frame == 'yes'
		if type(center) != bool:
			center = center == 'yes'

		widget.__init__(self, form)
		self.type = 'label'
		self.text = text
		self.frame = frame
		self.center = center
		self.x_pad = 8
		self.y_pad = 8
		self.tab_str = '    ' # Replace tab characters by four spaces
Пример #5
0
    def __init__(self, name):
        widget.__init__(self, name)

        # init config variables

        #debug
        self.debug = config_var("debug", False)
        self.debug.hook = self.update_debug
        # enable debug
        self.debug.set(True)

        # config path
        self.config_path = config_var("config_path", "conf")
        self.config_path.hook = self.update_config_path

        # test variable list
        self.var_list = config_var("var_list", ["item"])

        self.log_debug("initial values:")
        self.log_debug("-> .debug = True")
        self.log_debug("-> .config_path = " + self.config_path.get())
        self.log_debug("-> .var_list = " + str(self.var_list.value))

        cfr = config_file_reader()
        cfr.debug()

        # init test class
        self.t = test("test")
        self.log_debug("init system done")
Пример #6
0
    def __init__(self, form, path=None, adjust=True, frame=False):
        """<DOC>
		Constructor.
		
		Arguments:
		form -- The parent form.
		
		Keyword arguments:
		path -- The full path to the image (default=None).
		adjust -- Indicates whether the image should be scaled according to the #
				  size of the widget (default=True).
		frame -- Indicates whether a frame should be drawn around the widget #
				 (default=False).
		</DOC>"""

        if type(adjust) != bool:
            adjust = adjust == u'yes'
        if type(frame) != bool:
            frame = frame == u'yes'

        widget.__init__(self, form)
        self.adjust = adjust
        self.frame = frame
        self.path = path
        self.type = u'image'
Пример #7
0
    def __init__(self, form, nodes=5, click_accepts=False, var=None):
        """<DOC>
		Constructor
		
		Arguments:
		form -- the parent form
		
		Keyword arguments:
		nodes -- the number of nodes or a list of node identifiers (e.g.,
				 ['yes', 'no', 'maybe']. If a list is passed the rating scale
				 will have labels, otherwise it will just have boxes.
				 (default=5)
		click_accepts -- indicates whether the form should close when a value
						 is selected (default=False)
		var -- the name of the experimental variable that should be used to log
			   the widget status (default=None)								 
		</DOC>"""

        if type(click_accepts) != bool:
            click_accepts = click_accepts == 'yes'

        widget.__init__(self, form)
        self.type = 'rating_scale'
        self.box_size = 16
        self.click_accepts = click_accepts
        self.pos_list = []
        self.var = var
        if type(nodes) == int:
            self.nodes = [''] * nodes
        elif type(nodes) in (str, unicode):
            self.nodes = nodes.split(';')
        else:
            self.nodes = nodes
        self.set_value(None)
Пример #8
0
	def __init__(self, form, path=None, adjust=True, frame=False):
	
		"""<DOC>
		Constructor
		
		Arguments:
		form -- the parent form
		
		Keyword arguments:
		path -- the full path to the image (default=None)		
		adjust -- indicates whether the image should be scaled according to the
				  size of the widget (default=True)
		frame -- indicates whether a frame should be drawn around the widget
				 (default=False)
		</DOC>"""		
	
		if type(adjust) != bool:
			adjust = adjust == 'yes'			
		if type(frame) != bool:
			frame = frame == 'yes'						
	
		widget.__init__(self, form)
		self.adjust = adjust
		self.frame = frame
		self.path = path
		self.type = 'image'
Пример #9
0
    def __init__(self, width=0, height=0):
        widget.__init__(self, "textarea", width, height)

        self.font = font.get_font()
        self.line_height = self.font.size('a')[1]
        self.line_offset = self.LineOffset
        self.line_separator = self.LineSeparator

        self.text = ""
Пример #10
0
    def __init__(self, width=0, height=0):
        widget.__init__(self, "checkbox", width, height)
        self.normal_image = pygame.image.load(self.Normal)
        self.checked_image = pygame.image.load(self.Checked)
        self.state_changed = None
        self.checked = False

        self.width = self.normal_image.get_width()
        self.height = self.normal_image.get_height()
Пример #11
0
 def __init__(self, name):
     widget.__init__(self, name)
     self.url = config_var("url", "www.yahoo.de")
     self.key = config_var("key", "asdf")
     self.log_debug("initial values:")
     self.url.log_debug("-> .value = " + self.url.value)
     self.key.log_debug("-> .value = " + self.key.value)
     cfr = config_file_reader()
     cfr.debug()
     self.log_debug("init test done")
Пример #12
0
    def __init__(self, image_path, width=0, height=0):
        widget.__init__(self, "picturebox", width, height)
        self.image_path = image_path
        self.image = pygame.image.load(self.image_path)

        if self.width == 0 and self.height == 0:
            self.width = self.image.get_width()
            self.height = self.image.get_height()
        elif self.width < self.image.get_width or self.height < self.image.get_height():
            self.image = pygame.transform.scale(self.image, (self.width, self.height))
Пример #13
0
    def __init__(self, name):
        widget.__init__(self, name)

        # list of apps
        self.app_list = config_var("app_list",  ["WeatherApp"])
        cfr = config_file_reader()
        cfr.debug()

        self.app_list.set(["WeatherApp"])

        # load apps
        self.__initialize()

        self.log_debug("init apps done")
Пример #14
0
	def __init__(self, form, nodes=5, click_accepts=False, orientation=u'horizontal', var=None, default=None):
	
		"""<DOC>
		Constructor.
		
		Arguments:
		form			--	The parent form.
		
		Keyword arguments:
		nodes			--	The number of nodes or a list of node identifiers (e.g., #
							['yes', 'no', 'maybe']. If a list is passed the rating scale #
							will have labels, otherwise it will just have boxes #
							(default=5).
		click_accepts	--	Indicates whether the form should close when a value #
							is selected (default=False).
		orientation		--	'horizontal' indicates a horizontally oriented
							rating scale, 'vertical' indicates a vertically
							oriented rating scale. (default=u'horizontal')
		var				--	The name of the experimental variable that should be used to log #
							the widget status. The value that is logged is the number of #
							the node that was selected, with the first node being 0. If no #
							nodes were selected, the value is 'None'. For more information #
							about the use of response variables in forms, see the form #
							documentation page.(default=None).
		default			--	The node that is selected by default, or None to #
							select no node. The value corresponds to the node #
							number, where 0 is the first node. (default=None)
		</DOC>"""	
		
		if isinstance(click_accepts, basestring):
			click_accepts = click_accepts == u'yes'
		
		widget.__init__(self, form)
		self.type = u'rating_scale'
		self.box_size = 16
		self.click_accepts = click_accepts
		self.pos_list = []
		self.var = var
		self.orientation = orientation
		if type(nodes) == int:
			self.nodes = [u'']*nodes
		elif isinstance(nodes, basestring):
			self.nodes = nodes.split(u';')
		else:
			self.nodes = nodes
		self.set_value(default)
Пример #15
0
    def __init__(self, name):
        widget.__init__(self, name)

        # debug
        self.debug = config_var("debug", True)
        self.debug.hook = self.update_debug
        #enable / disable debug
        self.debug.set(True)

        #config path
        config_file_reader.config_path = "conf"

        cfr = config_file_reader()
        cfr.debug()

        self.gui = gui("gui")
        self.apps = apps("apps")
        self.log_debug("init liquidsand done")
Пример #16
0
 def __init__(self, name):
     widget.__init__(self, name)
     self.log_debug("init gui done")
Пример #17
0
 def __init__(self, width=0, height=0):
     widget.__init__(self, "textbox", width, height)
     self.font = font.get_font()
     self.text = ""
     self.tick = 0
     self.text_changed = None
Пример #18
0
 def __init__(self, width=0, height=0):
     widget.__init__(self, "label", width, height)
     self.font = font.get_font()
     self.text = ""
     self.auto_size = True
Пример #19
0
 def __init__(self, name, value):
     self.value = value
     widget.__init__(self, name)
     self.log("so much deeper")
Пример #20
0
 def __init__(self):
     widget.__init__(self)
Пример #21
0
 def __init__(self, name):
     widget.__init__(self, name)
     self.log("test")
     self.d = deep("deep")
Пример #22
0
 def __init__(self, name):
     widget.__init__(self, name)
     self.log("so deep")
Пример #23
0
 def __init__(self):
     widget.__init__(self, "config_file_reader")
     self.__filename = config_file_reader.config_path + "/" + self.get_parent().name + ".json"
     self.__changed = False
     self.__read_file()
     atexit.register(self.exit)
Пример #24
0
 def __init__(self, name, value):
     widget.__init__(self, name)
     self.__value = value
     self.__hooks = list()
Пример #25
0
 def __init__(self, width=0, height=0):
     widget.__init__(self, "textbox", width, height)
     self.font = font.get_font()
     self.text = ""
     self.tick = 0
     self.text_changed = None