예제 #1
0
def wid_text_on_m_over_b_callback(w, relx, rely, wheelx, wheely):
    wid_focus.set_focus(w, auto_scroll=False)

    w.set_color(tl=True, bg=True, br=True, name="white", alpha=0.05)

    if w.row_on_m_over_b is not None:
        w.row_on_m_over_b(w, relx, rely, wheelx, wheely)
예제 #2
0
def wid_text_button_on_m_over_b_callback(w, relx,
                                         rely, wheelx, wheely):
    w.set_color(tl=True, bg=True, br=True, name="white", alpha=1.0)
    wid_focus.set_focus(w, auto_scroll=False)

    if w.row_on_m_over_b is not None:
        w.row_on_m_over_b(w, relx, rely, wheelx, wheely)
예제 #3
0
def visible():
    global mywid
    if mywid is None:
        return

    mywid.toggle_hidden()
    mywid.set_focus()
    mywid.to_front()
    wid_focus.set_focus(mywid)
예제 #4
0
def wid_text_on_m_down_callback(w, x, y, button):
    wid_focus.set_focus(w, auto_scroll=False)

    w.set_active()
    w.set_color(tl=True, bg=True, br=True, name="red", alpha=0.5)

    if w.row_on_m_down is not None:
        return w.row_on_m_down(w, x, y, button)
    return False
예제 #5
0
def wid_text_on_m_down_callback(w, x, y, button):
    wid_focus.set_focus(w, auto_scroll=False)

    w.set_active()
    w.set_color(tl=True, bg=True, br=True, name="red", alpha=0.5)

    if w.row_on_m_down is not None:
        return w.row_on_m_down(w, x, y, button)
    return False
예제 #6
0
def visible():
    global mywid
    if mywid is None:
        return

    mywid.toggle_hidden()
    mywid.set_focus()
    mywid.to_front()
    wid_focus.set_focus(mywid)

    mm.tip2("Press Escape to go back")
예제 #7
0
def visible():
    global mywid
    if mywid is None:
        return

    mywid.toggle_hidden()
    mywid.set_focus()
    mywid.to_front()
    wid_focus.set_focus(mywid)

    mm.tip2("Press Escape to go back")
예제 #8
0
def visible():
    global mywid
    if mywid is None:
        return
    mywid.toggle_hidden()
    mywid.set_focus()
    mywid.to_front()
    wid_focus.set_focus(mywid)

    game.g.editor_mode = True
    game.g.map_help()
예제 #9
0
def visible():
    global mywid
    if mywid is None:
        return
    mywid.toggle_hidden()
    mywid.set_focus()
    mywid.to_front()
    wid_focus.set_focus(mywid)

    game.g.editor_mode = True
    game.g.map_help()
예제 #10
0
def wid_text_on_key_down_callback(w, sym, mod):
    rc = False
    if w.row_on_key_sym is not None:
        if w.row_on_key_sym == sym:
            if w.row_on_key_mod is not None:
                if w.row_on_key_mod == mod:
                    rc = w.row_on_key_down(w, sym, mod)
            else:
                rc = w.row_on_key_down(w, sym, mod)
    else:
        if w.row_on_key_down is not None:
            rc = w.row_on_key_down(w, sym, mod)

    if rc is True:
        w.set_active()
        w.set_color(tl=True, bg=True, br=True, name="red", alpha=0.5)
    else:
        parent = w.get_parent()
        for w in parent.text_wids:
            rc = False

            if w.row_on_key_sym is not None:
                if w.row_on_key_sym == sym:
                    if w.row_on_key_mod is not None:
                        if w.row_on_key_mod == mod:
                            rc = w.row_on_key_down(w, sym, mod)
                    else:
                        rc = w.row_on_key_down(w, sym, mod)

            if rc is True:
                w.set_active()
                w.set_color(tl=True, bg=True, br=True, name="red", alpha=0.5)
                break

    if rc is True:
        wid_focus.set_focus(w, auto_scroll=True)

    return rc
예제 #11
0
def wid_text_on_key_down_callback(w, sym, mod):
    rc = False
    if w.row_on_key_sym is not None:
        if w.row_on_key_sym == sym:
            if w.row_on_key_mod is not None:
                if w.row_on_key_mod == mod:
                    rc = w.row_on_key_down(w, sym, mod)
            else:
                rc = w.row_on_key_down(w, sym, mod)
    else:
        if w.row_on_key_down is not None:
            rc = w.row_on_key_down(w, sym, mod)

    if rc is True:
        w.set_active()
        w.set_color(tl=True, bg=True, br=True, name="red", alpha=0.5)
    else:
        parent = w.get_parent()
        for w in parent.text_wids:
            rc = False

            if w.row_on_key_sym is not None:
                if w.row_on_key_sym == sym:
                    if w.row_on_key_mod is not None:
                        if w.row_on_key_mod == mod:
                            rc = w.row_on_key_down(w, sym, mod)
                    else:
                        rc = w.row_on_key_down(w, sym, mod)

            if rc is True:
                w.set_active()
                w.set_color(tl=True, bg=True, br=True, name="red", alpha=0.5)
                break

    if rc is True:
        wid_focus.set_focus(w, auto_scroll=True)

    return rc