Commit ce9c26e4 authored by Guillaume Seguin's avatar Guillaume Seguin

Rename custombuttonbuttons to custombuttons_widgets

Previous rename was wrong as it overlapped with another variable in use,
thus breaking everything. D'oh !
parent 035ed036
......@@ -948,11 +948,11 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
pass
def cbuttons_reload(self):
allcbs = getattr(self, "custombuttonbuttons", [])
allcbs = getattr(self, "custombuttons_widgets", [])
for button in allcbs:
self.centersizer.Detach(button)
button.Destroy()
self.custombuttonbuttons = []
self.custombuttons_widgets = []
custombuttons = self.custombuttons[:] + [None]
for i, btndef in enumerate(custombuttons):
if btndef is None:
......@@ -977,7 +977,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
if btndef is not None:
b.Bind(wx.EVT_BUTTON, self.procbutton)
b.Bind(wx.EVT_MOUSE_EVENTS, self.editbutton)
self.custombuttonbuttons.append(b)
self.custombuttons_widgets.append(b)
if type(self.centersizer) == wx.GridBagSizer:
self.centersizer.Add(b, pos = (i // 4, i % 4), flag = wx.EXPAND)
else:
......@@ -1135,7 +1135,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
#if self.uppersizer.GetItem(self.newbuttonbutton) is not None:
# self.uppersizer.SetItemMinSize(self.newbuttonbutton, obj.GetSize())
# self.mainsizer.Layout()
for b in self.custombuttonbuttons:
for b in self.custombuttons_widgets:
#if b.IsFrozen(): b.Thaw()
if b.properties is None:
b.Enable()
......@@ -1165,7 +1165,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
dst = None
src = self.dragging.sourcebutton
drg = self.dragging
for b in self.custombuttonbuttons:
for b in self.custombuttons_widgets:
if b.GetScreenRect().Contains(scrpos):
dst = b
break
......@@ -1212,7 +1212,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
dst = None
src = self.dragging.sourcebutton
drg = self.dragging
for b in self.custombuttonbuttons:
for b in self.custombuttons_widgets:
if b.GetScreenRect().Contains(scrpos):
dst = b
break
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment