Progress bar

Marc Vanzegbroeck
Posts: 1102
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium
Contact:

Progress bar

Post by Marc Vanzegbroeck »

Hi,

I have a question about the progress bar.

Code: Select all

#include "FiveWin.ch"
func test()
   local aantal := 1
   local oProgress,oDlg,i
   DEFINE DIALOG oDlg RESOURCE "TESTPROGRESS"
   REDEFINE PROGRESS oProgress ID 150 OF oDlg
   ACTIVATE DIALOG oDlg CENTERED ON INIT oProgress:SetRange( 0, 38 ) NOWAIT
   SysRefresh()
   FOR i = 1 to 38
      aantal += 1
      oProgress:SetPos( aantal )
      WaitSeconds( .25 )
   NEXT i
   msginfo(oProgress:nPosition)
   oDlg:end()
return

Code: Select all

1 24 "c:\fwh\FWH710\samples\WinXP\WindowsXP.Manifest"

TESTPROGRESS DIALOG 7, 23, 343, 43
STYLE 0x4L | WS_POPUP | WS_MINIMIZEBOX | WS_MAXIMIZEBOX
FONT 8, "MS Sans Serif"
{
 GROUPBOX "Openen van bestanden", -1, 3, 6, 337, 28, BS_GROUPBOX
 CONTROL "", 150, "msctls_progress32", 0 | WS_CHILD | WS_VISIBLE, 7, 17, 327, 12
}

If I run this, the progress bar is 100% at the end, but if I comment the 'WaitSeconds( .25 )' line, because I want
an other function there, then progress bar is empty.
I already tried oProgress:refresh(), oDlg:refresh() and sysrefresh(), but the bar is never 100% full.

How can do an update of the progress-line?

Thanks,
Marc
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Progress bar

Post by Enrico Maria Giordano »

I just tried your sample and if I remove WaitSeconds() call then what I see is a filled progressbar under a MsgInfo() window.

What is the problem?

EMG
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Marc,

You have to use it this way:

oProgress:SetStep( 1 )
for ...
oProgress:StepIt()
next
regards, saludos

Antonio Linares
www.fivetechsoft.com
Marc Vanzegbroeck
Posts: 1102
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium
Contact:

Post by Marc Vanzegbroeck »

Enrico,

Here I have a empty progress-bar after removing waitseconds() :(

This is what I have after removing the waitseconds()

Image

Antonio,

Same result with your example. It's working if I use waitseconds(), but is also empty after removing the waitseconds()/

I use xharbour + FWH7.10.

Regards,
Marc
Marc Vanzegbroeck
Posts: 1102
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium
Contact:

Post by Marc Vanzegbroeck »

Antonio, Enrico, did you checked my example on vista or XP?

It seems to be a vista-problem.

I just tested the same exe-file on windows XP and there it's working fine.

Regards,
Marc
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Marc,

This sample is working fine here:

Code: Select all

#include "FiveWin.ch" 
func test() 
   local aantal := 1 
   local oProgress,oDlg,i 
   DEFINE DIALOG oDlg
   @ 2, 3 PROGRESS oProgress OF oDlg SIZE 120, 10
   ACTIVATE DIALOG oDlg CENTERED ON INIT oProgress:SetRange( 0, 38 ) NOWAIT 
   SysRefresh() 
   FOR i = 1 to 38 
      aantal += 1 
      oProgress:StepIt()
   NEXT i 
   msginfo("Done!") 
   oDlg:end() 
return
Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

I know whats going on. It caused by the themes support. We reviewed this issue recently.

I am reading the msgs in these forums about it...
regards, saludos

Antonio Linares
www.fivetechsoft.com
Marc Vanzegbroeck
Posts: 1102
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium
Contact:

Post by Marc Vanzegbroeck »

Antonio,

Did you found a solution for this problem?

Thanks,
Marc
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Marc,

No, not yet :-(

Without themes it works fine, with themes its erratic
regards, saludos

Antonio Linares
www.fivetechsoft.com
Marc Vanzegbroeck
Posts: 1102
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium
Contact:

Post by Marc Vanzegbroeck »

Antonio,

I didn't set a special theme. It's the standand vista-theme that was on the PC...

Regards,
Marc
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Marc,

Yes I know. I am using the standard theme here

(Well, not 100%, as I use Vista-Glass)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Marc Vanzegbroeck
Posts: 1102
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium
Contact:

Post by Marc Vanzegbroeck »

Antonio,

Did you found a solution yet?

Thanks,
Marc
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Marc,

No, not yet. Sorry :-(

We need to discover why it fails with themes. Without themes works fine.
regards, saludos

Antonio Linares
www.fivetechsoft.com
Marc Vanzegbroeck
Posts: 1102
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium
Contact:

Post by Marc Vanzegbroeck »

Antonio,

Any news about this problem yet?

Thanks,
Marc
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Marc,

This is the best code that we have got and still is not working fine. Without the manifest in the rc, it works fine:
test.prg

Code: Select all

#include "FiveWin.ch" 

function Main()
 
   local oProgress,oDlg,i 

   DEFINE DIALOG oDlg 

   @ 2, 3 PROGRESS oProgress OF oDlg SIZE 120, 10 

   ACTIVATE DIALOG oDlg CENTERED ON INIT oProgress:SetRange( 0, 100 ) NOWAIT 

   oProgress:SetStep( 10 )
   oProgress:SetPos( 0 )

   FOR i = 1 to 10 
      oProgress:StepIt()
      UpdateWindow( oProgress:hWnd )
      Sleep( 200 )  // try with other values here
   NEXT i 

   MsgInfo( "Done!" ) 
   oDlg:end() 

return nil
Test.rc

Code: Select all

#ifdef __FLAT__
   1 24 "WindowsXP.Manifest"
#endif
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply