Progress bar from XbpPack2

This forum is for posting of useful information
Message
Author
User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Progress bar from XbpPack2

#1 Post by rdonnay »

Here is a program that uses the XbpPack2.Dll provided to Xbase++ subscribers from Alaska Software.

This dll contains a new class: XbpProgressBar.

I have created a sample program that shows how to use this class in eXpress++ applications.
This sample program includes a new class named WaitProgress that you can use as a replacement for DC_WaitOn() and for other uses.

Create a new folder named \exp19\samples\XbpPack and unzip the attached files in that folder, then run pbuild Progress.xpj.

Code: Select all

FUNCTION Main()

LOCAL GetList[0]

@ 0,0 DCPUSHBUTTON CAPTION 'Standard Please Wait Progress Bar' ;
      SIZE 40,2 ACTION {||PleaseWait( 5 )}

@ 2,0 DCPUSHBUTTON CAPTION 'Backup Files Progress Bar' ;
      SIZE 40,2 ACTION {||Backup(.f.)}

@ 4,0 DCPUSHBUTTON CAPTION 'Backup Files Progress Bar (w/cancel button)' ;
      SIZE 40,2 ACTION {||Backup(.t.)}

DCREAD GUI FIT TITLE 'Progress Bars' SETAPPWINDOW

RETURN nil

* -------------

FUNCTION PleaseWait( nSeconds )

LOCAL oProgress, i

DEFAULT nSeconds := 2

oProgress := WaitProgress():new()
oProgress:messageString := 'Doing some stuff. Please Wait...'
oProgress:title := 'Doing Stuff'
oProgress:progressStyle := XBPPRGR_STYLE_MARQUEE
oProgress:create()
FOR i := 1 TO nSeconds * 10
  DC_CompleteEvents() // need this to move window
  Sleep(10)
NEXT
oProgress:destroy()

RETURN nil

* -------------

FUNCTION Backup( lCancelButton )

LOCAL oProgress, aDir, i, j

DEFAULT lCancelButton := .f.

oProgress := WaitProgress():new()
oProgress:messageString := 'Backing up files. Please Wait...'
oProgress:title := 'File Backup'
oProgress:isCancelButton := lCancelButton

oProgress:create()

aDir := Directory()
FOR i := 1 TO Len(aDir)
  oProgress:setData(0)
  oProgress:statusObject:setCaption(aDir[i,1])
  oProgress:progressObject:maximum := aDir[i,2]
  FOR j := 1 TO aDir[i,2] STEP 200 // need this to move window
    oProgress:setData( j )
    DC_CompleteEvents()
    IF oProgress:isCancelled
      EXIT
    ENDIF
  NEXT
  IF oProgress:isCancelled
    EXIT
  ENDIF
NEXT

oProgress:destroy()

RETURN nil
Attachments
progress.zip
(32.74 KiB) Downloaded 1008 times
The eXpress train is coming - and it has more cars.

User avatar
hz_scotty
Posts: 107
Joined: Thu Jan 28, 2010 8:20 am
Location: Wr.Neustadt / Österreich

Re: Progress bar from XbpPack2

#2 Post by hz_scotty »

Backup files progress bar and the function with the ESC

1.the bar, from 2 file to end of files, will not begin from 1 count
(it stays after 1 file always on the end of the progress bar! by me)
only you switch to another application and return back to progress bar
then the bar goes to right ( i think there is a refresh or reset value problem)

2. XbpPack2.ch is not in your package ;)

best regards
best regards
Hans

User avatar
Tom
Posts: 1171
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: Progress bar from XbpPack2

#3 Post by Tom »

XbpPack2.ch is not in your package
xbpack2.ch/.dll are parts of the xbpack2-package, which you need to load from Alaska Software.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Progress bar from XbpPack2

#4 Post by rdonnay »

I don't understand your comment about the backup progress.

It works perfectly for me.
The eXpress train is coming - and it has more cars.

User avatar
hz_scotty
Posts: 107
Joined: Thu Jan 28, 2010 8:20 am
Location: Wr.Neustadt / Österreich

Re: Progress bar from XbpPack2

#5 Post by hz_scotty »

Zwischenablage01.jpg
Zwischenablage01.jpg (204.84 KiB) Viewed 23347 times
Zwischenablage02.jpg
Zwischenablage02.jpg (205.84 KiB) Viewed 23347 times
on the first screen you see the progress bar - thats ok
when the first copy is finish the name of the second file is changed under the progress bar
but the progress bar is not reset (and begin from left to right) it stay's full on the right position (see Pic.2)

but when you change the focus to desktop (klick once on desktop with the mouse)
and then change the focus to your backupwindow the progress bar is show correct until the next file is come

i checked ist on a Win XP SP3 and on a Win Vista SP2 Computer

on both are the same mistake

hope i could help to understand
best regards
Hans

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Progress bar from XbpPack2

#6 Post by rdonnay »

Ok, now I understand.
I never tested it without a manifest file on XP or under Windows 7 without the manifest.

That behavior appears to happen only on XP without a manifest.

Copy the file \exp19\lib\manifest.xml to a file named Progress.Exe.Manifest.

I will try to determine why this is happening.
The eXpress train is coming - and it has more cars.

User avatar
hz_scotty
Posts: 107
Joined: Thu Jan 28, 2010 8:20 am
Location: Wr.Neustadt / Österreich

Re: Progress bar from XbpPack2

#7 Post by hz_scotty »

with the "manifest file" it works on WIN XP Sp3 :clap:
the progess bar now looks other - as bar not as small boxes

on VISTA with SP2 its the same problem
it is equal if there is a "manifest file"
the progress bar has small boxes and will not reset
best regards
Hans

BruceN
Posts: 280
Joined: Thu Jan 28, 2010 7:46 am
Location: Slidell, LA

Re: Progress bar from XbpPack2

#8 Post by BruceN »

There's something on Alaska's page re this:

http://news.alaska-software.com/readmes ... .bugreport

I've had problems with msnifst files on vista/7 so I stopped using them. I'll stick to Roger's dc_waiton. Better support, less problems (better taste, less filling?)

bruce
There are only 10 kinds of people - those who understand binary and those who don't :)

User avatar
Auge_Ohr
Posts: 1407
Joined: Wed Feb 24, 2010 3:44 pm

Re: Progress bar from XbpPack2

#9 Post by Auge_Ohr »

hi,

we did have that Thema in 2006 with ActivX an Progressbar from MsComCtl.OCX

depend on OS() ( Vista / Win7 ) you can see Progress Marquee Effect
Marquee Effect
Marquee Effect
Marquee.JPG (57.07 KiB) Viewed 23324 times
see also how Class Style and Class Part belong to it when using "visual Style"
(sometimes you have to switch between Version 5 and Version 6 to get Effect )
Attachments
PB56DEMO.ZIP
Progressbar from MsComCtl.OCX
(15.77 KiB) Downloaded 980 times
greetings by OHR
Jimmy

User avatar
hz_scotty
Posts: 107
Joined: Thu Jan 28, 2010 8:20 am
Location: Wr.Neustadt / Österreich

Re: Progress bar from XbpPack2

#10 Post by hz_scotty »

i like to display the process bar for "index on" or "reindex" with the XbpPack2

at this time i use DCPROGRESS in my Application

but when i need this for many Index (programmstart/reindex) the window flicker
so i like to chance it to the new XbpPack2 to display it like the demo from roger

Code: Select all

    
FOR j := 1 TO aDir[i,2] STEP 200 // need this to move window
    oProgress:setData( j )
    DC_CompleteEvents()
    IF oProgress:isCancelled
        EXIT
    ENDIF
NEXT

IF oProgress:isCancelled
   EXIT
ENDIF

can anybody show me some code for a process bar for indexing with XbpPack2?


many thanks for help
best regards
Hans

Post Reply