Commit 08d4abbe authored by Duane Johnson's avatar Duane Johnson

Fix that enable/disable does not immediately redraw. Fix that buttons are not...

Fix that enable/disable does not immediately redraw. Fix that buttons are not disabled on disconnect.
parent 18d23a71
......@@ -133,8 +133,11 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
wx.CallAfter(self.connectbtn.Disable)
for i in self.printerControls:
wx.CallAfter(i.Enable)
# Enable XYButtons and ZButtons
self.xyb.enable()
self.zb.enable()
if self.filename:
wx.CallAfter(self.printbtn.Enable)
......@@ -1313,6 +1316,10 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
wx.CallAfter(self.pausebtn.Disable);
for i in self.printerControls:
wx.CallAfter(i.Disable)
# Disable XYButtons and ZButtons
self.xyb.disable()
self.zb.disable()
if self.paused:
self.p.paused=0
......
......@@ -47,9 +47,11 @@ class XYButtons(BufferedCanvas):
def disable(self):
self.enabled = False
self.update()
def enable(self):
self.enabled = True
self.update()
def distanceToLine(self, pos, x1, y1, x2, y2):
xlen = x2 - x1
......
......@@ -33,9 +33,11 @@ class ZButtons(BufferedCanvas):
def disable(self):
self.enabled = False
self.update()
def enable(self):
self.enabled = True
self.update()
def lookupRange(self, ydist):
idx = -1
......
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