From: Ferdi van der Werf Date: Mon, 16 Apr 2012 21:06:02 +0000 (+0200) Subject: New layout icons for 3d preview pane X-Git-Tag: RC3~68^2~3^2^2~4 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=20d975004c4beac730d4512642fe8636b625e2ee;p=cura.git New layout icons for 3d preview pane --- diff --git a/Cura/gui/preview3d.py b/Cura/gui/preview3d.py index 425655a0..3d91b9b7 100644 --- a/Cura/gui/preview3d.py +++ b/Cura/gui/preview3d.py @@ -27,6 +27,8 @@ from util import gcodeInterpreter from util import stl from util import util3d +IdMirrorX2 = 10 + class previewPanel(wx.Panel): def __init__(self, parent): wx.Panel.__init__(self, parent,-1) @@ -72,42 +74,54 @@ class previewPanel(wx.Panel): self.toolbar.AddControl(self.layerSpin) self.Bind(wx.EVT_SPINCTRL, self.OnLayerNrChange, self.layerSpin) - self.toolbar2 = wx.ToolBar( self, -1, style = wx.TB_HORIZONTAL | wx.NO_BORDER | wx.TB_FLAT ) + self.toolbar2 = wx.ToolBar( self, -1, style = wx.TB_HORIZONTAL | wx.NO_BORDER ) self.toolbar2.SetToolBitmapSize( ( 21, 21 ) ) + self.toolbar2.AddSeparator() + - self.mirrorX = buttons.GenBitmapToggleButton(self.toolbar2, -1, wx.Bitmap('Cura/images/object-mirror-x.png'), size=(20,20)) + self.mirrorX = buttons.GenBitmapToggleButton(self.toolbar2, -1, wx.Bitmap('Cura/images/object-mirror-x-off.png'), style=0, size=(20,20)) self.mirrorX.SetBezelWidth(1) self.mirrorX.SetUseFocusIndicator(False) + self.mirrorX.SetValue(profile.getProfileSetting('flip_x') == 'True') + if self.mirrorX.GetValue(): + self.mirrorX.SetBitmapLabel(wx.Bitmap('Cura/images/object-mirror-x-on.png')) self.mirrorX.helpText = 'Mirror X' self.mirrorX.Bind(wx.EVT_ENTER_WINDOW, self.OnPopupDisplay) self.mirrorX.Bind(wx.EVT_LEAVE_WINDOW, self.OnPopupHide) - self.mirrorX.SetValue(profile.getProfileSetting('flip_x') == 'True') + self.mirrorX.Bind(wx.EVT_BUTTON, self.OnFlipXClick) self.toolbar2.AddControl(self.mirrorX) - self.Bind(wx.EVT_BUTTON, self.OnFlipXClick, self.mirrorX) - self.mirrorY = buttons.GenBitmapToggleButton(self.toolbar2, -1, wx.Bitmap('Cura/images/object-mirror-y.png'), size=(20,20)) + + self.mirrorY = buttons.GenBitmapToggleButton(self.toolbar2, -1, wx.Bitmap('Cura/images/object-mirror-y-off.png'), size=(20,20)) self.mirrorY.SetBezelWidth(1) self.mirrorY.SetUseFocusIndicator(False) + self.mirrorY.SetValue(profile.getProfileSetting('flip_y') == 'True') + if self.mirrorY.GetValue(): + self.mirrorY.SetBitmapLabel(wx.Bitmap('Cura/images/object-mirror-x-on.png')) self.mirrorY.helpText = 'Mirror Y' self.mirrorY.Bind(wx.EVT_ENTER_WINDOW, self.OnPopupDisplay) self.mirrorY.Bind(wx.EVT_LEAVE_WINDOW, self.OnPopupHide) - self.mirrorY.SetValue(profile.getProfileSetting('flip_y') == 'True') + self.mirrorY.Bind(wx.EVT_BUTTON, self.OnFlipYClick) self.toolbar2.AddControl(self.mirrorY) - self.Bind(wx.EVT_BUTTON, self.OnFlipYClick, self.mirrorY) - self.mirrorZ = buttons.GenBitmapToggleButton(self.toolbar2, -1, wx.Bitmap('Cura/images/object-mirror-z.png'), size=(20,20)) + + self.mirrorZ = buttons.GenBitmapToggleButton(self.toolbar2, -1, wx.Bitmap('Cura/images/object-mirror-z-off.png'), size=(20,20)) self.mirrorZ.SetBezelWidth(1) self.mirrorZ.SetUseFocusIndicator(False) + self.mirrorZ.SetValue(profile.getProfileSetting('flip_z') == 'True') + if self.mirrorZ.GetValue(): + self.mirrorZ.SetBitmapLabel(wx.Bitmap('Cura/images/object-mirror-z-on.png')) self.mirrorZ.helpText = 'Mirror Z' self.mirrorZ.Bind(wx.EVT_ENTER_WINDOW, self.OnPopupDisplay) self.mirrorZ.Bind(wx.EVT_LEAVE_WINDOW, self.OnPopupHide) - self.mirrorZ.SetValue(profile.getProfileSetting('flip_z') == 'True') + self.mirrorZ.Bind(wx.EVT_BUTTON, self.OnFlipZClick) self.toolbar2.AddControl(self.mirrorZ) - self.Bind(wx.EVT_BUTTON, self.OnFlipZClick, self.mirrorZ) self.toolbar2.AddSeparator() - self.swapXZ = buttons.GenBitmapToggleButton(self.toolbar2, -1, wx.Bitmap('Cura/images/object-swap-xz.png'), size=(20,20)) + self.swapXZ = buttons.GenBitmapToggleButton(self.toolbar2, -1, wx.Bitmap('Cura/images/object-swap-xz-off.png'), size=(20,20)) self.swapXZ.SetBezelWidth(1) self.swapXZ.SetUseFocusIndicator(False) + if self.swapXZ.GetValue(): + self.swapXZ.SetBitmapLabel(wx.Bitmap('Cura/images/object-swap-xz-on.png')) self.swapXZ.helpText = 'Swap XZ' self.swapXZ.Bind(wx.EVT_ENTER_WINDOW, self.OnPopupDisplay) self.swapXZ.Bind(wx.EVT_LEAVE_WINDOW, self.OnPopupHide) @@ -115,7 +129,7 @@ class previewPanel(wx.Panel): self.toolbar2.AddControl(self.swapXZ) self.Bind(wx.EVT_BUTTON, self.OnSwapXZClick, self.swapXZ) - self.swapYZ = buttons.GenBitmapToggleButton(self.toolbar2, -1, wx.Bitmap('Cura/images/object-swap-yz.png'), size=(20,20)) + self.swapYZ = buttons.GenBitmapToggleButton(self.toolbar2, -1, wx.Bitmap('Cura/images/object-swap-yz-off.png'), size=(20,20)) self.swapYZ.SetBezelWidth(1) self.swapYZ.SetUseFocusIndicator(False) self.swapYZ.helpText = 'Swap YZ' @@ -125,35 +139,35 @@ class previewPanel(wx.Panel): self.toolbar2.AddControl(self.swapYZ) self.Bind(wx.EVT_BUTTON, self.OnSwapYZClick, self.swapYZ) - self.toolbar2.InsertSeparator(self.toolbar2.GetToolsCount()) - 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.InsertSeparator(self.toolbar2.GetToolsCount()) - self.toolbar2.AddControl(wx.StaticText(self.toolbar2, -1, 'Copy')) - self.mulXsub = wx.Button(self.toolbar2, -1, '-', size=(21,21)) - self.toolbar2.AddControl(self.mulXsub) - self.Bind(wx.EVT_BUTTON, self.OnMulXSubClick, self.mulXsub) - self.mulXadd = wx.Button(self.toolbar2, -1, '+', size=(21,21)) - self.toolbar2.AddControl(self.mulXadd) - self.Bind(wx.EVT_BUTTON, self.OnMulXAddClick, self.mulXadd) - - self.mulYsub = wx.Button(self.toolbar2, -1, '-', size=(21,21)) - self.toolbar2.AddControl(self.mulYsub) - self.Bind(wx.EVT_BUTTON, self.OnMulYSubClick, self.mulYsub) - self.mulYadd = wx.Button(self.toolbar2, -1, '+', size=(21,21)) - self.toolbar2.AddControl(self.mulYadd) - self.Bind(wx.EVT_BUTTON, self.OnMulYAddClick, self.mulYadd) - - self.toolbar2.InsertSeparator(self.toolbar2.GetToolsCount()) - self.toolbar2.AddControl(wx.StaticText(self.toolbar2, -1, 'Rot')) - self.rotate = wx.SpinCtrl(self.toolbar2, -1, profile.getProfileSetting('model_rotate_base'), size=(21*3,21), style=wx.SP_WRAP|wx.SP_ARROW_KEYS) - self.rotate.SetRange(0, 360) - self.toolbar2.AddControl(self.rotate) - self.Bind(wx.EVT_SPINCTRL, self.OnRotate, self.rotate) + #self.toolbar2.InsertSeparator(self.toolbar2.GetToolsCount()) + #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.InsertSeparator(self.toolbar2.GetToolsCount()) + #self.toolbar2.AddControl(wx.StaticText(self.toolbar2, -1, 'Copy')) + #self.mulXsub = wx.Button(self.toolbar2, -1, '-', size=(21,21)) + #self.toolbar2.AddControl(self.mulXsub) + #self.Bind(wx.EVT_BUTTON, self.OnMulXSubClick, self.mulXsub) + #self.mulXadd = wx.Button(self.toolbar2, -1, '+', size=(21,21)) + #self.toolbar2.AddControl(self.mulXadd) + #self.Bind(wx.EVT_BUTTON, self.OnMulXAddClick, self.mulXadd) + + #self.mulYsub = wx.Button(self.toolbar2, -1, '-', size=(21,21)) + #self.toolbar2.AddControl(self.mulYsub) + #self.Bind(wx.EVT_BUTTON, self.OnMulYSubClick, self.mulYsub) + #self.mulYadd = wx.Button(self.toolbar2, -1, '+', size=(21,21)) + #self.toolbar2.AddControl(self.mulYadd) + #self.Bind(wx.EVT_BUTTON, self.OnMulYAddClick, self.mulYadd) + #self.toolbar2.InsertSeparator(self.toolbar2.GetToolsCount()) + #self.toolbar2.AddControl(wx.StaticText(self.toolbar2, -1, 'Rot')) + #self.rotate = wx.SpinCtrl(self.toolbar2, -1, profile.getProfileSetting('model_rotate_base'), size=(21*3,21), style=wx.SP_WRAP|wx.SP_ARROW_KEYS) + #self.rotate.SetRange(0, 360) + #self.toolbar2.AddControl(self.rotate) + #self.Bind(wx.EVT_SPINCTRL, self.OnRotate, self.rotate) + self.toolbar2.Realize() self.updateToolbar() @@ -184,22 +198,42 @@ class previewPanel(wx.Panel): def OnFlipXClick(self, e): profile.putProfileSetting('flip_x', str(self.mirrorX.GetValue())) + if self.mirrorX.GetValue(): + self.mirrorX.SetBitmapLabel(wx.Bitmap('Cura/images/object-mirror-x-on.png')) + else: + self.mirrorX.SetBitmapLabel(wx.Bitmap('Cura/images/object-mirror-x-off.png')) self.updateModelTransform() def OnFlipYClick(self, e): profile.putProfileSetting('flip_y', str(self.mirrorY.GetValue())) + if self.mirrorY.GetValue(): + self.mirrorY.SetBitmapLabel(wx.Bitmap('Cura/images/object-mirror-y-on.png')) + else: + self.mirrorY.SetBitmapLabel(wx.Bitmap('Cura/images/object-mirror-y-off.png')) self.updateModelTransform() def OnFlipZClick(self, e): profile.putProfileSetting('flip_z', str(self.mirrorZ.GetValue())) + if self.mirrorZ.GetValue(): + self.mirrorZ.SetBitmapLabel(wx.Bitmap('Cura/images/object-mirror-z-on.png')) + else: + self.mirrorZ.SetBitmapLabel(wx.Bitmap('Cura/images/object-mirror-z-off.png')) self.updateModelTransform() def OnSwapXZClick(self, e): profile.putProfileSetting('swap_xz', str(self.swapXZ.GetValue())) + if self.swapXZ.GetValue(): + self.swapXZ.SetBitmapLabel(wx.Bitmap('Cura/images/object-swap-xz-on.png')) + else: + self.swapXZ.SetBitmapLabel(wx.Bitmap('Cura/images/object-swap-xz-off.png')) self.updateModelTransform() def OnSwapYZClick(self, e): profile.putProfileSetting('swap_yz', str(self.swapYZ.GetValue())) + if self.swapYZ.GetValue(): + self.swapYZ.SetBitmapLabel(wx.Bitmap('Cura/images/object-swap-yz-on.png')) + else: + self.swapYZ.SetBitmapLabel(wx.Bitmap('Cura/images/object-swap-yz-off.png')) self.updateModelTransform() def OnMulXAddClick(self, e): diff --git a/Cura/images/object-mirror-x-off.png b/Cura/images/object-mirror-x-off.png new file mode 100644 index 00000000..302b2b2c Binary files /dev/null and b/Cura/images/object-mirror-x-off.png differ diff --git a/Cura/images/object-mirror-x-on.png b/Cura/images/object-mirror-x-on.png new file mode 100644 index 00000000..4d07b349 Binary files /dev/null and b/Cura/images/object-mirror-x-on.png differ diff --git a/Cura/images/object-mirror-x.png b/Cura/images/object-mirror-x.png deleted file mode 100644 index 1edcb61d..00000000 Binary files a/Cura/images/object-mirror-x.png and /dev/null differ diff --git a/Cura/images/object-mirror-y.png b/Cura/images/object-mirror-y-off.png similarity index 61% rename from Cura/images/object-mirror-y.png rename to Cura/images/object-mirror-y-off.png index 267251aa..5f72a439 100644 Binary files a/Cura/images/object-mirror-y.png and b/Cura/images/object-mirror-y-off.png differ diff --git a/Cura/images/object-mirror-y-on.png b/Cura/images/object-mirror-y-on.png new file mode 100644 index 00000000..f7dfc622 Binary files /dev/null and b/Cura/images/object-mirror-y-on.png differ diff --git a/Cura/images/object-mirror-z-off.png b/Cura/images/object-mirror-z-off.png new file mode 100644 index 00000000..801fa983 Binary files /dev/null and b/Cura/images/object-mirror-z-off.png differ diff --git a/Cura/images/object-mirror-z-on.png b/Cura/images/object-mirror-z-on.png new file mode 100644 index 00000000..c599670c Binary files /dev/null and b/Cura/images/object-mirror-z-on.png differ diff --git a/Cura/images/object-mirror-z.png b/Cura/images/object-mirror-z.png deleted file mode 100644 index e0a0ab2f..00000000 Binary files a/Cura/images/object-mirror-z.png and /dev/null differ diff --git a/Cura/images/object-swap-xz-off.png b/Cura/images/object-swap-xz-off.png new file mode 100644 index 00000000..830570e6 Binary files /dev/null and b/Cura/images/object-swap-xz-off.png differ diff --git a/Cura/images/object-swap-xz-on.png b/Cura/images/object-swap-xz-on.png new file mode 100644 index 00000000..c5949549 Binary files /dev/null and b/Cura/images/object-swap-xz-on.png differ diff --git a/Cura/images/object-swap-xz.png b/Cura/images/object-swap-xz.png deleted file mode 100644 index 21f5676c..00000000 Binary files a/Cura/images/object-swap-xz.png and /dev/null differ diff --git a/Cura/images/object-swap-yz-off.png b/Cura/images/object-swap-yz-off.png new file mode 100644 index 00000000..19abb428 Binary files /dev/null and b/Cura/images/object-swap-yz-off.png differ diff --git a/Cura/images/object-swap-yz-on.png b/Cura/images/object-swap-yz-on.png new file mode 100644 index 00000000..bb60079c Binary files /dev/null and b/Cura/images/object-swap-yz-on.png differ diff --git a/Cura/images/object-swap-yz.png b/Cura/images/object-swap-yz.png deleted file mode 100644 index c7e8dd66..00000000 Binary files a/Cura/images/object-swap-yz.png and /dev/null differ