Example #1
0
def emulate_ok_press(element=None, inserters=None):
    if inserters:
        for i in inserters:
            i.K_RETURN_pressed()
    e = event.Event(constants.THORPY_EVENT, id=constants.EVENT_DONE, el=element)
    event.post(e)
    functions.quit_menu_func()
Example #2
0
 def click(e):
     if element.get_fus_rect().collidepoint(e.pos):
         if hasattr(element,"e_ok"):
             emulate_ok_press(element.e_ok)
         elif hasattr(element, "e_cancel"):
             post_cancel(element)
             functions.quit_menu_func()
Example #3
0
 def quit_save(self):
     ev = Event(constants.THORPY_EVENT, name=constants.EVENT_DONE, el=self)
     post(ev)
     for (varset, varname), handler in iter(self.handlers.items()):
         # si varset
         self.varsets[varset].set_value(varname, handler.get_value())
         # sinon si link
         # sinon si fonction
     functions.quit_menu_func()
Example #4
0
 def quit_save(self):
     ev = Event(constants.THORPY_EVENT,
                name=constants.EVENT_DONE,
                el=self)
     post(ev)
     for (varset, varname), handler in iter(self.handlers.items()):
         # si varset
         self.varsets[varset].set_value(varname, handler.get_value())
         # sinon si link
         # sinon si fonction
     functions.quit_menu_func()
Example #5
0
def emulate_cancel_press(element, inserters=None):
    if inserters:
        for i in inserters:
            i.K_RETURN_pressed()
    post_cancel(element)
    functions.quit_menu_func()
Example #6
0
 def click_quit_reaction(self, pygame_event):
     """Makes the element disappear if click is not colliding it."""
     self.click_quit = True
     (x, y) = pygame_event.pos
     if not self.collide((x, y), constants.STATE_NORMAL):
         functions.quit_menu_func()
Example #7
0
 def click_quit_reaction(self, pygame_event):
     """Makes the element disappear if click is not colliding it."""
     self.click_quit = True
     (x, y) = pygame_event.pos
     if not self.collide((x, y), constants.STATE_NORMAL):
         functions.quit_menu_func()
Example #8
0
 def click_outside(e):
     if not box.get_fus_rect().collidepoint(e.pos):
         functions.quit_menu_func()