Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: kliment/Printrun
base: e73e11d554
...
head fork: kliment/Printrun
compare: 8b83ba62b6
  • 3 commits
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Showing with 30 additions and 20 deletions.
  1. +30 −20 pronterface.py
View
50 pronterface.py
@@ -485,14 +485,14 @@ def edit_macro(self,macro):
if macro == "": return self.new_macro()
if self.macros.has_key(macro):
old_def = self.macros[macro]
- elif hasattr(self.__class__,"do_"+macro):
- print _("Name '%s' is being used by built-in command") % macro
- return
- elif len([c for c in macro if not c.isalnum() and c != "_"]):
- print _("Macro name may contain only alphanumeric symbols and underscores")
+ elif len([c for c in macro.encode("ascii","replace") if not c.isalnum() and c != "_"]):
+ print _("Macro name may contain only ASCII alphanumeric symbols and underscores")
if webavail:
self.webInterface.AddLog("Macro name may contain only alphanumeric symbols and underscores")
return
+ elif hasattr(self.__class__,"do_"+macro):
+ print _("Name '%s' is being used by built-in command") % macro
+ return
else:
old_def = ""
self.start_macro(macro,old_def)
@@ -950,7 +950,10 @@ def cbuttons_reload(self):
b.SetToolTip(wx.ToolTip(_("click to add new custom button")))
b.Bind(wx.EVT_BUTTON,self.cbutton_edit)
else:
- continue
+ b=wx.Button(self.panel,-1,".",size=(1,1))
+ #b=wx.StaticText(self.panel,-1,"",size=(72,22),style=wx.ALIGN_CENTRE+wx.ST_NO_AUTORESIZE) #+wx.SIMPLE_BORDER
+ b.Disable()
+ #continue
b.custombutton=i
b.properties=btndef
if btndef is not None:
@@ -1114,13 +1117,25 @@ def editbutton(self,e):
if not hasattr(self,"dragging"):
# init dragging of the custom button
if hasattr(obj,"custombutton") and obj.properties is not None:
- self.newbuttonbutton.SetLabel("")
- self.newbuttonbutton.SetFont(wx.Font(10,wx.FONTFAMILY_DEFAULT,wx.FONTSTYLE_NORMAL,wx.FONTWEIGHT_NORMAL))
- self.newbuttonbutton.SetForegroundColour("black")
- self.newbuttonbutton.SetSize(obj.GetSize())
- if self.upperbottomsizer.GetItem(self.newbuttonbutton) is not None:
- self.upperbottomsizer.SetItemMinSize(self.newbuttonbutton,obj.GetSize())
- self.topsizer.Layout()
+ #self.newbuttonbutton.SetLabel("")
+ #self.newbuttonbutton.SetFont(wx.Font(10,wx.FONTFAMILY_DEFAULT,wx.FONTSTYLE_NORMAL,wx.FONTWEIGHT_NORMAL))
+ #self.newbuttonbutton.SetForegroundColour("black")
+ #self.newbuttonbutton.SetSize(obj.GetSize())
+ #if self.upperbottomsizer.GetItem(self.newbuttonbutton) is not None:
+ # self.upperbottomsizer.SetItemMinSize(self.newbuttonbutton,obj.GetSize())
+ # self.topsizer.Layout()
+ for b in self.custombuttonbuttons:
+ #if b.IsFrozen(): b.Thaw()
+ if b.properties is None:
+ b.Enable()
+ b.SetLabel("")
+ b.SetFont(wx.Font(10,wx.FONTFAMILY_DEFAULT,wx.FONTSTYLE_NORMAL,wx.FONTWEIGHT_NORMAL))
+ b.SetForegroundColour("black")
+ b.SetSize(obj.GetSize())
+ if self.upperbottomsizer.GetItem(b) is not None:
+ self.upperbottomsizer.SetItemMinSize(b,obj.GetSize())
+ self.topsizer.Layout()
+ # b.SetStyle(wx.ALIGN_CENTRE+wx.ST_NO_AUTORESIZE+wx.SIMPLE_BORDER)
self.dragging = wx.Button(self.panel,-1,obj.GetLabel(),style=wx.BU_EXACTFIT)
self.dragging.SetBackgroundColour(obj.GetBackgroundColour())
self.dragging.SetForegroundColour(obj.GetForegroundColour())
@@ -1128,11 +1143,6 @@ def editbutton(self,e):
self.dragging.Raise()
self.dragging.Disable()
self.dragging.SetPosition(self.panel.ScreenToClient(scrpos))
- for b in self.custombuttonbuttons:
- #if b.IsFrozen(): b.Thaw()
- if b.properties is None:
- b.Enable()
- # b.SetStyle(wx.ALIGN_CENTRE+wx.ST_NO_AUTORESIZE+wx.SIMPLE_BORDER)
self.last_drag_dest = obj
self.dragging.label = obj.s_label = obj.GetLabel()
self.dragging.bgc = obj.s_bgc = obj.GetBackgroundColour()
@@ -2063,10 +2073,10 @@ def paint(self,ev):
#gc.DrawText(text,29,-2)
gc.SetFont(gc.CreateFont(wx.Font(10,wx.FONTFAMILY_DEFAULT,wx.FONTSTYLE_NORMAL,wx.FONTWEIGHT_BOLD),wx.WHITE))
gc.DrawText(self.title,x0+19,y0+4)
- gc.DrawText(text, x0+133,y0+4)
+ gc.DrawText(text, x0+119,y0+4)
gc.SetFont(gc.CreateFont(wx.Font(10,wx.FONTFAMILY_DEFAULT,wx.FONTSTYLE_NORMAL,wx.FONTWEIGHT_BOLD)))
gc.DrawText(self.title,x0+18,y0+3)
- gc.DrawText(text, x0+132,y0+3)
+ gc.DrawText(text, x0+118,y0+3)
if __name__ == '__main__':
app = wx.App(False)

No commit comments for this range

Something went wrong with that request. Please try again.