#Only import the _core to save import time
import wx._core
+
class CuraApp(wx.App):
def __init__(self, files):
if platform.system() == "Windows" and not 'PYCHARM_HOSTED' in os.environ:
- super(CuraApp, self).__init__(redirect = True, filename = 'output.txt')
+ super(CuraApp, self).__init__(redirect=True, filename='output.txt')
else:
- super(CuraApp, self).__init__(redirect = False)
+ super(CuraApp, self).__init__(redirect=False)
self.mainWindow = None
self.splash = None
def setFullScreenCapable(frame):
frameobj = _objc.PyObjCObject_New(frame.GetHandle(), 0, 1)
- NSWindowCollectionBehaviorFullScreenPrimary = 1<<7
+ NSWindowCollectionBehaviorFullScreenPrimary = 1 << 7
window = frameobj.window()
newBehavior = window.collectionBehavior() | NSWindowCollectionBehaviorFullScreenPrimary
window.setCollectionBehavior_(newBehavior)
self.pluginPanel.Show(False)
#Alteration page
- self.alterationPanel = alterationPanel.alterationPanel(self.nb, callback)
- self.nb.AddPage(self.alterationPanel, "Start/End-GCode")
+ if profile.getPreference('gcode_flavor') == 'UltiGCode':
+ self.alterationPanel = None
+ else:
+ self.alterationPanel = alterationPanel.alterationPanel(self.nb, callback)
+ self.nb.AddPage(self.alterationPanel, "Start/End-GCode")
self.Bind(wx.EVT_SIZE, self.OnSize)
def updateProfileToControls(self):
super(normalSettingsPanel, self).updateProfileToControls()
- self.alterationPanel.updateProfileToControls()
+ if self.alterationPanel is not None:
+ self.alterationPanel.updateProfileToControls()
self.pluginPanel.updateProfileToControls()
self.viewSelection = openglGui.glComboButton(self, 'View mode', [7,19,11,15,23], ['Normal', 'Overhang', 'Transparent', 'X-Ray', 'Layers'], (-1,0), self.OnViewChange)
self.layerSelect = openglGui.glSlider(self, 10000, 0, 1, (-1,-2), lambda : self.QueueRefresh())
- self.youMagineButton = openglGui.glButton(self, 26, 'YouMagine', (2,0), lambda button: youmagineGui.youmagineManager(self.GetTopLevelParent(), self))
+ self.youMagineButton = openglGui.glButton(self, 26, 'YouMagine upload', (2,0), lambda button: youmagineGui.youmagineManager(self.GetTopLevelParent(), self))
self.notification = openglGui.glNotification(self, (0, 0))
elif len(self._altTooltip) > 0:
glPushMatrix()
glTranslatef(pos[0], pos[1], 0)
- glTranslatef(0.6*bs*scale, 0, 0)
-
- glPushMatrix()
- glColor4ub(60,60,60,255)
- glTranslatef(-1, -1, 0)
- opengl.glDrawStringLeft(self._altTooltip)
- glTranslatef(0, 2, 0)
- opengl.glDrawStringLeft(self._altTooltip)
- glTranslatef(2, 0, 0)
- opengl.glDrawStringLeft(self._altTooltip)
- glTranslatef(0, -2, 0)
- opengl.glDrawStringLeft(self._altTooltip)
- glPopMatrix()
-
- glColor4ub(255,255,255,255)
- opengl.glDrawStringLeft(self._altTooltip)
+ glTranslatef(0, 0.6*bs, 0)
+ glTranslatef(0, 6, 0)
+ #glTranslatef(0.6*bs*scale, 0, 0)
+
+ for line in self._altTooltip.split('\n'):
+ glPushMatrix()
+ glColor4ub(60,60,60,255)
+ glTranslatef(-1, -1, 0)
+ opengl.glDrawStringCenter(line)
+ glTranslatef(0, 2, 0)
+ opengl.glDrawStringCenter(line)
+ glTranslatef(2, 0, 0)
+ opengl.glDrawStringCenter(line)
+ glTranslatef(0, -2, 0)
+ opengl.glDrawStringCenter(line)
+ glPopMatrix()
+
+ glColor4ub(255,255,255,255)
+ opengl.glDrawStringCenter(line)
+ glTranslatef(0, 18, 0)
glPopMatrix()
def _checkHit(self, x, y):
def machineIsConnected():
#UltiGCode is designed for SD-Card printing, so never auto-detect the serial port.
- if profile.getPreference('gcode_flavor') == 'UltiGCode':
- return False
port = profile.getPreference('serial_port')
if port == 'AUTO':
+ if profile.getPreference('gcode_flavor') == 'UltiGCode':
+ return False
return len(serialList(True)) > 0
if platform.system() == "Windows":
return port in serialList()