From: Daid Date: Wed, 28 Mar 2012 18:36:46 +0000 (+0200) Subject: Initial layout for print window X-Git-Tag: RC1~17 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=2d7929704785bd68f9320ce3bb606b2cff650409;p=cura.git Initial layout for print window --- diff --git a/Cura/newui/mainWindow.py b/Cura/newui/mainWindow.py index e1b1f8c1..7ac31951 100644 --- a/Cura/newui/mainWindow.py +++ b/Cura/newui/mainWindow.py @@ -261,7 +261,13 @@ class mainWindow(configBase.configWindowBase): self.progressPanelList.append(spp) def OnPrint(self, e): - printWindow.printWindow() + if self.filename == None: + wx.MessageBox('You need to load a file before you can print it.', 'Print error', wx.OK | wx.ICON_INFORMATION) + return + if not os.path.exists(self.filename[: self.filename.rfind('.')] + "_export.gcode"): + wx.MessageBox('You need to slice the file to GCode before you can print it.', 'Print error', wx.OK | wx.ICON_INFORMATION) + return + printWindow.printFile(self.filename[: self.filename.rfind('.')] + "_export.gcode") def OnExpertOpen(self, e): acw = advancedConfig.advancedConfigWindow() diff --git a/Cura/newui/printWindow.py b/Cura/newui/printWindow.py index 9df9794a..7b28a45d 100644 --- a/Cura/newui/printWindow.py +++ b/Cura/newui/printWindow.py @@ -17,14 +17,26 @@ class printWindow(wx.Frame): "Main user interface window" def __init__(self): super(printWindow, self).__init__(None, -1, title='Printing') - self.SetSizer(wx.GridBagSizer(2, 2)) + self.SetSizer(wx.BoxSizer()) + self.panel = wx.Panel(self) + self.GetSizer().Add(self.panel, 1, flag=wx.EXPAND) + self.sizer = wx.GridBagSizer(2, 2) + self.panel.SetSizer(self.sizer) - self.statsPanel = wx.Panel(self) - self.GetSizer().Add(self.statsPanel, pos=(0,0), span=(4,1), flag=wx.EXPAND) + sb = wx.StaticBox(self.panel, label="Statistics") + boxsizer = wx.StaticBoxSizer(sb, wx.VERTICAL) + boxsizer.Add(wx.StaticText(self.panel, -1, "Filament: #.##m #.##g"), flag=wx.LEFT, border=5) + boxsizer.Add(wx.StaticText(self.panel, -1, "Print time: ##:##"), flag=wx.LEFT, border=5) - self.GetSizer().Add(wx.Button(self, -1, 'Test'), pos=(0,1)) - self.GetSizer().Add(wx.Button(self, -1, 'Test'), pos=(1,1)) - self.GetSizer().Add(wx.Button(self, -1, 'Test'), pos=(2,1)) + self.sizer.Add(boxsizer, pos=(0,0), span=(4,1), flag=wx.EXPAND) + + self.sizer.Add(wx.Button(self.panel, -1, 'Connect'), pos=(0,1)) + self.sizer.Add(wx.Button(self.panel, -1, 'Load GCode'), pos=(1,1)) + self.sizer.Add(wx.Button(self.panel, -1, 'Print GCode'), pos=(2,1)) + self.sizer.Add(wx.Button(self.panel, -1, 'Cancel print'), pos=(3,1)) + self.sizer.Add(wx.Gauge(self.panel, -1), pos=(4,0), span=(1,2), flag=wx.EXPAND) + self.sizer.AddGrowableRow(3) + self.sizer.AddGrowableCol(0) self.Bind(wx.EVT_CLOSE, self.OnClose)