Exemplo n.º 1
0
def cb_item6(li, item):
    box = elementary.Box(li)
    box.size_hint_min = (200, 150)

    sc = elementary.Scroller(li)
    sc.bounce = (False, True)
    sc.size_hint_align = (evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
    sc.size_hint_weight = (evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
    sc.show()

    bt = elementary.Button(li)
    bt.text = "Ctxpop will be on the top of layer"
    bt.callback_clicked_add(cb_btn)
    bt.size_hint_min = (190, 140)

    sc.content = bt
    box.pack_end(sc)

    cp = elementary.Ctxpopup(li)
    cp.callback_dismissed_add(cb_dismissed)
    cp.content = box
    (x, y) = li.evas.pointer_canvas_xy_get()
    cp.move(x, y)
    cp.show()
    bt.data["ctxpopup"] = cp
Exemplo n.º 2
0
def cb_map_clicked(Map):
    (x, y) = Map.evas.pointer_canvas_xy_get()
    (lon, lat) = Map.canvas_to_region_convert(x, y)
    cp = elementary.Ctxpopup(Map)
    cp.item_append("%f  %f" % (lon, lat), None, None).disabled = True
    cp.item_append("Add Overlay here", None, cb_ctx_overlay_add, Map, lon, lat)
    ic = elementary.Icon(Map)
    ic.file_set("images/logo.png")
    cp.item_append("Add Overlay with icon", None, cb_ctx_overlay_add, Map, lon,
                   lat, 0, ic)
    cp.item_append("Add Overlay custom content", None,
                   cb_ctx_overlay_add_custom, Map, lon, lat)
    cp.item_append("Add Overlay random color", None,
                   cb_ctx_overlay_add_random_color, Map, lon, lat)
    cp.item_append("Add Overlay (min zoom 4)", None, cb_ctx_overlay_add, Map,
                   lon, lat, 4)
    cp.item_append("Add 16 Grouped Overlays", None, cb_ctx_overlay_grouped,
                   Map, lon, lat, x, y)
    cp.item_append("Add one with a bubble attached", None,
                   cb_ctx_overlay_bubble, Map, lon, lat)
    cp.item_append("Add an Overlay Line", None, cb_ctx_overlay_line, Map, lon,
                   lat)
    cp.item_append("Add an Overlay Polygon", None, cb_ctx_overlay_polygon, Map,
                   lon, lat)
    cp.item_append("Add an Overlay Circle", None, cb_ctx_overlay_circle, Map,
                   lon, lat, 10)
    cp.item_append("Add an Overlay Scale", None, cb_ctx_overlay_scale, Map, x,
                   y)
    cp.move(x, y)
    cp.show()
Exemplo n.º 3
0
def cb_map_clicked(Map):
    (x, y) = Map.evas.pointer_canvas_xy_get()
    (lon, lat) = Map.canvas_to_region_convert(x, y)
    cp = elementary.Ctxpopup(Map)
    cp.item_append("%f  %f" % (lon, lat)).disabled = True
    cp.item_append("Set start point", None, cb_ctx_set_from, Map, lon, lat)
    cp.item_append("Set end point", None, cb_ctx_set_to, Map, lon, lat)
    cp.move(x, y)
    cp.show()
Exemplo n.º 4
0
def cb_item4(li, item):
    cp = elementary.Ctxpopup(li)
    cp.horizontal = True
    it = item_new(cp, "", "home")
    it = item_new(cp, "", "file")
    it = item_new(cp, "", "delete")
    it = item_new(cp, "", "folder")
    it = item_new(cp, "", "edit")
    it = item_new(cp, "", "clock")

    (x, y) = li.evas.pointer_canvas_xy_get()
    cp.move(x, y)
    cp.show()
Exemplo n.º 5
0
def cb_item3(li, item):
    cp = elementary.Ctxpopup(li)
    it = item_new(cp, "Eina")
    it = item_new(cp, "Eet")
    it = item_new(cp, "Evas")
    it = item_new(cp, "Ecore")
    it.disabled = True
    it = item_new(cp, "Embryo")
    it = item_new(cp, "Edje")

    (x, y) = li.evas.pointer_canvas_xy_get()
    cp.move(x, y)
    cp.show()
Exemplo n.º 6
0
def cb_item1(li, item):
    cp = elementary.Ctxpopup(li)
    it = item_new(cp, "Go to home folder", "home")
    it = item_new(cp, "Save file", "file")
    it = item_new(cp, "Delete file", "delete")
    it = item_new(cp, "Navigate to folder", "folder")
    it.disabled = True
    it = item_new(cp, "Edit entry", "edit")
    it = item_new(cp, "Sate date and time", "clock")
    it.disabled = True

    (x, y) = li.evas.pointer_canvas_xy_get()
    cp.move(x, y)
    cp.show()
Exemplo n.º 7
0
def cb_item5(li, item):
    box = elementary.Box(li)
    box.size_hint_min = (150, 150)

    sc = elementary.Scroller(li)
    sc.bounce = (False, True)
    sc.size_hint_align = (evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
    sc.size_hint_weight = (evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
    sc.show()

    bt = elementary.Button(li)
    bt.text = "Enlightenment"
    bt.size_hint_min = (140, 140)

    sc.content = bt
    box.pack_end(sc)

    cp = elementary.Ctxpopup(li)
    cp.content = box
    (x, y) = li.evas.pointer_canvas_xy_get()
    cp.move(x, y)
    cp.show()