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 » How to get an "OnParentOpen" in a control
Re: How to get an "OnParentOpen" in a control [message #24150 is a reply to message #24147] Tue, 29 December 2009 12:04 Go to previous messageGo to previous message
koldo is currently offline  koldo
Messages: 3365
Registered: August 2008
Senior Veteran
Hello Honza

Quote:

I'm still not sure where's the problem Smile The code you posted just works for me.


Look at this:

void StaticImage::Layout() {
	SetFirstChild((Ctrl *)this);
	SizePos();
	Ctrl::Layout();
}


The code was wrong because it tried to set every child in the window as the first child... so the program hangs.

Simply doing this the program goes well:

void StaticImage::Layout() {
   	if (fit == Background) {
		SetFirstChild((Ctrl *)this);
		SizePos();
	}
	Ctrl::Layout();
} 


Perhaps I should have to add some code to avoid to have more than one Background StaticImage in a window.

Quote:

By the way: Why don't you use Painter for this? It would give user much more possibilities if SetFit took as an argument FILL_[H|V](PAD|REPEAT|REFLECT) and actually it would simplify the code a lot (e.g. that switch in Paint() would be unnecessary).


Yes, it could be. In fact Painter is used in all Controls4U classes with overrided Paint(), but StaticImage as antialiasing and other Painter technology is not necessary.

Best regards
Koldo



Best regards
IƱaki
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to mix use widgets and win32 window in u++?
Next Topic: Additon to SliderCtrl: Jump
Goto Forum:
  


Current Time: Sat May 18 03:11:09 CEST 2024

Total time taken to generate the page: 0.01659 seconds