|
|
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » Issue in docking example application
Issue in docking example application [message #43700] |
Mon, 22 September 2014 23:01 ![Go to next message Go to next message](theme/default/images/down.png) |
frankdeprins
Messages: 99 Registered: September 2008 Location: Antwerp - Belgium
|
Member |
|
|
Hello Mirek,
In the docking example application, there is an issue.
Well, the issue is not exactly in that example or the docking library, but in CtrlLib.
Here is what I noticed:
- When you minimize a docked window and then hover the tab, the docked window will reveal itself (expand). So far, so good.
- But when you move the mouse back out of the window and it's tab, there is something wrong with the auto-hiding: the window hides itself indeed, but then briefly flashes to it's full size once again.
After some digging, I found the cause to be in the Animate procedure in CtrlUtil.cpp.
The following change made the issue go away:
void Animate(Ctrl& c, const Rect& target, int type)
{
if(type < 0)
type = GUI_PopUpEffect();
Rect r0 = c.GetRect();
dword time0 = GetTickCount();
int anitime = 150;
#ifdef SLOWANIMATION
anitime = 1500;
#endif
if(type)
for(;;) {
int t = int(GetTickCount() - time0);
if(t > anitime)
break;
if(type == GUIEFFECT_SLIDE) {
Rect r = r0;
if(r.left != target.left)
r.left -= ((r.left - target.left)* t) / anitime;
if(r.top != target.top)
r.top -= ((r.top - target.top) * t) / anitime;
if(r.right != target.right)
r.right += ((target.right - r.right) * t) / anitime;
if(r.bottom != target.bottom)
r.bottom += ((target.bottom - r.bottom) * t) / anitime;
c.SetRect(r);
}
else
if(type == GUIEFFECT_FADE)
c.SetAlpha((byte)(255 * t / anitime));
else
break;
c.Sync();
Sleep(0);
#ifdef SLOWANIMATION
Sleep(100);
#endif
}
c.SetRect(target);
c.SetAlpha(255);
}
Could you please review this change and, if OK, apply it?
I know this function is used a lot for all animations, so I guess some care will be needed.
Regards,
Frank
|
|
|
|
|
|
|
|
|
|
Re: Issue in docking example application [message #43761 is a reply to message #43756] |
Mon, 06 October 2014 08:24 ![Go to previous message Go to previous message](theme/default/images/up.png) ![Go to next message Go to next message](theme/default/images/down.png) |
frankdeprins
Messages: 99 Registered: September 2008 Location: Antwerp - Belgium
|
Member |
|
|
I'm sorry Javier, but now we are talking about quite some amount of custom code.
Can't you reduce the testcase and limit it to the use of Upp code/controls only?
I hope you understand that I cannot check all this custom code, especially since I am completely unfamiliar with OpenGL stuff.
What I did find strange is that the docking animation is extremely slow in your test app.
Could it be you introduced something slowing down the drawing code of your control?
During the animation, the control gets resized and, hence, repainted quite a lot and when there is some slowdown there, it will have quite some influence.
As for the rest, it looked like the contents of the control were not always refreshed/repainted when they should, but I could not really observe distortions.
[Updated on: Mon, 06 October 2014 08:29] Report message to a moderator
|
|
|
Re: Issue in docking example application [message #43763 is a reply to message #43761] |
Mon, 06 October 2014 09:49 ![Go to previous message Go to previous message](theme/default/images/up.png) ![Go to next message Go to next message](theme/default/images/down.png) |
frankdeprins
Messages: 99 Registered: September 2008 Location: Antwerp - Belgium
|
Member |
|
|
I transformed the GLDrawDemo app from Upp to use docking and noticed the same problems as in your sample:
° GL control is not repainted properly
° Docking animation is terribly slow
Once again, though, I could not observe any distortion or bad drawing other than the repaint issue in the main window. The GL control in the docking window remains black though. I guess that is something I do incorrectly.
On the other hand, I found quite some problem reports about this GLCtrl in the forum and I have the impression that it is not exactly the crown jewel of Upp.
[Updated on: Mon, 06 October 2014 15:16] Report message to a moderator
|
|
|
|
Re: Issue in docking example application [message #43767 is a reply to message #43765] |
Tue, 07 October 2014 07:45 ![Go to previous message Go to previous message](theme/default/images/up.png) |
frankdeprins
Messages: 99 Registered: September 2008 Location: Antwerp - Belgium
|
Member |
|
|
Personally, I have the impression that the GlCtrl is the culprit.
Even without the docking, the same problems as I encountered were already reported in this forum.
It looks like, when you have multiple GlCtrl instances in one topwindow, they all paint to the same surface (some static member somewhere?).
In my converted GlDrawDemo -> GLDockDemo app, I had the impression that the docking GlCtrl was drawing to the one in the toplevel window. Something that came to my mind observing your example app as well.
But, as you say, I am not an OpenGL or even graphics expert. So, I'm afraid I'm at the end of this.
|
|
|
Goto Forum:
Current Time: Fri Apr 26 20:18:04 CEST 2024
Total time taken to generate the page: 0.02899 seconds
|
|
|