chiark / gitweb /
New layout icons for 3d preview pane
authorFerdi van der Werf <efcm@vdwerf.eu>
Mon, 16 Apr 2012 21:06:02 +0000 (23:06 +0200)
committerFerdi van der Werf <efcm@vdwerf.eu>
Mon, 16 Apr 2012 21:06:02 +0000 (23:06 +0200)
15 files changed:
Cura/gui/preview3d.py
Cura/images/object-mirror-x-off.png [new file with mode: 0644]
Cura/images/object-mirror-x-on.png [new file with mode: 0644]
Cura/images/object-mirror-x.png [deleted file]
Cura/images/object-mirror-y-off.png [moved from Cura/images/object-mirror-y.png with 61% similarity]
Cura/images/object-mirror-y-on.png [new file with mode: 0644]
Cura/images/object-mirror-z-off.png [new file with mode: 0644]
Cura/images/object-mirror-z-on.png [new file with mode: 0644]
Cura/images/object-mirror-z.png [deleted file]
Cura/images/object-swap-xz-off.png [new file with mode: 0644]
Cura/images/object-swap-xz-on.png [new file with mode: 0644]
Cura/images/object-swap-xz.png [deleted file]
Cura/images/object-swap-yz-off.png [new file with mode: 0644]
Cura/images/object-swap-yz-on.png [new file with mode: 0644]
Cura/images/object-swap-yz.png [deleted file]

index 425655a0fcf1bed73c47f4fcc44ffc722cfc02b1..3d91b9b7c72f13dcb7e0bcabf8c29a05cbb63bc2 100644 (file)
@@ -27,6 +27,8 @@ from util import gcodeInterpreter
 from util import stl\r
 from util import util3d\r
 \r
+IdMirrorX2 = 10\r
+\r
 class previewPanel(wx.Panel):\r
        def __init__(self, parent):\r
                wx.Panel.__init__(self, parent,-1)\r
@@ -72,42 +74,54 @@ class previewPanel(wx.Panel):
                self.toolbar.AddControl(self.layerSpin)\r
                self.Bind(wx.EVT_SPINCTRL, self.OnLayerNrChange, self.layerSpin)\r
                \r
-               self.toolbar2 = wx.ToolBar( self, -1, style = wx.TB_HORIZONTAL | wx.NO_BORDER | wx.TB_FLAT )\r
+               self.toolbar2 = wx.ToolBar( self, -1, style = wx.TB_HORIZONTAL | wx.NO_BORDER )\r
                self.toolbar2.SetToolBitmapSize( ( 21, 21 ) )\r
+               self.toolbar2.AddSeparator()\r
+\r
 \r
-               self.mirrorX = buttons.GenBitmapToggleButton(self.toolbar2, -1, wx.Bitmap('Cura/images/object-mirror-x.png'), size=(20,20))\r
+               self.mirrorX = buttons.GenBitmapToggleButton(self.toolbar2, -1, wx.Bitmap('Cura/images/object-mirror-x-off.png'), style=0, size=(20,20))\r
                self.mirrorX.SetBezelWidth(1)\r
                self.mirrorX.SetUseFocusIndicator(False)\r
+               self.mirrorX.SetValue(profile.getProfileSetting('flip_x') == 'True')\r
+               if self.mirrorX.GetValue():\r
+                       self.mirrorX.SetBitmapLabel(wx.Bitmap('Cura/images/object-mirror-x-on.png'))\r
                self.mirrorX.helpText = 'Mirror X'\r
                self.mirrorX.Bind(wx.EVT_ENTER_WINDOW, self.OnPopupDisplay)\r
                self.mirrorX.Bind(wx.EVT_LEAVE_WINDOW, self.OnPopupHide)\r
-               self.mirrorX.SetValue(profile.getProfileSetting('flip_x') == 'True')\r
+               self.mirrorX.Bind(wx.EVT_BUTTON, self.OnFlipXClick)\r
                self.toolbar2.AddControl(self.mirrorX)\r
-               self.Bind(wx.EVT_BUTTON, self.OnFlipXClick, self.mirrorX)\r
-               self.mirrorY = buttons.GenBitmapToggleButton(self.toolbar2, -1, wx.Bitmap('Cura/images/object-mirror-y.png'), size=(20,20))\r
+\r
+               self.mirrorY = buttons.GenBitmapToggleButton(self.toolbar2, -1, wx.Bitmap('Cura/images/object-mirror-y-off.png'), size=(20,20))\r
                self.mirrorY.SetBezelWidth(1)\r
                self.mirrorY.SetUseFocusIndicator(False)\r
+               self.mirrorY.SetValue(profile.getProfileSetting('flip_y') == 'True')\r
+               if self.mirrorY.GetValue():\r
+                       self.mirrorY.SetBitmapLabel(wx.Bitmap('Cura/images/object-mirror-x-on.png'))\r
                self.mirrorY.helpText = 'Mirror Y'\r
                self.mirrorY.Bind(wx.EVT_ENTER_WINDOW, self.OnPopupDisplay)\r
                self.mirrorY.Bind(wx.EVT_LEAVE_WINDOW, self.OnPopupHide)\r
-               self.mirrorY.SetValue(profile.getProfileSetting('flip_y') == 'True')\r
+               self.mirrorY.Bind(wx.EVT_BUTTON, self.OnFlipYClick)\r
                self.toolbar2.AddControl(self.mirrorY)\r
-               self.Bind(wx.EVT_BUTTON, self.OnFlipYClick, self.mirrorY)\r
-               self.mirrorZ = buttons.GenBitmapToggleButton(self.toolbar2, -1, wx.Bitmap('Cura/images/object-mirror-z.png'), size=(20,20))\r
+\r
+               self.mirrorZ = buttons.GenBitmapToggleButton(self.toolbar2, -1, wx.Bitmap('Cura/images/object-mirror-z-off.png'), size=(20,20))\r
                self.mirrorZ.SetBezelWidth(1)\r
                self.mirrorZ.SetUseFocusIndicator(False)\r
+               self.mirrorZ.SetValue(profile.getProfileSetting('flip_z') == 'True')\r
+               if self.mirrorZ.GetValue():\r
+                       self.mirrorZ.SetBitmapLabel(wx.Bitmap('Cura/images/object-mirror-z-on.png'))\r
                self.mirrorZ.helpText = 'Mirror Z'\r
                self.mirrorZ.Bind(wx.EVT_ENTER_WINDOW, self.OnPopupDisplay)\r
                self.mirrorZ.Bind(wx.EVT_LEAVE_WINDOW, self.OnPopupHide)\r
-               self.mirrorZ.SetValue(profile.getProfileSetting('flip_z') == 'True')\r
+               self.mirrorZ.Bind(wx.EVT_BUTTON, self.OnFlipZClick)\r
                self.toolbar2.AddControl(self.mirrorZ)\r
-               self.Bind(wx.EVT_BUTTON, self.OnFlipZClick, self.mirrorZ)\r
 \r
                self.toolbar2.AddSeparator()\r
 \r
-               self.swapXZ = buttons.GenBitmapToggleButton(self.toolbar2, -1, wx.Bitmap('Cura/images/object-swap-xz.png'), size=(20,20))\r
+               self.swapXZ = buttons.GenBitmapToggleButton(self.toolbar2, -1, wx.Bitmap('Cura/images/object-swap-xz-off.png'), size=(20,20))\r
                self.swapXZ.SetBezelWidth(1)\r
                self.swapXZ.SetUseFocusIndicator(False)\r
+               if self.swapXZ.GetValue():\r
+                       self.swapXZ.SetBitmapLabel(wx.Bitmap('Cura/images/object-swap-xz-on.png'))\r
                self.swapXZ.helpText = 'Swap XZ'\r
                self.swapXZ.Bind(wx.EVT_ENTER_WINDOW, self.OnPopupDisplay)\r
                self.swapXZ.Bind(wx.EVT_LEAVE_WINDOW, self.OnPopupHide)\r
@@ -115,7 +129,7 @@ class previewPanel(wx.Panel):
                self.toolbar2.AddControl(self.swapXZ)\r
                self.Bind(wx.EVT_BUTTON, self.OnSwapXZClick, self.swapXZ)\r
 \r
-               self.swapYZ = buttons.GenBitmapToggleButton(self.toolbar2, -1, wx.Bitmap('Cura/images/object-swap-yz.png'), size=(20,20))\r
+               self.swapYZ = buttons.GenBitmapToggleButton(self.toolbar2, -1, wx.Bitmap('Cura/images/object-swap-yz-off.png'), size=(20,20))\r
                self.swapYZ.SetBezelWidth(1)\r
                self.swapYZ.SetUseFocusIndicator(False)\r
                self.swapYZ.helpText = 'Swap YZ'\r
@@ -125,35 +139,35 @@ class previewPanel(wx.Panel):
                self.toolbar2.AddControl(self.swapYZ)\r
                self.Bind(wx.EVT_BUTTON, self.OnSwapYZClick, self.swapYZ)\r
                \r
-               self.toolbar2.InsertSeparator(self.toolbar2.GetToolsCount())\r
-               self.toolbar2.AddControl(wx.StaticText(self.toolbar2, -1, 'Scale'))\r
-               self.scale = wx.TextCtrl(self.toolbar2, -1, profile.getProfileSetting('model_scale'), size=(21*2,21))\r
-               self.toolbar2.AddControl(self.scale)\r
-               self.Bind(wx.EVT_TEXT, self.OnScale, self.scale)\r
-\r
-               self.toolbar2.InsertSeparator(self.toolbar2.GetToolsCount())\r
-               self.toolbar2.AddControl(wx.StaticText(self.toolbar2, -1, 'Copy'))\r
-               self.mulXsub = wx.Button(self.toolbar2, -1, '-', size=(21,21))\r
-               self.toolbar2.AddControl(self.mulXsub)\r
-               self.Bind(wx.EVT_BUTTON, self.OnMulXSubClick, self.mulXsub)\r
-               self.mulXadd = wx.Button(self.toolbar2, -1, '+', size=(21,21))\r
-               self.toolbar2.AddControl(self.mulXadd)\r
-               self.Bind(wx.EVT_BUTTON, self.OnMulXAddClick, self.mulXadd)\r
-\r
-               self.mulYsub = wx.Button(self.toolbar2, -1, '-', size=(21,21))\r
-               self.toolbar2.AddControl(self.mulYsub)\r
-               self.Bind(wx.EVT_BUTTON, self.OnMulYSubClick, self.mulYsub)\r
-               self.mulYadd = wx.Button(self.toolbar2, -1, '+', size=(21,21))\r
-               self.toolbar2.AddControl(self.mulYadd)\r
-               self.Bind(wx.EVT_BUTTON, self.OnMulYAddClick, self.mulYadd)\r
-               \r
-               self.toolbar2.InsertSeparator(self.toolbar2.GetToolsCount())\r
-               self.toolbar2.AddControl(wx.StaticText(self.toolbar2, -1, 'Rot'))\r
-               self.rotate = wx.SpinCtrl(self.toolbar2, -1, profile.getProfileSetting('model_rotate_base'), size=(21*3,21), style=wx.SP_WRAP|wx.SP_ARROW_KEYS)\r
-               self.rotate.SetRange(0, 360)\r
-               self.toolbar2.AddControl(self.rotate)\r
-               self.Bind(wx.EVT_SPINCTRL, self.OnRotate, self.rotate)\r
+               #self.toolbar2.InsertSeparator(self.toolbar2.GetToolsCount())\r
+               #self.toolbar2.AddControl(wx.StaticText(self.toolbar2, -1, 'Scale'))\r
+               #self.scale = wx.TextCtrl(self.toolbar2, -1, profile.getProfileSetting('model_scale'), size=(21*2,21))\r
+               #self.toolbar2.AddControl(self.scale)\r
+               #self.Bind(wx.EVT_TEXT, self.OnScale, self.scale)\r
+\r
+               #self.toolbar2.InsertSeparator(self.toolbar2.GetToolsCount())\r
+               #self.toolbar2.AddControl(wx.StaticText(self.toolbar2, -1, 'Copy'))\r
+               #self.mulXsub = wx.Button(self.toolbar2, -1, '-', size=(21,21))\r
+               #self.toolbar2.AddControl(self.mulXsub)\r
+               #self.Bind(wx.EVT_BUTTON, self.OnMulXSubClick, self.mulXsub)\r
+               #self.mulXadd = wx.Button(self.toolbar2, -1, '+', size=(21,21))\r
+               #self.toolbar2.AddControl(self.mulXadd)\r
+               #self.Bind(wx.EVT_BUTTON, self.OnMulXAddClick, self.mulXadd)\r
+\r
+               #self.mulYsub = wx.Button(self.toolbar2, -1, '-', size=(21,21))\r
+               #self.toolbar2.AddControl(self.mulYsub)\r
+               #self.Bind(wx.EVT_BUTTON, self.OnMulYSubClick, self.mulYsub)\r
+               #self.mulYadd = wx.Button(self.toolbar2, -1, '+', size=(21,21))\r
+               #self.toolbar2.AddControl(self.mulYadd)\r
+               #self.Bind(wx.EVT_BUTTON, self.OnMulYAddClick, self.mulYadd)\r
                \r
+               #self.toolbar2.InsertSeparator(self.toolbar2.GetToolsCount())\r
+               #self.toolbar2.AddControl(wx.StaticText(self.toolbar2, -1, 'Rot'))\r
+               #self.rotate = wx.SpinCtrl(self.toolbar2, -1, profile.getProfileSetting('model_rotate_base'), size=(21*3,21), style=wx.SP_WRAP|wx.SP_ARROW_KEYS)\r
+               #self.rotate.SetRange(0, 360)\r
+               #self.toolbar2.AddControl(self.rotate)\r
+               #self.Bind(wx.EVT_SPINCTRL, self.OnRotate, self.rotate)\r
+\r
                self.toolbar2.Realize()\r
                self.updateToolbar()\r
                \r
@@ -184,22 +198,42 @@ class previewPanel(wx.Panel):
        \r
        def OnFlipXClick(self, e):\r
                profile.putProfileSetting('flip_x', str(self.mirrorX.GetValue()))\r
+               if self.mirrorX.GetValue():\r
+                       self.mirrorX.SetBitmapLabel(wx.Bitmap('Cura/images/object-mirror-x-on.png'))\r
+               else:\r
+                       self.mirrorX.SetBitmapLabel(wx.Bitmap('Cura/images/object-mirror-x-off.png'))\r
                self.updateModelTransform()\r
                \r
        def OnFlipYClick(self, e):\r
                profile.putProfileSetting('flip_y', str(self.mirrorY.GetValue()))\r
+               if self.mirrorY.GetValue():\r
+                       self.mirrorY.SetBitmapLabel(wx.Bitmap('Cura/images/object-mirror-y-on.png'))\r
+               else:\r
+                       self.mirrorY.SetBitmapLabel(wx.Bitmap('Cura/images/object-mirror-y-off.png'))\r
                self.updateModelTransform()\r
 \r
        def OnFlipZClick(self, e):\r
                profile.putProfileSetting('flip_z', str(self.mirrorZ.GetValue()))\r
+               if self.mirrorZ.GetValue():\r
+                       self.mirrorZ.SetBitmapLabel(wx.Bitmap('Cura/images/object-mirror-z-on.png'))\r
+               else:\r
+                       self.mirrorZ.SetBitmapLabel(wx.Bitmap('Cura/images/object-mirror-z-off.png'))\r
                self.updateModelTransform()\r
 \r
        def OnSwapXZClick(self, e):\r
                profile.putProfileSetting('swap_xz', str(self.swapXZ.GetValue()))\r
+               if self.swapXZ.GetValue():\r
+                       self.swapXZ.SetBitmapLabel(wx.Bitmap('Cura/images/object-swap-xz-on.png'))\r
+               else:\r
+                       self.swapXZ.SetBitmapLabel(wx.Bitmap('Cura/images/object-swap-xz-off.png'))\r
                self.updateModelTransform()\r
 \r
        def OnSwapYZClick(self, e):\r
                profile.putProfileSetting('swap_yz', str(self.swapYZ.GetValue()))\r
+               if self.swapYZ.GetValue():\r
+                       self.swapYZ.SetBitmapLabel(wx.Bitmap('Cura/images/object-swap-yz-on.png'))\r
+               else:\r
+                       self.swapYZ.SetBitmapLabel(wx.Bitmap('Cura/images/object-swap-yz-off.png'))\r
                self.updateModelTransform()\r
 \r
        def OnMulXAddClick(self, e):\r
diff --git a/Cura/images/object-mirror-x-off.png b/Cura/images/object-mirror-x-off.png
new file mode 100644 (file)
index 0000000..302b2b2
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 (file)
index 0000000..4d07b34
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 (file)
index 1edcb61..0000000
Binary files a/Cura/images/object-mirror-x.png and /dev/null differ
similarity index 61%
rename from Cura/images/object-mirror-y.png
rename to Cura/images/object-mirror-y-off.png
index 267251aa15965eaaa4d3cd764686d98330badd02..5f72a439db6018ff04add57fa3a628e79fb636a0 100644 (file)
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 (file)
index 0000000..f7dfc62
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 (file)
index 0000000..801fa98
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 (file)
index 0000000..c599670
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 (file)
index e0a0ab2..0000000
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 (file)
index 0000000..830570e
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 (file)
index 0000000..c594954
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 (file)
index 21f5676..0000000
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 (file)
index 0000000..19abb42
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 (file)
index 0000000..bb60079
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 (file)
index c7e8dd6..0000000
Binary files a/Cura/images/object-swap-yz.png and /dev/null differ