當前位置: 首頁>>代碼示例>>Python>>正文


Python IconButtonWdg.add_class方法代碼示例

本文整理匯總了Python中pyasm.widget.IconButtonWdg.add_class方法的典型用法代碼示例。如果您正苦於以下問題:Python IconButtonWdg.add_class方法的具體用法?Python IconButtonWdg.add_class怎麽用?Python IconButtonWdg.add_class使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pyasm.widget.IconButtonWdg的用法示例。


在下文中一共展示了IconButtonWdg.add_class方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: get_open_wdg

# 需要導入模塊: from pyasm.widget import IconButtonWdg [as 別名]
# 或者: from pyasm.widget.IconButtonWdg import add_class [as 別名]
    def get_open_wdg( sobject, file_type=None):
        ''' given a snapshot. open the sandbox in explorer '''

        span = SpanWdg()

        # explore button
        dir = sobject.get_client_lib_dir(file_type=file_type)
        open_button = IconButtonWdg( "Explore: %s" % dir, IconWdg.LOAD, False)
        open_button.add_event("onclick", "Applet.open_explorer('%s')" % dir)
        open_button.add_class('small')
        span.add(open_button)

        #dir = sobject.get_sandbox_dir()
        #copy_button = IconButtonWdg( "Copy to sandbox: %s" % dir, IconWdg.DOWNLOAD, False)
        #span.add(copy_button)

        return span
開發者ID:mincau,項目名稱:TACTIC,代碼行數:19,代碼來源:composite_wdg.py

示例2: get_display

# 需要導入模塊: from pyasm.widget import IconButtonWdg [as 別名]
# 或者: from pyasm.widget.IconButtonWdg import add_class [as 別名]
    def get_display(self):
        sobject = self.get_current_sobject()
        search_key = SearchKey.build_by_sobject(sobject)

        display = DivWdg()
        display.add_style("position: relative")
        display.add_class("spt_button_top")
        display.add_style("width: 26px")
        display.add_style("margin-left: auto")
        display.add_style("margin-right: auto")


        BASE = '/context/themes2/default/'
        over_div = DivWdg()
        display.add(over_div)
        over_div.add_class("spt_button_over")
        over_img = "<img src='%s/MainButton_over.png'/>" % BASE
        over_div.add(over_img)
        over_div.add_style("position: absolute")
        over_div.add_style("top: -9px")
        over_div.add_style("left: 0px")
        over_div.add_style("display: none")

        click_div = DivWdg()
        display.add(click_div)
        click_div.add_class("spt_button_click")
        click_img = "<img src='%s/MainButton_click.png'/>" % BASE
        click_div.add(click_img)
        click_div.add_style("position: absolute")
        click_div.add_style("top: -9px")
        click_div.add_style("left: 0px")
        click_div.add_style("display: none")





        if self.get_option('align') =='left':
            display.add_style("text-align: left")
        else:
            display.add_style("text-align: center")

        icon = self.get_option("icon")
        if not icon:
            icon = "create"


        icon_tip = self.get_option("icon_tip")
        if not icon_tip:
            icon_tip = self.get_option("hint")
        if not icon_tip:
            icon_tip = ""

        enable = self.get_option("enable")
        if enable:
            result = ExpressionParser().eval(enable, sobject)
            if not result:
                return "&nbsp;"


        if not self.script_obj and not self.script:
            icon_wdg = IconButtonWdg("No Script Found", IconWdg.ERROR)
        else:
            icon_link = icon.upper()

            icon_wdg = IconButtonWdg(icon_tip, icon=icon_link)
            if not sobject.is_insert():
                icon_wdg.add_class("hand")
                #icon_wdg.add_behavior(self.behavior)
                icon_wdg.add_class("spt_button_%s" % self.name)


        icon_div = DivWdg()
        icon_div.add(icon_wdg)
        icon_div.add_style("position: absolute")
        icon_div.add_style("top: 2px")
        icon_div.add_style("left: 5px")
        display.add(icon_div)

        hit_wdg = icon_div
        hit_wdg.add_class("spt_button_hit")

        if sobject.is_insert():
            hit_wdg.add_style("opacity: 0.4")
        else:
            hit_wdg.add_class("spt_button_hit_wdg")


        display.add_style("height: 18px")
        display.add_style("min-width: 21px")
        #display.add_style("overflow: hidden")
        display.add_style("margin-top: 0px")


        expression = self.kwargs.get('expression')
        if expression:
            value = Search.eval(expression, sobject, single=True)

            if value:

#.........這裏部分代碼省略.........
開發者ID:mincau,項目名稱:TACTIC,代碼行數:103,代碼來源:button_wdg.py

示例3: get_display

# 需要導入模塊: from pyasm.widget import IconButtonWdg [as 別名]
# 或者: from pyasm.widget.IconButtonWdg import add_class [as 別名]
    def get_display(my):
        sobject = my.get_current_sobject()
        search_key = SearchKey.build_by_sobject(sobject)

        display = DivWdg()
        display.add_style("position: relative")
        display.add_class("spt_button_top")

        BASE = "/context/themes2/default/"
        over_div = DivWdg()
        display.add(over_div)
        over_div.add_class("spt_button_over")
        over_img = "<img src='%s/MainButton_over.png'/>" % BASE
        over_div.add(over_img)
        over_div.add_style("position: absolute")
        over_div.add_style("top: -9px")
        over_div.add_style("left: 0px")
        over_div.add_style("display: none")

        click_div = DivWdg()
        display.add(click_div)
        click_div.add_class("spt_button_click")
        click_img = "<img src='%s/MainButton_click.png'/>" % BASE
        click_div.add(click_img)
        click_div.add_style("position: absolute")
        click_div.add_style("top: -9px")
        click_div.add_style("left: 0px")
        click_div.add_style("display: none")

        if my.get_option("align") == "left":
            display.add_style("text-align: left")
        else:
            display.add_style("text-align: center")

        icon = my.get_option("icon")
        if not icon:
            icon = "create"

        icon_tip = my.get_option("icon_tip")
        if not icon_tip:
            icon_tip = my.get_option("hint")
        if not icon_tip:
            icon_tip = ""

        enable = my.get_option("enable")
        if enable:
            result = ExpressionParser().eval(enable, sobject)
            if not result:
                return "&nbsp;"

        if not my.script_obj and not my.script:
            icon_wdg = IconButtonWdg("No Script Found", IconWdg.ERROR)
        else:
            try:
                icon_link = eval("IconWdg.%s" % icon.upper())
            except Exception, e:
                print "WARNING: ", str(e)
                icon_link = IconWdg.ERROR

            icon_wdg = IconButtonWdg(icon_tip, icon_link)
            if not sobject.is_insert():
                icon_wdg.add_class("hand")
                # icon_wdg.add_behavior(my.behavior)
                icon_wdg.add_class("spt_button_%s" % my.name)
開發者ID:hellios78,項目名稱:TACTIC,代碼行數:66,代碼來源:button_wdg.py


注:本文中的pyasm.widget.IconButtonWdg.add_class方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。