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


Python HiddenWdg.set_attr方法代碼示例

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


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

示例1: get_display

# 需要導入模塊: from pyasm.widget import HiddenWdg [as 別名]
# 或者: from pyasm.widget.HiddenWdg import set_attr [as 別名]

#.........這裏部分代碼省略.........
                time_prefix = 'ot'
                div = DivWdg()
                div.add("OT")
                div.add_styles('text-align: right; margin-right: 4px')
                td.add(div)
            elif row_to_draw == my.STT_ROW:
                time_prefix = 'stt'
                div = DivWdg()
                div.add("ST")
               
                div.add_styles('text-align: right; margin: 0 4px 4px 0')
                td.add(div)
            elif row_to_draw == my.ENT_ROW:
                time_prefix = 'ent'
                div = DivWdg()
                div.add("ET")
               
                div.add_styles('text-align: right; margin: 0 4px 4px 0')
                td.add(div)
                

            for idx, day in enumerate(days):
                day_wdg = DivWdg()
                day_wdg.add(day)

                td = table.add_cell()
                td.add_style("width: %spx" % my.day_width)

                
                text = TextWdg('%sday_%s' % (time_prefix, day))
                
                if disabled:
                    text.set_option('read_only','true')
                    text.set_attr('disabled','disabled')

                td.add(text)
                text.add_class('spt_day%s' % (time_prefix))
                text.add_styles("width: %spx;text-align: right;padding-left: 2px" %(my.day_width-2))
                #text.add_styles("width: 100%;text-align: right;padding-left: 2px")
                if day == today:
                    text.add_style("border: solid 1px black")
                else:
                    text.add_border()

                week_day = my.weekday_dict[idx]
                if week_day in ['Sat','Sun']:
                    # MAIN: Overtime, weekend
                    if row_to_draw == my.OT_ROW:
                        text.add_color("background", "background2", modifier=[-15,0,5])
                    else:
                        text.add_color("background", "background2", modifier= [0,15,20])

                text.add_style("margin: 0px 1px")

                if row_to_draw == my.OT_ROW:
                    text.add_attr('input_field_type', 'ot')
                else:
                    text.add_attr('input_field_type', 'st')

                if my.kwargs.get('show_all_users')=='true':
                    text.set_option('read_only','true')

                #TODO: while we may have multiple entries per task, we will only use the latest one here
                # for now, making the UI cleaner

                # if a corresponding entry exists, display its value
開發者ID:0-T-0,項目名稱:TACTIC,代碼行數:70,代碼來源:work_hours_element_wdg.py

示例2: SearchLimitWdg

# 需要導入模塊: from pyasm.widget import HiddenWdg [as 別名]
# 或者: from pyasm.widget.HiddenWdg import set_attr [as 別名]

#.........這裏部分代碼省略.........
        current_value = "%d - %d" % (left_bound, right_bound)

        if self.style == self.SIMPLE:
            showing_wdg.add( current_value )
        else:
            # add a range selector using ItemsNavigatorWdg
            from pyasm.widget import ItemsNavigatorWdg
            selector = ItemsNavigatorWdg(self.label, self.count, self.search_limit)
            selector.select.add_behavior( {
                'type': 'change',
                'cbjs_action': self.refresh_script
            } )

            selector.set_style(self.style)
            selector.select.add_style("width: 100px")
            #selector.add_style("display: inline")
            selector.add_style("float: left")

            selector.set_value(current_value)
            selector.set_display_label(False)

            showing_wdg.add( selector) 

        showing_wdg.add( next )


        showing_wdg.add("<br clear='all'/>")
        showing_wdg.add("<br clear='all'/>")


        #showing_wdg.add( " x ")
        showing_wdg.add(self.text)
        self.text.add_style("margin-top: -3px")
        self.text.set_attr("size", "1")
        self.text.add_attr("title", "Set number of items per page")


        # set the limit
        set_limit_wdg = self.get_set_limit_wdg()
        widget.add(set_limit_wdg)


        from tactic.ui.widget.button_new_wdg import ActionButtonWdg
        button = ActionButtonWdg(title='Search')
        widget.add(button)
        button.add_style("float: right")
        button.add_style("margin-top: 8px")
        button.add_behavior( {
            'type': 'click_up',
            'cbjs_action': '''
            var top = bvr.src_el.getParent(".spt_search_limit_top");
            var select = top.getElement(".spt_search_limit_select");
            var value = select.value;
            if (value == 'Custom') {
                custom = top.getElement(".spt_search_limit_custom_text");
                value = custom.value;
            }
            if (value == '') {
                value = 20;
            }
            var text = top.getElement(".spt_search_limit_text");
            text.value = value;

            spt.dg_table.search_cbk({}, bvr) 
            '''
        } )
開發者ID:mincau,項目名稱:TACTIC,代碼行數:70,代碼來源:search_limit_wdg.py


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