Fix the build

Patched the sources and add a Makefile to make BeTeX build on Haiku. The app
runs altough with very limited functionality (Layout is broken, the preview
does not seem to work, occassional crashes...).
Fix crashes on creating popup dialogs
Fetch the dimensions of inserted objects correctly
Add MainTBar
Fix the layout

MainWindow now uses LayoutBuilder
Merge pull request #1 from atalax/master

Fix the build + 2 minor fixes