Page 1 of 1 1
Topic Options
#86346 - 2002-06-26 08:07 PM CopyFilePB
John Offline
Fresh Scripter

Registered: 2001-09-27
Posts: 38
Loc: Canada
Just recently started using KixGUI and im having a ton of fun writing with it.

Attached below is a simple script that copies all files from my documents to network drive with a progress bar.

My question is: How can a control the progress bar if a user clicks cancel or kills its. Im trying to display a message to the user in the event the user hits the cancel or kills the PB.

Any help greatly appreciated

Regards

John

$frm=$root.createform("frm","COPY FILES",210,100,350,100)

$lbl1=$frm.addlabel("lbl1","Copying files from MY DOCUMENTS folder to your" +chr(10)+ "Network H: DRIVE" + chr(10)+chr(10)+ "PLEASE WAIT",10,2,300,200)
$lbl1.borderstyle=0
$lbl1.textalign=1 ;center

$frm.visible=1

;Copies all files from my documents to H: drive

$frm1=$root.createform("copyfrm","copy form", 200,200,300,100)
$frm1.CopyFilePB("c:\Documents and Settings\@userid\My Documents\*.doc","H:\My Documents",0,1)

Top
#86347 - 2002-06-26 08:13 PM Re: CopyFilePB
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
very simple...

use Win2k and offline folders... [Big Grin]
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#86348 - 2002-06-26 08:20 PM Re: CopyFilePB
John Offline
Fresh Scripter

Registered: 2001-09-27
Posts: 38
Loc: Canada
Dont want to turn on Offline folders, to many training problems(believe or not).
Top
#86349 - 2002-06-26 09:42 PM Re: CopyFilePB
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
When I tested, I found that when I hit 'Cancel' CopyFilePB returned a value of '1223.' Change your code like this...

code:
$rc=$frm1.CopyFilePB("c:\Documents and Settings\@userid\My Documents\*.doc","H:\My Documents",0,1) 

if $rc=1223
? "User hit cancel..."
endif


Top
#86350 - 2002-06-26 10:34 PM Re: CopyFilePB
John Offline
Fresh Scripter

Registered: 2001-09-27
Posts: 38
Loc: Canada
thanks Chris, thats perfect...

I kept trying to see what @error code it returned and of course it only returned one 0 ... still trying to get the handle on kixgui...

cheers

John

Top
#86351 - 2002-06-26 10:50 PM Re: CopyFilePB
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
No problem. I might also suggest you use a system variable for your My Docs location. You can either pull the path out of the registry or you can use "%USERPROFILE%\My Documents."
Top
#86352 - 2002-06-27 12:39 AM Re: CopyFilePB
John Offline
Fresh Scripter

Registered: 2001-09-27
Posts: 38
Loc: Canada
Thanks again for the solution, tips and quick response..

Cheers

John

Top
#86353 - 2002-06-27 06:43 PM Re: CopyFilePB
Alex.H Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 406
Loc: France
John,
Kixgui don't set the @error value, for some particular reason (well, size of the dll is one of them)
On the other hand, the result is returned if you used a method (complete, error, something else), and yes there is a missing state in the manual. (same for copy, move and delete)
_________________________
? getobject(Kixtart.org.Signature)

Top
Page 1 of 1 1


Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 507 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.059 seconds in which 0.025 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org