Commit 40e7c3ba authored by Kliment Yanev's avatar Kliment Yanev

Make pronterface window even more compact

parent 4c292e61
...@@ -109,7 +109,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole): ...@@ -109,7 +109,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
zcol=(180,255,180) zcol=(180,255,180)
self.cpbuttons=[ self.cpbuttons=[
[_("Motors off"),("M84"),(0,0),(250,250,250),(1,2)], [_("Motors off"),("M84"),(0,0),(250,250,250),(1,2)],
[_("Check temp"),("M105"),(2,5),(225,200,200),(1,2)], [_("Check temp"),("M105"),(2,5),(225,200,200),(1,1)],
[_("Extrude"),("extrude"),(4,0),(225,200,200),(1,2)], [_("Extrude"),("extrude"),(4,0),(225,200,200),(1,2)],
[_("Reverse"),("reverse"),(5,0),(225,200,200),(1,2)], [_("Reverse"),("reverse"),(5,0),(225,200,200),(1,2)],
] ]
...@@ -520,19 +520,16 @@ class PronterWindow(wx.Frame,pronsole.pronsole): ...@@ -520,19 +520,16 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self.resetbtn=wx.Button(self.panel,-1,_("Reset"),style=wx.BU_EXACTFIT) self.resetbtn=wx.Button(self.panel,-1,_("Reset"),style=wx.BU_EXACTFIT)
self.resetbtn.Bind(wx.EVT_BUTTON,self.reset) self.resetbtn.Bind(wx.EVT_BUTTON,self.reset)
uts.Add(self.resetbtn) uts.Add(self.resetbtn)
self.minibtn=wx.Button(self.panel,-1,_("Mini mode"),style=wx.BU_EXACTFIT) #self.minibtn=wx.Button(self.panel,-1,_("Mini mode"),style=wx.BU_EXACTFIT)
self.minibtn.Bind(wx.EVT_BUTTON,self.toggleview) #self.minibtn.Bind(wx.EVT_BUTTON,self.toggleview)
uts.Add((25,-1)) #uts.Add((25,-1))
self.monitorbox=wx.CheckBox(self.panel,-1,_("Monitor Printer"))
uts.Add(self.monitorbox,0,wx.ALIGN_CENTER)
self.monitorbox.Bind(wx.EVT_CHECKBOX,self.setmonitor)
uts.Add((15,-1),flag=wx.EXPAND) #uts.Add((15,-1),flag=wx.EXPAND)
uts.Add(self.minibtn,0,wx.ALIGN_CENTER) #uts.Add(self.minibtn,0,wx.ALIGN_CENTER)
#SECOND ROW #SECOND ROW
ubs=self.upperbottomsizer=wx.BoxSizer(wx.HORIZONTAL) ubs=self.upperbottomsizer=uts#wx.BoxSizer(wx.HORIZONTAL)
self.loadbtn=wx.Button(self.panel,-1,_("Load file"),style=wx.BU_EXACTFIT) self.loadbtn=wx.Button(self.panel,-1,_("Load file"),style=wx.BU_EXACTFIT)
self.loadbtn.Bind(wx.EVT_BUTTON,self.loadfile) self.loadbtn.Bind(wx.EVT_BUTTON,self.loadfile)
...@@ -601,6 +598,11 @@ class PronterWindow(wx.Frame,pronsole.pronsole): ...@@ -601,6 +598,11 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self.printerControls.append(btn) self.printerControls.append(btn)
lls.Add(btn,pos=i[2],span=i[4]) lls.Add(btn,pos=i[2],span=i[4])
self.monitorbox=wx.CheckBox(self.panel,-1,_("Watch"))
lls.Add(self.monitorbox,pos=(2,6))
self.monitorbox.Bind(wx.EVT_CHECKBOX,self.setmonitor)
lls.Add(wx.StaticText(self.panel,-1,_("Heat")),pos=(2,0),span=(1,1),flag=wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT) lls.Add(wx.StaticText(self.panel,-1,_("Heat")),pos=(2,0),span=(1,1),flag=wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT)
htemp_choices=[self.temps[i]+" ("+i+")" for i in sorted(self.temps.keys(),key=lambda x:self.temps[x])] htemp_choices=[self.temps[i]+" ("+i+")" for i in sorted(self.temps.keys(),key=lambda x:self.temps[x])]
...@@ -719,7 +721,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole): ...@@ -719,7 +721,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self.uppersizer=wx.BoxSizer(wx.VERTICAL) self.uppersizer=wx.BoxSizer(wx.VERTICAL)
self.uppersizer.Add(self.uppertopsizer) self.uppersizer.Add(self.uppertopsizer)
self.uppersizer.Add(self.upperbottomsizer) #self.uppersizer.Add(self.upperbottomsizer)
self.lowersizer=wx.BoxSizer(wx.HORIZONTAL) self.lowersizer=wx.BoxSizer(wx.HORIZONTAL)
self.lowersizer.Add(lls) self.lowersizer.Add(lls)
...@@ -817,9 +819,9 @@ class PronterWindow(wx.Frame,pronsole.pronsole): ...@@ -817,9 +819,9 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
allcbs = [] allcbs = []
ubs=self.upperbottomsizer ubs=self.upperbottomsizer
cs=self.centersizer cs=self.centersizer
for item in ubs.GetChildren(): #for item in ubs.GetChildren():
if hasattr(item.GetWindow(),"custombutton"): # if hasattr(item.GetWindow(),"custombutton"):
allcbs += [(ubs,item.GetWindow())] # allcbs += [(ubs,item.GetWindow())]
for item in cs.GetChildren(): for item in cs.GetChildren():
if hasattr(item.GetWindow(),"custombutton"): if hasattr(item.GetWindow(),"custombutton"):
allcbs += [(cs,item.GetWindow())] allcbs += [(cs,item.GetWindow())]
...@@ -859,10 +861,10 @@ class PronterWindow(wx.Frame,pronsole.pronsole): ...@@ -859,10 +861,10 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
#else: #else:
# b.Bind(wx.EVT_BUTTON,lambda e:e.Skip()) # b.Bind(wx.EVT_BUTTON,lambda e:e.Skip())
self.custombuttonbuttons.append(b) self.custombuttonbuttons.append(b)
if i<4: #if i<4:
ubs.Add(b) # ubs.Add(b)
else: #else:
cs.Add(b,pos=((i-4)/3,(i-4)%3)) cs.Add(b,pos=((i)/4,(i)%4))
self.topsizer.Layout() self.topsizer.Layout()
def help_button(self): def help_button(self):
......
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