Home » Developing U++ » Bugs (& fixes) » problems with splitter and layouts
problems with splitter and layouts [message #16479] |
Tue, 17 June 2008 14:57 |
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 #16500 is a reply to message #16487] |
Wed, 18 June 2008 12:29 |
|
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 |
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 )
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 #16967 is a reply to message #16479] |
Wed, 23 July 2008 20:05 |
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 #17184 is a reply to message #17166] |
Fri, 01 August 2008 16:38 |
mdelfede
Messages: 1307 Registered: September 2007
|
Ultimate 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 |
mdelfede
Messages: 1307 Registered: September 2007
|
Ultimate 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
Ciao
Max
[Updated on: Fri, 01 August 2008 16:55] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Wed May 15 04:42:31 CEST 2024
Total time taken to generate the page: 0.03002 seconds
|