Changeset: 539 fdbozzo - 30/11/2014 18:55:29:
- Agregado botón Cancel en el form de progreso
This commit is contained in:
@@ -60,6 +60,7 @@ Else
|
|||||||
oVFP9.DoCmd( "PUBLIC oFoxBin2prg" )
|
oVFP9.DoCmd( "PUBLIC oFoxBin2prg" )
|
||||||
oVFP9.DoCmd( "oFoxBin2prg = CREATEOBJECT('c_foxbin2prg')" )
|
oVFP9.DoCmd( "oFoxBin2prg = CREATEOBJECT('c_foxbin2prg')" )
|
||||||
oVFP9.DoCmd( "oFoxBin2prg.cargar_frm_avance()" )
|
oVFP9.DoCmd( "oFoxBin2prg.cargar_frm_avance()" )
|
||||||
|
oVFP9.DoCmd( "oFoxBin2prg.o_frm_avance.Caption = '" & FileSystemObject.GetBaseName( WScript.ScriptName ) & " - ' + oFoxBin2Prg.c_loc_process_progress" )
|
||||||
|
|
||||||
For i = 0 To WScript.Arguments.Count-1
|
For i = 0 To WScript.Arguments.Count-1
|
||||||
scanDirs( WScript.Arguments(i) )
|
scanDirs( WScript.Arguments(i) )
|
||||||
@@ -83,6 +84,8 @@ Else
|
|||||||
cFlagNoTimestamps = "'1'"
|
cFlagNoTimestamps = "'1'"
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
oVFP9.DoCmd( "oFoxBin2prg.o_frm_avance.Caption = '" & FileSystemObject.GetBaseName( WScript.ScriptName ) & " - ' + oFoxBin2Prg.c_loc_process_progress + ' (Press Esc to Cancel)'" )
|
||||||
|
|
||||||
For i = 1 To nFile_Count
|
For i = 1 To nFile_Count
|
||||||
oVFP9.DoCmd( "oFoxBin2Prg.AvanceDelProceso(oFoxBin2Prg.c_loc_processing_file + ' " & aFiles(i) & "...', " & i & ", " & nFile_Count & ", 0)" )
|
oVFP9.DoCmd( "oFoxBin2Prg.AvanceDelProceso(oFoxBin2Prg.c_loc_processing_file + ' " & aFiles(i) & "...', " & i & ", " & nFile_Count & ", 0)" )
|
||||||
cFlagRecompile = "'" & FileSystemObject.GetParentFolderName( aFiles(i) ) & "'"
|
cFlagRecompile = "'" & FileSystemObject.GetParentFolderName( aFiles(i) ) & "'"
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ Else
|
|||||||
oVFP9.DoCmd( "PUBLIC oFoxBin2prg" )
|
oVFP9.DoCmd( "PUBLIC oFoxBin2prg" )
|
||||||
oVFP9.DoCmd( "oFoxBin2prg = CREATEOBJECT('c_foxbin2prg')" )
|
oVFP9.DoCmd( "oFoxBin2prg = CREATEOBJECT('c_foxbin2prg')" )
|
||||||
oVFP9.DoCmd( "oFoxBin2prg.cargar_frm_avance()" )
|
oVFP9.DoCmd( "oFoxBin2prg.cargar_frm_avance()" )
|
||||||
|
oVFP9.DoCmd( "oFoxBin2prg.o_frm_avance.Caption = '" & FileSystemObject.GetBaseName( WScript.ScriptName ) & " - ' + oFoxBin2Prg.c_loc_process_progress" )
|
||||||
|
|
||||||
For i = 0 To WScript.Arguments.Count-1
|
For i = 0 To WScript.Arguments.Count-1
|
||||||
scanDirs( WScript.Arguments(i) )
|
scanDirs( WScript.Arguments(i) )
|
||||||
@@ -89,6 +90,8 @@ Else
|
|||||||
cFlagNoTimestamps = "'1'"
|
cFlagNoTimestamps = "'1'"
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
oVFP9.DoCmd( "oFoxBin2prg.o_frm_avance.Caption = '" & FileSystemObject.GetBaseName( WScript.ScriptName ) & " - ' + oFoxBin2Prg.c_loc_process_progress + ' (Press Esc to Cancel)'" )
|
||||||
|
|
||||||
For i = 1 To nFile_Count
|
For i = 1 To nFile_Count
|
||||||
oVFP9.DoCmd( "oFoxBin2Prg.AvanceDelProceso(oFoxBin2Prg.c_loc_processing_file + ' " & aFiles(i) & "...', " & i & ", " & nFile_Count & ", 0)" )
|
oVFP9.DoCmd( "oFoxBin2Prg.AvanceDelProceso(oFoxBin2Prg.c_loc_processing_file + ' " & aFiles(i) & "...', " & i & ", " & nFile_Count & ", 0)" )
|
||||||
cFlagRecompile = "'" & FileSystemObject.GetParentFolderName( aFiles(i) ) & "'"
|
cFlagRecompile = "'" & FileSystemObject.GetParentFolderName( aFiles(i) ) & "'"
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ Else
|
|||||||
oVFP9.DoCmd( "PUBLIC oFoxBin2prg" )
|
oVFP9.DoCmd( "PUBLIC oFoxBin2prg" )
|
||||||
oVFP9.DoCmd( "oFoxBin2prg = CREATEOBJECT('c_foxbin2prg')" )
|
oVFP9.DoCmd( "oFoxBin2prg = CREATEOBJECT('c_foxbin2prg')" )
|
||||||
oVFP9.DoCmd( "oFoxBin2prg.cargar_frm_avance()" )
|
oVFP9.DoCmd( "oFoxBin2prg.cargar_frm_avance()" )
|
||||||
|
oVFP9.DoCmd( "oFoxBin2prg.o_frm_avance.Caption = '" & FileSystemObject.GetBaseName( WScript.ScriptName ) & " - ' + oFoxBin2Prg.c_loc_process_progress" )
|
||||||
|
|
||||||
cFlagGenerateLog = "'0'"
|
cFlagGenerateLog = "'0'"
|
||||||
cFlagDontShowErrMsg = "'0'"
|
cFlagDontShowErrMsg = "'0'"
|
||||||
@@ -83,6 +84,8 @@ Else
|
|||||||
|
|
||||||
cFlagRecompile = "'" & FileSystemObject.GetParentFolderName( WScript.Arguments(0) ) & "'"
|
cFlagRecompile = "'" & FileSystemObject.GetParentFolderName( WScript.Arguments(0) ) & "'"
|
||||||
|
|
||||||
|
oVFP9.DoCmd( "oFoxBin2prg.o_frm_avance.Caption = '" & FileSystemObject.GetBaseName( WScript.ScriptName ) & " - ' + oFoxBin2Prg.c_loc_process_progress + ' (Press Esc to Cancel)'" )
|
||||||
|
|
||||||
If nDebug = 0 Or nDebug = 2 Then
|
If nDebug = 0 Or nDebug = 2 Then
|
||||||
cCMD = "oFoxBin2prg.ejecutar( '" & WScript.Arguments(0) & "' )"
|
cCMD = "oFoxBin2prg.ejecutar( '" & WScript.Arguments(0) & "' )"
|
||||||
Else
|
Else
|
||||||
@@ -98,7 +101,14 @@ Else
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If GetBit(nDebug, 4) Then
|
If GetBit(nDebug, 4) Then
|
||||||
If oVFP9.Eval("oFoxBin2prg.l_Error") Then
|
'If oVFP9.Eval("oFoxBin2prg.l_Error") Then
|
||||||
|
If nExitCode = 1799 Then
|
||||||
|
MsgBox "Conversion Cancelled by User!", 48, WScript.ScriptName
|
||||||
|
cErrFile = oVFP9.Eval("FORCEPATH('FoxBin2Prg.LOG',GETENV('TEMP') )")
|
||||||
|
oVFP9.DoCmd("STRTOFILE( oFoxBin2prg.c_ErrorLog, '" & cErrFile & "' )")
|
||||||
|
WSHShell.run cErrFile
|
||||||
|
|
||||||
|
ElseIf nExitCode > 0 Then
|
||||||
MsgBox "End of Process! (with errors)", 48, WScript.ScriptName
|
MsgBox "End of Process! (with errors)", 48, WScript.ScriptName
|
||||||
cErrFile = oVFP9.Eval("FORCEPATH('FoxBin2Prg.LOG',GETENV('TEMP') )")
|
cErrFile = oVFP9.Eval("FORCEPATH('FoxBin2Prg.LOG',GETENV('TEMP') )")
|
||||||
oVFP9.DoCmd("STRTOFILE( oFoxBin2prg.c_ErrorLog, '" & cErrFile & "' )")
|
oVFP9.DoCmd("STRTOFILE( oFoxBin2prg.c_ErrorLog, '" & cErrFile & "' )")
|
||||||
|
|||||||
BIN
foxbin2prg.exe
BIN
foxbin2prg.exe
Binary file not shown.
@@ -592,6 +592,7 @@ DEFINE CLASS c_foxbin2prg AS CUSTOM
|
|||||||
n_FB2PRG_Version = 1.19
|
n_FB2PRG_Version = 1.19
|
||||||
*-- Localized properties
|
*-- Localized properties
|
||||||
c_loc_processing_file = C_PROCESSING_LOC
|
c_loc_processing_file = C_PROCESSING_LOC
|
||||||
|
c_loc_process_progress = C_PROCESS_PROGRESS_LOC
|
||||||
*--
|
*--
|
||||||
c_Language = 'ES'
|
c_Language = 'ES'
|
||||||
c_FB2PRG_EXE_Version = 0
|
c_FB2PRG_EXE_Version = 0
|
||||||
@@ -710,7 +711,6 @@ DEFINE CLASS c_foxbin2prg AS CUSTOM
|
|||||||
|
|
||||||
FINALLY
|
FINALLY
|
||||||
ON ESCAPE
|
ON ESCAPE
|
||||||
THIS.o_Frm_Avance = NULL
|
|
||||||
THIS.o_FSO = NULL
|
THIS.o_FSO = NULL
|
||||||
THIS.o_FNC = NULL
|
THIS.o_FNC = NULL
|
||||||
ENDTRY
|
ENDTRY
|
||||||
@@ -722,10 +722,19 @@ DEFINE CLASS c_foxbin2prg AS CUSTOM
|
|||||||
PROCEDURE AvanceDelProceso
|
PROCEDURE AvanceDelProceso
|
||||||
LPARAMETERS tcTexto, tnValor, tnTotal, tnTipo
|
LPARAMETERS tcTexto, tnValor, tnTotal, tnTipo
|
||||||
|
|
||||||
*-- Si o_Frm_Avance se habilit<69> de forma externa, l_ShowProgress podr<64>a ser .F. para controlarlo desde fuera.
|
TRY
|
||||||
IF VARTYPE(THIS.o_Frm_Avance) = "O" THEN
|
*-- Si o_Frm_Avance se habilit<69> de forma externa, l_ShowProgress podr<64>a ser .F. para controlarlo desde fuera.
|
||||||
THIS.o_Frm_Avance.AvanceDelProceso( tcTexto, tnValor, tnTotal, tnTipo )
|
IF VARTYPE(THIS.o_Frm_Avance) = "O" THEN
|
||||||
ENDIF
|
*-- Cuando esta rutina se invoca desde el script, este m<>todo es el #1 y no puede cancelarse todav<61>a
|
||||||
|
IF THIS.o_Frm_Avance.l_Cancelled AND PROGRAM(-1) > 1 THEN
|
||||||
|
ERROR 1799
|
||||||
|
ENDIF
|
||||||
|
THIS.o_Frm_Avance.AvanceDelProceso( tcTexto, tnValor, tnTotal, tnTipo )
|
||||||
|
ENDIF
|
||||||
|
|
||||||
|
CATCH
|
||||||
|
THROW
|
||||||
|
ENDTRY
|
||||||
ENDPROC
|
ENDPROC
|
||||||
|
|
||||||
|
|
||||||
@@ -2670,19 +2679,20 @@ ENDDEFINE
|
|||||||
|
|
||||||
*******************************************************************************************************************
|
*******************************************************************************************************************
|
||||||
DEFINE CLASS frm_avance AS FORM
|
DEFINE CLASS frm_avance AS FORM
|
||||||
Height = 100
|
Height = 110
|
||||||
Width = 628
|
Width = 628
|
||||||
ShowWindow = 2
|
ShowWindow = 2
|
||||||
DoCreate = .T.
|
DoCreate = .T.
|
||||||
AutoCenter = .T.
|
AutoCenter = .T.
|
||||||
BorderStyle = 2
|
BorderStyle = 2
|
||||||
CAPTION = C_PROCESS_PROGRESS_LOC + ' (Press Esc to Cancel)'
|
CAPTION = 'FoxBin2Prg - ' + C_PROCESS_PROGRESS_LOC + ' (Press Esc to Cancel)'
|
||||||
ControlBox = .F.
|
ControlBox = .F.
|
||||||
BackColor = RGB(255,255,255)
|
BackColor = RGB(255,255,255)
|
||||||
nmax_value = 100
|
nmax_value = 100
|
||||||
nmax_value2 = 100
|
nmax_value2 = 100
|
||||||
nvalue = 0
|
nvalue = 0
|
||||||
nvalue2 = 0
|
nvalue2 = 0
|
||||||
|
l_Cancelled = .F.
|
||||||
Name = "frm_avance"
|
Name = "frm_avance"
|
||||||
_memberdata = [<VFPData>] ;
|
_memberdata = [<VFPData>] ;
|
||||||
+ [<memberdata name="avancedelproceso" display="AvanceDelProceso"/>] ;
|
+ [<memberdata name="avancedelproceso" display="AvanceDelProceso"/>] ;
|
||||||
@@ -2694,11 +2704,12 @@ DEFINE CLASS frm_avance AS FORM
|
|||||||
+ [<memberdata name="nvalue_assign" display="nValue_assign"/>] ;
|
+ [<memberdata name="nvalue_assign" display="nValue_assign"/>] ;
|
||||||
+ [<memberdata name="nmax_value" display="nMax_Value"/>] ;
|
+ [<memberdata name="nmax_value" display="nMax_Value"/>] ;
|
||||||
+ [<memberdata name="nmax_value2" display="nMax_Value2"/>] ;
|
+ [<memberdata name="nmax_value2" display="nMax_Value2"/>] ;
|
||||||
|
+ [<memberdata name="l_cancelled" display="l_Cancelled"/>] ;
|
||||||
+ [</VFPData>]
|
+ [</VFPData>]
|
||||||
|
|
||||||
|
|
||||||
ADD OBJECT shp_base AS shape WITH ;
|
ADD OBJECT shp_base AS shape WITH ;
|
||||||
Top = 32, ;
|
Top = 28, ;
|
||||||
Left = 12, ;
|
Left = 12, ;
|
||||||
Height = 13, ;
|
Height = 13, ;
|
||||||
Width = 604, ;
|
Width = 604, ;
|
||||||
@@ -2707,7 +2718,7 @@ DEFINE CLASS frm_avance AS FORM
|
|||||||
|
|
||||||
|
|
||||||
ADD OBJECT shp_avance AS shape WITH ;
|
ADD OBJECT shp_avance AS shape WITH ;
|
||||||
Top = 32, ;
|
Top = 28, ;
|
||||||
Left = 12, ;
|
Left = 12, ;
|
||||||
Height = 13, ;
|
Height = 13, ;
|
||||||
Width = 36, ;
|
Width = 36, ;
|
||||||
@@ -2722,13 +2733,13 @@ DEFINE CLASS frm_avance AS FORM
|
|||||||
Caption = ".", ;
|
Caption = ".", ;
|
||||||
Height = 17, ;
|
Height = 17, ;
|
||||||
Left = 12, ;
|
Left = 12, ;
|
||||||
Top = 12, ;
|
Top = 8, ;
|
||||||
Width = 604, ;
|
Width = 604, ;
|
||||||
Name = "lbl_Tarea"
|
Name = "lbl_Tarea"
|
||||||
|
|
||||||
|
|
||||||
ADD OBJECT shp_base2 AS shape WITH ;
|
ADD OBJECT shp_base2 AS shape WITH ;
|
||||||
Top = 68, ;
|
Top = 64, ;
|
||||||
Left = 12, ;
|
Left = 12, ;
|
||||||
Height = 13, ;
|
Height = 13, ;
|
||||||
Width = 604, ;
|
Width = 604, ;
|
||||||
@@ -2737,7 +2748,7 @@ DEFINE CLASS frm_avance AS FORM
|
|||||||
|
|
||||||
|
|
||||||
ADD OBJECT shp_avance2 AS shape WITH ;
|
ADD OBJECT shp_avance2 AS shape WITH ;
|
||||||
Top = 68, ;
|
Top = 64, ;
|
||||||
Left = 12, ;
|
Left = 12, ;
|
||||||
Height = 13, ;
|
Height = 13, ;
|
||||||
Width = 36, ;
|
Width = 36, ;
|
||||||
@@ -2752,15 +2763,33 @@ DEFINE CLASS frm_avance AS FORM
|
|||||||
Caption = ".", ;
|
Caption = ".", ;
|
||||||
Height = 17, ;
|
Height = 17, ;
|
||||||
Left = 12, ;
|
Left = 12, ;
|
||||||
Top = 48, ;
|
Top = 44, ;
|
||||||
Width = 604, ;
|
Width = 604, ;
|
||||||
Name = "lbl_Tarea2"
|
Name = "lbl_Tarea2"
|
||||||
|
|
||||||
|
|
||||||
|
ADD OBJECT cmdcancel AS commandbutton WITH ;
|
||||||
|
Top = 84, ;
|
||||||
|
Left = 252, ;
|
||||||
|
Height = 21, ;
|
||||||
|
Width = 100, ;
|
||||||
|
Caption = "Cancel", ;
|
||||||
|
Enabled = .F., ;
|
||||||
|
Name = "cmdCancel"
|
||||||
|
|
||||||
|
|
||||||
PROCEDURE AvanceDelProceso
|
PROCEDURE AvanceDelProceso
|
||||||
LPARAMETERS tcTexto, tnValor, tnTotal, tnTipo
|
LPARAMETERS tcTexto, tnValor, tnTotal, tnTipo
|
||||||
|
|
||||||
WITH THIS AS frm_avance OF foxbin2prg.prg
|
WITH THIS AS frm_avance OF foxbin2prg.prg
|
||||||
|
*-- Habilita el bot<6F>n de cancelar una vez que se comienzan a pasar valores
|
||||||
|
IF NOT EMPTY(tnValor) THEN
|
||||||
|
IF NOT .cmdCancel.Enabled THEN
|
||||||
|
.cmdCancel.Enabled = .T.
|
||||||
|
ENDIF
|
||||||
|
DOEVENTS
|
||||||
|
ENDIF
|
||||||
|
|
||||||
DO CASE
|
DO CASE
|
||||||
CASE tnTipo = 0
|
CASE tnTipo = 0
|
||||||
IF NOT EMPTY(tcTexto) THEN
|
IF NOT EMPTY(tcTexto) THEN
|
||||||
@@ -2825,6 +2854,11 @@ DEFINE CLASS frm_avance AS FORM
|
|||||||
ENDPROC
|
ENDPROC
|
||||||
|
|
||||||
|
|
||||||
|
PROCEDURE cmdcancel.Click
|
||||||
|
THISFORM.l_Cancelled = .T.
|
||||||
|
ENDPROC
|
||||||
|
|
||||||
|
|
||||||
ENDDEFINE
|
ENDDEFINE
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user