add class PaintEvent
add dispatch method, add flags is_handled and redraw_requestes and their methods
refactor