def __init__(self):
		BaseWindowController.__init__(self)
		self.w = FloatingWindow((340, 220), 'Quadratic Converter')
		# ---------------------------
		top = 10
		self.w.maxDistanceTitle = TextBox((10, top, 100, 20), "Max Distance: ")
		minMaxDist  = 0.01
		maxMaxDist  = 10.0
		self.initMaxDist = 1.0
		self.maxDistanceValue = self.initMaxDist
		self.w.maxDistanceValueText = TextBox((110, top, -90, 22), str(self.initMaxDist))
		self.w.maxDistanceResetButton = Button((-80, top, -10, 22), "Reset", callback=self.maxDistanceResetCallback)
		self.w.maxDistanceSlider = Slider( (10, top+20, -10, 20),
				minValue=log(minMaxDist), maxValue=log(maxMaxDist),
				value=log(self.initMaxDist), callback=self.maxDistanceSliderCallback )
		# ---------------------------
		top = 60
		self.w.minLengthTitle = TextBox((10, top, 150, 20), "Min Segment Length: ")
		minMinLen  = 0
		maxMinLen  = 100
		initMinLen = 30
		self.minLengthValue = initMinLen
		self.w.minLengthValueText = TextBox((160, top, -10, 22), str(initMinLen))
		self.w.minLengthSlider = Slider( (10, top+20, -10, 20),
				minValue=minMinLen, maxValue=maxMinLen,
				value=initMinLen, callback=self.minLengthSliderCallback )
		# ---------------------------
		top = 110
		self.useArcLength = True
		#self.w.arclencheckbox = CheckBox((10, top, 90, 20), "Arc length", callback=self.arcLengthCheckBoxCallback, value=self.useArcLength)
		self.calculatePreview = True
		self.w.previewCheckBox = CheckBox((10, top, 70, 20), "Preview", callback=self.previewCheckBoxCallback, value=self.calculatePreview)
		self.w.closeButton = Button((120, top, 70, 20), "Close", callback=self.closeCallBack)
		self.w.convertCurrentFont = Button((210, top, 120, 20), "Convert Font", callback=self.convertCurrentFontCallback)
		# ---------------------------
		top = 150
		self.layers = ["foreground"]+CurrentFont().layerOrder
		self.w.layerText = TextBox((10, top, 120, 20), "Layer (per-glyph): ")
		self.w.layerPopup = PopUpButton((130, top, 90, 20), self.layers)#, callback=self.arcLengthCheckBoxCallback)
		self.w.convertCurrentGlyph = Button((225, top, 105, 20), "Convert Glyph", callback=self.convertCurrentGlyphCallback)
		# ---------------------------
		self.w.infoText = TextBox((10, -38, -10, 34), "WARNING. Un-saved modifications in a UFO will not be converted.")
		# ---------------------------
		self.w.open()
		self.w.bind("close", self.windowClosed)
		addObserver(self, "draw", "draw")
		UpdateCurrentGlyphView()
Esempio n. 2
0
 def windowCloseCallback(self, sender):
     self.deactivateModule()
     BaseWindowController.windowCloseCallback(self, sender)
Esempio n. 3
0
 def windowCloseCallback(self, sender):
     self.deactivateModule()
     UpdateCurrentGlyphView()
     BaseWindowController.windowCloseCallback(self, sender)
Esempio n. 4
0
 def windowCloseCallback(self, sender):
     self.removeObserver()
     self.updateView()
     BaseWindowController.windowCloseCallback(self, sender)
Esempio n. 5
0
 def __init__(self):
     BaseWindowController.__init__(self)
     self.w = FloatingWindow((340, 220), 'Quadratic Converter')
     # ---------------------------
     top = 10
     self.w.maxDistanceTitle = TextBox((10, top, 100, 20), "Max Distance: ")
     minMaxDist = 0.01
     maxMaxDist = 10.0
     self.initMaxDist = 1.0
     self.maxDistanceValue = self.initMaxDist
     self.w.maxDistanceValueText = TextBox((110, top, -90, 22),
                                           str(self.initMaxDist))
     self.w.maxDistanceResetButton = Button(
         (-80, top, -10, 22),
         "Reset",
         callback=self.maxDistanceResetCallback)
     self.w.maxDistanceSlider = Slider(
         (10, top + 20, -10, 20),
         minValue=log(minMaxDist),
         maxValue=log(maxMaxDist),
         value=log(self.initMaxDist),
         callback=self.maxDistanceSliderCallback)
     # ---------------------------
     top = 60
     self.w.minLengthTitle = TextBox((10, top, 150, 20),
                                     "Min Segment Length: ")
     minMinLen = 0
     maxMinLen = 100
     initMinLen = 30
     self.minLengthValue = initMinLen
     self.w.minLengthValueText = TextBox((160, top, -10, 22),
                                         str(initMinLen))
     self.w.minLengthSlider = Slider((10, top + 20, -10, 20),
                                     minValue=minMinLen,
                                     maxValue=maxMinLen,
                                     value=initMinLen,
                                     callback=self.minLengthSliderCallback)
     # ---------------------------
     top = 110
     self.useArcLength = True
     #self.w.arclencheckbox = CheckBox((10, top, 90, 20), "Arc length", callback=self.arcLengthCheckBoxCallback, value=self.useArcLength)
     self.calculatePreview = True
     self.w.previewCheckBox = CheckBox(
         (10, top, 70, 20),
         "Preview",
         callback=self.previewCheckBoxCallback,
         value=self.calculatePreview)
     self.w.closeButton = Button((120, top, 70, 20),
                                 "Close",
                                 callback=self.closeCallBack)
     self.w.convertCurrentFont = Button(
         (210, top, 120, 20),
         "Convert Font",
         callback=self.convertCurrentFontCallback)
     # ---------------------------
     top = 150
     self.layers = ["foreground"] + CurrentFont().layerOrder
     self.w.layerText = TextBox((10, top, 120, 20), "Layer (per-glyph): ")
     self.w.layerPopup = PopUpButton(
         (130, top, 90, 20),
         self.layers,
         callback=self.arcLengthCheckBoxCallback)
     self.w.convertCurrentGlyph = Button(
         (225, top, 105, 20),
         "Convert Glyph",
         callback=self.convertCurrentGlyphCallback)
     # ---------------------------
     self.w.infoText = TextBox(
         (10, -38, -10, 34),
         "WARNING. Un-saved modifications in a UFO will not be converted.")
     # ---------------------------
     self.w.open()
     self.w.bind("close", self.windowClosed)
     addObserver(self, "draw", "draw")
     UpdateCurrentGlyphView()
Esempio n. 6
0
 def windowCloseCallback(self, sender):
     self.deactivateModule()
     self.updateView()
     BaseWindowController.windowCloseCallback(self, sender)
Esempio n. 7
0
 def windowCloseCallback(self, sender):
     self.deactivateModule()
     UpdateCurrentGlyphView()
     BaseWindowController.windowCloseCallback(self, sender)
Esempio n. 8
0
 def windowCloseCallback(self, sender):
     BaseWindowController.windowCloseCallback(self, sender)
Esempio n. 9
0
 def windowCloseCallback(self, sender):
     BaseWindowController.windowCloseCallback(self, sender)