Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Widgets - General questions or Mixed problems » FrameAddSize(Size& sz) really needed?
Re: FrameAddSize(Size& sz) really needed? [message #3704 is a reply to message #3684] Wed, 14 June 2006 15:52 Go to previous messageGo to previous message
Werner is currently offline  Werner
Messages: 234
Registered: May 2006
Location: Cologne / Germany
Experienced Member
luzr wrote on Mon, 12 June 2006 18:48

Well, as I said before, it is not needed until some situation expects the right value....

One of such situations is e.g. when creating TopWindow with layout

MyWin::MyWin()
{
SetFrame(MyFrame);
CtrlLayout(*this, "");
}

Now try to make MyFrame quite thick (e.g. 50 pixels) and do not implement AddFrameSize.

Mirek


Yes!

CtrlLayout calls AddFrameSize ...

template <class T>                                       // In TopWindow.h
void CtrlLayout(T& ctrl)
{
	InitLayout(ctrl, ctrl, ctrl, ctrl);
	Size sz = ctrl.AddFrameSize(T::GetLayoutSize());
	ctrl.SetMinSize(sz);
	ctrl.SetRect(sz);
}


... and AddFrameSize in turn calls FrameAddSize ...

Size Ctrl::AddFrameSize(int cx, int cy) const           // In CtrlPos.cpp
{
	Size sz = Size(cx, cy);
	for(int i = frame.GetCount() - 1; i >= 0; i--)
		frame[i].frame->FrameAddSize(sz);
	return sz;
}


Sorry for the inconvenience!

Werner
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to set the Constructor of a derived widget class?
Next Topic: OpenGL, SDL
Goto Forum:
  


Current Time: Fri Jul 18 11:29:19 CEST 2025

Total time taken to generate the page: 0.03919 seconds