if you would constrain the mouse position, buttons would not work?
you not like my drawing state idea? did you test both codes?
a total different way? try
http://kll.engineering-news.org/kllfusion01/downloads/painter_basic_mousewheelplusplus_pde.txt
you still not repair your code posting??
and also test copy / paste back to PDE ( and run ) works