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


Python DivWdg.set_style方法代码示例

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


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

示例1: get_example_display

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

        div = DivWdg()

        # --- Example of new spt.fx animation slider --------------------------------------------------------------

        slide_div = DivWdg()
        slide_div.set_id( "ui_play_sliding_thing" )
        slide_div.set_style( "background: #9f9f9f; color: #0f0f0f; border: 1px solid black;" )
        slide_div.add( "For a moment after Mr. and Mrs. Darling left the house the night-lights by the beds of the three children continued to burn clearly. They were awfully nice little night-lights, and one cannot help wishing that they could have kept awake to see Peter; but Wendy's light blinked and gave such a yawn that the other two yawned also, and before they could close their mouths all the three went out. There was another light in the room now, a thousand times brighter than the night-lights, and in the time we have taken to say this, it had been in all the drawers in the nursery, looking for Peter's shadow, rummaged the wardrobe and turned every pocket inside out. It was not really a light; it made this light by flashing about so quickly, but when it came to rest for a second you saw it was a fairy, no longer than your hand, but still growing. It was a girl called Tinker Bell exquisitely gowned in a skeleton leaf, cut low and square, through which her figure could be seen to the best advantage. She was slightly inclined to embonpoint." )

        div.add( slide_div )

        div.add( '<br/>' )
        click_slide = DivWdg()
        click_slide.add( "Click Me to Slide!" )
        click_slide.set_style( "background: #0f0f0f; color: #9f9f9f; border: 1px solid black; width: 100px; " \
                               "cursor: pointer;" )

        click_slide.add_behavior( { 'type': 'click_up',
                                    'dst_el': 'ui_play_sliding_thing',
                                    'cbfn_action': 'spt.fx.slide_anim_cbk',
                                    'options': { 'direction': 'vertical',
                                                 'duration': 500,  # time in milliseconds
                                                 'frame_rate': 15   # frames per second
                                                }
                                    } )

        div.add( click_slide )
        return div
开发者ID:0-T-0,项目名称:TACTIC,代码行数:32,代码来源:fx_anim_examples_wdg.py

示例2: get_display

# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import set_style [as 别名]
    def get_display(my):
        my.view = my.kwargs.get('view')
        if not my.view:
            my.view = 'publish'
        widget = Widget()
        sobject = my.get_current_sobject()
        search_type = sobject.get_search_type()
        search_id = sobject.get_id()

        if my.get_option('preview') != 'false': 
            my.thumb.set_current_index(my.get_current_index())
            widget.add(my.thumb)

        publish_link = PublishLinkWdg(search_type,search_id, config_base=my.view) 
        div = DivWdg(publish_link)
        div.set_style('clear: left; padding-top: 6px')
        widget.add(div)

        # build a popup link to show publish browsing
        browse_link = IconButtonWdg("Publish Browser", IconWdg.CONTENTS)
        browse_link.add_behavior({'type': 'click_up',
            'cbjs_action': 'spt.popup.get_widget(evt, bvr)',
            'options': {'popup_id' : 'publish_browser',
                        'class_name' : 'pyasm.prod.web.PublishBrowserWdg' ,
                        'title': 'Publish Browser'},
            'args' : { 'search_type': search_type,
                        'search_id' : search_id }
            })
        div.add(browse_link)
        div.set_style('padding-top: 6px')


        return widget
开发者ID:funic,项目名称:TACTIC,代码行数:35,代码来源:table_element_wdg.py

示例3: get_display

# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import set_style [as 别名]
    def get_display(my):
        widget = Widget()
        
        thumb = super(ThumbPublishWdg, my).get_display()

        widget.add(thumb)
        sobject = my.get_current_sobject()
        search_type = sobject.get_search_type()
        search_id = sobject.get_id()

        publish_link = PublishLinkWdg(search_type,search_id) 
        div = DivWdg(publish_link)
        div.set_style('clear: left; padding-top: 6px')
        widget.add(div)

        # build an iframe to show publish browsing
        browse_link = IconButtonWdg("Publish Browser", IconWdg.CONTENTS)
        iframe = WebContainer.get_iframe()
        iframe.set_width(100)

        url = WebContainer.get_web().get_widget_url()
        url.set_option("widget", "pyasm.prod.web.PublishBrowserWdg")
        url.set_option("search_type", search_type)
        url.set_option("search_id", search_id)
        script = iframe.get_on_script(url.to_string())
        browse_link.add_event("onclick", script)

        div.add(browse_link)
        div.set_style('padding-top: 6px')


        return widget
开发者ID:0-T-0,项目名称:TACTIC,代码行数:34,代码来源:prod_table_element_wdg.py

示例4: get_display

# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import set_style [as 别名]
    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,代码行数:53,代码来源:tab_wdg.py

示例5: get_example_display

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

        div = DivWdg()

        # --- Example of FIRING a DOM event for a 'dom_listen' behavior type --------------------------------------

        dom_event_name = 'domselffire'
        dom_fire_div = DivWdg()
        dom_fire_div.set_style("border: 1px solid #000000; background: #0000AA; width: 200px; height: 100px; " \
                                 "cursor: pointer;")
        dom_fire_div.add("Firing a DOM event (for 'dom_event' type behavior)!")
        dom_fire_div.add_behavior( {'type': 'click',
                                    'cbfn_action': 'spt.ui_play.dom_event_self_fire_action',
                                    'options': {'event_name': dom_event_name} } )
        dom_fire_div.add_behavior( {'type': 'dom_listen', 'event_name': dom_event_name,
                                    'cbfn_action': 'spt.ui_play.dom_listen_cbk'} )
        div.add( dom_fire_div )

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

示例6: get_display

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

        widget = Widget()
         
        # added a change password widget to the preferences tab.  
        # This should be moved into the table eventually
        div = DivWdg()
        #div.add(ChangePasswordLinkWdg())
        div.set_style("font-size: 14px; padding-left: 10px; margin-top: 10px" )
        widget.add(div)



        search = Search("sthpw/pref_list")
        sobjects = search.get_sobjects()
        table = TableWdg("sthpw/pref_list", "user")
        table.set_sobjects(sobjects)
        widget.add(table)


        return widget
开发者ID:0-T-0,项目名称:TACTIC,代码行数:23,代码来源:preference_wdg.py

示例7: get_display

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

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

        bgcolor = div.get_color("background3")
        bgcolor2 = div.get_color("background3", -3)

        files_div.add_behavior( {
            'type': 'mouseenter',
            'bgcolor': bgcolor2,
            'cbjs_action': '''
            bvr.src_el.setStyle("background", bvr.bgcolor)
            '''
        } )

        files_div.add_behavior( {
            'type': 'mouseout',
            'bgcolor': bgcolor,
            'cbjs_action': '''
            bvr.src_el.setStyle("background", bvr.bgcolor)
            '''
        } )


        background = DivWdg()
        background.add_class("spt_files_background")
        files_div.add(background)
        background.add_style("font-size: 4.0em")
        background.add_style("font-weight: bold")
        background.add_style("opacity: 0.1")
        background.add_style("position: absolute")
        background.add_style("left: 50%")
        background.add_style("top: 100px")
        background.add_border()
        inner_background = DivWdg("Drag Files Here")
        background.add(inner_background)
        inner_background.set_style("position: absolute")
        inner_background.set_style("margin-left: -50%")



        # Test drag and drop files
        files_div.add_attr("ondragenter", "return false")
        files_div.add_attr("ondragover", "return false")
        files_div.add_attr("ondrop", "spt.drag.noop(event, this)")
        files_div.add_behavior( {
        'type': 'load',
        'cbjs_action': '''
        spt.drag = {}
        var background;

        spt.drag.show_file = function(file, top, delay, icon) {

            if (!background) {
                background = top.getElement(".spt_files_background");
                background.setStyle("display", "none");
            }

            var template = top.getElement(".spt_upload_file_template");
            var clone = spt.behavior.clone(template);
            clone.removeClass("spt_upload_file_template");
            clone.addClass("spt_upload_file");
            clone.setStyle("display", "");

            if (typeof(delay) == 'undefined') {
                delay = 0;
            }

            // remember the file handle
开发者ID:funic,项目名称:TACTIC,代码行数:70,代码来源:ingest_wdg.py


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