FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Progress bar
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Progress bar
Posted: Sun Mar 02, 2008 11:30 AM
Hi,

I have a question about the progress bar.

#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


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
Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Progress bar
Posted: Sun Mar 02, 2008 04:29 PM

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

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Progress bar
Posted: Sun Mar 02, 2008 07:40 PM

Marc,

You have to use it this way:

oProgress:SetStep( 1 )
for ...
oProgress:StepIt()
next

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Progress bar
Posted: Sun Mar 02, 2008 07:41 PM
Enrico,

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

This is what I have after removing the waitseconds()



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
Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Progress bar
Posted: Sun Mar 02, 2008 08:20 PM

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

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Progress bar
Posted: Sun Mar 02, 2008 08:35 PM
Marc,

This sample is working fine here:
#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

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Progress bar
Posted: Sun Mar 02, 2008 08:38 PM

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
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Progress bar
Posted: Mon Mar 03, 2008 10:39 AM

Antonio,

Did you found a solution for this problem?

Thanks,
Marc

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Progress bar
Posted: Mon Mar 03, 2008 06:14 PM

Marc,

No, not yet :-(

Without themes it works fine, with themes its erratic

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Progress bar
Posted: Mon Mar 03, 2008 07:13 PM

Antonio,

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

Regards,
Marc

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Progress bar
Posted: Mon Mar 03, 2008 07:38 PM

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
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Progress bar
Posted: Wed Mar 26, 2008 03:35 PM

Antonio,

Did you found a solution yet?

Thanks,
Marc

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Progress bar
Posted: Wed Mar 26, 2008 05:38 PM

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
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Progress bar
Posted: Mon Jul 14, 2008 07:03 AM

Antonio,

Any news about this problem yet?

Thanks,
Marc

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Progress bar
Posted: Mon Jul 14, 2008 09:32 AM
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
#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
#ifdef __FLAT__
   1 24 "WindowsXP.Manifest"
#endif
regards, saludos

Antonio Linares
www.fivetechsoft.com