Пример #1
0
def save_as(ev):
    d = ui.Dialog("Save sheet as...")
    d.add_ok_cancel(ok=save_sheet, cancel=cancel_save_as)
    d.body <= html.SPAN('File name', style=dict(marginRight='10px'))
    d.body <= html.INPUT()
    document.unbind('keydown')

    document <= d
Пример #2
0
def save_as(ev):
    d = ui.Dialog("Save sheet as...")
    d.add_ok_cancel(ok=save_sheet, cancel=cancel_save_as)
    d.body <= html.SPAN('File name', style=dict(marginRight='10px'))
    d.body <= html.INPUT()
    document.unbind('keydown')
    
    document <= d
Пример #3
0
def show(path, zone, page_num=0):
    slideshow = Slideshow(path)

    if page_num < 0:
        page_num = 0
    elif page_num >= len(slideshow.pages):
        page_num = len(pages) - 1
    slideshow.page_num = page_num
    document.unbind('keydown')
    document.bind('keydown', lambda ev: keydown(ev, slideshow, zone))

    show_page(slideshow, zone, page_num)
Пример #4
0
def show(path, zone, page_num=0):
    slideshow = Slideshow(path)
    
    if page_num<0:
        page_num = 0
    elif page_num >= len(slideshow.pages):
        page_num = len(pages)-1
    slideshow.page_num = page_num
    document.unbind('keydown')
    document.bind('keydown',lambda ev:keydown(ev, slideshow, zone))

    show_page(slideshow, zone, page_num)
Пример #5
0
def showartis(ev):
    if 'vertical-menu' in doc:
        del doc['vertical-menu']
    doc.unbind('mouseclick', custom_menu)

    ev.stopPropagation()
    # Set up artifact select
    arti = DIV(Id='vertical-menu', Class='vertical-menu')
    for art in artifacts:
        temp = DIV(strings[art],
                   Id=art,
                   data_id=ev.target.attrs["data-id"],
                   Class='vertical-menu menu-item')
        temp.bind('click', custom_menu)
        arti <= temp
    arti.top = ev.y
    arti.left = ev.x
    doc <= arti
    doc.bind('click', custom_menu)
Пример #6
0
def custom_menu(ev):
    if 'data-id' in ev.target.attrs and 'menu-item' in ev.target.attrs[
            'class'] and 'vertical-menu' in ev.target.attrs['class']:
        if f"{ev.target.attrs['data-id']}-{ev.target.id}" not in doc:
            b = BUTTON(
                strings[ev.target.id],
                Class=
                f'text_button saved_arti {ev.target.attrs["data-id"].split("-")[1]}',
                Id=f"{ev.target.attrs['data-id']}-{ev.target.id}",
                data_arti=ev.target.id)
            b.bind('click', delete_me)
            doc[ev.target.attrs["data-id"]] <= b
            grind_table_state['artifacts'].add(
                f"{ev.target.attrs['data-id']}-{ev.target.id}")
            set_storage(f"{ev.target.attrs['data-id']}-{ev.target.id}", 'y')
            if ev.target.attrs['data-id'].split(
                    '-')[1] in grind_table_state['arti_check']:
                calculate_change()
        ev.stopPropagation()
    if 'vertical-menu' in doc:
        del doc['vertical-menu']
    doc.unbind('mouseclick', custom_menu)
Пример #7
0
def show(path, zone, page_num=None):
    slideshow = Slideshow(path)

    if page_num is None:
        page_num = 0
        # check if page num was stored in a cookie
        cookies = document.cookie
        if cookies:
            elts = dict([x.strip() for x in cookie.split('=')]
                        for cookie in cookies.split(";"))
            if "page" in elts:
                page_num = int(elts["page"])
    if page_num < 0:
        page_num = 0
    elif page_num >= len(slideshow.pages):
        page_num = len(pages) - 1

    slideshow.page_num = page_num
    document.unbind('keydown')
    document.bind('keydown', lambda ev: keydown(ev, slideshow, zone))

    show_page(slideshow, zone, page_num)
Пример #8
0
def show(path, zone, page_num=None):
    slideshow = Slideshow(path)
    
    if page_num is None:
        page_num = 0
        # check if page num was stored in a cookie
        cookies = document.cookie
        if cookies:
            elts = dict([x.strip() for x in cookie.split('=')] 
                for cookie in cookies.split(";"))
            if "page" in elts:
                page_num = int(elts["page"])
    if page_num < 0:
        page_num = 0
    elif page_num >= len(slideshow.pages):
        page_num = len(slideshow.pages) - 1

    slideshow.page_num = page_num
    document.unbind('keydown')
    document.bind('keydown',lambda ev:keydown(ev, slideshow, zone))
    
    show_page(slideshow, zone, page_num)
Пример #9
0
 def mouseup(self, event):
     self.is_moving = False
     document.unbind("mousemove")
     document.unbind("touchmove")
Пример #10
0
 def mouseUp(e):
     doc.unbind('mousemove')
Пример #11
0
 def mouseUp(e):
     doc.unbind('mousemove')
Пример #12
0
 def on_mouse_up(self, event):
     document.unbind('mousemove', self.mouse_move_handler)
     document.unbind('mouseup', self.mouse_up_handler)