Den 07-03-2014 01:59, John Weeks skrev:
I have a need for windows that maintain a set aspect ratio, so I implemented
heightForWidth(). Since I'm still exploring, I made it very simple (this
function is called by a wrapper class that actually implements
heightForWidth()):
int
Well, I see your point- why should the window necessarily be the same shape as
the graph when the graph is constrained to a particular dimensional
relationship. But both Macintosh and Windows provide ways to constrain a
window's dimensions while the user is dragging the window to a new size. In
I have a need for windows that maintain a set aspect ratio, so I implemented
heightForWidth(). Since I'm still exploring, I made it very simple (this
function is called by a wrapper class that actually implements
heightForWidth()):
int grafRec::doHeightForWidth(int w)
{
return w/2;
}