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++ » Bugs (& fixes) » problems with splitter and layouts
problems with splitter and layouts [message #16479] Tue, 17 June 2008 14:57 Go to next message
cocob is currently offline  cocob
Messages: 156
Registered: January 2008
Experienced Member
hello
I don't think this is a bug. I think i'm a not using it correctly.


I have designed a simple layout ( 2 buttons ) and i want to draw it in a splitterCtrl. Here a minimalist version of my code that produce the problem. The background of the layout is not painted correctly in the splitterCtrl.

TopWindow a;
Splitter b;
WithMyLayout<Ctrl> c;
WithMyLayout<Ctrl> d;
CtrlLayout(c);
CtrlLayout(d);
b.Vert(c, d);
a.Add(b);	
a.Run()


Thanks for your help.

[Updated on: Tue, 17 June 2008 14:57]

Report message to a moderator

Re: problems with splitter and layouts [message #16480 is a reply to message #16479] Tue, 17 June 2008 17:03 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Quick guess is that you haven't set the size of the splitter control. Adding a call to SizePos() should work:
TopWindow a;
...
a.Add(b.SizePos());	
a.Run()
Re: problems with splitter and layouts [message #16481 is a reply to message #16479] Tue, 17 June 2008 17:11 Go to previous messageGo to next message
cocob is currently offline  cocob
Messages: 156
Registered: January 2008
Experienced Member
thanks for your help but this doesn't change anything ...
Re: problems with splitter and layouts [message #16482 is a reply to message #16481] Tue, 17 June 2008 17:17 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Sorry! I didn't notice the other problem...

You need to use ParentCtrl instead of Ctrl for the layouts (ie WithMyLayout<ParentCtrl>). Ctrl doesn't paint it's background, ParentCtrl does.
Re: problems with splitter and layouts [message #16483 is a reply to message #16479] Tue, 17 June 2008 17:22 Go to previous messageGo to next message
cocob is currently offline  cocob
Messages: 156
Registered: January 2008
Experienced Member
now its ok thank to you !
Re: problems with splitter and layouts [message #16484 is a reply to message #16482] Tue, 17 June 2008 17:27 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1361
Registered: November 2005
Location: Poland
Ultimate Contributor

ParentCtrl dosn't paint the background too Smile It's just transparent. StaticRect paints the background.
Re: problems with splitter and layouts [message #16487 is a reply to message #16482] Tue, 17 June 2008 20:03 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12962
Registered: November 2005
Ultimate Member
mrjt wrote on Tue, 17 June 2008 11:17

Sorry! I didn't notice the other problem...

You need to use ParentCtrl instead of Ctrl for the layouts (ie WithMyLayout<ParentCtrl>). Ctrl doesn't paint it's background, ParentCtrl does.


More correct "definition" is that ParentCtrl is transparent, while Ctrl's Paint is undefined.

Mirek
Re: problems with splitter and layouts [message #16500 is a reply to message #16487] Wed, 18 June 2008 12:29 Go to previous messageGo to next message
tojocky is currently offline  tojocky
Messages: 607
Registered: April 2008
Location: UK
Contributor

How can I invert colours of splitter bar when I drag (change position) with mouse? This mechanism like as in windows or linux when change window sizes in optimized mode (when I change windows size is paint only rectangle wich I drag without paint all window form... and in the end full refreshing window form with new size)?

[Updated on: Mon, 23 June 2008 14:43]

Report message to a moderator

Re: problems with splitter and layouts [message #16937 is a reply to message #16479] Mon, 21 July 2008 19:48 Go to previous messageGo to next message
cocob is currently offline  cocob
Messages: 156
Registered: January 2008
Experienced Member
hello all. I have an other problems with splitters, layouts and GLCtrl...

here a little example (the same as before Smile)

        TopWindow a;
	Splitter b;
	Withbug1Layout<ParentCtrl> c;
	Withbug1Layout<ParentCtrl> d;
	CtrlLayout(c);
	CtrlLayout(d);
	b.Vert(c, d);
	a.Add(b);	
	a.Run();


There is a GLCtrl on the layout like this

LAYOUT(bug1Layout, 184, 204)
	ITEM(GLCtrl, dv___0, RightPosZ(12, 104).BottomPosZ(8, 104))
	ITEM(Button, dv___1, LeftPosZ(8, 64).TopPosZ(8, 68))
END_LAYOUT


The problem is : the GLCtrl is not reshaped when i move the splitter bar.

Thanks for your help
Re: problems with splitter and layouts [message #16940 is a reply to message #16937] Tue, 22 July 2008 11:57 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
You need to set tell the GLCtrl to scale with it's parent by using HSizePos & VSizePos. These can be selected from the sping buttons at the top of the Layout Designer, or set with code.

I'd also change the 2nd last line to a.Add(b.SizePos()), so that the splitter scales with the window.
Re: problems with splitter and layouts [message #16967 is a reply to message #16479] Wed, 23 July 2008 20:05 Go to previous messageGo to next message
cocob is currently offline  cocob
Messages: 156
Registered: January 2008
Experienced Member
I confirm that it is not the problem. I have tried all springs positions but it doesn't change anything.

For example, if i replace the GLCtrl by a LineEdit or other control : there is no problem of resizing...

LAYOUT(3DViewer, 412, 320)
	ITEM(GLCtrl, opengl, HSizePosZ(20, 4).VSizePosZ(20, 4))
	ITEM(Label, dv___1, SetLabel(t_("- :")).HSizePosZ(20, 4).TopPosZ(0, 20))
	ITEM(Button, dv___2, LeftPosZ(0, 16).TopPosZ(20, 16))
END_LAYOUT
Re: problems with splitter and layouts [message #16987 is a reply to message #16479] Thu, 24 July 2008 16:25 Go to previous messageGo to next message
kodos is currently offline  kodos
Messages: 111
Registered: March 2008
Experienced Member
Which version of U++ are you using?

See: http://www.ultimatepp.org/forum/index.php?t=msg&th=3420& amp;start=0&
Re: problems with splitter and layouts [message #16996 is a reply to message #16479] Thu, 24 July 2008 19:48 Go to previous messageGo to next message
cocob is currently offline  cocob
Messages: 156
Registered: January 2008
Experienced Member
SVN 317 ...
I don't know if it is the same problem. Have you produced the problem ?
Re: problems with splitter and layouts [message #16998 is a reply to message #16479] Thu, 24 July 2008 20:30 Go to previous messageGo to next message
kodos is currently offline  kodos
Messages: 111
Registered: March 2008
Experienced Member
I have SVN rev 320 and I can not reproduce the problem. Everything seems to work as expected.
Re: problems with splitter and layouts [message #17001 is a reply to message #16479] Thu, 24 July 2008 21:40 Go to previous messageGo to next message
cocob is currently offline  cocob
Messages: 156
Registered: January 2008
Experienced Member
I attach a simple test case of my problem : tested with 2008.1

Thanks for your help
Re: problems with splitter and layouts [message #17115 is a reply to message #17001] Tue, 29 July 2008 16:18 Go to previous messageGo to next message
cocob is currently offline  cocob
Messages: 156
Registered: January 2008
Experienced Member
did somebody managed to reproduce my problem ?

Thanks for your help

[Updated on: Tue, 29 July 2008 16:19]

Report message to a moderator

Re: problems with splitter and layouts [message #17116 is a reply to message #16479] Tue, 29 July 2008 16:37 Go to previous messageGo to next message
cocob is currently offline  cocob
Messages: 156
Registered: January 2008
Experienced Member
for information i can't reproduce the problem on win32 platform. For the moment it occurs only on Debian
Re: problems with splitter and layouts [message #17166 is a reply to message #17116] Fri, 01 August 2008 09:07 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12962
Registered: November 2005
Ultimate Member
Confirmed, Max alerted Smile

Mirek
Re: problems with splitter and layouts [message #17184 is a reply to message #17166] Fri, 01 August 2008 16:38 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1264
Registered: September 2007
Senior Contributor
Uhmm... that one happened some time ago... and it was solved.
I'll investigate a bit more

Max

Well, that's strange, because before it worked... If you resize the splitter, glctrl don't update... but it does as soon as you move the full main window.
Did some event handling change in the meanwhile ?

Max

[Updated on: Fri, 01 August 2008 16:43]

Report message to a moderator

Re: problems with splitter and layouts [message #17185 is a reply to message #17184] Fri, 01 August 2008 16:54 Go to previous messageGo to previous message
mdelfede is currently offline  mdelfede
Messages: 1264
Registered: September 2007
Senior Contributor
Well.. a solution is found, but I don't know why behaviour changed. In X11Wnd.cpp, from line 963 :

// Synchronizes the native windows inside ctrls
void Ctrl::SyncNativeWindows(void)
{
	ArrayMap<Window, Ctrl::XWindow>& xwindows = Xwindow();
	for(int i = 0; i < xwindows.GetCount(); i++)
	{
		XWindow &xw = xwindows[i];
		Window w = xwindows.GetKey(i);
		if(xw.ctrl && xw.ctrl->parent && w)
		{
			Window dummy;
			int x, y;
			unsigned int width, height, border, depth;
			XGetGeometry(Xdisplay, w, &dummy, &x, &y, &width, &height, &border, &depth);
			Rect r = xw.ctrl->GetRectInParentWindow();
			if( (x != r.left || y != r.top) && ((int)width == r.Width() && (int)height == r.Height()))
				XMoveWindow(Xdisplay, w, r.left, r.top);
			else if( (x == r.left || y == r.top) && ((int)width != r.Width() || (int)height != r.Height()))
===> HERE			XMoveResizeWindow(Xdisplay, w, r.left, r.top, r.Width(), r.Height());
//				XResizeWindow(Xdisplay, w, r.Width(), r.Height());
			else if( x != r.left || y != r.top || (int)width != r.Width() || (int)height != r.Height())
				XMoveResizeWindow(Xdisplay, w, r.left, r.top, r.Width(), r.Height());
		}
	}

} // END Ctrl::SyncNativeWindows()



I had to replace the XResizeWindow() with XMoveResizeWindow() (the one commented out). That's weird, but no time now to investigate more Smile

Ciao

Max

[Updated on: Fri, 01 August 2008 16:55]

Report message to a moderator

Previous Topic: Pop-up help for Toolbar icons located in wrong display on multidisplay setup
Next Topic: Problem with xfce theme
Goto Forum:
  


Current Time: Thu Dec 03 14:29:41 CET 2020

Total time taken to generate the page: 0.01424 seconds