From: Steven P. <n9...@n9...> - 2004-02-24 18:36:38
|
On Feb 23, 2004, at 11:47 PM, Roger Binns wrote: > Looks good. It is what I was expecting, and you even check the > window is on the screen :-) Don't forget to update > help/versionhistory.htd I thought to be smart, I should do that. You'll notice that if the window is offscreen, I allow for the fact that the user may *want* it offscreen, so I only move it on the edge so they can grab it. Some people way like them off to the side, who knows. ;-) Also, if it is set very large I set the size to about 90% of the screen resolution, but don't move it entirely on the screen. Since the size is scaled for them, if they do want to move it on the screen at least it will fit, but I'm not forcing it on them. What's the versionhistory stuff? {grin} OK, I put in some notes. >> It doesn't save sash position for windows that have it, perhaps this >> is something that should be added as an optional parameter. > > Sashes matter less and have far more sizing issues. (Which side are > you sizing from, and what do you shrink if the overall window is too > large?) OK, you've convinced me, I'll leave them alone. :-) I did start to look at it and you are right, MANY issues involved there and it's not as clear-cut as the size/position stuff.... >> Perhaps a separate percentage for height/width? Hmmmm.... > > Maybe just a percentage of screen and aspect ratio instead? I think > the aspect ratio better defines if the window looks well proportioned. I've implemented a "aspect ratio" as a decimal value of width/height. I've made the first pass at resizing using the EVT_CLOSE stuff. It worked great for the print preview frame, but it doesn't seem to work for the dialogs like config or comm. When you hit the "OK", "CANCEL", etc... you don't end up ever receiving a close event, so for those I had to leave in the call to save settings for each case, and I added a OnClose event for the case where the user just clicks on the window-close button; I treat it like a Cancel button. This isn't as generic as your proposed suggestion, but that generic approach wouldn't work with dialogs anyway from what I've seen. I'll look at implementing it for windows that it *would* work for, dialogs would just need a little extra code to cover all the bases. I'll keep poking at it, but as it is it's functional for the main window, print preview window, config dialog and commbrowser dialog. It's a start, and I can always clean up and refine later. ;-) |