Пример #1
0
    def __init__(self, parent, sketchpad):
        """
		Constructor
		
		Arguments:
		parent -- parent QWidget
		
		Keyword arguments:
		sketchpad -- sketchpad item
		"""

        QtGui.QDialog.__init__(self, parent, \
         QtCore.Qt.WindowMinMaxButtonsHint | QtCore.Qt.WindowCloseButtonHint)
        self.sketchpad = sketchpad
        self.tools_widget = sketchpad_widget.sketchpad_widget(self.sketchpad, \
         parent=self, embed=False)
        self.close_button = QtGui.QPushButton( \
         self.sketchpad.experiment.icon("close"), "Close")
        self.close_button.setIconSize(QtCore.QSize(16, 16))
        QtCore.QObject.connect(self.close_button, QtCore.SIGNAL("clicked()"), \
         self.accept)
        self.hbox = QtGui.QHBoxLayout()
        self.hbox.addStretch()
        self.hbox.addWidget(self.close_button)
        self.hbox.setContentsMargins(0, 0, 0, 0)
        self.hbox_widget = QtGui.QWidget()
        self.hbox_widget.setLayout(self.hbox)
        self.vbox = QtGui.QVBoxLayout()
        self.vbox.addWidget(self.tools_widget)
        self.vbox.addWidget(self.hbox_widget)
        self.setLayout(self.vbox)
Пример #2
0
	def __init__(self, main_window, sketchpad):

		"""
		desc:
			Constructor.

		arguments:
			main_window:	A qtopensesame object.
			sketchpad:		A sketchpad object.
		"""

		super(sketchpad_dialog, self).__init__(main_window, flags= \
			QtCore.Qt.WindowMinMaxButtonsHint | QtCore.Qt.WindowCloseButtonHint)
		self.sketchpad = sketchpad
		self.tools_widget = sketchpad_widget.sketchpad_widget(self.sketchpad,
			parent=self, embed=False)
		self.close_button = QtGui.QPushButton(self.theme.qicon(u"close"),
			u"Close")
		self.close_button.setIconSize(QtCore.QSize(16,16))
		self.close_button.clicked.connect(self.accept)
		self.hbox = QtGui.QHBoxLayout()
		self.hbox.addStretch()
		self.hbox.addWidget(self.close_button)
		self.hbox.setContentsMargins(0, 0, 0, 0)
		self.hbox_widget = QtGui.QWidget()
		self.hbox_widget.setLayout(self.hbox)
		self.vbox = QtGui.QVBoxLayout()
		self.vbox.addWidget(self.tools_widget)
		self.vbox.addWidget(self.hbox_widget)
		self.setLayout(self.vbox)
Пример #3
0
	def __init__(self, main_window, sketchpad):

		"""
		desc:
			Constructor.

		arguments:
			main_window:	A qtopensesame object.
			sketchpad:		A sketchpad object.
		"""

		super(sketchpad_dialog, self).__init__(main_window, flags= \
			QtCore.Qt.WindowMinMaxButtonsHint | QtCore.Qt.WindowCloseButtonHint)
		self.sketchpad = sketchpad
		self.tools_widget = sketchpad_widget.sketchpad_widget(self.sketchpad,
			parent=self, embed=False)
		self.close_button = QtWidgets.QPushButton(self.theme.qicon(u"close"),
			u"Close")
		self.close_button.setIconSize(QtCore.QSize(16,16))
		self.close_button.clicked.connect(self.accept)
		self.hbox = QtWidgets.QHBoxLayout()
		self.hbox.addStretch()
		self.hbox.addWidget(self.close_button)
		self.hbox.setContentsMargins(0, 0, 0, 0)
		self.hbox_widget = QtWidgets.QWidget()
		self.hbox_widget.setLayout(self.hbox)
		self.vbox = QtWidgets.QVBoxLayout()
		self.vbox.addWidget(self.tools_widget)
		self.vbox.addWidget(self.hbox_widget)
		self.setLayout(self.vbox)
Пример #4
0
	def init_edit_widget(self):

		"""Construct the edit widget that contains the controls"""

		qtitem.qtitem.init_edit_widget(self, False)

		row = 0

		self.edit_grid.addWidget(QtGui.QLabel("Duration"), row, 0)
		self.edit_duration = QtGui.QLineEdit()
		QtCore.QObject.connect(self.edit_duration, QtCore.SIGNAL("editingFinished()"), self.apply_edit_changes)
		self.edit_grid.addWidget(self.edit_duration, row, 1)
		
		row += 1
		self.checkbox_reset = QtGui.QCheckBox("Reset feedback variables")
		self.checkbox_reset.toggled.connect(self.apply_edit_changes)
		self.edit_grid.addWidget(self.checkbox_reset, row, 0)

		row += 1
		self.popout_button = QtGui.QPushButton(self.experiment.icon(self.item_type), "Open editor in new window")
		self.popout_button.setIconSize(QtCore.QSize(16, 16))
		QtCore.QObject.connect(self.popout_button, QtCore.SIGNAL("clicked()"), self.popout)
		self.edit_grid.addWidget(self.popout_button, row, 0)

		self.tools_widget = sketchpad_widget.sketchpad_widget(self)
		self.edit_vbox.addWidget(self.tools_widget)
Пример #5
0
    def init_edit_widget(self):
        """Construct the edit widget that contains the controls"""

        qtitem.qtitem.init_edit_widget(self, False)

        row = 0

        self.edit_grid.addWidget(QtGui.QLabel("Duration"), row, 0)
        self.edit_duration = QtGui.QLineEdit()
        QtCore.QObject.connect(self.edit_duration,
                               QtCore.SIGNAL("editingFinished()"),
                               self.apply_edit_changes)
        self.edit_grid.addWidget(self.edit_duration, row, 1)

        row += 1
        self.checkbox_reset = QtGui.QCheckBox("Reset feedback variables")
        self.checkbox_reset.toggled.connect(self.apply_edit_changes)
        self.edit_grid.addWidget(self.checkbox_reset, row, 0)

        row += 1
        self.popout_button = QtGui.QPushButton(
            self.experiment.icon(self.item_type), "Open editor in new window")
        self.popout_button.setIconSize(QtCore.QSize(16, 16))
        QtCore.QObject.connect(self.popout_button, QtCore.SIGNAL("clicked()"),
                               self.popout)
        self.edit_grid.addWidget(self.popout_button, row, 0)

        self.tools_widget = sketchpad_widget.sketchpad_widget(self)
        self.edit_vbox.addWidget(self.tools_widget)
Пример #6
0
	def __init__(self, parent, sketchpad):
	
		"""
		Constructor
		
		Arguments:
		parent -- parent QWidget
		
		Keyword arguments:
		sketchpad -- sketchpad item
		"""
	
		QtGui.QDialog.__init__(self, parent, \
			QtCore.Qt.WindowMinMaxButtonsHint | QtCore.Qt.WindowCloseButtonHint)
		self.sketchpad = sketchpad
		self.tools_widget = sketchpad_widget.sketchpad_widget(self.sketchpad, \
			parent=self, embed=False)							
		self.close_button = QtGui.QPushButton( \
			self.sketchpad.experiment.icon("close"), "Close")
		self.close_button.setIconSize(QtCore.QSize(16,16))
		QtCore.QObject.connect(self.close_button, QtCore.SIGNAL("clicked()"), \
			self.accept)			
		self.hbox = QtGui.QHBoxLayout()
		self.hbox.addStretch()
		self.hbox.addWidget(self.close_button)
		self.hbox.setContentsMargins(0, 0, 0, 0)		
		self.hbox_widget = QtGui.QWidget()
		self.hbox_widget.setLayout(self.hbox)		
		self.vbox = QtGui.QVBoxLayout()
		self.vbox.addWidget(self.tools_widget)
		self.vbox.addWidget(self.hbox_widget)					
		self.setLayout(self.vbox)
Пример #7
0
	def init_edit_widget(self):

		"""Construct the edit widget that contains the controls"""

		qtitem.qtitem.init_edit_widget(self, False)

		row = 3
		self.edit_grid.addWidget(QtGui.QLabel("Duration"), row, 0)
		self.edit_duration = QtGui.QLineEdit()
		self.edit_duration.setToolTip("A numeric value (duration in milliseconds), 'keypress', 'mouseclick', or '[variable_name]'")
		QtCore.QObject.connect(self.edit_duration, QtCore.SIGNAL("editingFinished()"), self.apply_edit_changes)
		self.edit_grid.addWidget(self.edit_duration, row, 1)

		row += 1
		self.checkbox_start_response_interval = QtGui.QCheckBox("Start response interval")
		self.checkbox_start_response_interval.setToolTip("If checked, the response items will use the onset of the sketchpad to determine response time")
		self.edit_grid.addWidget(self.checkbox_start_response_interval, row, 0)
		QtCore.QObject.connect(self.checkbox_start_response_interval, QtCore.SIGNAL("stateChanged(int)"), self.apply_edit_changes)

		row += 1
		self.popout_button = QtGui.QPushButton(self.experiment.icon(self.item_type), "Open editor in new window")
		self.popout_button.setIconSize(QtCore.QSize(16,16))
		self.popout_button.setToolTip("Open the sketchpad editor in a new window")
		QtCore.QObject.connect(self.popout_button, QtCore.SIGNAL("clicked()"), self.popout)
		self.edit_grid.addWidget(self.popout_button, row, 0)

		self.tools_widget = sketchpad_widget.sketchpad_widget(self)
		self.edit_vbox.addWidget(self.tools_widget)
Пример #8
0
    def init_edit_widget(self):

        """
		desc:
			Initializes the widget.
		"""

        qtplugin.init_edit_widget(self, False)
        self.canvas = sketchpad_canvas(self)
        self.sketchpad_widget = sketchpad_widget(self)
        self.add_widget(self.sketchpad_widget)
        self.auto_add_widget(self.sketchpad_widget.ui.edit_duration, u"duration")
        self.first_refresh = True
Пример #9
0
    def init_edit_widget(self):
        """
		desc:
			Initializes the widget.
		"""

        qtplugin.init_edit_widget(self, False)
        self.canvas = sketchpad_canvas(self)
        self.sketchpad_widget = sketchpad_widget(self)
        self.add_widget(self.sketchpad_widget)
        self.auto_add_widget(self.sketchpad_widget.ui.edit_duration,
                             u'duration')
        self.first_refresh = True
Пример #10
0
    def init_edit_widget(self):
        """
		desc:
			Initializes the widget.
		"""

        qtplugin.init_edit_widget(self, False)
        self.canvas = sketchpad_canvas(self)
        self.sketchpad_widget = sketchpad_widget(self)
        self.add_widget(self.sketchpad_widget)
        self.auto_add_widget(self.sketchpad_widget.ui.edit_duration,
                             u'duration')
        self.auto_add_widget(self.sketchpad_widget.ui.checkbox_reset_variables,
                             u'reset_variables')
Пример #11
0
	def init_edit_widget(self):

		"""
		desc:
			Initializes the widget.
		"""

		qtplugin.init_edit_widget(self, False)
		self.canvas = sketchpad_canvas(self)
		self.sketchpad_widget = sketchpad_widget(self)
		self.add_widget(self.sketchpad_widget)
		self.auto_add_widget(self.sketchpad_widget.ui.edit_duration,
			u'duration')
		self.auto_add_widget(self.sketchpad_widget.ui.checkbox_reset_variables,
			u'reset_variables')
Пример #12
0
	def init_edit_widget(self):

		"""Construct the edit widget that contains the controls"""

		qtplugin.qtplugin.init_edit_widget(self, False)		
		self.add_line_edit_control('duration', 'Duration',
			tooltip='A numeric value (duration in milliseconds), "keypress", or "mouseclick"' \
			)
		self.popout_button = QtGui.QPushButton(self.experiment.icon(self.item_type), "Open editor in new window")
		self.popout_button.setIconSize(QtCore.QSize(16,16))
		self.popout_button.setToolTip("Open the sketchpad editor in a new window")
		QtCore.QObject.connect(self.popout_button, QtCore.SIGNAL("clicked()"), self.popout)
		self.add_control('', self.popout_button, 
			'Open the sketchpad editor in a new window')
		self.tools_widget = sketchpad_widget.sketchpad_widget(self)
		self.edit_vbox.addWidget(self.tools_widget)
Пример #13
0
	def init_edit_widget(self):

		"""
		desc:
			Initializes the widget.
		"""

		qtplugin.init_edit_widget(self, False)
		self.canvas = sketchpad_canvas(self)
		self.sketchpad_widget = sketchpad_widget(self)
		self.add_widget(self.sketchpad_widget)
		self.auto_add_widget(self.sketchpad_widget.ui.edit_duration,
			u'duration')
		self.sketchpad_widget.ui.edit_duration.setValidator(
			duration_validator(self))
		self.first_refresh = True
		self._lock = False
Пример #14
0
    def init_edit_widget(self):
        """Construct the edit widget that contains the controls"""

        qtplugin.qtplugin.init_edit_widget(self, False)
        self.add_line_edit_control('duration', 'Duration', tooltip= \
         'A numeric value (duration in milliseconds), "keypress", or "mouseclick"' \
         )
        self.popout_button = QtGui.QPushButton(self.experiment.icon( \
         self.item_type), "Open editor in new window")
        self.popout_button.setIconSize(QtCore.QSize(16, 16))
        self.popout_button.setToolTip( \
         "Open the sketchpad editor in a new window")
        QtCore.QObject.connect(self.popout_button, \
         QtCore.SIGNAL("clicked()"), self.popout)
        self.add_control('', self.popout_button,
                         'Open the sketchpad editor in a new window')
        self.tools_widget = sketchpad_widget.sketchpad_widget(self)
        self.edit_vbox.addWidget(self.tools_widget)
Пример #15
0
    def init_edit_widget(self):
        """Construct the edit widget that contains the controls"""

        qtitem.qtitem.init_edit_widget(self, False)

        row = 3
        self.edit_grid.addWidget(QtGui.QLabel("Duration"), row, 0)
        self.edit_duration = QtGui.QLineEdit()
        self.edit_duration.setToolTip(
            "A numeric value (duration in milliseconds), 'keypress', 'mouseclick', or '[variable_name]'"
        )
        QtCore.QObject.connect(self.edit_duration,
                               QtCore.SIGNAL("editingFinished()"),
                               self.apply_edit_changes)
        self.edit_grid.addWidget(self.edit_duration, row, 1)

        row += 1
        self.checkbox_start_response_interval = QtGui.QCheckBox(
            "Start response interval")
        self.checkbox_start_response_interval.setToolTip(
            "If checked, the response items will use the onset of the sketchpad to determine response time"
        )
        self.edit_grid.addWidget(self.checkbox_start_response_interval, row, 0)
        QtCore.QObject.connect(self.checkbox_start_response_interval,
                               QtCore.SIGNAL("stateChanged(int)"),
                               self.apply_edit_changes)

        row += 1
        self.popout_button = QtGui.QPushButton(
            self.experiment.icon(self.item_type), "Open editor in new window")
        self.popout_button.setIconSize(QtCore.QSize(16, 16))
        self.popout_button.setToolTip(
            "Open the sketchpad editor in a new window")
        QtCore.QObject.connect(self.popout_button, QtCore.SIGNAL("clicked()"),
                               self.popout)
        self.edit_grid.addWidget(self.popout_button, row, 0)

        self.tools_widget = sketchpad_widget.sketchpad_widget(self)
        self.edit_vbox.addWidget(self.tools_widget)