The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Kill progress box
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

peter.cook

UK
356 Posts

Posted - 02/12/2004 :  5:10:03 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi,

Can I kill / destroy / close a progress box?

Cheers,

pete

Mike Buess

USA
3037 Posts

Posted - 02/12/2004 :  5:53:44 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Pete,

LabTalk's 'break -e' closes both LT and OC progress boxes. (I think they're essentially the same thing.)

Mike Buess
Origin WebRing Member
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 02/12/2004 :  9:48:43 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You just need to structure your code such that the progressBox will go out of scope, then the destructor will close the box.

CP


Go to Top of Page

peter.cook

UK
356 Posts

Posted - 02/13/2004 :  4:05:01 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Mike, CP,

Thanks for replies. I just had to add a pause as well eg :

LT_execute("break -e; sec -p 0.1")

CP - I'm not sure I understand what you mean though...possibly my problem was one of windows refreshing anyway.

Cheers,

Pete

Go to Top of Page

cpyang

USA
1406 Posts

Posted - 02/13/2004 :  5:25:40 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
a scope is any section of code enclosed in { },
see below


void test()
{
out_str("before enter scope with progressBox");
// new scope, can also be if(1) { }
{
out_str("progressBox now opens");
int imax = 100;
progressBox aa("This is an example:", PBOX_TOPMOST);
aa.SetRange(0,imax);
string str;


for(int ii = 0; ii < imax; ii++)
{
if(aa.Set(ii))
{
str.Format("Current at %d", ii);
aa.SetText(str, PBOXT_TITLE);
}
else
{
out_str("User abort!");
break;
}
LT_execute("sec -p 0.5"); // wasting some time
}
out_str("progressBox will close shortly");
}
out_str("after scope with progressbox");
LT_execute("sec -p 1.5"); // wasting some time

out_str("end program");
}






CP


Go to Top of Page

peter.cook

UK
356 Posts

Posted - 02/16/2004 :  06:22:03 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks for lesson CP!

Cheers,

Pete

Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000