Remove no longer needed wxpython3.0 patch
Scott Talbert
4 years ago
0 | Description: Update for wxPython 3.0 | |
1 | These changes should remain compatible with wxPython 2.8. | |
2 | Bug-Debian: https://bugs.debian.org/759058 | |
3 | Forwarded: no | |
4 | Last-Update: 2014-09-07 | |
5 | ||
6 | Index: soundgrain-4.1.1/Resources/FxBall.py | |
7 | =================================================================== | |
8 | --- soundgrain-4.1.1.orig/Resources/FxBall.py | |
9 | +++ soundgrain-4.1.1/Resources/FxBall.py | |
10 | @@ -152,8 +152,8 @@ def getColors(col, gradient): | |
11 | return firstColor, secondColor | |
12 | ||
13 | def GetRoundMaskBitmap(w, h, radius): | |
14 | - maskColor = wx.Color(30,30,30) | |
15 | - shownColor = wx.Color(29,29,29) | |
16 | + maskColor = wx.Colour(30,30,30) | |
17 | + shownColor = wx.Colour(29,29,29) | |
18 | b = wx.EmptyBitmap(w,h) | |
19 | dc = wx.MemoryDC(b) | |
20 | dc.SetPen(wx.Pen(maskColor, 1)) | |
21 | @@ -168,7 +168,7 @@ def GetRoundMaskBitmap(w, h, radius): | |
22 | ||
23 | def GetRoundBitmap(w, h, mask, col, gradient): | |
24 | firstColor, secondColor = getColors(col, gradient) | |
25 | - maskColor = wx.Color(30,30,30) | |
26 | + maskColor = wx.Colour(30,30,30) | |
27 | b = wx.EmptyBitmap(w,h) | |
28 | dc = wx.MemoryDC(b) | |
29 | dc.SetPen(wx.Pen(maskColor, 1)) | |
30 | Index: soundgrain-4.1.1/Resources/splash.py | |
31 | =================================================================== | |
32 | --- soundgrain-4.1.1.orig/Resources/splash.py | |
33 | +++ soundgrain-4.1.1/Resources/splash.py | |
34 | @@ -63,12 +63,7 @@ class SoundGrainSplashScreen(wx.Frame): | |
35 | dc.DrawRectangle(0,0,w,h) | |
36 | dc.DrawBitmap(self.bmp, 0,0,True) | |
37 | dc.SetTextForeground("#FFFFFF") | |
38 | - font = dc.GetFont() | |
39 | - if PLATFORM == "win32": | |
40 | - pass | |
41 | - else: | |
42 | - font.SetFaceName("Monaco") | |
43 | - font.SetPixelSize((15,15)) | |
44 | + font = wx.FFontFromPixelSize(pixelSize=(15,15), family=wx.FONTFAMILY_DEFAULT, face="Monaco") | |
45 | dc.SetFont(font) | |
46 | dc.DrawLabel(u"Olivier Bélanger", wx.Rect(0, 320, 400, 15), wx.ALIGN_CENTER) | |
47 | dc.DrawLabel("iACT, %s" % SG_YEAR, wx.Rect(0, 335, 400, 15), wx.ALIGN_CENTER) | |
48 | @@ -80,6 +75,11 @@ class SoundGrainSplashScreen(wx.Frame): | |
49 | self.Destroy() | |
50 | ||
51 | if __name__ == '__main__': | |
52 | - app = wx.PySimpleApp() | |
53 | + class MySimpleApp(wx.App): | |
54 | + def OnInit(self): | |
55 | + # Suppress WXDEBUG assertions, as happens by default with wx2.8. | |
56 | + #self.SetAssertMode(wx.PYAPP_ASSERT_SUPPRESS) | |
57 | + return True | |
58 | + app = MySimpleApp() | |
59 | frame = SoundGrainSplashScreen(None, img="SoundGrainSplash.png") | |
60 | app.MainLoop() | |
61 | Index: soundgrain-4.1.1/SoundGrain.py | |
62 | =================================================================== | |
63 | --- soundgrain-4.1.1.orig/SoundGrain.py | |
64 | +++ soundgrain-4.1.1/SoundGrain.py | |
65 | @@ -286,12 +286,12 @@ class DrawingSurface(wx.Panel): | |
66 | return self.oscilScaling | |
67 | ||
68 | def SetColors(self, outline, bg, fill, rect, losa, wave): | |
69 | - self.outlinecolor = wx.Color(*outline) | |
70 | - self.backgroundcolor = wx.Color(*bg) | |
71 | - self.fillcolor = wx.Color(*fill) | |
72 | - self.rectcolor = wx.Color(*rect) | |
73 | - self.losacolor = wx.Color(*losa) | |
74 | - self.wavecolor = wx.Color(*wave) | |
75 | + self.outlinecolor = wx.Colour(*outline) | |
76 | + self.backgroundcolor = wx.Colour(*bg) | |
77 | + self.fillcolor = wx.Colour(*fill) | |
78 | + self.rectcolor = wx.Colour(*rect) | |
79 | + self.losacolor = wx.Colour(*losa) | |
80 | + self.wavecolor = wx.Colour(*wave) | |
81 | self.losaBrush = wx.Brush(self.losacolor, wx.SOLID) | |
82 | self.losaPen = wx.Pen(self.losacolor, width=1, style=wx.SOLID) | |
83 | ||
84 | @@ -1310,7 +1310,7 @@ class ControlPanel(scrolled.ScrolledPane | |
85 | defaultFile="", | |
86 | wildcard="AIFF file |*.aif;*.aiff;*.aifc;*.AIF;*.AIFF;*.Aif;*.Aiff|" \ | |
87 | "Wave file |*.wav;*.wave;*.WAV;*.WAVE;*.Wav;*.Wave", | |
88 | - style=wx.OPEN) | |
89 | + style=wx.FD_OPEN) | |
90 | if dlg.ShowModal() == wx.ID_OK: | |
91 | sndPath = dlg.GetPath() | |
92 | self.loadSound(ensureNFD(sndPath)) | |
93 | @@ -1322,7 +1322,7 @@ class ControlPanel(scrolled.ScrolledPane | |
94 | defaultFile="", | |
95 | wildcard="AIFF file |*.aif;*.aiff;*.aifc;*.AIF;*.AIFF;*.Aif;*.Aiff|" \ | |
96 | "Wave file |*.wav;*.wave;*.WAV;*.WAVE;*.Wav;*.Wave", | |
97 | - style=wx.OPEN) | |
98 | + style=wx.FD_OPEN) | |
99 | if dlg.ShowModal() == wx.ID_OK: | |
100 | ok = True | |
101 | sndPath = dlg.GetPath() | |
102 | @@ -2053,7 +2053,7 @@ class MainFrame(wx.Frame): | |
103 | dlg = wx.FileDialog(self, message="Open SoundGrain file...", | |
104 | defaultFile="", | |
105 | wildcard="SoundGrain file (*.sg)|*.sg", | |
106 | - style=wx.OPEN) | |
107 | + style=wx.FD_OPEN) | |
108 | if dlg.ShowModal() == wx.ID_OK: | |
109 | path = dlg.GetPath() | |
110 | self.loadFile(ensureNFD(path)) | |
111 | @@ -2077,7 +2077,7 @@ class MainFrame(wx.Frame): | |
112 | def handleSaveAs(self, evt): | |
113 | dlg = wx.FileDialog(self, message="Save file as ...", | |
114 | defaultFile="Granulator.sg", | |
115 | - style=wx.SAVE) | |
116 | + style=wx.FD_SAVE) | |
117 | if dlg.ShowModal() == wx.ID_OK: | |
118 | path = dlg.GetPath() | |
119 | if os.path.isfile(path): | |
120 | @@ -2323,7 +2323,7 @@ class MainFrame(wx.Frame): | |
121 | wildcard = "AIFF file|*.aiff;*.aif|" \ | |
122 | "Wave file|*.wave;*.wav" | |
123 | dlg2 = wx.FileDialog(self, message="Choose a filename...", defaultDir=os.getcwd(), | |
124 | - defaultFile="mixedtable.wav", wildcard=wildcard, style=wx.SAVE | wx.CHANGE_DIR) | |
125 | + defaultFile="mixedtable.wav", wildcard=wildcard, style=wx.FD_SAVE | wx.FD_CHANGE_DIR) | |
126 | if dlg2.ShowModal() == wx.ID_OK: | |
127 | path = dlg2.GetPath() | |
128 | if path != "": | |
129 | @@ -2461,10 +2461,10 @@ class MainFrame(wx.Frame): | |
130 | info.Copyright = u'(C) %s Olivier Bélanger' % SG_YEAR | |
131 | wx.AboutBox(info) | |
132 | ||
133 | -class SoundGrainApp(wx.PySimpleApp): | |
134 | +class SoundGrainApp(wx.App): | |
135 | def __init__(self, *args, **kwargs): | |
136 | global SCREEN_SIZE | |
137 | - wx.PySimpleApp.__init__(self, *args, **kwargs) | |
138 | + wx.App.__init__(self, *args, **kwargs) | |
139 | X,Y = wx.SystemSettings.GetMetric(wx.SYS_SCREEN_X), wx.SystemSettings.GetMetric(wx.SYS_SCREEN_Y) | |
140 | SCREEN_SIZE = (X, Y) | |
141 | if X < 900: sizex = X - 40 | |
142 | @@ -2476,6 +2476,11 @@ class SoundGrainApp(wx.PySimpleApp): | |
143 | self.frame = MainFrame(None, -1, pos=(20,20), size=(sizex,sizey)) | |
144 | self.loadFile = self.frame.loadFile | |
145 | ||
146 | + def OnInit(self): | |
147 | + # Suppress WXDEBUG assertions, as happens by default with wx2.8. | |
148 | + #self.SetAssertMode(wx.PYAPP_ASSERT_SUPPRESS) | |
149 | + return True | |
150 | + | |
151 | def MacOpenFile(self, filename): | |
152 | self.loadFile(ensureNFD(filename)) | |
153 |