当前位置: 首页>>代码示例>>Python>>正文


Python HtmlElement.hr方法代码示例

本文整理汇总了Python中pyasm.web.HtmlElement.hr方法的典型用法代码示例。如果您正苦于以下问题:Python HtmlElement.hr方法的具体用法?Python HtmlElement.hr怎么用?Python HtmlElement.hr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyasm.web.HtmlElement的用法示例。


在下文中一共展示了HtmlElement.hr方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_display

# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import hr [as 别名]
    def get_display(my):

        search_key = my.kwargs.get('parent_key')

        div = DivWdg()

        if not search_key:
            div.add("Search Key for SObjectHeaderHdg is empty")
            return div

        sobject = Search.get_by_search_key( search_key )
        if not sobject:
            div.add("SObject with Search Key [%s] does not exist" % search_key)
            return div


        search_type_obj = sobject.get_search_type_obj()
        title = search_type_obj.get_title()
        title_wdg = DivWdg()
        title_wdg.add_style("font-size: 1.8em")

        name = sobject.get_display_value()
        title_wdg.add("%s: %s" % (title, name ))

        div.add(title_wdg)
        div.add(HtmlElement.hr())

        return div
开发者ID:southpawtech,项目名称:TACTIC-DEV,代码行数:30,代码来源:custom_layout_wdg.py

示例2: get_save_wdg

# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import hr [as 别名]
    def get_save_wdg(my):

        # add the popup
        popup = PopupWdg(id="save_search_wdg")
        popup.add("Save Search", "title")

        div = DivWdg()
        div.add("Save current search as: ")

        text = TextWdg("save_search_text")
        text.set_id("save_search_text")
        div.add(text)

        save_button = ButtonWdg("Save Search")
        behavior = {"type": "click", "mouse_btn": "LMB", "cbjs_action": "spt.dg_table.save_search_cbk(evt, bvr);"}
        save_button.add_behavior(behavior)

        cancel_button = ButtonWdg("Cancel")
        cancel_button.add_event("onclick", "$('save_search_wdg').style.display = 'none'")

        div.add(HtmlElement.hr())
        button_div = DivWdg()
        button_div.add_style("text-align: center")
        button_div.add(save_button)
        button_div.add("  ")
        button_div.add(cancel_button)
        div.add(button_div)

        popup.add(div, "content")

        return popup
开发者ID:raidios,项目名称:TACTIC,代码行数:33,代码来源:search_wdg.py

示例3: get_menu_item

# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import hr [as 别名]
    def get_menu_item(my, element_name, display_handler):

        content = DivWdg()
        content.add_attr("spt_element_name", element_name)
        content.add_class("hand")

        # add the drag/drop behavior
        behavior = {
            "type": "drag",
            "mouse_btn": "LMB",
            "modkeys": "",
            "src_el": "@",
            "cbfn_setup": "spt.side_bar.pp_setup",
            "cbfn_motion": "spt.side_bar.pp_motion",
            "cbfn_action": "spt.side_bar.pp_action",
        }
        content.add_behavior(behavior)

        content.set_id("manage_%s" % element_name)
        content.add_style("position: relative")
        content.add_style("margin: 3px")
        content.add_style("left: 0")
        content.add_style("top: 0")
        content.add_style("z-index: 100")
        if display_handler == "SeparatorWdg":
            content.add(HtmlElement.hr())
        else:
            content.add(element_name)

        return content
开发者ID:hellios78,项目名称:TACTIC,代码行数:32,代码来源:view_manager_wdg.py

示例4: get_save_wdg

# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import hr [as 别名]
    def get_save_wdg(self):

        div = DivWdg()
        div.add("Save current search as: ")

        text = TextWdg("save_search_text")
        text.set_id("save_search_text")
        div.add(text)



        save_button = ButtonWdg("Save Search")
        behavior = {
            'cbjs_action':  'spt.table.save_search();'
        }
        save_button.add_behavior( behavior )


        cancel_button = ButtonWdg("Cancel")
        cancel_button.add_event("onclick", "$('save_search_wdg').style.display = 'none'")

        div.add(HtmlElement.hr())
        button_div = DivWdg()
        button_div.add_style("text-align: center")
        button_div.add(save_button)
        button_div.add("  ")
        button_div.add(cancel_button)
        div.add(button_div)

        return div
开发者ID:mincau,项目名称:TACTIC,代码行数:32,代码来源:search_wdg.py

示例5: get_display

# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import hr [as 别名]
    def get_display(self):

        if self.get_example_chooser == 'true':
            return self.get_example_chooser_content()

        div = DivWdg()
        div.set_id("UiPlaygroundPanelWdg")

        title = "UI Playground"
        title_wdg = DivWdg()
        title_wdg.add_looks("fnt_title_2")
        title_wdg.add(title)
        div.add(title_wdg)

        div.add(HtmlElement.hr())

        div.add( '<br/>' )
        click_chooser = DivWdg()
        click_chooser.add_looks("fnt_text")
        click_chooser.add( " UI Examples List Popup" )
        click_chooser.add_class("SPT_DTS")
        click_chooser.add_styles("cursor: pointer; padding: 6px; width: 130px; background-color: black;")

        click_chooser.add_behavior( {'type': 'click_up',
                                     'cbfn_action': 'spt.popup.get_widget',
                                     'options': { 'title': 'TACTIC&trade; UI Examples',
                                                  'width': '400px',
                                                  'popup_id': 'UiExamplesChooserPopup',
                                                  'popup_parent_id': 'UiPlaygroundPanelWdg',
                                                  'class_name': 'tactic.ui.panel.ui_playground_panel_wdg.' \
                                                                'UiPlaygroundPanelWdg'
                                                  },
                                     'args': { 'get_example_chooser': 'true' }
                                     } )


        div.add( click_chooser )
        div.add( '<br/>' )

        example_display_div = DivWdg()
        example_display_div.add_styles( "padding: 10px;" )
        example_display_div.set_id("UiExampleDisplayDiv")

        div.add( example_display_div )

        div.add( '<br/>' )
        div.add( '<br/>' )

        return div
开发者ID:mincau,项目名称:TACTIC,代码行数:51,代码来源:ui_playground_panel_wdg.py

示例6: get_display

# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import hr [as 别名]
    def get_display(my):
        widget = DivWdg(id='new_item_panel')
        widget.add_class("new_item_panel")
        widget.add_class("spt_new_item_top")

        div = DivWdg()
        div.add_color("background", "background")
        div.add_color("color", "color")
        div.add_style("padding", "5px")
        div.add_border()

        if my.is_personal:
            is_personal = 'true'
        else:
            is_personal = 'false'

        if my.type == 'new_folder':
            #div.set_attr('spt_view', 'new_folder')
            div.add(HtmlElement.b('Create New Folder'))
            div.add(HtmlElement.br(2))
            """
            # add exisiting views in the div for checking with client's input
             # add exiting views:
            from panel_wdg import ViewPanelSaveWdg
            views = ViewPanelSaveWdg.get_existing_views(my.is_personal)
            hidden = HiddenWdg('existing_views', '|'.join(views))
            div.add(hidden)
            """
            text2 = TextWdg("new_title")
            text2.add_class("spt_new_item_title")
            span = SpanWdg("Title: ")
            span.set_id('create_new_title')
            #span.add_style('display: none')
            span.add_style('padding-left: 8px')
            span.add(text2)
            div.add(span)
            div.add(HtmlElement.br(2))

            div.add_style("width: 350px")


            action = '''
            var top = bvr.src_el.getParent(".spt_new_item_top");
            var name_el = top.getElement(".spt_new_item_name");
            var title = bvr.src_el.value;
            var name = title.replace(/[\[email protected]#$%^&*()'"]/g, "");
            name = name.replace(/ /g, "_");
            name = name.toLowerCase();
            name_el.value = name;
            '''


            # change the name based on the title
            text2.add_behavior( {
            'type': 'change',
            'cbjs_action': action
            } )

            div.add("The name of the folder is a hidden name that is used by other elements to refer to uniquely to this item.<br/><br/>")
            text = TextWdg('new_name')
            text.add_class("spt_new_item_name")
            span = SpanWdg('Name: ')
            span.add(text)
            div.add(span)

            div.add(HtmlElement.br(2))
            
            #script = "spt.side_bar.manage_section_action_cbk({'value':'predefined'},'project_view');"
            #link = HtmlElement.js_href(script, data='[ Predefined View ]')
            #div3 = DivWdg('Optional: drag existing elements from Project Views or %s into this new folder' %link.get_buffer_display())
            #div.add(div3)
            #item_div = DivWdg(css='spt_new_item spt_side_bar_content')
            #div.add(item_div)

            div.add("<hr/>")

           
            #save_div = SpanWdg(css='med hand')
            #div.add(save_div)
            #save_div.add(IconWdg('Save Folder', IconWdg.SAVE))

            save_button = ActionButtonWdg(title='Create', tip='Create a new folder')
            div.add(save_button)
       
            bvr = {
            "type": "click_up",
            "view": my.view,
            "is_personal": is_personal == 'true',
            'cbjs_action': '''
            var top = bvr.src_el.getParent(".spt_new_item_top");
            var name_el = top.getElement(".spt_new_item_name");
            var name_value = name_el.value;
            if (name_value == "") {
                var title_el = top.getElement(".spt_new_item_title");
                var title = title_el.value;
                var name = spt.convert_to_alpha_numeric(title);
                name_el.value = name;
            }
            if (name_value == "") {
                spt.alert("Please fill in a value for name.");
#.........这里部分代码省略.........
开发者ID:blezek,项目名称:TACTIC,代码行数:103,代码来源:view_manager_wdg.py

示例7: ButtonWdg

# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import hr [as 别名]
        #select.set_option("query_filter", "\"view\" like 'saved_search:%'")
        div.add(select)

        retrieve_button = ButtonWdg("Retrieve Search")
        behavior = {
            'type':         'click',
            'cbjs_action':  'spt.dg_table.retrieve_search_cbk(evt, bvr);'
        }
        retrieve_button.add_behavior( behavior )



        cancel_button = ButtonWdg("Cancel")
        cancel_button.add_event("onclick", "$('retrieve_search_wdg').style.display = 'none'")

        div.add(HtmlElement.hr())
        button_div = DivWdg()
        button_div.add_style("text-align: center")
        button_div.add(retrieve_button)
        button_div.add("&nbsp;&nbsp;")
        button_div.add(cancel_button)
        div.add(button_div)

        popup.add(div, "content")

        return popup


    def get_save_wdg(my):

        # add the popup
开发者ID:hellios78,项目名称:TACTIC,代码行数:33,代码来源:search_wdg.py

示例8: get_display

# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import hr [as 别名]
    def get_display(my):
        div = DivWdg()

        search_type = "prod/asset"

        search_type_obj = SearchType.get(search_type)
        title = search_type_obj.get_title()
        title_wdg = DivWdg()
        title_wdg.add_style("font-size: 1.8em")
        title_wdg.add("%s" % (title) )

        div.add(title_wdg)
        div.add(HtmlElement.hr())


        table = Table()
        div.add(table)
        table.set_max_width()

        table.add_row()

        from pyasm.widget import ThumbWdg, DiscussionWdg, SObjectTaskTableElement

        td = table.add_cell()
        td.add_style("width: 250px")
        td.add_style("vertical-align: top")
        td.add_style("border-right: solid 1px")
        title = DivWdg()
        title.add_class("maq_search_bar")
        x = DivWdg("[?] [x]")
        x.add_style("float: right")
        title.add(x)
        title.add("Info")
        td.add(title)
        thumb = ThumbWdg()
        thumb.set_sobject(sobject)
        td.add(thumb)
        from pyasm.prod.web import AssetInfoWdg
        info = AssetInfoWdg()
        info.thumb = thumb
        info.set_sobject(sobject)
        td.add(info)

        td = table.add_cell()
        td.add_style("vertical-align: top")
        td.add_style("padding-left: 5px")
        td.add_style("border-right: solid 1px")
       
        # notes
        title = DivWdg()
        title.add_class("maq_search_bar")
        x = DivWdg("[x]")
        x.add_style("float: right")
        title.add(x)
        title.add("Notes")
        td.add(title)
        discussion_wdg = DiscussionWdg()
        discussion_wdg.preprocess()
        discussion_wdg.set_sobject(sobject)
        td.add(discussion_wdg)

        td = table.add_cell()
        td.add_style("vertical-align: top")
        td.add_style("padding-left: 5px")
        td.add_style("border-right: solid 1px")
 

        # tasks
        title = DivWdg()
        title.add_class("maq_search_bar")
        x = DivWdg("[x]")
        x.add_style("float: right")
        title.add(x)
        title.add("Custom Properties")
        td.add(title)
        search = Search("prod/custom_property")
        search.add_filter("search_type", "sample3d/book")
        sobjects = search.get_sobjects()
        table = TableLayoutWdg(search_type="prod/custom_property", view='table')
        table.set_sobjects(sobjects)
        td.add(table)

        div.add(HtmlElement.hr())
        div.add(HtmlElement.br(clear="all"))





        title_wdg = DivWdg()
        title_wdg.add_class("maq_search_bar")
        x = DivWdg("[x]")
        x.add_style("float: right")
        title_wdg.add(x)
        #title_wdg.add_style("font-size: 1.5em")
        title_wdg.add("Detail" )
        div.add(title_wdg)
        div.add(HtmlElement.br())


#.........这里部分代码省略.........
开发者ID:0-T-0,项目名称:TACTIC,代码行数:103,代码来源:search_type_panel_wdg.py

示例9: get_display

# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import hr [as 别名]

#.........这里部分代码省略.........

        button = ActionButtonWdg(title="Save")
        button.add_style("float: left")
        button.add_style("margin: 0 10 3")
        #button = ProdIconButtonWdg("Save")
        #button.add_style("margin: 5 10")
        behavior = {
            'type': 'click_up',
            'cbfn_action': 'spt.script_editor.save_script_cbk'
        }
        button.add_behavior(behavior)
        button_div.add(button)


        button = ActionButtonWdg(title="Clear")
        button.add_style("float: left")
        button.add_style("margin: 0 10 3")
        #button = ProdIconButtonWdg("Clear")
        #button.add_style("margin: 5 10")
        button.add_behavior( {
            'type': 'click_up',
            'cbjs_action': '''
            spt.api.Utility.clear_inputs( bvr.src_el.getParent('.spt_js_editor') );
            editAreaLoader.setValue('shelf_script', '');

            '''
        } )

        button_div.add(button)
        """

        div.add( HtmlElement.br(clear='all') )

        div.add( HtmlElement.hr() )


        save_wdg = DivWdg()
        save_wdg.add_style("padding: 2px 5px 6px 5px")
        save_wdg.add_color("background", "background", -5)

        # script code
        save_span = SpanWdg()
        save_span.add("<b>Code: </b>")
        save_wdg.add(save_span)
        save_text = TextWdg("shelf_code")
        save_text.set_value(script_code)
        save_text.add_attr("readonly", "true")
        save_text.set_id("shelf_code")
        save_text.add_class("spt_code")
        save_wdg.add(save_text)

        save_wdg.add("&nbsp;&nbsp;")

        # script name (path??)
        save_span = SpanWdg()
        save_span.add("<b>Script Path: </b>")
        save_wdg.add(save_span)
        save_text = TextWdg("shelf_folder")
        save_text.add_attr("size", "40")
        save_text.set_id("shelf_folder")
        save_text.add_class("spt_folder")
        save_text.set_value(script_folder)
        save_wdg.add(save_text)
        save_wdg.add(" / ")
        save_text = TextWdg("shelf_title")
        save_text.add_attr("size", "40")
开发者ID:funic,项目名称:TACTIC,代码行数:70,代码来源:shelf_wdg.py

示例10: get_display

# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import hr [as 别名]
    def get_display(my):
        div = DivWdg()

        sobject = my.get_sobject_from_kwargs()
        if not sobject:
            div.add("SObject not found")
            return div

        search_type_obj = sobject.get_search_type_obj()
        title = search_type_obj.get_title()
        title_wdg = DivWdg()
        title_wdg.add_style("font-size: 1.8em")
        title_wdg.add("%s: %s" % (title, sobject.get_code() ) )

        div.add(title_wdg)
        div.add(HtmlElement.hr())


        table = Table()
        table.set_max_width()

        col1 = table.add_col()
        col1.add_style('width: 200px')
        col2 = table.add_col()
        col2.add_style('width: 320px')
        col3 = table.add_col()
        col3.add_style('width: 400px')
        table.add_row()

        from pyasm.widget import ThumbWdg, DiscussionWdg, SObjectTaskTableElement

        td = table.add_cell()
        td.add_style("vertical-align: top")
        td.add_style("border-right: solid 1px")
        title = DivWdg()
        title.add_class("maq_search_bar")
        #x = DivWdg("[?] [x]")
        #x.add_style("float: right")
        #title.add(x)
        title.add("Info")
        td.add(title)
        thumb = ThumbWdg()
        thumb.set_sobject(sobject)
        thumb.set_option("detail", "false")
        td.add(thumb)
        from pyasm.prod.web import AssetInfoWdg
        info = AssetInfoWdg()
        info.thumb = thumb
        info.set_sobject(sobject)
        td.add(info)

        # tasks
        td = table.add_cell()
        td.add_style("vertical-align: top")
        td.add_style("padding-left: 5px")
        td.add_style("border-right: solid 1px")
        title = DivWdg()
        title.add_class("maq_search_bar")
        #x = DivWdg("[x]")
        #x.add_style("float: right")
        #title.add(x)
        title.add("Tasks")
        td.add(title)
        task_wdg = SObjectTaskTableElement()
        task_wdg.set_sobject(sobject)
        td.add(task_wdg)
        td.add_style('cell-padding','10')


        # discussion
        td = table.add_cell()
        #td.add_style("min-width: 300px")
        #td.add_style("width: 600px")
        td.add_style("vertical-align: top")
        td.add_style("padding-left: 5px")
        td.add_style("border-right: solid 1px")
       
        title = DivWdg()
        title.add_class("maq_search_bar")
        #x = DivWdg("[x]")
        #x.add_style("float: right")
        #title.add(x)
        title.add("Notes")
        td.add(title)
        discussion_wdg = DiscussionWdg()
        discussion_wdg.preprocess()
        discussion_wdg.set_sobject(sobject)
        td.add(discussion_wdg)
        note_panel = discussion_wdg.get_note_menu()
        td.add(note_panel)

        div.add(table)
       

        div.add(HtmlElement.hr())
        div.add(HtmlElement.br(clear="all"))

        title_wdg = DivWdg()
        title_wdg.add_class("maq_search_bar")
        #x = DivWdg("[x]")
#.........这里部分代码省略.........
开发者ID:0-T-0,项目名称:TACTIC,代码行数:103,代码来源:sobject_panel_wdg.py

示例11: generate_section

# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import hr [as 别名]
    def generate_section( my, config, subsection_div, info, base_path="" ):

        title = my.kwargs.get('title')
        view = my.kwargs.get('view')

        base_path_flag = True
        if not base_path:
            base_path = "/%s" % info.get('view').capitalize()
            base_path_flag = False
        current_path = base_path

        # add in the elements
        if config.get_view() == "definition":
            element_names = config.get_element_names()
            sort = False
            # not sorting for now
            if sort == True:
                element_names.sort()
        else:
            element_names = config.get_element_names()

        
        # if there are no elements, then just add a drop widget
        if not element_names:
            if my.mode == 'view':
                item_div = DivWdg()
                item_div.add_style("margin: 3px")
                item_div.add_style("color: #555")
                item_div.add("<i>-- No items --</i>")
                subsection_div.add(item_div)
            else:
                my.add_dummy(config, subsection_div)
            return

        for element_name in element_names:
            display_class = config.get_display_handler(element_name)

            if display_class == "SeparatorWdg":
                div = DivWdg()
                div.add_attr("spt_view", config.get_view() )
                div.add_class("spt_side_bar_element")
                div.add_class("spt_side_bar_separator")
                div.add_attr("spt_element_name", element_name)

                hr =  HtmlElement.hr()
                hr.add_style("size: 1px")
                div.add(hr)
                div.add_style("height", "5")
                subsection_div.add(div)

                options = config.get_display_options(element_name)
                my.add_separator_behavior(div, element_name, config, options)

                continue

            elif display_class in ["SideBarSectionLinkWdg","FolderWdg"]:

                security = Environment.get_security()
                default_access = "view"
                if not security.check_access("side_bar", element_name, "view", default=default_access):
                    continue

                title = my._get_title(config, element_name)
                

                paths = []
                if current_path in paths:
                    is_open = True
                else:
                    is_open = False


                options = config.get_display_options(element_name)
                config_view = config.get_view()

                current_path = "%s/%s" % (base_path, element_name)
                
                # create HTML elements for Section Link ...
                outer_div = DivWdg()
                outer_div.add_attr("spt_view", config_view )
                outer_div.add_class("spt_side_bar_element")
                outer_div.add_class("spt_side_bar_section")
                outer_div.set_attr("SPT_ACCEPT_DROP", "manageSideBar")
                outer_div.add_attr("spt_element_name", element_name)
                outer_div.add_attr("spt_title", title)
                
                #if info.get('login') : 
                #    outer_div.add_attr("spt_login", info.get('login')) 

                # add an invisible drop widget
                outer_div.add(my.get_drop_wdg())


                # Create the link
                s_link_div = DivWdg()
                s_link_div.add_class("SPT_DTS")
                s_link_div.add_class("spt_side_bar_section_link")

                s_link_div.add_style("cursor: pointer")
                s_link_div.add_style( "padding-top: 4px" )
#.........这里部分代码省略.........
开发者ID:0-T-0,项目名称:TACTIC,代码行数:103,代码来源:base_section_wdg.py


注:本文中的pyasm.web.HtmlElement.hr方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。