def cursor_clicked(obj, item=None):
    win = StandardWindow("cursors", "Cursors", autodel=True, size=(320, 480))
    win.autodel_set(True)

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

    ck = Clock(win, cursor="clock")
    bx.pack_end(ck)
    ck.show()

    bt = Button(win, text="Coffee Mug", cursor="coffee_mug")
    bx.pack_end(bt)
    bt.show()

    bt = Button(win, text="Cursor unset", cursor="bogosity")
    bt.cursor_unset()
    bx.pack_end(bt)
    bt.show()

    lst = List(win,
               size_hint_weight=EXPAND_BOTH,
               size_hint_align=FILL_BOTH,
               cursor="watch")
    lst.item_append("watch over list")
    lst.item_append("watch over list")
    bx.pack_end(lst)
    lst.go()
    lst.show()

    en = Entry(win,
               scrollable=True,
               single_line=True,
               entry="Xterm cursor",
               size_hint_weight=EXPAND_HORIZ,
               size_hint_align=FILL_HORIZ,
               cursor="xterm")
    bx.pack_end(en)
    en.show()

    win.show()
def cursor_clicked(obj, item=None):
    win = StandardWindow("cursors", "Cursors", autodel=True, size=(320,480))
    win.autodel_set(True)

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

    ck = Clock(win, cursor="clock")
    bx.pack_end(ck)
    ck.show()

    bt = Button(win, text="Coffee Mug", cursor="coffee_mug")
    bx.pack_end(bt)
    bt.show()

    bt = Button(win, text="Cursor unset", cursor="bogosity")
    bt.cursor_unset()
    bx.pack_end(bt)
    bt.show()

    lst = List(win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH,
        cursor="watch")
    lst.item_append("watch over list")
    lst.item_append("watch over list")
    bx.pack_end(lst)
    lst.go()
    lst.show()

    en = Entry(win, scrollable=True, single_line=True, entry="Xterm cursor",
        size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ,
        cursor="xterm")
    bx.pack_end(en)
    en.show()

    win.show()
Ejemplo n.º 3
0
def evas3d_clicked(obj, item=None):
    win = StandardWindow("evas3d", "Evas 3d test")
    win.autodel_set(True)
    if obj is None:
        win.callback_delete_request_add(lambda o: elementary.exit())

    cube = Cube(win, 240, 240, 240)

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

    sl = Slider(win,
                text="Rot X",
                unit_format="%1.0f units",
                span_size=360,
                min_max=(0, 360),
                size_hint_align=FILL_HORIZ,
                size_hint_weight=EXPAND_BOTH)
    vbox.pack_end(sl)
    sl.callback_changed_add(ch_rot_x, cube)
    sl.show()

    sl = Slider(win,
                text="Rot Y",
                unit_format="%1.0f units",
                span_size=360,
                min_max=(0, 360),
                size_hint_align=FILL_HORIZ,
                size_hint_weight=EXPAND_BOTH)
    vbox.pack_end(sl)
    sl.callback_changed_add(ch_rot_y, cube)
    sl.show()

    sl = Slider(win,
                text="Rot Z",
                unit_format="%1.0f units",
                span_size=360,
                min_max=(0, 360),
                size_hint_align=FILL_HORIZ,
                size_hint_weight=EXPAND_BOTH)
    vbox.pack_end(sl)
    sl.callback_changed_add(ch_rot_z, cube)
    sl.show()

    sl = Slider(win,
                text="CX Off",
                unit_format="%1.0f units",
                span_size=360,
                min_max=(-320, 320),
                value=cube.cxo,
                size_hint_align=FILL_HORIZ,
                size_hint_weight=EXPAND_BOTH)
    vbox.pack_end(sl)
    sl.callback_changed_add(ch_cx, cube)
    sl.show()

    sl = Slider(win,
                text="CY Off",
                unit_format="%1.0f units",
                span_size=360,
                min_max=(-320, 320),
                value=cube.cyo,
                size_hint_align=FILL_HORIZ,
                size_hint_weight=EXPAND_BOTH)
    vbox.pack_end(sl)
    sl.callback_changed_add(ch_cy, cube)
    sl.show()

    sl = Slider(win,
                text="Foc",
                unit_format="%1.0f units",
                span_size=360,
                min_max=(1, 2000),
                value=cube.focv,
                size_hint_align=FILL_HORIZ,
                size_hint_weight=EXPAND_BOTH)
    vbox.pack_end(sl)
    sl.callback_changed_add(ch_foc, cube)
    sl.show()

    sl = Slider(win,
                text="Z0",
                unit_format="%1.0f units",
                span_size=360,
                min_max=(-2000, 2000),
                value=cube.z0v,
                size_hint_align=FILL_HORIZ,
                size_hint_weight=EXPAND_BOTH)
    vbox.pack_end(sl)
    sl.callback_changed_add(ch_z0, cube)
    sl.show()

    win.resize(480, 480)
    cube.update()
    win.show()
def actionslider_clicked(obj):
    win = StandardWindow("actionslider", "Actionslider")
    win.autodel_set(True)
    if obj is None:
        win.callback_delete_request_add(lambda o: elementary.exit())

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

    acts = Actionslider(win,
                        size_hint_weight=EXPAND_HORIZ,
                        size_hint_align=(EVAS_HINT_FILL, 0.0),
                        indicator_pos=ELM_ACTIONSLIDER_RIGHT,
                        magnet_pos=ELM_ACTIONSLIDER_RIGHT,
                        enabled_pos=(ELM_ACTIONSLIDER_LEFT
                                     | ELM_ACTIONSLIDER_RIGHT))
    acts.part_text_set("left", "Snooze")
    acts.part_text_set("center", "")
    acts.part_text_set("right", "Stop")
    acts.callback_pos_changed_add(_position_change_magnetic_cb)
    acts.callback_selected_add(_pos_selected_cb)
    bx.pack_end(acts)
    acts.show()

    acts = Actionslider(win,
                        size_hint_weight=EXPAND_HORIZ,
                        size_hint_align=(EVAS_HINT_FILL, 0.0),
                        indicator_pos=ELM_ACTIONSLIDER_CENTER,
                        magnet_pos=ELM_ACTIONSLIDER_CENTER,
                        enabled_pos=(ELM_ACTIONSLIDER_LEFT
                                     | ELM_ACTIONSLIDER_RIGHT))
    acts.part_text_set("left", "Snooze")
    acts.part_text_set("center", "")
    acts.part_text_set("right", "Stop")
    acts.callback_selected_add(_pos_selected_cb)
    bx.pack_end(acts)
    acts.show()

    acts = Actionslider(
        win,
        style="bar",
        size_hint_weight=EXPAND_HORIZ,
        size_hint_align=(EVAS_HINT_FILL, 0.0),
        indicator_pos=ELM_ACTIONSLIDER_LEFT,
        magnet_pos=(ELM_ACTIONSLIDER_CENTER | ELM_ACTIONSLIDER_RIGHT),
        enabled_pos=(ELM_ACTIONSLIDER_CENTER | ELM_ACTIONSLIDER_RIGHT))
    acts.part_text_set("left", "")
    acts.part_text_set("center", "Accept")
    acts.part_text_set("right", "Reject")
    acts.callback_selected_add(_pos_selected_cb)
    bx.pack_end(acts)
    acts.show()

    acts = Actionslider(win,
                        style="bar",
                        text="Go",
                        size_hint_weight=EXPAND_HORIZ,
                        size_hint_align=(EVAS_HINT_FILL, 0.0),
                        indicator_pos=ELM_ACTIONSLIDER_LEFT,
                        magnet_pos=ELM_ACTIONSLIDER_LEFT)
    acts.part_text_set("left", "")
    acts.part_text_set("center", "Accept")
    acts.part_text_set("right", "Reject")
    acts.callback_pos_changed_add(_position_change_magnetic_cb)
    acts.callback_selected_add(_pos_selected_cb)
    bx.pack_end(acts)
    acts.show()

    acts = Actionslider(win,
                        size_hint_weight=EXPAND_HORIZ,
                        size_hint_align=(EVAS_HINT_FILL, 0.0),
                        indicator_pos=ELM_ACTIONSLIDER_LEFT,
                        magnet_pos=ELM_ACTIONSLIDER_ALL)
    acts.part_text_set("left", "Left")
    acts.part_text_set("center", "Center")
    acts.part_text_set("right", "Right")
    acts.text_set("Go")
    acts.callback_selected_add(_pos_selected_cb)
    bx.pack_end(acts)
    acts.show()

    acts = Actionslider(win,
                        size_hint_weight=EXPAND_HORIZ,
                        size_hint_align=(EVAS_HINT_FILL, 0.0),
                        indicator_pos=ELM_ACTIONSLIDER_CENTER,
                        magnet_pos=ELM_ACTIONSLIDER_CENTER)
    acts.part_text_set("left", "Enable")
    acts.part_text_set("center", "Magnet")
    acts.part_text_set("right", "Disable")
    acts.callback_pos_changed_add(_magnet_enable_disable_cb)
    acts.callback_selected_add(_pos_selected_cb)
    bx.pack_end(acts)
    acts.show()

    win.resize(320, 400)
    win.show()
Ejemplo n.º 5
0
def evas3d_clicked(obj, item=None):
    win = StandardWindow("evas3d", "Evas 3d test")
    win.autodel_set(True)
    if obj is None:
        win.callback_delete_request_add(lambda o: elementary.exit())

    cube = Cube(win, 240, 240, 240)

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

    sl = Slider(win, text="Rot X", unit_format="%1.0f units", span_size=360,
        min_max=(0, 360), size_hint_align=FILL_HORIZ,
        size_hint_weight=EXPAND_BOTH)
    vbox.pack_end(sl)
    sl.callback_changed_add(ch_rot_x, cube)
    sl.show()

    sl = Slider(win, text="Rot Y", unit_format="%1.0f units", span_size=360,
        min_max=(0, 360), size_hint_align=FILL_HORIZ,
        size_hint_weight=EXPAND_BOTH)
    vbox.pack_end(sl)
    sl.callback_changed_add(ch_rot_y, cube)
    sl.show()

    sl = Slider(win, text="Rot Z", unit_format="%1.0f units", span_size=360,
        min_max=(0, 360), size_hint_align=FILL_HORIZ,
        size_hint_weight=EXPAND_BOTH)
    vbox.pack_end(sl)
    sl.callback_changed_add(ch_rot_z, cube)
    sl.show()

    sl = Slider(win, text="CX Off", unit_format="%1.0f units", span_size=360,
        min_max=(-320, 320), value=cube.cxo, size_hint_align=FILL_HORIZ,
        size_hint_weight=EXPAND_BOTH)
    vbox.pack_end(sl)
    sl.callback_changed_add(ch_cx, cube)
    sl.show()

    sl = Slider(win, text="CY Off", unit_format="%1.0f units", span_size=360,
        min_max=(-320, 320), value=cube.cyo, size_hint_align=FILL_HORIZ,
        size_hint_weight=EXPAND_BOTH)
    vbox.pack_end(sl)
    sl.callback_changed_add(ch_cy, cube)
    sl.show()

    sl = Slider(win, text="Foc", unit_format="%1.0f units", span_size=360,
        min_max=(1, 2000), value=cube.focv, size_hint_align=FILL_HORIZ,
        size_hint_weight=EXPAND_BOTH)
    vbox.pack_end(sl)
    sl.callback_changed_add(ch_foc, cube)
    sl.show()

    sl = Slider(win, text="Z0", unit_format="%1.0f units", span_size=360,
        min_max=(-2000, 2000), value=cube.z0v, size_hint_align=FILL_HORIZ,
        size_hint_weight=EXPAND_BOTH)
    vbox.pack_end(sl)
    sl.callback_changed_add(ch_z0, cube)
    sl.show()

    win.resize(480, 480)
    cube.update()
    win.show()
def actionslider_clicked(obj):
    win = StandardWindow("actionslider", "Actionslider")
    win.autodel_set(True)
    if obj is None:
        win.callback_delete_request_add(lambda o: elementary.exit())

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

    acts = Actionslider(win, size_hint_weight=EXPAND_HORIZ,
        size_hint_align=(EVAS_HINT_FILL, 0.0),
        indicator_pos=ELM_ACTIONSLIDER_RIGHT, magnet_pos=ELM_ACTIONSLIDER_RIGHT,
        enabled_pos=(ELM_ACTIONSLIDER_LEFT | ELM_ACTIONSLIDER_RIGHT))
    acts.part_text_set("left", "Snooze")
    acts.part_text_set("center", "")
    acts.part_text_set("right", "Stop")
    acts.callback_pos_changed_add(_position_change_magnetic_cb)
    acts.callback_selected_add(_pos_selected_cb)
    bx.pack_end(acts)
    acts.show()

    acts = Actionslider(win, size_hint_weight=EXPAND_HORIZ,
        size_hint_align=(EVAS_HINT_FILL, 0.0),
        indicator_pos=ELM_ACTIONSLIDER_CENTER,
        magnet_pos=ELM_ACTIONSLIDER_CENTER,
        enabled_pos=(ELM_ACTIONSLIDER_LEFT | ELM_ACTIONSLIDER_RIGHT))
    acts.part_text_set("left", "Snooze")
    acts.part_text_set("center", "")
    acts.part_text_set("right", "Stop")
    acts.callback_selected_add(_pos_selected_cb)
    bx.pack_end(acts)
    acts.show()

    acts = Actionslider(win, style="bar", size_hint_weight=EXPAND_HORIZ,
        size_hint_align=(EVAS_HINT_FILL, 0.0),
        indicator_pos=ELM_ACTIONSLIDER_LEFT,
        magnet_pos=(ELM_ACTIONSLIDER_CENTER | ELM_ACTIONSLIDER_RIGHT),
        enabled_pos=(ELM_ACTIONSLIDER_CENTER | ELM_ACTIONSLIDER_RIGHT))
    acts.part_text_set("left", "")
    acts.part_text_set("center", "Accept")
    acts.part_text_set("right", "Reject")
    acts.callback_selected_add(_pos_selected_cb)
    bx.pack_end(acts)
    acts.show()

    acts = Actionslider(win, style="bar", text="Go",
        size_hint_weight=EXPAND_HORIZ, size_hint_align=(EVAS_HINT_FILL, 0.0),
        indicator_pos=ELM_ACTIONSLIDER_LEFT, magnet_pos=ELM_ACTIONSLIDER_LEFT)
    acts.part_text_set("left", "")
    acts.part_text_set("center", "Accept")
    acts.part_text_set("right", "Reject")
    acts.callback_pos_changed_add(_position_change_magnetic_cb)
    acts.callback_selected_add(_pos_selected_cb)
    bx.pack_end(acts)
    acts.show()

    acts = Actionslider(win, size_hint_weight=EXPAND_HORIZ,
        size_hint_align=(EVAS_HINT_FILL, 0.0),
        indicator_pos=ELM_ACTIONSLIDER_LEFT, magnet_pos=ELM_ACTIONSLIDER_ALL)
    acts.part_text_set("left", "Left")
    acts.part_text_set("center", "Center")
    acts.part_text_set("right", "Right")
    acts.text_set("Go");
    acts.callback_selected_add(_pos_selected_cb)
    bx.pack_end(acts)
    acts.show()

    acts = Actionslider(win, size_hint_weight=EXPAND_HORIZ,
        size_hint_align=(EVAS_HINT_FILL, 0.0),
        indicator_pos=ELM_ACTIONSLIDER_CENTER,
        magnet_pos=ELM_ACTIONSLIDER_CENTER)
    acts.part_text_set("left", "Enable")
    acts.part_text_set("center", "Magnet")
    acts.part_text_set("right", "Disable")
    acts.callback_pos_changed_add(_magnet_enable_disable_cb)
    acts.callback_selected_add(_pos_selected_cb)
    bx.pack_end(acts)
    acts.show()

    win.resize(320, 400)
    win.show()