Werner Messages: 234 Registered: May 2006 Location: Cologne / Germany
Experienced Member
Werner wrote on Sun, 11 June 2006 22:52
luzr wrote on Sun, 11 June 2006 21:07
Is is required because sometimes you need to get the Size of Ctrl based on its view size.
(If you want to know when, try FindInFiles in uppsrc
Mirek
Well, I once again tried FindInFiles (Indeed, I already did it before posting .) I learned that you always use FrameLayout in combination with FrameAddSize. And in principle I recognize that "sometimes you need to get the Size of Ctrl based on its view size". But I still can't figure out in which cases you do need it. As far as I grasp I should look for a piece of code querying the size of the control. But I don't understand which precise expression to look for .
So I don't know if I need FrameAddSize for my own frames. But of course I can write "FrameAddSize(Size& sz) {}" and just observe what happens .
Werner
Just if somebody read this thread and might be interested in the answers ...
I fiddled about with some frames and I hope to have found the answers. Here they are (If something is wrong I would be happy to get corrected!):
1.
In which case is FrameAddSize(Size& sz) called by Ultimate++'s framework?
Never.
2.
Do I need to call it myself? If so: When?
Not normally. Only if I need to get the size of a ctrl based on the size of its view. So far I couldn't find an example where this is the case.
3.
Does it make sense to define and use FrameLayout(Rect& r) without semantically defining FrameAddSize(Size& sz)?
Yes, see the answer to question #2. But in any case in my own frame class for syntactical reasons I need to define the FrameAddSize function even if it's empty.
4.
Does it make sense to define and use FrameAddSize(Size& sz) without semantically defining FrameLayout(Rect& r)?
Maybe. But I doubt it very much. In any case I can't imagine a useful example.
All this sounds quite obvious. So, why did I ask these silly questions?
I studied the article "About Frames" in "Browse topics" where FrameAddSize is semantically defined in 2 cases. And I still wonder what is the need for this ...