Home » U++ Library support » U++ Widgets - General questions or Mixed problems » Drop list is not shown
Re: Drop list is not shown [message #43888 is a reply to message #43884] |
Fri, 14 November 2014 16:10 |
|
mirek
Messages: 13975 Registered: November 2005
|
Ultimate Member |
|
|
OK, that narrows it down. As I am still clueless what might be wrong, might I ask for some logging?
void PopUpTable::PopUp(Ctrl *owner, int x, int top, int bottom, int width) {
if(inpopup)
return;
inpopup++;
DoClose();
int h = AddFrameSize(width, min(droplines * GetLineCy(), GetTotalCy())).cy;
Rect rt = RectC(x, bottom, width, h);
Rect area = Ctrl::GetWorkArea(Point(x, top));
bool up = false;
if(rt.bottom > area.bottom) {
up = true;
rt.top = top - h;
rt.bottom = rt.top + h;
}
open = false;
popup.Create();
popup->table = this;
if(up) {
popup->SetRect(Rect(rt.left, rt.bottom - 1, rt.right, rt.bottom));
popup->Add(TopPos(0, rt.Height()).LeftPos(0, rt.Width()));
}
else {
popup->SetRect(Rect(rt.left, rt.top, rt.right, rt.top + 1));
popup->Add(BottomPos(0, rt.Height()).LeftPos(0, rt.Width()));
}
DLOG("---------------------------");
DDUMP(popup->GetRect());
DDUMP(rt);
if(GUI_PopUpEffect()) {
CenterCursor();
popup->PopUp(owner, true, true, GUI_DropShadows());
SetFocus();
Ctrl::ProcessEvents();
Animate(*popup, rt, GUIEFFECT_SLIDE);
// Ctrl::Remove();
}
if(!open) {
popup->SetRect(rt);
if(!popup->IsOpen())
popup->PopUp(owner, true, true, GUI_DropShadows());
CenterCursor();
SetFocus();
open = true;
}
inpopup--;
}
void Animate(Ctrl& c, const Rect& target, int type)
{
if(type < 0)
type = GUI_PopUpEffect();
Rect r0 = c.GetRect();
DDUMP(r0);
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;
if(r.GetWidth() > target.GetWidth())
r.right = r.left + target.GetWidth();
if(r.GetHeight() > target.GetHeight())
r.bottom = r.top + target.GetHeight();
DDUMP(r);
c.SetRect(r);
if(r == target)
break;
}
else
if(type == GUIEFFECT_FADE)
c.SetAlpha((byte)(255 * t / anitime));
else
break;
c.Sync();
Sleep(0);
#ifdef SLOWANIMATION
Sleep(100);
#endif
}
DDUMP(target);
c.SetRect(target);
c.SetAlpha(255);
}
[
|
|
|
|
|
Drop list is not shown
|
|
|
Re: Drop list is not shown
By: mirek on Wed, 12 November 2014 11:25
|
|
|
Re: Drop list is not shown
|
|
|
Re: Drop list is not shown
By: mirek on Thu, 13 November 2014 13:16
|
|
|
Re: Drop list is not shown
By: mirek on Thu, 13 November 2014 19:43
|
|
|
Re: Drop list is not shown
|
|
|
Re: Drop list is not shown
By: mirek on Fri, 14 November 2014 16:10
|
|
|
Re: Drop list is not shown
|
|
|
Re: Drop list is not shown
By: mirek on Sun, 16 November 2014 16:39
|
|
|
Re: Drop list is not shown
By: mirek on Sun, 16 November 2014 16:39
|
|
|
Re: Drop list is not shown
|
|
|
Re: Drop list is not shown
|
|
|
Re: Drop list is not shown
By: mirek on Sun, 16 November 2014 17:47
|
|
|
Re: Drop list is not shown
|
|
|
Re: Drop list is not shown
By: mirek on Thu, 20 November 2014 20:44
|
|
|
Re: Drop list is not shown
|
|
|
Re: Drop list is not shown
By: mirek on Fri, 21 November 2014 11:50
|
|
|
Re: Drop list is not shown
|
|
|
Re: Drop list is not shown
By: mirek on Mon, 24 November 2014 11:41
|
|
|
Re: Drop list is not shown
|
Goto Forum:
Current Time: Fri Apr 26 16:31:26 CEST 2024
Total time taken to generate the page: 0.03563 seconds
|