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


Python StandardWindow.focus_highlight_enabled方法代码示例

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


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

示例1: focus3_clicked

# 需要导入模块: from efl.elementary.window import StandardWindow [as 别名]
# 或者: from efl.elementary.window.StandardWindow import focus_highlight_enabled [as 别名]
def focus3_clicked(obj, item=None):
    win = StandardWindow("focus3", "Focus 3", autodel=True, size=(320, 480))

    win.focus_highlight_enabled = True

    bx = Box(win, size_hint_weight=EXPAND_BOTH)
    win.resize_object_add(bx)
    bx.show()

    en = Entry(win, scrollable=True, single_line=True, text="An entry",
               size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ)
    en.callback_focused_add(_focused_cb)
    en.callback_unfocused_add(_unfocused_cb)
    bx.pack_end(en)
    en.show()

    bt = Button(win, text="Add", focus_allow=False,
                size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ)
    bt.callback_clicked_add(_add_cb, win, bx)
    bx.pack_end(bt)
    bt.show()

    bt = Button(win, text="Del", focus_allow=False,
                size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ)
    bt.callback_clicked_add(_del_cb, bx)
    bx.pack_end(bt)
    bt.show()

    bt = Button(win, text="hide", focus_allow=False,
                size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ)
    bt.callback_clicked_add(_hide_cb)
    bx.pack_end(bt)
    bt.show()

    win.show()
开发者ID:maikodaraine,项目名称:EnlightenmentUbuntu,代码行数:37,代码来源:test_focus.py

示例2: focus5_clicked

# 需要导入模块: from efl.elementary.window import StandardWindow [as 别名]
# 或者: from efl.elementary.window.StandardWindow import focus_highlight_enabled [as 别名]
def focus5_clicked(obj, item=None):

    theme_overlay_add(os.path.join(script_path, "test_focus_custom.edj"))

    win = StandardWindow("focus5", "Focus Custom", autodel=True, size=(320, 320))
    win.focus_highlight_enabled = True
    win.focus_highlight_animate = True
    win.focus_highlight_style = "glow"

    fr = Frame(win, style="pad_large",
              size_hint_weight=EXPAND_BOTH);
    win.resize_object_add(fr)
    fr.show()

    bx = Box(fr)
    fr.content = bx
    bx.show()

    chk = Check(bx, text='Enable glow effect on "Glow" Button', state=True,
                size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH)
    bx.pack_end(chk)
    chk.show()

    spinner = Spinner(bx, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH)
    bx.pack_end(spinner)
    spinner.show()

    bt = Button(bx, text="Glow Button",
                size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH)
    bt.callback_focused_add(_glow_effect_on_cb, win, chk)
    bt.callback_unfocused_add(_glow_effect_off_cb, win, chk)
    bx.pack_end(bt)
    bt.show()

    sp = Separator(bx, horizontal=True,
                   size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH)
    bx.pack_end(sp)
    sp.show()

    bx2 = Box(bx, horizontal=True,
              size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
    bx.pack_end(bx2)
    bx2.show()

    for i in range (1, 5):
        bt = Button(bx2, text="Button %d" % i,
                    size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
        bx2.pack_end(bt)
        bt.show()

    win.show()
开发者ID:maikodaraine,项目名称:EnlightenmentUbuntu,代码行数:53,代码来源:test_focus.py

示例3: naviframe_clicked

# 需要导入模块: from efl.elementary.window import StandardWindow [as 别名]
# 或者: from efl.elementary.window.StandardWindow import focus_highlight_enabled [as 别名]
def naviframe_clicked(obj):
    win = StandardWindow("naviframe", "Naviframe test", autodel=True,
        size=(400, 400))
    win.focus_highlight_enabled = True
    if obj is None:
        win.callback_delete_request_add(lambda o: elementary.exit())

    nf = Naviframe(win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
    win.resize_object_add(nf)
    nf.show()

    bt = Button(win, text="Next")
    bt.callback_clicked_add(page2, nf)

    content = Photo(nf, file=os.path.join(img_path, "logo.png"),
        fill_inside=True, style="shadow")

    item = nf.item_push("Page 1", None, bt, content, "basic")
    nf.data["page1"] = item

    win.show()
开发者ID:maikodaraine,项目名称:EnlightenmentUbuntu,代码行数:23,代码来源:test_naviframe.py

示例4: focus_clicked

# 需要导入模块: from efl.elementary.window import StandardWindow [as 别名]
# 或者: from efl.elementary.window.StandardWindow import focus_highlight_enabled [as 别名]
def focus_clicked(obj, item=None):
    win = StandardWindow("focus", "Focus", autodel=True, size=(800,600))
    
    win.focus_highlight_enabled = True

    tbx = Box(win, size_hint_weight=EXPAND_BOTH)
    win.resize_object_add(tbx)
    tbx.show()

    ### Toolbar
    tbar = Toolbar(win, shrink_mode=ELM_TOOLBAR_SHRINK_MENU,
                   size_hint_align=(EVAS_HINT_FILL,0.0))

    tb_it = tbar.item_append("document-print", "Hello", _tb_sel)
    tb_it.disabled = True
    tb_it = tbar.item_append("folder-new", "World", _tb_sel)
    tb_it = tbar.item_append("object-rotate-right", "H", _tb_sel)
    tb_it = tbar.item_append("mail-send", "Comes", _tb_sel)
    tb_it = tbar.item_append("clock", "Elementary", _tb_sel)

    tb_it = tbar.item_append("refresh", "Menu", _tb_sel)
    tb_it.menu = True
    tbar.menu_parent = win
    menu = tb_it.menu

    menu.item_add(None, "Shrink", "edit-cut", _tb_sel)
    menu_it = menu.item_add(None, "Mode", "edit-copy", _tb_sel)
    menu.item_add(menu_it, "is set to", "edit-paste", _tb_sel)
    menu.item_add(menu_it, "or to", "edit-paste", _tb_sel)
    menu.item_add(None, "Menu", "edit-delete", _tb_sel)

    tbx.pack_end(tbar)
    tbar.show()


    mainbx = Box(win, horizontal=True, size_hint_weight=EXPAND_BOTH)
    tbx.pack_end(mainbx)
    mainbx.show()

    ## First Col
    bx = Box(win, size_hint_weight=EXPAND_BOTH)
    mainbx.pack_end(bx)
    bx.show()

    lb = Label(win, text="<b>Use Tab or Shift+Tab<br/>or Arrow keys</b>",
                    size_hint_align=FILL_BOTH)
    bx.pack_end(lb)
    lb.show()

    tg = Check(win, style="toggle")
    tg.part_text_set("on", "Yes")
    tg.part_text_set("off", "No")
    bx.pack_end(tg)
    tg.show()
    
    en = Entry(win, scrollable=True, single_line=True, text="This is a single line",
                    size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ)
    bx.pack_end(en)
    en.show()

    #
    bx2 = Box(win, horizontal=True, size_hint_align=FILL_BOTH)
    bx.pack_end(bx2)
    bx2.show()

    for i in range(2):
        bt = Button(win, text="Box", size_hint_align=FILL_BOTH, disabled=(i % 2))
        bx2.pack_end(bt)
        bt.show()

    sc = Scroller(win, bounce=(True,True), content_min_limit=(1,1),
                  size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
    bx2.pack_end(sc)
    sc.show()

    bt = Button(win, text="Scroller", size_hint_align=FILL_BOTH)
    sc.content = bt
    bt.show()

    #
    bt = Button(win, text="Box", size_hint_align=FILL_BOTH)
    bx.pack_end(bt)
    bt.show()

    #
    bx2 = Box(win, horizontal=True, size_hint_align=FILL_BOTH)
    bx.pack_end(bx2)
    bx2.show()
    
    for i in range(2):
        bx3 = Box(win, size_hint_align=FILL_BOTH)
        bx2.pack_end(bx3)
        bx3.show()

        for j in range(3):
            bt = Button(win, text="Box", size_hint_align=FILL_BOTH)
            bx3.pack_end(bt)
            bt.show()
    

#.........这里部分代码省略.........
开发者ID:maikodaraine,项目名称:EnlightenmentUbuntu,代码行数:103,代码来源:test_focus.py

示例5: focus4_clicked

# 需要导入模块: from efl.elementary.window import StandardWindow [as 别名]
# 或者: from efl.elementary.window.StandardWindow import focus_highlight_enabled [as 别名]
def focus4_clicked(obj, item=None):
    win = StandardWindow("focus4", "Focus 4", autodel=True, size=(320, 320))

    win.focus_highlight_enabled = True
    win.focus_highlight_animate = True

    fr = Frame(win, style="pad_large",
              size_hint_weight=EXPAND_BOTH);
    win.resize_object_add(fr)
    fr.show()

    # First Example - Using Focus Highlight
    bx = Box(fr)
    fr.content = bx
    bx.show()

    tg = Check(bx, text="Focus Highlight Enabled (Config)", state=True,
               size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH)
    tg.callback_changed_add(_highlight_enabled_cb, win)

    bx.pack_end(tg)
    tg.show()

    tg = Check(bx, text="Focus Highlight Animate (Config)", state=True,
               size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH)
    tg.callback_changed_add(_highlight_animate_cb, win)
    bx.pack_end(tg)
    tg.show()

    tg = Check(bx, text="Focus Highlight Enabled (Win)", state=True,
               size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH)
    tg.callback_changed_add(_win_highlight_enabled_cb, win)
    bx.pack_end(tg)
    tg.show()

    tg = Check(bx, text="Focus Highlight Animate (Win)", state=True,
               size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH)
    tg.callback_changed_add(_win_highlight_animate_cb, win)
    bx.pack_end(tg)
    tg.show()

    sp = Separator(win, horizontal=True,
                   size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH)
    bx.pack_end(sp)
    sp.show()

    # Second Example - Using Custom Chain
    lb = Label(bx, text="Custom Chain: Please use tab key to check",
               size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH)
    bx.pack_end(lb)
    lb.show()

    bx2 = Box(bx, horizontal=True,
              size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
    bx.pack_end(bx2)
    bx2.show()

    bt1 = Button(bx2, text="Button 1",
                 size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
    bx2.pack_end(bt1)
    bt1.show()
    
    bt2 = Button(bx2, text="Button 2",
                 size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
    bx2.pack_end(bt2)
    bt2.show()
    
    bt3 = Button(bx2, text="Button 3",
                 size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
    bx2.pack_end(bt3)
    bt3.show()
    
    bt4 = Button(bx2, text="Button 4",
                 size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
    bx2.pack_end(bt4)
    bt4.show()

    bx2.focus_custom_chain = [bt2, bt1, bt4, bt3]
   
    tg = Check(bx, text="Custom Chain", state=False, 
               size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH)
    tg.callback_changed_add(_custom_chain_cb, bx)
    bx.pack_end(tg)
    tg.show()
   

    win.show()
开发者ID:maikodaraine,项目名称:EnlightenmentUbuntu,代码行数:89,代码来源:test_focus.py

示例6: focus2_clicked

# 需要导入模块: from efl.elementary.window import StandardWindow [as 别名]
# 或者: from efl.elementary.window.StandardWindow import focus_highlight_enabled [as 别名]
def focus2_clicked(obj, item=None):
    win = StandardWindow("focus2", "Focus 2", autodel=True, size=(400, 400))

    win.focus_highlight_enabled = True

    bx = Box(win, size_hint_weight=EXPAND_BOTH)
    win.resize_object_add(bx)
    bx.show()

    PARENT = bx

    en = Entry(PARENT, scrollable=True, single_line=True,
               text="Entry that should get focus",
               size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ)
    bx.pack_end(en)
    en.show()
    
    bt = Button(PARENT, text="Give focus to entry")
    bt.callback_clicked_add(_focus_obj, en)
    bx.pack_end(bt)
    bt.show()
   
    ly = Layout(PARENT, size_hint_weight=EXPAND_BOTH)
    ly.file = edj_file, "layout"
    bx.pack_end(ly)
    ly.show()

    bt1 = bt = Button(ly, text="Button 1")
    ly.part_content_set("element1", bt)

    en1 = Entry(ly, scrollable=True, single_line=True,
                text="Scrolled Entry that should get focus",
                size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ )
    ly.part_content_set("element2", en1)

    bt = Button(ly, text="Button 2")
    ly.part_content_set("element3", bt)


    bt = Button(PARENT, text="Give focus to layout",
                size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ)
    bt.callback_clicked_add(_focus_obj, ly)
    bx.pack_end(bt)
    bt.show()

    bt = Button(PARENT, text="Give focus to layout part",
                size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ)
    bt.callback_clicked_add(_focus_layout_part, ly)
    bx.pack_end(bt)
    bt.show()

    bt = Button(PARENT, text="Give focus to layout 'Button 1'",
                size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ)
    bt.callback_clicked_add(_focus_obj, bt1)
    bx.pack_end(bt)
    bt.show()

    bt = Button(PARENT, text="Give focus to layout 'Entry'",
                size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ)
    bt.callback_clicked_add(_focus_obj, en1)
    bx.pack_end(bt)
    bt.show()

    bt.focus_next_object_set(en, ELM_FOCUS_DOWN)
    en.focus_next_object_set(bt, ELM_FOCUS_UP)
    win.show()
开发者ID:maikodaraine,项目名称:EnlightenmentUbuntu,代码行数:68,代码来源:test_focus.py


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