Page 1 of 1

Simplification of Window::getAbsolutePosition(), etc

Posted: Fri Jun 25, 2004 22:19
by Jeff_Leigh
It seems rather redundent to implement getPosition, getAbsolutePosition, and getRelativePosition...

Couldn't a version of getPosition() and getSize() be built to accept an optional MetricsMode parameter?

(This would simplify a bit of code I wrote which currently has to set the metrics mode to match it's parent's mode and then set it back when done... as it is actually cleaner to code it that way than to use if's and the named functions.)

Simplification of Window::getAbsolutePosition(), etc

Posted: Fri Jun 25, 2004 22:55
by Jeff_Leigh
Woops!

I'm not sure if you've fixed it or not yet, but in my copy the function name for StaticText::setBackgroundEnabled() is misspelled.

I'll grab the latest CVS over the weekend.

Simplification of Window::getAbsolutePosition(), etc

Posted: Sat Jun 26, 2004 06:51
by CrazyEddie
It seems rather redundent to implement getPosition, getAbsolutePosition, and getRelativePosition...

Couldn't a version of getPosition() and getSize() be built to accept an optional MetricsMode parameter?

(This would simplify a bit of code I wrote which currently has to set the metrics mode to match it's parent's mode and then set it back when done... as it is actually cleaner to code it that way than to use if's and the named functions.)

Yeah, this is one area that I need to revisit (again) at some stage. I'll add some functions as you describe, hopefully over this weekend sometime. I also have to add matching setter method for those getters.

I'm not sure if you've fixed it or not yet, but in my copy the function name for StaticText::setBackgroundEnabled() is misspelled.

:oops: Thanks for spotting that, I have now committed a fix ;) (and just broke peoples code :roll:)

[Edit]
I have added the requested functions to the Window base class. The other functions are still available though - to remove them now would be a major breaking change. As stated above, soon I'll add a matching set of manipulator methods (possibly next week). HTH.
[/Edit]