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


Python TextWdg.set_id方法代码示例

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


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

示例1: get_save_wdg

# 需要导入模块: from pyasm.widget import TextWdg [as 别名]
# 或者: from pyasm.widget.TextWdg import set_id [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

示例2: get_save_wdg

# 需要导入模块: from pyasm.widget import TextWdg [as 别名]
# 或者: from pyasm.widget.TextWdg import set_id [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

示例3: get_display

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

        raise Exception("tactic.widget.ColorInputWdg is deprecated")

        color_div = DivWdg()
        color_div.add_style("z-index: 1000")
        # color_div.add_style("float: left")
        import random

        number = random.randint(1, 1000)
        rainbow_id = "rainbow_%s" % number

        color_div.add(
            """
        <img id="%s" src="/context/spt_js/mooRainbow/rainbow.png" alt="[r]" width="16" height="16" />
        """
            % rainbow_id
        )
        # <input id="myInput" name="myInput" type="text" size="13" />

        text = TextWdg(my.get_name())
        text.set_id("myInput")
        behavior = {"type": "keyboard", "kbd_handler_name": "DgTableMultiLineTextEdit"}
        text.add_behavior(behavior)
        color_div.add(text)

        color_div.add_behavior(
            {
                "type": "load",
                "cbjs_action": """
            var r = new MooRainbow('%s', {
                startColor: [58, 142, 246],
                imgPath:    '/context/spt_js/mooRainbow/images/',
                onComplete: function(color) { $(myInput).value=color.hex; }
            });
            """
                % rainbow_id,
            }
        )

        return color_div
开发者ID:hellios78,项目名称:TACTIC,代码行数:43,代码来源:color_input_wdg.py

示例4: get_display

# 需要导入模块: from pyasm.widget import TextWdg [as 别名]
# 或者: from pyasm.widget.TextWdg import set_id [as 别名]
    def get_display(my):
        assert my.load_script

        widget = DivWdg()
        widget.add_style('float', 'right')

        load_button = TextOptionBtnWdg(label='   Load   ', size='medium')
        load_button.get_top_el().add_style('float', 'left')
        load_button.get_top_el().set_id(my.LOAD_BUTTON_ID)
        load_button.add_behavior(
                {'type': "click_up",
                "cbjs_action":
                "setTimeout(function() {%s}, 200) "% my.load_script
                })
        widget.add(load_button)
        arrow_button = load_button.get_option_widget()
        #widget.add(arrow_button)
        suffix = "ASSET_LOADER_FUNCTIONS"
        menus_in = [ my.smart_menu_data ]


        SmartMenu.add_smart_menu_set( arrow_button,  menus_in)
        SmartMenu.assign_as_local_activator(arrow_button, None, True)

        #SmartMenu.attach_smart_context_menu( load_button, menus_in, False )
        x_div = FloatDivWdg("x")
        x_div.add_color('color','color')
        x_div.add_style('margin-right: 6px')
        widget.add(x_div)
        multiplier = TextWdg()
        multiplier.set_id("load_multiplier")
        multiplier.set_option("size", "1.5")
        multiplier.add_style("font-size: 0.8em")
        multiplier.add_style("float: left")
        multiplier.add_class("load_multiplier")
        widget.add( multiplier )
        return widget
开发者ID:0-T-0,项目名称:TACTIC,代码行数:39,代码来源:loader_button_wdg.py

示例5: get_display

# 需要导入模块: from pyasm.widget import TextWdg [as 别名]
# 或者: from pyasm.widget.TextWdg import set_id [as 别名]

#.........这里部分代码省略.........
        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")
        save_text.set_id("shelf_title")
        save_text.add_class("spt_title")
        save_text.set_value(script_name)
        save_wdg.add(save_text)
        div.add(save_wdg)

        from tactic.ui.container import ResizableTableWdg
        table = ResizableTableWdg()
        table.add_row()

        td = table.add_cell(resize=False)
        td.add_style("vertical-align: top")

        td.add(editor)
开发者ID:funic,项目名称:TACTIC,代码行数:70,代码来源:shelf_wdg.py


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