Página 1 de 1

Progress Bar ayuda

Publicado: 18 Abr 2016 00:35
por bierco
Buen dia Compañeros
Me podrian colaborar por favor con una duda??
No se realizar un progress bar.....
Tengo un boto "Instalar" con el siguiente codigo en onclik:
Audio.Load(CHANNEL_NARRATION, "AutoPlay\\Audio\\Voces\\iniciando.mp3", true, false);
Paragraph.SetVisible("Paragraph1", true);
----------------------------------------------------------------------------
b = Tree.GetChildCount("Tree1", "0");
if b~=-1 then
for i=1, b do
ch = Tree.GetChildCount("Tree1", i);
if b~=-1 then
for x=1, ch do
tv = Tree.GetNode("Tree1", i.."."..x);
if tv~=nil then
if tv.Checked then
Path = tv.Data ;
if File.DoesExist(Path)~=false then
result = File.Run(Path, "", "", SW_SHOWNORMAL, true);
xt = result ;
end
end
end
end
end
if i==b then
if xt~=true then
Audio.Load(CHANNEL_NARRATION, "AutoPlay\\Audio\\Voces\\Completado.mp3", true, false);
Dialog.Message("Completado", "Ha finalizado la instalación de los programas seleccionados", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
end
end
end
end


Pero en la cadena "result = File.Run(Path, "", "", SW_SHOWNORMAL, true);" no logro colocar el Progress bar..

He descargado unos codigos de progress bar pero no he podido colocar. Aclaro que tampoco se colocar la funcion global para que ese progress bar funcione. El progress bar que nesecito es uno parecido a este, y despues llamar la funcion en la cadena mencionada:

Pero no quiero q sea copia solo quiero que me muestre el progreso, y vaya contando:

function EjectProgressInstall(Source, Destination, Copied, Total, FileCopied, FileTotal)

		-- Parto los archivos a instalar para su presentacion en texto...
			SplitDest = String.SplitPath(Destination);
			soloExt = SplitDest.Extension
			soloFile = SplitDest.Filename;
			soloFolder = SplitDest.Folder;
			stConcat = String.Concat(soloFolder, soloFile);
		
			if (Source ~= "") then
			Label.SetText("L_Status1", "Copiando archivo \r\n"..String.Mid(Source, String.Length(_SourceFolder) + 1, -1));

			end
			
			
			 -- Configuro la posicion de la instalacion en la barra de imagen usando los parametros
    
    		if Image.GetSize("Image1").Width == 100 then
			Image.SetVisible("Image1", false);

			else
			
			-- progress1

			Label.SetText("Label1", ((Copied / Total) * 100));
			nPercentage = Math.Floor(Copied / Total * 100);
			Label.SetText("Label1", "Estado general del copiado al (" .. nPercentage .. "%)...");
			Image.SetSize("Image1", nPercentage*4.3, 17);-- NOTA IMPORTANTE!!: Debes de ir probando segun longitud de la barra de progreso mediante el multiplicador de una forma que
													   -- cuadre el tamaño dentro de su cuadricula (plugin1 o plugin2 segun caso). Ejemplo: *6 o 5.5 si vas a usar decimales que sean
													   -- decimales con puntos NUNCA EN COMA! 




			totalTranslated = String.GetFormattedSize(FileTotal, FMTSIZE_AUTOMATIC, true);--TOTAL PESO ARCHIVO
			CopiedTranslated = String.GetFormattedSize(FileCopied, FMTSIZE_AUTOMATIC, true);-- TOTAL PESOS COPIADOS
			Remaining = String.GetFormattedSize(FileTotal-FileCopied, FMTSIZE_AUTOMATIC, true); -- RESTANTE POR COPIAR




	
			nTotalPercentage = Math.Floor((FileCopied / FileTotal) * 100);
			Label.SetText("L_Status3", "Total peso archivo: "..totalTranslated.."\r\n\r\nTotal Copiados: "..CopiedTranslated.."\r\n\r\nRestante por copiar: "..Remaining);

						
			splittedPath = String.SplitPath(Source);
			solofile = splittedPath.Filename;
			
			Label.SetText("L_Status2", "A carpeta \r\n"..soloFolder.."\r\n\r\nArchivo a copiar: "..soloFile..soloExt);


			
			end
	
		
		if Copied == Total then
		Label.SetText("Label1", "Terminado!");
		Label.SetText("L_Status1", "Copia Terminada!");
		Label.SetText("L_Status2",  "Copia terminada!");
		Label.SetText("L_Status3",  "");
		Image.SetSize("Image1", 1, 17);
		Image.SetSize("Image2", 1, 17);
		return false;
		else
		return true;
		end
end 
-------------------------------------






File.Copy(_SourceFolder.."\\AutoPlay\\Docs\\*.*", "C:\\Install_To_Path\\", false, true, true, false, EjectProgressInstall); -- LLAMO A LA FUNCION ANTES DESCRITA.
	


Me pueden porfavor colaborar con un progress bar sencillo?

Gracias.

Re: Progress Bar ayuda

Publicado: 18 Abr 2016 02:47
por Dow Sher
En primera, el comando File.Run no tiene soporte para progressbar. File.Copy si lo tiene (CallbackFunction) porque es un proceso, COPIA en cambio, File.Run no es un proceso, es solo una llamada a la ejecución de un archivo .exe que el cual es muy a parte de AM, un proceso que se ejecuta fuera del de AMS.

Lee la ayuda de AMS te servirá

Re: Progress Bar ayuda

Publicado: 19 Abr 2016 14:19
por abood1987
debe poner el software se instala automáticamente