IsActive fix & code cleanup

No if a text edit is set to inactive you can't mouse down.
changed code to use setVariable so code is a bit cleaner.
Fixed some small spacing issues.