-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCustomWidgetsXRC.py
84 lines (73 loc) · 2.94 KB
/
CustomWidgetsXRC.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import wx
from wx import xrc
from CustomWidgets import wxFader
from CustomWidgets import wxKnob
from CustomWidgets import wxPiano
from CustomWidgets import wxMediaVisual
class wxFaderCtrlXmlHandler(xrc.XmlResourceHandler):
def __init__(self):
xrc.XmlResourceHandler.__init__(self)
# Standard styles
self.AddWindowStyles()
def CanHandle(self,node):
return self.IsOfClass(node, 'wxFader')
# Process XML parameters and create the object
def DoCreateResource(self):
assert self.GetInstance() is None
#~ f = wxFader(self.GetParentAsWindow(),
#~ self.GetID(),
#~ self.GetPosition(),
#~ self.GetSize(),
#~ self.GetStyle())
f = wxFader()
f.Create(self.GetParentAsWindow(), self.GetID(), self.GetPosition(), self.GetSize(), self.GetStyle())
self.SetupWindow(f)
f.SetInput(self.GetText('input_type'), eval(self.GetText('address')))
return f
class wxKnobCtrlXmlHandler(xrc.XmlResourceHandler):
def __init__(self):
xrc.XmlResourceHandler.__init__(self)
# Standard styles
self.AddWindowStyles()
def CanHandle(self,node):
return self.IsOfClass(node, 'wxKnob')
# Process XML parameters and create the object
def DoCreateResource(self):
assert self.GetInstance() is None
f = wxKnob()
f.Create(self.GetParentAsWindow(), self.GetID(), self.GetPosition(), self.GetSize(), self.GetStyle())
self.SetupWindow(f)
f.SetInput(self.GetText('input_type'), eval(self.GetText('address')))
return f
class wxPianoCtrlXmlHandler(xrc.XmlResourceHandler):
def __init__(self):
xrc.XmlResourceHandler.__init__(self)
# Standard styles
self.AddWindowStyles()
def CanHandle(self,node):
return self.IsOfClass(node, 'wxPiano')
# Process XML parameters and create the object
def DoCreateResource(self):
assert self.GetInstance() is None
f = wxPiano(self.GetParentAsWindow(),
self.GetID(),
self.GetPosition(),
self.GetSize(),
self.GetStyle())
self.SetupWindow(f)
return f
class wxMediaVisualCtrlXmlHandler(xrc.XmlResourceHandler):
def __init__(self):
xrc.XmlResourceHandler.__init__(self)
# Standard styles
self.AddWindowStyles()
def CanHandle(self,node):
return self.IsOfClass(node, 'wxMediaVisual')
# Process XML parameters and create the object
def DoCreateResource(self):
assert self.GetInstance() is None
f = wxMediaVisual()
f.Create(self.GetParentAsWindow(), self.GetID())
self.SetupWindow(f)
f.SetInput(self.GetText('input_type'), eval(self.GetText('address')))
return f