PDA

View Full Version : Bug in non-modal panels ?



nixx
10-04-2004, 06:46 AM
Hi all

I think I 've stumbled upon a bug that has to do with non-modal panels.
Either that, or I 'm doing something terribly wrong ...again :)

In a nutshell, if I have a non-modal panel in Layout, and I use a button to
launch another (modal) panel on top of it, the original one gets all screwed
up, showing "ok" and "cancel" buttons in weird places. That only happens if
the newly launched panel is fully or partly over the original one.

I 'm including some quick test code in the form of a master script that
illustrates the problem. If it's a known bug, my apologies for having missed
it; if it's not, and I 'm just doing something wrong, or if there is any way
to overcome this problem, I 'll appreciate any help :)

The code :

//----------------------------------------

@version 2.2
@warnings
@script master
@name panels test

testitems;

create
{
testitems = "This is a test";
testitems = "for a possible bug";
testitems = "in the LW panels";
}

flags
{
return(SCENE);
}

process: event, command
{
}


options
{
reqbegin("Panel-over-panel test");

p1 = ctllistbox("Listbox",400,300,"count","name");
p2 = ctlbutton("Open another requester",150,"open_requester");

reqopen();
}

count
{
return(testitems.size());
}

name: index
{
return(testitems[index]);
}

open_requester
{
reqbegin("Panel on-top");

r1 = ctltext("","This is the actual test - is the underlying panel
screwed up ?");
r2 = ctltext("","If it's not, try moving this panel over it and see.");

return if !reqpost();

reqend();
}

//----------------------------------------


Thanks,

nick

GregMalick
10-04-2004, 10:02 AM
Last April, I had an extended email exchange with Reiner Schug (lwrs_web) about a similar problem and we both came to the conclusion you should not use two panels in LScript. We ended up deciding it's better to just use TABS or close one panel before you open the other. I still had problems with the close/re-open technique so I suggest using a TABS in your non-modal panel.

SHORT ANSWER: yes, it's unstable (buggy).

faulknermano
10-04-2004, 10:13 AM
let me say that while it's not reliable, there are other "supported" features of lscript that is just unreliable. the trick is to close the original non-modal first before opening up the modal one. before your modal reqbegin(), execute a reqabort(), and at the end of that requester, execute options().

nixx
10-04-2004, 10:58 AM
let me say that while it's not reliable, there are other "supported" features of lscript that is just unreliable. the trick is to close the original non-modal first before opening up the modal one. before your modal reqbegin(), execute a reqabort(), and at the end of that requester, execute options().

Thanks, that is exactly what I ended up doing, and I think it works pretty well.

nick