comparison gamelib/widgets.py @ 324:3476e8f3b100

Fixed mouse and cursor handling.
author Jeremy Thurgood <firxen@gmail.com>
date Sat, 28 Aug 2010 13:30:44 +0200
parents 40dd77f71e11
children 837728b3cbf4
comparison
equal deleted inserted replaced
323:0630a37cb371 324:3476e8f3b100
47 def mouse_down(self, event): 47 def mouse_down(self, event):
48 self.action() 48 self.action()
49 self.screen.state_widget.mouse_move(event) 49 self.screen.state_widget.mouse_move(event)
50 50
51 def mouse_move(self, event): 51 def mouse_move(self, event):
52 pos = self.parent.global_to_local(event.pos) 52 self.screen.state.highlight_override = True
53 if self.rect.collidepoint(pos):
54 self.screen.cursor_highlight(True)
55 53
56 54
57 class MessageDialog(BoomLabel, CursorWidget): 55 class MessageDialog(BoomLabel, CursorWidget):
58 56
59 def __init__(self, screen, text, wrap_width, style=None, **kwds): 57 def __init__(self, screen, text, wrap_width, style=None, **kwds):
81 def _draw_all_no_bg(self, surface): 79 def _draw_all_no_bg(self, surface):
82 CursorWidget.draw_all(self, surface) 80 CursorWidget.draw_all(self, surface)
83 81
84 def mouse_down(self, event): 82 def mouse_down(self, event):
85 self.dismiss() 83 self.dismiss()
84
85 def cursor_highlight(self):
86 return False