Some bugfixes and a TextControl editor as a popup

This fixes some bugs on Windows with two button mouses.
Additionally I have implemented the TextControl as a popup using JIDE.

Sorry for the line endings. I didn't realize it, before it was too late. I added a .gitattributes file, that should fix this for future commits.