1
2
4
5
6
7
8 combinations = dict(
9 onFocus = ["onLostFocus"],
10 onLostFocus = ["onFocus"],
11 onKeyDown = ["onKeyUp", "onKeyPress"],
12 onKeyUp = ["onKeyPress", "onKeyDown"],
13 onKeyPress = ["onKeyDown", "onKeyUp"],
14 onMouseMove = ["onMouseDown","onMouseUp","onMouseEnter","onMouseLeave"],
15 onMouseDown = ["onMouseUp","onMouseEnter","onMouseLeave","onMouseMove"],
16 onMouseUp = ["onMouseEnter","onMouseLeave","onMouseMove","onMouseDown"],
17 onMouseEnter = ["onMouseLeave","onMouseMove","onMouseDown","onMouseUp"],
18 onMouseLeave = ["onMouseMove","onMouseDown","onMouseUp","onMouseEnter"],
19 onTabSelected = ["onBeforeTabSelected"],
20 onBeforeTabSelected = ["onTabSelected"],
21 )
22
24 self.set(obj, **kwargs)
25
26 - def set(self, obj, **kwargs):
27 """Check for missing event functions and substitute these with """
28 """the ignore method"""
29 ignore = getattr(self, "ignore")
30 for k, v in kwargs.iteritems():
31 setattr(self, k, getattr(obj, v))
32 if k in self.combinations:
33 for k1 in self.combinations[k]:
34 if not hasattr(self, k1):
35 setattr(self, k1, ignore)
36
37 - def ignore(self, *args, **kwargs):
38 """Ignore event"""
39
40
41 return True
42