本文整理汇总了Python中pyasm.widget.TextAreaWdg.set_option方法的典型用法代码示例。如果您正苦于以下问题:Python TextAreaWdg.set_option方法的具体用法?Python TextAreaWdg.set_option怎么用?Python TextAreaWdg.set_option使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.widget.TextAreaWdg
的用法示例。
在下文中一共展示了TextAreaWdg.set_option方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_advanced_definition_wdg
# 需要导入模块: from pyasm.widget import TextAreaWdg [as 别名]
# 或者: from pyasm.widget.TextAreaWdg import set_option [as 别名]
def get_advanced_definition_wdg(self):
# add the advanced entry
advanced = DivWdg()
advanced.add_style("margin-top: 10px")
advanced.add_style("padding: 10px")
advanced.add_border()
title = DivWdg()
title.add_style("color: black")
title.add("Advanced - XML Column Definition")
title.add_style("margin-top: -23")
advanced.add(title)
advanced.add("<br/>")
input = TextAreaWdg("config_xml")
input.set_id("config_xml")
input.set_option("rows", "10")
input.set_option("cols", "70")
input.set_value(self.config_string)
advanced.add(input)
advanced.add(HtmlElement.br(2))
button_div = DivWdg()
button_div.add_style("text-align: center")
button = ActionButtonWdg(title="Save Definition")
#button = ProdIconButtonWdg("Save Definition")
button.add_event("onclick", "spt.custom_project.save_definition_cbk()")
button_div.add(button)
button_div.add_style("margin-left: 130px")
advanced.add(button_div)
return advanced
示例2: handle_xml_mode
# 需要导入模块: from pyasm.widget import TextAreaWdg [as 别名]
# 或者: from pyasm.widget.TextAreaWdg import set_option [as 别名]
def handle_xml_mode(my, custom_table, mode):
tbody = custom_table.add_tbody()
tbody.add_class("spt_custom_xml")
if mode != 'xml':
tbody.add_style('display: none')
# extra for custom config_xml
custom_table.add_row()
td = custom_table.add_cell()
td.add("Config XML Definition")
div = DivWdg()
div.set_id("config_xml_options")
#div.add_style("display: none")
div.add_style("margin-top: 10px")
default = '''
<element name=''>
<display class=''>
<option></option>
</display>
</element>
'''
config_xml_wdg = TextAreaWdg("config_xml")
config_xml_wdg.set_option("rows", "8")
config_xml_wdg.set_option("cols", "50")
config_xml_wdg.set_value(default)
div.add( config_xml_wdg )
custom_table.add_cell(div)
# create columns
custom_table.add_row()
td = custom_table.add_cell()
create_columns_wdg = CheckboxWdg("create_columns")
create_columns_wdg.set_checked()
td.add("Create required columns? ")
td = custom_table.add_cell()
td.add(create_columns_wdg)
custom_table.close_tbody()
示例3: get_display
# 需要导入模块: from pyasm.widget import TextAreaWdg [as 别名]
# 或者: from pyasm.widget.TextAreaWdg import set_option [as 别名]
def get_display(my):
sobject = my.get_current_sobject()
# handle the start and end
frame_start = sobject.get_value("tc_frame_start")
frame_end = sobject.get_value("tc_frame_end")
frame_start_text = TextWdg("tc_frame_start")
frame_start_text.set_value(frame_start)
frame_start_text.set_option("size", "2")
frame_end_text = TextWdg("tc_frame_end")
frame_end_text.set_value(frame_end)
frame_end_text.set_option("size", "2")
# handle the notes
frame_notes = sobject.get_value("frame_note")
frame_notes_text = TextAreaWdg("frame_note")
frame_notes_text.set_value(frame_notes)
frame_notes_text.set_option("rows", "1")
# handle the in and out handles
frame_in = sobject.get_value("frame_in")
frame_out = sobject.get_value("frame_out")
frame_in_text = TextWdg("frame_in")
frame_in_text.set_value(frame_in)
frame_in_text.set_option("size", "2")
frame_out_text = TextWdg("frame_out")
frame_out_text.set_value(frame_out)
frame_out_text.set_option("size", "2")
div = DivWdg()
table = Table()
div.add(table)
table.add_row()
td = table.add_cell("Range:")
td.add_style("width: 100px")
td = table.add_cell()
td.add("start: ")
td.add(frame_start_text)
td.add(" - end: ")
td.add(frame_end_text)
table.add_row()
table.add_cell("Handles:")
td = table.add_cell()
td.add(" in: ")
td.add(frame_in_text)
td.add(" - out: ")
td.add(frame_out_text)
td.add("<br/>")
table.add_row()
table.add_cell("Notes:")
td = table.add_cell(frame_notes_text)
"""
div.add("Range - start: ")
div.add(frame_start_text)
div.add(" - end: ")
div.add(frame_end_text)
div.add("<br/>")
div.add("Handles - in: ")
div.add(frame_in_text)
div.add(" - out: ")
div.add(frame_out_text)
div.add("<br/>")
div.add("Notes:")
div.add(frame_notes_text)
"""
return div
示例4: get_display
# 需要导入模块: from pyasm.widget import TextAreaWdg [as 别名]
# 或者: from pyasm.widget.TextAreaWdg import set_option [as 别名]
def get_display(my):
sobject = my.get_current_sobject()
# handle the start and end
frame_start = sobject.get_value("tc_frame_start")
frame_end = sobject.get_value("tc_frame_end")
frame_start_text = TextWdg("tc_frame_start")
frame_start_text.set_value(frame_start)
frame_start_text.set_option("size", "2")
frame_end_text = TextWdg("tc_frame_end")
frame_end_text.set_value(frame_end)
frame_end_text.set_option("size", "2")
# handle the notes
frame_notes = sobject.get_value("frame_note")
frame_notes_text = TextAreaWdg("frame_note")
frame_notes_text.set_value(frame_notes)
frame_notes_text.set_option("rows", "2")
# handle the in and out handles
frame_in = sobject.get_value("frame_in")
frame_out = sobject.get_value("frame_out")
frame_in_text = TextWdg("frame_in")
frame_in_text.set_value(frame_in)
frame_in_text.set_option("size", "2")
frame_out_text = TextWdg("frame_out")
frame_out_text.set_value(frame_out)
frame_out_text.set_option("size", "2")
div = DivWdg()
table = Table()
div.add(table)
table.add_row()
td = table.add_cell("Range:")
td.add_style("width: 100px")
td = table.add_cell()
td.add_style("text-align: right")
td.add_style("padding: 5px")
td.add("start: ")
td.add(frame_start_text)
td = table.add_cell()
td.add_style("text-align: right")
td.add_style("padding: 5px")
td.add("end: ")
td.add(frame_end_text)
table.add_row()
table.add_cell("Handles:")
td = table.add_cell()
td.add_style("text-align: right")
td.add_style("padding: 5px")
td.add("in: ")
td.add(frame_in_text)
td = table.add_cell()
td.add_style("text-align: right")
td.add_style("padding: 5px")
td.add("out: ")
td.add(frame_out_text)
td.add("<br/>")
table.add_row()
table.add_cell("Notes:")
td = table.add_cell(frame_notes_text)
td.add_style("padding: 5px")
td.add_attr("colspan", "2")
return div
示例5: get_display
# 需要导入模块: from pyasm.widget import TextAreaWdg [as 别名]
# 或者: from pyasm.widget.TextAreaWdg import set_option [as 别名]
#.........这里部分代码省略.........
})
buttons_list.append( {'label': 'Save as Def', 'tip': 'Save as Definition',
'bvr': { 'cbjs_action': "alert('Not Implemented')" }
})
buttons = TextBtnSetWdg( float="right", buttons=buttons_list,
spacing=6, size='small', side_padding=4 )
inner_div.add(buttons)
title_div = DivWdg()
title_div.add_style("margin-bottom: 10px")
title_div.add_class("maq_search_bar")
title_div.add("Element Definition")
inner_div.add(title_div)
test = SimpleElementDefinitionWdg(config_view=config_view, element_name=element_name)
inner_div.add(test)
config_title_wdg = DivWdg()
inner_div.add(config_title_wdg)
config_title_wdg.add("<b>Definitions in config</b>")
config_title_wdg.add_style("margin: 15px 0px 5px 0px")
for config in config_view.get_configs():
view = config.get_view()
xml = config.get_element_xml(element_name)
config_div = DivWdg()
inner_div.add(config_div)
# add the title
from pyasm.widget import SwapDisplayWdg, IconWdg
view_div = DivWdg()
view_div.add_class("spt_view")
config_div.add(view_div)
if not xml:
icon_wdg = IconWdg( "Nothing defined", IconWdg.DOT_RED )
icon_wdg.add_style("float: right")
view_div.add(icon_wdg)
else:
icon_wdg = IconWdg( "Is defined", IconWdg.DOT_GREEN )
icon_wdg.add_style("float: right")
view_div.add(icon_wdg)
swap = SwapDisplayWdg()
view_div.add(swap)
swap.add_action_script('''
var info_wdg = bvr.src_el.getParent('.spt_view').getElement('.spt_info');
spt.toggle_show_hide(info_wdg);
''')
mode = "predefined"
file_path = config.get_file_path()
if not file_path:
mode = "database"
elif file_path == 'generated':
mode = 'generated'
# display the title
view_div.add("%s" % view)
view_div.add(" - [%s]" % mode)
info_div = DivWdg()
info_div.add_class("spt_info")
info_div.add_style("margin-left: 20px")
info_div.add_style("display: none")
#if not xml:
# info_div.add_style("display: none")
#else:
# swap.set_off()
view_div.add(info_div)
path_div = DivWdg()
if not file_path:
file_path = mode
path_div.add("Defined in: %s" % file_path)
info_div.add(path_div)
text_wdg = TextAreaWdg()
text_wdg.set_option("rows", 15)
text_wdg.set_option("cols", 80)
text_wdg.set_value(xml)
info_div.add(text_wdg)
#view_div.add("<hr/>")
return top