本文整理汇总了Python中vanilla.HorizontalLine方法的典型用法代码示例。如果您正苦于以下问题:Python vanilla.HorizontalLine方法的具体用法?Python vanilla.HorizontalLine怎么用?Python vanilla.HorizontalLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vanilla
的用法示例。
在下文中一共展示了vanilla.HorizontalLine方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import vanilla [as 别名]
# 或者: from vanilla import HorizontalLine [as 别名]
def __init__( self ):
# Window 'self.w':
textY = 19
spaceX = 10
spaceY = 10
buttonX = 90
buttonY = 20
windowWidth = spaceX*4+buttonX*3
windowHeight = spaceY*6+textY*2+buttonY
self.w = vanilla.FloatingWindow(
( windowWidth, windowHeight ), # default window size
"Set Kerning Groups", # window title
)
self.w.textLower = vanilla.TextBox((spaceX, spaceY, 200, textY), "Lowercase style?", sizeStyle='regular')
self.w.normalButton = vanilla.Button((spaceX, spaceY*2+textY, buttonX, buttonY), "Normal", sizeStyle='regular', callback=self.SetKernPairsMain )
self.w.cursiveButton = vanilla.Button((spaceX*2+buttonX, spaceY*2+textY, buttonX, buttonY), "Cursive", sizeStyle='regular', callback=self.SetKernPairsMain )
self.w.allcapButton = vanilla.Button((spaceX*3+buttonX*2, spaceY*2+textY, buttonX, buttonY), "All Cap", sizeStyle='regular', callback=self.SetKernPairsMain )
self.w.line = vanilla.HorizontalLine((spaceX, spaceX*4+textY*2, -spaceX, 1))
self.w.radioButton = vanilla.RadioGroup((spaceX, spaceY*5+textY*2, 300, textY), ["All Glyphs", "Selected Glyphs"], sizeStyle='regular', isVertical=False)
# Open window and focus on it:
self.w.open()
self.w.radioButton.set(0)
self.w.makeKey()
示例2: __init__
# 需要导入模块: import vanilla [as 别名]
# 或者: from vanilla import HorizontalLine [as 别名]
def __init__(self):
self.searchResults = []
self.selectedChars = ""
self.w = FloatingWindow((300, 400), "Unicode Picker", minSize=(250, 300),
autosaveName="UnicodePicker")
y = 8
self.w.searchField = EditText((10, y, -10, 25),
placeholder="Search Unicode name or value",
callback=self.searchTextChanged_)
y = 40
columnDescriptions = [
dict(title="char", width=40,
cell=makeTextCell(align="center", font=AppKit.NSFont.systemFontOfSize_(14))),
dict(title="unicode", width=60, cell=makeTextCell(align="right")),
dict(title="name"),
]
self.w.unicodeList = List((0, y, 0, -100), [], columnDescriptions=columnDescriptions,
rowHeight=18,
selectionCallback=self.listSelectionChanged_,
doubleClickCallback=self.listDoubleClickCallback_)
self.w.unicodeList._nsObject.setBorderType_(AppKit.NSNoBorder)
y = -100
self.w.divider = HorizontalLine((0, y, 0, 1))
y += 5
self.w.unicodeText = TextBox((20, y, -10, 55), "")
self.w.unicodeText._nsObject.cell().setFont_(AppKit.NSFont.systemFontOfSize_(36))
self.w.unicodeText._nsObject.cell().setLineBreakMode_(AppKit.NSLineBreakByTruncatingMiddle)
y += 55
self.w.copyButton = Button((20, y, 120, 25), "Copy", callback=self.copy_)
self.w.copyButton.enable(False)
self.w.open()
self.w._window.setWindowController_(self)
self.w._window.setBecomesKeyOnlyIfNeeded_(False)
self.w._window.makeKeyWindow()
示例3: __init__
# 需要导入模块: import vanilla [as 别名]
# 或者: from vanilla import HorizontalLine [as 别名]
def __init__( self ):
windowWidth = 400
windowHeight = 280
self.w = vanilla.FloatingWindow(
( windowWidth, windowHeight ), # default window size
"ALL YOUR @BASE BELONG TO US.", # window title
autosaveName = "com.Tosche.BatchMetricKey.mainwindow" # stores last window position and size
)
# UI elements:
self.w.presetText = vanilla.TextBox( ( 12, 13, 55, 17), "Presets:", sizeStyle='regular' )
self.w.presetPopup = vanilla.PopUpButton( (14+58, 13, -15, 17), [str(x) for x in presets], callback=self.setField, sizeStyle='regular' )
self.w.keyTextField = vanilla.EditText( (14, 45, -15, 22), re.sub(" .*", "", presets[0]), sizeStyle = 'regular')
self.w.setToText = vanilla.TextBox( ( 12, 78, 50, 17), "Set to:", sizeStyle='regular' )
self.w.applyL = vanilla.CheckBox( ( 12+50, 78, 50, 22), "Left", value=True, sizeStyle='regular')
self.w.applyR = vanilla.CheckBox( ( 12+50+50, 78, 56, 22), "Right", value=True, sizeStyle='regular')
self.w.avoidNest = vanilla.CheckBox( ( 275, 78, 115, 22), "Adoid Nesting", value=True, sizeStyle='regular')
self.w.radioQText = vanilla.TextBox( ( 12, 115, 100, 17), "If there is Q:", sizeStyle='regular' )
self.w.radioQ = vanilla.RadioGroup( (100, 115, 350, 19), ["Use width of O (no key)", "Use RSB of Q"], sizeStyle='regular', isVertical=False)
self.w.radioQ.set(0)
self.w.line = vanilla.HorizontalLine((12, 190, -10, 1))
self.w.explain = vanilla.TextBox( ( 12, 200, 350, 80), "@base is a glyph without suffix of the selected glyph.\n@base of hsuperior is h\n@Base of a.smcp is A\n@base.smcp of one.numr is one.smcp", sizeStyle='regular' )
# Run Button:
self.w.setButton = vanilla.Button((290, 145, 90, 34), "Set", sizeStyle='regular', callback=self.BatchMetricKeyMain )
self.w.setDefaultButton( self.w.setButton )
# Open window and focus on it:
self.w.open()
self.w.makeKey()
示例4: __init__
# 需要导入模块: import vanilla [as 别名]
# 或者: from vanilla import HorizontalLine [as 别名]
def __init__(self, font, html, glyphsWithIssues):
self.font = font
self.html = html
self.glyphsWithIssues = glyphsWithIssues
title = "Glyph Nanny Report: Unsaved Font"
if font.path is not None:
title = u"Glyph Nanny Report: %s" % os.path.basename(font.path)
self.w = vanilla.Window((600, 400), title=title, minSize=(200, 200))
self.w.reportView = HTMLView((0, 0, -0, -50))
self.w.reportView.setHTML(html)
self.w.line = vanilla.HorizontalLine((0, -50, 0, 1))
self.w.saveButton = vanilla.Button((15, -35, 100, 20), "Save Report", callback=self.saveButtonCallback)
self.w.markButton = vanilla.Button((-115, -35, 100, 20), "Mark Glyphs", callback=self.markButtonCallback)
self.w.open()
示例5: _heading
# 需要导入模块: import vanilla [as 别名]
# 或者: from vanilla import HorizontalLine [as 别名]
def _heading(self, title):
self.leading += 20
setattr(self.w, 'text%s' % self.head_count, vanilla.TextBox((14, self.leading, 300, 14), title, sizeStyle='small'))
self.leading += 12
self.head_count += 1
setattr(self.w, 'rule%s' % self.head_count, vanilla.HorizontalLine((14, self.leading, 300, 14)))
self.leading += 12
示例6: __init__
# 需要导入模块: import vanilla [as 别名]
# 或者: from vanilla import HorizontalLine [as 别名]
def __init__( self ):
# Window 'self.w':
edY = 22
txX = 116
txY = 17
spX = 14
spY = 12
btnX = 60
btnY = 20
windowWidth = 260
windowHeight = 360
windowWidthResize = 100 # user can resize width by this value
windowHeightResize = 0 # user can resize height by this value
self.w = vanilla.FloatingWindow(
( windowWidth, windowHeight ), # default window size
"Make Bubble Layers", # window title
autosaveName = "com.Tosche.MakeBubbleLayers.mainwindow" # stores last window position and size
)
# Offset values:
self.w.textH = vanilla.TextBox( (spX, spY, txX, txY), "Horizontal Offset:" )
self.w.textV = vanilla.TextBox( (spX, spY*2+txY, txX, txY), "Vertical Offset:" )
self.w.editH = vanilla.EditText( (-spX-80, spY, -spX, edY), "60")
self.w.editV = vanilla.EditText( (-spX-80, spY*2+txY, -spX, edY), "60")
self.w.line1 = vanilla.HorizontalLine((0, spY*3+txY*2+5, -0, 1))
# Sidebearing modification:
self.w.adhereToSB = vanilla.CheckBox((spX, spY*4+txY*2, -spX, edY), "Adhere to Sidebearigs", callback=self.checkBoxCallback, value=True)
self.w.excess = vanilla.TextBox( (spX+16, spY*5+txY*3-7, -spX, txY), "Exceeding outlines are:" )
self.w.excessRadio = vanilla.RadioGroup((spX+16, spY*6+txY*4-14, 160, edY), ["Nudged", "Trimmed"], isVertical = False,)
self.w.line2 = vanilla.HorizontalLine((0, spY*6+txY*5-4, -0, 1))
# Rounding:
self.w.textRound = vanilla.TextBox( (spX, spY*7+txY*5, txX, txY), "Round Corners:" )
self.w.editRound = vanilla.EditText( (-spX-80, spY*7+txY*5, -spX, edY), "0")
self.w.line3 = vanilla.HorizontalLine((0, spY*8+txY*6+5, -0, 1))
# Overwrite Behaviour:
self.w.textOverwrite = vanilla.TextBox( (spX, spY*9+txY*7-11, -spX, txY), "Overwrite existing?" )
self.w.overwriteRadio = vanilla.RadioGroup((spX, spY*10+txY*8-14, -spX, edY), ["Never", "If Empty", "Always"], isVertical = False,)
self.w.line4 = vanilla.HorizontalLine((0, spY*11+txY*9-8, -0, 1))
# Master preference
self.w.masterRadio = vanilla.RadioGroup((spX, spY*11+txY*9, 0, edY), ["Current Master", "All Masters"], isVertical = False,)
# Run Button:
self.w.runButton = vanilla.Button((-80-15, -20-15, -15, -15), "Go!", sizeStyle='regular', callback=self.MakeBubbleLayersMain )
self.w.setDefaultButton( self.w.runButton )
self.progress = vanilla.Window((200, 65), closable=False, miniaturizable=False)
self.progress.text = vanilla.TextBox( (spX, spY, -spX, txY), "Please wait..." )
# Load Settings:
if not self.LoadPreferences():
self.w.excessRadio.set(0)
self.w.overwriteRadio.set(1)
self.w.masterRadio.set(1)
print "Note: 'Make Bubble Layers' could not load preferences. Will resort to defaults"
# Open window and focus on it:
self.w.open()
self.w.makeKey()
self.progress.open()
self.progress.center()
self.progress.hide()
示例7: __init__
# 需要导入模块: import vanilla [as 别名]
# 或者: from vanilla import HorizontalLine [as 别名]
def __init__( self ):
# Window 'self.w':
edY = 22
sp = 10
btnX = 80
btnY = 22
windowWidth = 300
windowHeight = 340
windowWidthResize = 100 # user can resize width by this value
windowHeightResize = 0 # user can resize height by this value
self.w = vanilla.FloatingWindow(
( windowWidth, windowHeight ), # default window size
"Export InDesign Tagged Text", # window title
autosaveName = "com.Tosche.ExportInDesignTaggedText.mainwindow" # stores last window position and size
)
f = Glyphs.font
try:
os.path.dirname(f.filepath)
location = "the same folder as the Glyphs source file"
except:
location = "Documents folder"
instruction = '''Instruction:
1. Export button will save the text file(s) in %s (overwites existing ones).
2. You also need to generate the font and make it available in InDesign.
3. In InDesign, have a document open. Go to "File > Place", choose the exported text file, and place it somewhere in the document. Et voilà!''' % location
instancePopupItems = []
for ins in f.instances:
familyName = ins.customParameters["familyName"] if ins.customParameters["familyName"] else f.familyName
instancePopupItems.append( "%s %s" % (familyName, ins.name) )
instancePopupItems += ["All instances"]
# UI elements:
self.w.instancesText = vanilla.TextBox( (sp, sp+5, 75, edY), "Export for", sizeStyle='small' )
self.w.instancesList = vanilla.PopUpButton( (sp*2+55, sp, -sp, edY), instancePopupItems, sizeStyle='small' )
self.w.tabCheck = vanilla.CheckBox( (sp, sp*2+edY*1, -sp, edY), "Tab-separated", sizeStyle = 'small', callback = self.checkBoxes)
self.w.unicodeCheck = vanilla.CheckBox( (sp, sp*2+edY*2, -sp, edY), "Unicode characters first, un-encoded later", sizeStyle = 'small', callback = self.checkBoxes)
self.w.breakCheck = vanilla.CheckBox( (sp, sp*2+edY*3, -sp, edY), "Break up the unicode part by category", sizeStyle = 'small')
self.w.runButton = vanilla.Button((sp, sp*3+edY*4, -sp, btnY), "Export", sizeStyle='regular', callback=self.ExportInDesignTaggedTextMain )
self.w.setDefaultButton( self.w.runButton )
self.w.border = vanilla.HorizontalLine((0, sp*4+edY*5, -0, 1))
self.w.instructionText = vanilla.TextBox( (sp, sp*5+edY*5, -sp, 200), instruction, sizeStyle='small' )
# Load Settings:
if not self.LoadPreferences():
print("Note: 'Export InDesign Tagged Text.py' could not load preferences. Will resort to defaults")
self.checkBoxes(self.w.unicodeCheck)
# Open window and focus on it:
self.w.open()
self.w.makeKey()