本文整理汇总了Python中pyasm.web.SpanWdg类的典型用法代码示例。如果您正苦于以下问题:Python SpanWdg类的具体用法?Python SpanWdg怎么用?Python SpanWdg使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SpanWdg类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: get_frame_rate_section
def get_frame_rate_section(self):
section_span = SpanWdg()
section_span.add('Frame Rate: ')
frame_rate_select = SelectWdg('frame_rate_select')
frame_rate_select.set_id('frame_rate_code')
frame_rate_select.add_style('width', '153px')
frame_rate_select.add_style('display', 'inline-block')
frame_rate_select.add_empty_option()
frame_rate_search = Search('twog/frame_rate')
frame_rates = frame_rate_search.get_sobjects()
for frame_rate in frame_rates:
frame_rate_select.append_option(frame_rate.get_value('name'), frame_rate.get_code())
try:
frame_rate_select.set_value(self.frame_rate_code)
except AttributeError:
pass
section_span.add(frame_rate_select)
return section_span
开发者ID:2gDigitalPost,项目名称:custom-rewrite,代码行数:25,代码来源:element_eval_wdg.py
示例2: get_prefs
def get_prefs(my):
div = DivWdg('Bar Size: ')
my.bar_select = FilterSelectWdg('progress_bar_size')
bar_sizes = [x*2 + 1 for x in xrange(6)]
my.bar_select.set_option('values', bar_sizes)
my.bar_select.set_option('default', '3')
div.add(my.bar_select)
my.bar_select_value = my.bar_select.get_value()
my.label_select = FilterSelectWdg('Label_Format')
my.label_select_value = my.label_select.get_value()
my.label_select.set_option('values', 'reg|small|abbr')
my.label_select.set_option('default', 'reg')
span = SpanWdg('Label Format: ', css='small')
span.add(my.label_select)
div.add(span)
my.desc_checkbox = FilterCheckboxWdg("Show Description", \
'Show Description: ', css='small')
my.desc_checkbox_value = my.desc_checkbox.get_value()
div.add(my.desc_checkbox)
my.include_sub_task = FilterCheckboxWdg("include_sub_task", \
label="include sub tasks", css='small')
my.include_sub_task_value = my.include_sub_task.is_checked()
div.add(my.include_sub_task)
return div
开发者ID:0-T-0,项目名称:TACTIC,代码行数:29,代码来源:parallel_status.py
示例3: get_format_section
def get_format_section(self):
section_span = SpanWdg()
section_span.add('Format: ')
section_span.add(self.get_format_select_wdg())
return section_span
开发者ID:2gDigitalPost,项目名称:custom-rewrite,代码行数:7,代码来源:element_eval_wdg.py
示例4: get_display
def get_display(my):
#my.init()
item_table = Table(css='minimal')
item_table.add_style('margin-left','30px')
for item in my.items:
item_table.add_row()
space_td = item_table.add_blank_cell()
item_td = item_table.add_cell(item.get_description())
item_td.set_attr("nowrap", "1")
delete = IconSubmitWdg("Remove from group", \
"stock_stop-16.png",add_hidden=False)
delete.add_event("onclick","document.form.remove_cmd.value=\
'%s|%s';document.form.submit();" \
% (my.group.get_primary_key_value(), item.get_primary_key_value()) )
del_span = SpanWdg(css='med')
del_span.add(delete)
item_table.add_cell(del_span)
if not my.items:
item_table.add_blank_cell()
my.add(item_table)
return super(ItemInContainerWdg, my).get_display()
开发者ID:0-T-0,项目名称:TACTIC,代码行数:25,代码来源:sobject_group_wdg.py
示例5: get_display
def get_display(my):
widget = Widget()
if not my.select:
return widget
if not my.schema:
Environment.add_warning("No schema defined")
widget.add("No schema defined")
return widget
if not my.search_type:
Environment.add_warning("HierarchicalFilterWdg: Cannot find current search_type")
widget.add("Cannot find current search_type")
return widget
span = SpanWdg(css="med")
parent_type = my.get_parent_type()
if parent_type:
parent_type_obj = SearchType.get(parent_type)
span.add("%s: " % parent_type_obj.get_value("title"))
# assume that there is a code in the parent
my.select.add_empty_option("-- Select --")
my.select.set_option("query", "%s|code|code" % my.parent_type)
span.add(my.select)
widget.add(span)
return widget
开发者ID:0-T-0,项目名称:TACTIC,代码行数:32,代码来源:filter_wdg.py
示例6: get_instantiation_wdg
def get_instantiation_wdg(self):
setting = self.get_default_setting()
default_instantiation = setting.get('instantiation')
div = DivWdg()
is_unchecked = True
default_cb = None
for value in self.get_instantiation_options():
name = self.get_element_name("instantiation")
checkbox = CheckboxWdg( name )
if value == default_instantiation:
default_cb = checkbox
checkbox.set_option("value", value)
checkbox.set_persistence()
if checkbox.is_checked():
is_unchecked = False
checkbox.add_behavior({'type': 'click_up',
'propagate_evt': True,
"cbjs_action": "spt.toggle_checkbox(bvr, '.spt_ui_options', '%s')" %name})
span = SpanWdg(checkbox, css='small')
span.add(value)
div.add(span)
if is_unchecked:
default_cb.set_checked()
return div
开发者ID:mincau,项目名称:TACTIC,代码行数:26,代码来源:load_options_wdg.py
示例7: get_display
def get_display(my):
div = SpanWdg()
div.add(" is ")
text = TextWdg("year")
value = my.values.get("year")
if value:
text.set_value(value)
div.add(text)
return div
开发者ID:0-T-0,项目名称:TACTIC,代码行数:9,代码来源:yearly_report_wdg.py
示例8: _get_target_span
def _get_target_span(my):
# get the target span
search = Search(my.container_cls)
my._order_search(search)
groups = search.get_sobjects()
if groups:
my.container_sobj = groups[0]
target_span = SpanWdg(css='med')
group_table = Table(my.GROUP_TABLE_NAME, css='table')
group_table.add_style('width','30em')
group_table.add_col(css='small')
group_table.add_col(css='small')
group_table.add_col()
target_span.add(group_table)
group_table.add_row_cell(search.get_search_type_obj()\
.get_description(), "heading")
checkbox = CheckboxWdg()
checkbox.set_option("onclick", \
"a=new Elements('container_ids');a.toggle_all(this);")
group_table.add_row()
group_table.add_cell(checkbox)
col_name = group_table.get_next_col_name()
toggle_control = HiddenRowToggleWdg(col_name=col_name, is_control=True, auto_index=True)
group_table.add_cell(toggle_control)
group_table.add_cell('MASTER CONTROL')
remove_cmd = HiddenWdg(SObjectGroupCmd.REMOVE_CMD)
my.add(remove_cmd)
for group in groups:
group_table.add_row()
checkbox = CheckboxWdg("container_ids")
checkbox.set_option("value", group.get_primary_key_value() )
toggle = HiddenRowToggleWdg(col_name, auto_index=True)
toggle.store_event()
group_details = ItemInContainerWdg( group, my.item_sobj, my.item_cls, my.grouping_cls )
# set the target content of the toggle
toggle.set_static_content(group_details)
group_table.add_cell( checkbox )
group_table.add_cell( toggle, add_hidden_wdg=True )
group_table.add_cell( group.get_description())
num_items = group_details.get_num_items()
if num_items:
td = group_table.add_cell( "( %s )" % num_items, 'no_wrap')
td.add_color(color)
else:
group_table.add_blank_cell()
return target_span
开发者ID:0-T-0,项目名称:TACTIC,代码行数:57,代码来源:sobject_group_wdg.py
示例9: get_display
def get_display(my):
web = WebContainer.get_web()
if not my.view:
view = web.get_form_value("filter|view")
# create popup
create_popup = PopupWdg("create_action")
create_popup.set_auto_hide(False)
create_popup.add("Enter name of view: ")
create_popup.add(TextWdg("create_view_name"))
# create_popup.add( HtmlElement.br(2) )
# create_popup.add( "Copy from template: " )
# template_select = SelectWdg("copy_from_template")
# template_select.add_empty_option("-- None --")
# template_select.set_option("values", "list|summary|task")
# create_popup.add( template_select )
create_popup.add(HtmlElement.br(2, clear="all"))
from pyasm.prod.web import ProdIconButtonWdg, ProdIconSubmitWdg
create_icon = ProdIconButtonWdg("Create")
ajax = AjaxCmd()
ajax.register_cmd("pyasm.widget.CustomCreateViewCbk")
ajax.add_element_name("create_view_name")
ajax.add_element_name("auto_create_edit")
ajax.set_option("search_type", my.search_type)
ajax.set_option("project", Project.get_project_code())
if my.view:
ajax.set_option("template_view", my.view)
create_icon.add_event(
"onclick",
"%s;%s"
% (ajax.get_on_script(), "toggle_display('create_action');setTimeout('document.form.submit()',1000)"),
)
cancel_icon = ProdIconButtonWdg("Cancel")
cancel_icon.add_event("onclick", "toggle_display('create_action')")
span = SpanWdg()
span.add(create_icon)
span.add(cancel_icon)
create_popup.add(span)
create_popup.add(HtmlElement.br())
# add the create button
create = IconButtonWdg("Create View", IconWdg.SAVE, True)
create.add_event("onclick", "%s" % create_popup.get_on_script())
# lay it all out
widget = Widget()
widget.add(create_popup)
# Browser does not have create
# widget.add(create)
return widget
开发者ID:hellios78,项目名称:TACTIC,代码行数:56,代码来源:custom_view_app_wdg.py
示例10: get_add_multiple_rows_button
def get_add_multiple_rows_button(self):
span_wdg = SpanWdg()
add_rows_button = ButtonNewWdg(title='Add Multiple Row', icon='PLUS_ADD')
add_rows_button.add_class('add_rows_button')
add_rows_button.add_style('display', 'inline-block')
add_rows_button.add_behavior(self.get_add_multiple_rows_behavior())
span_wdg.add(add_rows_button)
return span_wdg
开发者ID:2gDigitalPost,项目名称:custom-rewrite,代码行数:11,代码来源:prequal_eval_lines_wdg.py
示例11: get_add_row_button
def get_add_row_button(self):
section_span = SpanWdg()
section_span.add_style('display', 'inline-block')
add_row_button = ButtonNewWdg(title='Add Row', icon='ADD')
add_row_button.add_class('add_row_button')
add_row_button.add_behavior(get_add_audio_configuration_line_behavior(self.element_evaluation_code))
section_span.add(add_row_button)
return section_span
开发者ID:2gDigitalPost,项目名称:custom-rewrite,代码行数:11,代码来源:audio_configuration_lines_wdg.py
示例12: get_export_to_pdf_button
def get_export_to_pdf_button(self):
section_span = SpanWdg()
section_span.add_style('display', 'inline-block')
export_to_pdf_button = ButtonNewWdg(title='Export to PDF', icon='ARROW_DOWN')
export_to_pdf_button.add_class('export_to_pdf_button')
export_to_pdf_button.add_behavior(self.get_export_to_pdf_behavior(self.metadata_report_sobject.get_code()))
section_span.add(export_to_pdf_button)
return section_span
开发者ID:2gDigitalPost,项目名称:custom-rewrite,代码行数:11,代码来源:metadata_report_wdg.py
示例13: get_save_as_new_version_button
def get_save_as_new_version_button(self):
section_span = SpanWdg()
section_span.add_style('display', 'inline-block')
save_as_new_version_button = ButtonNewWdg(title='Save As New Version', icon='INSERT')
save_as_new_version_button.add_class('save_as_new_version_button')
save_as_new_version_button.add_behavior(self.get_save_as_new_version_behavior())
section_span.add(save_as_new_version_button)
return section_span
开发者ID:2gDigitalPost,项目名称:custom-rewrite,代码行数:11,代码来源:element_eval_wdg.py
示例14: get_save_button
def get_save_button(self):
section_span = SpanWdg()
section_span.add_style('display', 'inline-block')
save_button = ButtonNewWdg(title='Save', icon='SAVE')
save_button.add_class('save_button')
save_button.add_behavior(self.get_save_behavior(self.metadata_report_sobject.get_code()))
section_span.add(save_button)
return section_span
开发者ID:2gDigitalPost,项目名称:custom-rewrite,代码行数:11,代码来源:metadata_report_wdg.py
示例15: get_save_new_button
def get_save_new_button(self):
section_span = SpanWdg()
section_span.add_style('display', 'inline-block')
save_new_button = ButtonNewWdg(title='Save', icon='NEW')
save_new_button.add_class('save_due_date')
save_new_button.add_behavior(self.get_save_new_behavior())
section_span.add(save_new_button)
return section_span
开发者ID:2gDigitalPost,项目名称:custom-rewrite,代码行数:11,代码来源:change_due_date_wdg.py
示例16: get_remove_row_button
def get_remove_row_button(self, line_code):
section_span = SpanWdg()
section_span.add_style('display', 'inline-block')
remove_row_button = ButtonNewWdg(title='Remove Row', icon='DELETE')
remove_row_button.add_class('remove_row_button')
remove_row_button.add_behavior(get_remove_audio_configuration_line_behavior(self.element_evaluation_code,
line_code))
section_span.add(remove_row_button)
return section_span
开发者ID:2gDigitalPost,项目名称:custom-rewrite,代码行数:12,代码来源:audio_configuration_lines_wdg.py
示例17: get_remove_row_button
def get_remove_row_button(self, row_code):
span_wdg = SpanWdg()
remove_row_button = ButtonNewWdg(title='Remove Row', icon='DELETE')
remove_row_button.add_class('subtract_row_button')
remove_row_button.add_style('display', 'inline-block')
remove_row_button.add_behavior(self.get_remove_row_behavior(row_code))
span_wdg.add(remove_row_button)
return span_wdg
开发者ID:2gDigitalPost,项目名称:custom-rewrite,代码行数:12,代码来源:prequal_eval_lines_wdg.py
示例18: get_display
def get_display(my):
div = DivWdg(css='left_content')
div.set_style("margin-top: 10px; margin-bottom: 20px;")
# add some spacing
span = SpanWdg()
span.set_class('tab_front')
div.add(span)
# figure out which is the selected one
selected_index = 0
for i in range(0, len(my.tab_names)):
tab_name = my.tab_names[i]
if tab_name == my.tab_value:
selected_index = i
break
for i in range(0, len(my.tab_names)):
tab_name = my.tab_names[i]
widget = my.get_widget(tab_name)
tab = HtmlElement.span()
tab.set_attr('name', my.tab_group_name)
# required by IE
tab.set_id(my.tab_group_name)
tab.set_attr('tab', tab_name)
if i == selected_index:
# selected tab
tab.set_class("%s_selected" %my.get_style_prefix())
my.content_div.add(widget)
else:
# unselected tab
tab.set_class("%s_unselected" %my.get_style_prefix())
tab.add( my.get_header(tab_name) )
div.add(tab)
# display the content
my.content_div.set_id(my.content_div_id)
my.content_div.set_class("%s_content" %my.get_style_prefix())
my.content_div.add_style("display: block")
div.add(my.content_div)
return div
开发者ID:0-T-0,项目名称:TACTIC,代码行数:51,代码来源:tab_wdg.py
示例19: get_create_view_wdg
def get_create_view_wdg(my, search_type):
# create popup
create_popup = PopupWdg("create_action")
create_popup.set_auto_hide(False)
create_popup.add("Enter name of view: ")
create_popup.add(TextWdg("create_view_name"))
# create_popup.add( HtmlElement.br(2) )
# create_popup.add( "Copy from template: " )
# template_select = SelectWdg("copy_from_template")
# template_select.add_empty_option("-- None --")
# template_select.set_option("values", "list|summary|task")
# create_popup.add( template_select )
create_popup.add(HtmlElement.br(2))
create_popup.add(CheckboxWdg("auto_create_edit", label="Auto Create Edit View"))
create_popup.add(HtmlElement.br(2, clear="all"))
from pyasm.prod.web import ProdIconButtonWdg, ProdIconSubmitWdg
create_icon = ProdIconButtonWdg("Create")
ajax = AjaxCmd()
ajax.register_cmd("pyasm.widget.CustomCreateViewCbk")
ajax.add_element_name("create_view_name")
ajax.add_element_name("auto_create_edit")
ajax.set_option("search_type", search_type)
ajax.set_option("project", Project.get_project_code())
div = ajax.generate_div()
div.set_post_ajax_script("document.form.submit()")
create_icon.add_event("onclick", "%s;%s" % (ajax.get_on_script(), "toggle_display('create_action')"))
cancel_icon = ProdIconButtonWdg("Cancel")
cancel_icon.add_event("onclick", "toggle_display('create_action')")
span = SpanWdg()
span.add(create_icon)
span.add(cancel_icon)
create_popup.add(span)
create_popup.add(HtmlElement.br())
# add the create button
create = IconButtonWdg("Create View", IconWdg.SAVE, True)
create.add_event("onclick", "%s" % create_popup.get_on_script())
# lay it all out
widget = Widget()
widget.add(create_popup)
widget.add(create)
widget.add(div)
return widget
开发者ID:hellios78,项目名称:TACTIC,代码行数:50,代码来源:custom_view_app_wdg.py
示例20: get_config_wdg
def get_config_wdg(my):
widget = Widget()
search = Search("sthpw/widget_config")
div = DivWdg(css="filter_box")
span = SpanWdg(css="med")
span.add("Search Type: ")
select = FilterSelectWdg("config_search_type")
select.add_empty_option("-- Select --")
search_type_search = Search("sthpw/search_object")
search_type_search.add_order_by("search_type")
span.add(select)
project = Project.get()
project_type = project.get_base_type()
filter = search.get_regex_filter("search_type", "login|task|note|timecard", "EQ")
search_type_search.add_where(
"""
namespace = '%s' or namespace = '%s' or %s
"""
% (project_type, project.get_code(), filter)
)
select.set_search_for_options(search_type_search, value_column="search_type")
div.add(span)
search_type_value = select.get_value()
span = SpanWdg()
view_text = TextWdg("view")
view_text.set_persist_on_submit()
span.add("View: ")
span.add(view_text)
div.add(span)
widget.add(div)
view = view_text.get_value()
if view:
search.add_filter("view", view)
if search_type_value:
search.add_filter("search_type", search_type_value)
table = TableWdg("sthpw/widget_config")
table.set_search(search)
widget.add(table)
return widget
开发者ID:hellios78,项目名称:TACTIC,代码行数:48,代码来源:custom_project_tab_wdg.py
注:本文中的pyasm.web.SpanWdg类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论