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 » About DHCtrl and window handles...
Re: About DHCtrl and window handles... [message #12705 is a reply to message #12684] Tue, 13 November 2007 15:34 Go to previous messageGo to previous message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
In order to avoid the need of make friends of GLCtrl all windowed x11 controls (and maybe it could serve for other purposes...)
I suggest to add these 2 protected members to GLCtrl :

/////////////////////////////////////////////////////////////////////////////////////////
// Add subwindow to upp list of Xwindows
void Ctrl::AddUppXWindow(Window &w)
{
	int i = Xwindow().Find(None);
	if(i >= 0)
		Xwindow().SetKey(i, w);
	XWindow& cw = i >= 0 ? Xwindow()[i] : Xwindow().Add(w);
	cw.ctrl    = this;
	cw.exposed = true;
	cw.owner   = GetParent();
	cw.xic     = NULL;

} // END Ctrl::AddUppXWindow()


/////////////////////////////////////////////////////////////////////////////////////////
// Removes subwindow to upp list of Xwindows
void Ctrl::RemoveUppXWindow(Window &w)
{
	int i = Xwindow().Find(w);
	if(i >= 0)
	{
		Xwindow().SetKey(i, None);
		Xwindow()[i].ctrl = NULL;
	}

} // END Ctrl::RemoveUppXWindow()


This code is duplicated both in X11 Topwindow AND in GLCtrl, and is coming in my windowed X11 control too...
BTW, after I finish my X11 DHCtrl, I guess it would be not bad to rewrite X11 GLCtrl part to be derived of it... I'm already doing it for testing purposes.

Ciao

Max

p.s.: I'm thinking again that the good behaviour for event handling should start from TopWindow parenting child controls and propagated to them. AFAIK now, as is DHCtrl done (and mine too...) the parent of a windowed child control *don't* have any knowledge of events going to the child, as opposite as normal controls... maybe that can cause problems, I don't know yet.

[Updated on: Tue, 13 November 2007 15:39]

Report message to a moderator

 
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: SVN plan...
Next Topic: Interesting problem with setlocale
Goto Forum:
  


Current Time: Thu May 16 01:54:43 CEST 2024

Total time taken to generate the page: 0.02236 seconds