Don't worry. You're here now!
I know, I had the same problems. No idea why it doesn't work correctly.
I recommend to use TPageControl instead. The advantage is you don't need to "draw" the stuff by yourself tracking the tab changes. The bad thing is that it may need more memory but I think it is not your case.
Ok, I've look at the GitHub project and I have to say something:
Use subdirectories! Please. "src" for sources and "bin" for the final binary. And "docs" for documentation. Really, it will help a lot.
The main problem I had when I worked with your code is that most of it is in the main form. That mean thousand controls and it's hard to keep track of they all. You should split the stuff, using TFrame for different control groups (i.e. I did a TFrame for the "brush" selector, another one for the tiles selector, etc). This will also group your code and increase the order.
Also separate "logic" and "GUI" should help too. For example, split the "tile selector" in two units, one for the logic (i.e. add, remove, replace, load, save...) and the other will be the GUI that just renders the tiles and allows the user to select one of them.
Bookmarks