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 » Developing U++ » U++ Developers corner » Proposed change to U++ to allow owning children.
Re: Proposed change to U++ to allow owning children. [message #32080 is a reply to message #32079] Wed, 20 April 2011 21:23 Go to previous messageGo to previous message
Lance is currently offline  Lance
Messages: 656
Registered: March 2007
Contributor
Out put of sample program:

index.php?t=getfile&id=3192&private=0

And the main content of the sample program:

using namespace Upp;

class MyLabel : public Label
{
public:
	MyLabel(String& s){ SetLabel(s); }
};


struct ButtonApp : TopWindow {

	ButtonApp()	: count(0)
	{		
		Sizeable().Zoomable();
		Click();
	}

	void Click()
	{
		int x, y;
		Ctrl * p;
		x=count%max_row_button*(button_width+5)+2;
		y=count/max_row_button*(button_height+5)+2;
		
		if( count & 1)
			p=&NewChild<MyLabel>(String().Cat()<<"["<<count<<"] A Label");
		else
		{
			p=&NewChild<Button>()
				.SetLabel(String().Cat()<<"["<<count<<"] Click Me");
			*(Button*)p<<=THISBACK(Click);
		}
				
		p->LeftPos(x,button_width).TopPos(y,button_height);

		++count;
	}

	typedef ButtonApp CLASSNAME;

private:
	const static int button_width=180;
	const static int button_height=40;
	const static int max_row_button=5;

	int    count;
};

GUI_APP_MAIN
{
	ButtonApp().Run();
}
 
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
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
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
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
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Get MAC addresses for windows and linux
Next Topic: Testing framework in U++.
Goto Forum:
  


Current Time: Fri Aug 29 22:37:50 CEST 2025

Total time taken to generate the page: 0.07885 seconds