示例#1
0
文件: folding_box.py 项目: arokem/Fos
    def on_mouse_press(self, x, y, button, modifiers):
        if button == pyglet.window.mouse.LEFT and self.topbar.hit_test(x - self._gx, y - self._gy):
            self.collapsed = not self.collapsed
            return pyglet.event.EVENT_HANDLED

        SingleContainer.on_mouse_press(self, x, y, button, modifiers)
        return pyglet.event.EVENT_UNHANDLED
示例#2
0
    def on_mouse_press(self, x, y, button, modifiers):
        if button == pyglet.window.mouse.LEFT and \
          self.topbar.hit_test(x - self._gx, y - self._gy):
            self.collapsed = not self.collapsed
            return pyglet.event.EVENT_HANDLED

        SingleContainer.on_mouse_press(self, x, y, button, modifiers)
        return pyglet.event.EVENT_UNHANDLED
示例#3
0
    def on_mouse_press(self, x, y, button, modifiers):
        if button == pyglet.window.mouse.LEFT and \
          self.topbar.hit_test(x - self.x, y - self.y):
            self._in_drag = True
            self._offset_x = x - self.x
            self._offset_y = y - self.y
            return pyglet.event.EVENT_HANDLED

        SingleContainer.on_mouse_press(self, x, y, button, modifiers)
        return pyglet.event.EVENT_UNHANDLED
示例#4
0
	def on_mouse_press(self, x, y, button, modifiers):
		if button == pyglet.window.mouse.LEFT and \
				self.topbar.hit_test(x - self.x, y - self.y):
			self._in_drag = True
			self._offset_x = x - self.x
			self._offset_y = y - self.y
			return pyglet.event.EVENT_HANDLED
		
		SingleContainer.on_mouse_press(self, x, y, button, modifiers)
		return pyglet.event.EVENT_UNHANDLED
示例#5
0
	def on_mouse_press(self, x, y, button, modifiers):
		if button == pyglet.window.mouse.LEFT and \
				self.topbar.hit_test(x - self._gx, y - self._gy):
			self._collapsed = not self._collapsed
			self._h, self._last_h = self._last_h, self._h
			self.elements['topbar'].patch = self.theme['folding_box'][('image_closed' if self._collapsed else 'image')]
			self.find_root().update_layout()
			return pyglet.event.EVENT_HANDLED
		
		SingleContainer.on_mouse_press(self, x, y, button, modifiers)
		return pyglet.event.EVENT_UNHANDLED
示例#6
0
	def on_mouse_press(self, x, y, button, modifiers):
		if button == pyglet.window.mouse.LEFT and \
				self.topbar.hit_test(x - self.x, y - self.y):
			self._in_drag = True
			self._offset_x = x - self.x
			self._offset_y = y - self.y
			return pyglet.event.EVENT_HANDLED
		
		if self.resizeable and button == pyglet.window.mouse.LEFT and \
				self.elements['resize'].hit_test(x - self.x, y - self.y):
			self._in_resize = True
			self._orig_y = self.y
			self._orig_h = self.h
			self._offset_x = x - self.x - self.w
			self._offset_y = y - self.y
			return pyglet.event.EVENT_HANDLED
		
		SingleContainer.on_mouse_press(self, x, y, button, modifiers)
		return pyglet.event.EVENT_UNHANDLED