Added scale to preview window instead of model tab

master
daid 2012-03-21 16:53:05 +01:00
parent d923d8d3b8
commit b398e2a2cd
2 changed files with 15 additions and 4 deletions

View File

@ -159,10 +159,6 @@ class mainWindow(configBase.configWindowBase):
nb.AddPage(alterationPanel.alterationPanel(nb), "Start/End-GCode")
(left, right) = self.CreateConfigTab(nb, '3D Model')
configBase.TitleRow(left, "Scale")
c = configBase.SettingRow(left, "Scale", 'model_scale', '1.0', '')
validators.validFloat(c, 0.01)
configBase.settingNotify(c, self.preview3d.updateModelTransform)
configBase.TitleRow(right, "Rotate")
c = configBase.SettingRow(right, "Rotate (deg)", 'model_rotate_base', '0', '')
validators.validFloat(c)

View File

@ -74,6 +74,13 @@ class previewPanel(wx.Panel):
self.toolbar2.AddControl(self.flipZ)
self.Bind(wx.EVT_CHECKBOX, self.OnFlipZClick, self.flipZ)
self.toolbar2.InsertSeparator(4)
self.toolbar2.AddControl(wx.StaticText(self.toolbar2, -1, 'Scale'))
self.scale = wx.TextCtrl(self.toolbar2, -1, profile.getProfileSetting('model_scale'), size=(21*2,21))
self.toolbar2.AddControl(self.scale)
self.Bind(wx.EVT_TEXT, self.OnScale, self.scale)
self.toolbar2.Realize()
self.updateToolbar()
sizer = wx.BoxSizer(wx.VERTICAL)
@ -94,6 +101,14 @@ class previewPanel(wx.Panel):
profile.putProfileSetting('flip_z', str(self.flipZ.GetValue()))
self.updateModelTransform()
def OnScale(self, e):
try:
scale = float(self.scale.GetValue())
except:
scale = 1.0
profile.putProfileSetting('model_scale', str(scale))
self.updateModelTransform()
def On3DClick(self, e):
self.glCanvas.yaw = 30
self.glCanvas.pitch = 60