Does anyone have an example of how to create a progress bar on a dialog? I have tried to define the dialog from a resource and also to create it from scratch. But, I have not been able to get either to function properly.
Thanks in advance...
#include "FWCE.ch"
FUNCTION Main()
LOCAL oWnd
DEFINE WINDOW oWnd TITLE "Progress"
@ 2, 2 BUTTON "Progress" SIZE 80, 25 ACTION ProgDialog()
ACTIVATE WINDOW oWnd
RETURN NIL
function ProgDialog()
local oDlg, oPgr
DEFINE Dialog oDlg TITLE "Progress Bars" FROM 5,12 TO 180, 230 PIXEL
@ 1, 1 SAY oSay PROMPT "Testing" OF oDlg SIZE 150, 20
@ 2, 0.9 PROGRESS oPgr OF oDlg SIZE 100, 15
@ 3, 1 BUTTON "-" OF oDlg SIZE 20, 20 ;
ACTION ( oPgr:nPosition -= 10 , BarStat( oSay, oPgr ) )
@ 3, 4 BUTTON "+" OF oDlg SIZE 20, 20 ;
ACTION ( oPgr:nPosition += 10 , BarStat( oSay, oPgr ) )
ACTIVATE DIALOG oDlg ON INIT ( oPgr:nPosition := 50, BarStat( oSay, oPgr ) )
return nil
Procedure BarStat( oSay, oPgr )
oSay:setText( Str( oPgr:nMin ) + ", " + Str( oPgr:nMax ) + ", " + Str( oPgr:nPos ) )
Return
@ 3, 1 BUTTON "-" OF oDlg SIZE 20, 20 ;
ACTION ( if( oPgr:nPosition > 0, oPgr:nPosition -= 10, ), BarStat( oSay, oPgr ) )
@ 3, 4 BUTTON "+" OF oDlg SIZE 20, 20 ;
ACTION ( if( oPgr:nPosition < 100, oPgr:nPosition += 10, ), BarStat( oSay, oPgr ) )
ACTIVATE DIALOG oDlg ON INIT ( oPgr:SetRange( 0, 100 ), oPgr:nPosition := 50, BarStat( oSay, oPgr ) )
Return to FiveWin for Pocket PC
Users browsing this forum: No registered users and 28 guests