chiark / gitweb /
Change how the engine is interfaced from the python code. Put the GCode viewer in...
[cura.git] / Cura / gui / util / openglGui.py
index bab767e3235ba62e5e1d2846f8d70f05e33df86c..c9b0eeebe684408fc0d1573e2f3cf0e14a7879dd 100644 (file)
@@ -10,7 +10,7 @@ import time
 
 from wx import glcanvas
 import OpenGL
-OpenGL.ERROR_CHECKING = False
+#OpenGL.ERROR_CHECKING = False
 from OpenGL.GL import *
 
 from Cura.util import version
@@ -245,6 +245,7 @@ class glGuiPanel(glcanvas.GLCanvas):
                                locationInfo = tb[n]
                                errStr += "\n @ %s:%s:%d" % (os.path.basename(locationInfo[0]), locationInfo[2], locationInfo[1])
                        if not self._shownError:
+                               traceback.print_exc()
                                wx.CallAfter(wx.MessageBox, errStr, _("3D window error"), wx.OK | wx.ICON_EXCLAMATION)
                                self._shownError = True
 
@@ -287,7 +288,7 @@ class glGuiPanel(glcanvas.GLCanvas):
                # glVertex2f(0, 0)
                # glEnd()
                # glDisable(GL_TEXTURE_2D)
-               glPopMatrix()
+               glPopMatrix()
 
        def _OnEraseBackground(self,event):
                #Workaround for windows background redraw flicker.
@@ -709,7 +710,7 @@ class glNotification(glFrame):
                super(glNotification, self).__init__(parent, pos)
                glGuiLayoutGrid(self)._alignBottom = False
                self._label = glLabel(self, "Notification", (0, 0))
-               self._buttonEject = glButton(self, 31, "Eject", (1, 0), self.onEject, 25)
+               self._buttonExtra = glButton(self, 31, "???", (1, 0), self.onExtraButton, 25)
                self._button = glButton(self, 30, "", (2, 0), self.onClose, 25)
                self._padding = glLabel(self, "", (0, 1))
                self.setHidden(True)
@@ -727,18 +728,20 @@ class glNotification(glFrame):
                self.updateLayout()
                super(glNotification, self).draw()
 
-       def message(self, text, ejectCallback = None):
+       def message(self, text, extraButtonCallback = None, extraButtonIcon = None, extraButtonTooltip = None):
                self._anim = animation(self._base, -20, 25, 1)
                self.setHidden(False)
                self._label.setLabel(text)
-               self._buttonEject.setHidden(ejectCallback is None)
-               self._ejectCallback = ejectCallback
+               self._buttonExtra.setHidden(extraButtonCallback is None)
+               self._buttonExtra._imageID = extraButtonIcon
+               self._buttonExtra._tooltip = extraButtonTooltip
+               self._extraButtonCallback = extraButtonCallback
                self._base._queueRefresh()
                self.updateLayout()
 
-       def onEject(self, button):
+       def onExtraButton(self, button):
                self.onClose(button)
-               self._ejectCallback()
+               self._extraButtonCallback()
 
        def onClose(self, button):
                if self._anim is not None:
@@ -1028,7 +1031,7 @@ class glSlider(glGuiControl):
                else:
                        valueNormalized = 0
                glTranslate(0.0,scrollLength/2,0)
-               if self._focus:
+               if True:  # self._focus:
                        glColor4ub(0,0,0,255)
                        glPushMatrix()
                        glTranslate(-w/2,opengl.glGetStringSize(str(self._minValue))[1]/2,0)