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)
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)
def visible(): global mywid if mywid is None: return mywid.toggle_hidden() mywid.set_focus() mywid.to_front() wid_focus.set_focus(mywid)
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
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")
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()
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