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


Python HiddenWdg.set_option方法代码示例

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


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

示例1: get_display

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

#.........这里部分代码省略.........
            if row_to_draw == my.OT_ROW:
                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
开发者ID:0-T-0,项目名称:TACTIC,代码行数:69,代码来源:work_hours_element_wdg.py

示例2: handle_dir_or_item

# 需要导入模块: from pyasm.widget import HiddenWdg [as 别名]
# 或者: from pyasm.widget.HiddenWdg import set_option [as 别名]
    def handle_dir_or_item(my, item_div, dirname, basename):
        spath = "%s/%s" % (dirname, basename)
        fspath = "%s/%s" % (dirname, File.get_filesystem_name(basename))

        md5 = my.md5s.get(fspath)
        changed = False
        context = None
        error_msg = None
        snapshot = None
        file_obj = my.checked_in_paths.get(fspath)
        if not file_obj:
            if fspath.startswith(my.base_dir):
                rel = fspath.replace("%s/" % my.base_dir, "")
                file_obj = my.checked_in_paths.get(rel)


        if file_obj != None:

            snapshot_code = file_obj.get_value("snapshot_code")
            snapshot = my.snapshots_dict.get(snapshot_code)
            if not snapshot:
                # last resort
                snapshot = file_obj.get_parent()

            if snapshot:
                context = snapshot.get_value("context")
                item_div.add_attr("spt_snapshot_code", snapshot.get_code())

                snapshot_md5 = file_obj.get_value("md5")
                item_div.add_attr("spt_md5", snapshot_md5)
                item_div.add_attr("title", "Checked-in as: %s" % file_obj.get_value("file_name"))

                if md5 and md5 != snapshot_md5:
                    item_div.add_class("spt_changed")
                    changed = True
            else:
                error_msg = 'snapshot not found'

            


        status = None
        if file_obj != None:
            if changed:
                check = IconWdg( "Checked-In", IconWdg.ERROR, width=12 )
                status = "changed"
            else:
                check = IconWdg( "Checked-In", IconWdg.CHECK, width=12 )
                status = "same"
            item_div.add_color("color", "color", [0, 0, 50])

        else:
            check = None
            item_div.add_style("opacity: 0.8")
            status = "unversioned"



        if check:
            item_div.add(check)
            check.add_style("float: left")
            check.add_style("margin-left: -16px")
            check.add_style("margin-top: 4px")


        # add the file name
        filename_div = DivWdg()
        item_div.add(filename_div)
        filename_div.add(basename)
        file_info_div = None
        if snapshot and status != 'unversioned':
            file_info_div = SpanWdg()
            filename_div.add(file_info_div)

        if error_msg:
            filename_div.add(' (%s)'%error_msg)
        filename_div.add_style("float: left")
        filename_div.add_style("overflow: hidden")
        filename_div.add_style("width: 65%")


        # DEPRECATED
        from pyasm.widget import CheckboxWdg, TextWdg, SelectWdg, HiddenWdg
        checkbox = CheckboxWdg("check")
      

        checkbox.add_style("display: none")
        checkbox.add_class("spt_select")
        checkbox.add_style("float: right")
        checkbox.add_style("margin-top: 1px")
        item_div.add(checkbox)

        subcontext_val = ''
        cat_input = None
        is_select = True
        if my.context_options:
            context_sel = SelectWdg("context")
            context_sel.add_attr('title', 'context')
            context_sel.set_option("show_missing", False)
            context_sel.set_option("values", my.context_options)
#.........这里部分代码省略.........
开发者ID:lucasnemeth,项目名称:TACTIC,代码行数:103,代码来源:checkin_dir_list_wdg.py

示例3: get_display

# 需要导入模块: from pyasm.widget import HiddenWdg [as 别名]
# 或者: from pyasm.widget.HiddenWdg import set_option [as 别名]
    def get_display(self):
        current = self.get_current_sobject()

        if current.is_insert():
            widget = Widget()
            parent_key = self.get_option('parent_key')
            if parent_key:
                parent = SearchKey.get_by_search_key(parent_key)
                if parent:
                    widget.add(SpanWdg(parent.get_code()))
            else:

                # use the project as the parent
                parent = Project.get()
                widget.add(SpanWdg("Project: %s" % parent.get_code()))

                #raise TacticException('Task creation aborted since parent is undetermined. Please check the configuration that generates this table.')

            text = HiddenWdg(self.get_input_name())
            text.set_option('size','40')
            text.set_value(parent_key)

            widget.add(text)
            return widget

        else:
           

            search_type = current.get_value('search_type')
            if not search_type:
                return "No parent type"
            
            widget = Widget()
            parent = current.get_parent()
            if parent:
                widget.add(parent.get_code())
                return widget
        
        # What is this look up code for?
        text = TextWdg(self.get_input_name())
        behavior = {
            'type': 'keyboard',
            'kbd_handler_name': 'DgTableMultiLineTextEdit'
        }
        text.add_behavior(behavior)



        widget.add(text)

        icon = IconButtonWdg("Look up", IconWdg.ZOOM)
        icon.add_behavior( {
            'type': 'click_up',
            'cbjs_action': '''
                var options = {
                    title: '%s',
                    class_name: 'tactic.ui.panel.ViewPanelWdg'
                };
                var args = {
                    search_type: '%s',
                    view: 'list'
                };
                spt.popup.get_widget( {}, {options: options, args: args} );
            ''' % (search_type, search_type)
        } )
        widget.add(icon)

        return widget
开发者ID:mincau,项目名称:TACTIC,代码行数:70,代码来源:task_input_wdg.py


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