Little Things, Here and There #
Didn't do much work today (school's starting day after tomorrow, depression is setting in). Main thing I did today was to handle window positioning properly. Until now I was offsetting each window by a hard coded offset, and things wouldn't have looked so great with schemes/themes. I found some sample code which let you find the thickness of the border, but it only worked if the window was visible. So I had to show the window, figure out the proper offset, and then move it. However this caused some nasty flickering. But in the end it turned out that this was all for nothing. Window resources have a special setting which makes them be staggered, so I simply had to turn that on and use a WIND resource to create my window instead of calling NewCWindow with the dimensions/title. And it's more Mac-like too.
Then I worked some more on cleaning up the code. I thought that I should have a "globals" class, in which I should store all the global variables, like the startup port, patterns used for drawing the marquee, etc. But the implementation didn't come out very neatly, since it makes toolbox calls in its constructor, so I had to move InitMacToolbox from my Initialize function into the constructor for the class. I also had some problems with the scope of the variable, so I'm including my main .h file in yet anoter place.
I've started reading about static variables and functions, and they look like the thing I need to use. But that can be implemented tomorrow...
Oh, and I did work on the grid which I mentioned yesteday, but I ran into some problems because the grid is supposed to be displayed under the selection/lasso shape but over the actual image. So I decided to leave that out in the IB version. Actually I've decided to go into a feature-freeze, so that I can just focus on making the program more ellegant and stable. Then when I'm done with that, I can save a copy (as the IB reference version) and go back to adding features (like more tools, and better handling of files with no custom icons).
Post a Comment