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 » Access to parent class
Re: Access to parent class [message #52851 is a reply to message #52850] Thu, 12 December 2019 14:09 Go to previous message
mirek is currently offline  mirek
Messages: 13980
Registered: November 2005
Ultimate Member
On the second thought, if we have things like GetChildCount, we can definitely have this as Ctrl method...

#include <CtrlLib/CtrlLib.h>

using namespace Upp;

struct TestCtrl : Ctrl {
	virtual void LeftDown(Point p, dword keyflags) {
		TopWindow *w = GetAscendant<TopWindow>();
		if(w)
			w->Title(AsString(p));
	}
};

GUI_APP_MAIN
{
	TopWindow win;
	TestCtrl h;
	win << h.SizePos();
	win.Run();
}
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: GLDrawDemo NOGTK doesn't work
Next Topic: [SOLVED] Dual GlCtrl in one frame ?
Goto Forum:
  


Current Time: Tue May 14 02:30:48 CEST 2024

Total time taken to generate the page: 0.01397 seconds