-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDragableButton3.py
37 lines (32 loc) · 1.4 KB
/
DragableButton3.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
from DragNDropWidget3 import DragNDropWidget
from kivy.uix.button import Button
#from TestLayoutParents import CourseButton
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label
from kivy.uix.togglebutton import ToggleButton
class DragableButton(Button, DragNDropWidget):
'''
Fusing drag and drop capability with useful information from our course objects
'''
def __init__(self, course, **kw):
'''
Constructor
'''
#Button.__init__(self, **kw)
super(DragableButton, self).__init__(**kw)
self.size_hint = (None, None)
self.course=course
def add_bound_zone(self, new_zone_object):
self.bound_zone_objects.append(new_zone_object)
def add_droppable_zone(self, new_zone_object):
self.droppable_zone_objects.append(new_zone_object)
def add_kill_zone(self, new_zone_object):
self.kill_zone_objects.append(new_zone_object)
def __deepcopy__(self, dumb):
return DragableButton(text=self.text,
droppable_zone_objects=self.droppable_zone_objects,
bound_zone_objects=self.bound_zone_objects,
kill_zone_objects=self.kill_zone_objects,
drag_opacity=self.drag_opacity,
remove_on_drag=self.remove_on_drag)