Page 1 of 1

Barra de progresso sem fim.

Posted: Wed Apr 22, 2009 7:59 pm
by Anderson.OL
Olá a todos...

Bem, direto ao assunto.

Eu gostaria de fazer uma barra de progresso mas não tenho a informação de qdo a tarefa executada vai encerrar, sendo assim, quero uma barra de progresso somente para exibir que o programa está em execução, como no exemplo abaixo:

Image
Image
Image
Image
Image
Image

As imagens acima foram editadas pra exemplificar a necessidade

FwxH 9.03 | xHb 1.1.0 | xDev 0.72 | SqlLib | MySql

Re: Barra de progresso sem fim.

Posted: Wed Apr 22, 2009 10:44 pm
by jefe
poco te puedo ayudar ya que acabo de empezar con esto y no se nada, pero para lo que tu necesitas se hace con METER

eso si, no te puedo explicar como funciona, porque todabia estoy intentando comprender como funciona esto.

un saludo

Re: Barra de progresso sem fim.

Posted: Thu Apr 23, 2009 12:46 am
by Ramon Paredes
Anderson,

yo lo uso de la siguiente forma :

funcion genera_indices

MsgMeter( { | oMeter, oText, oDlg, lEnd | ;
CreaIndex( oMeter, oText, oDlg, @lEnd,mfil_ntx ) },;
"Tabla : " + ffil_dbf+" Tag : "+mfil_ntx,"Generando Indices")

return

//=================================================
FUNCTION CREAINDEX( oMeter, oText, oDlg, lEnd,mfil_ntx )
//==================================================

oMeter:nTotal = RECCOUNT()

INDEX ON &MCAMPO TAG (mFil_Ntx) TO (mfil_cdx) ;
EVAL ( oMeter:Set( RecNo() ), SysRefresh(), ! lEnd )

RETURN NIL

ojala te sirva

saludes desde Managua ,Nicaragua

Ramon Paredes

Re: Barra de progresso sem fim.

Posted: Thu Apr 23, 2009 2:57 am
by andresreyes_mzt
Marquee Style

By creating the progress bar control with the PBS_MARQUEE style, you can animate it in a way that shows activity but does not indicate what proportion of the task is complete. The highlighted part of the progress bar moves repeatedly along the length of the bar. You can start and stop the animation, and control its speed, by sending the PBM_SETMARQUEE message. Marquee progress bars do not have a range or position.

#define PBS_MARQUEE 0x08
#define PBM_SETMARQUEE (WM_USER+10)

Utiliza el Estilo PBS_MARQUEE al crear el control .. modifica la clase ... eso no necesita explicación ...

y un ::SendMsg( PBM_SETMARQUE, nOn, nMilisegundos )

nOn = 1 o 0 , empezar a detener animacion

nMilisegundos = Numero de segundos de refresco de la animacion.

esto te debera de funcionar

Saludos,

Andres Reyes Hernandez

Re: Barra de progresso sem fim.

Posted: Thu Apr 23, 2009 2:35 pm
by FranciscoA
Tambien puedes utilizar:

MsgRun("Aguarde por favor...",,{|| MiFuncion() } )

Saludos.

Re: Barra de progresso sem fim.

Posted: Fri Apr 24, 2009 12:11 pm
by Anderson.OL
andresreyes_mzt wrote:
Marquee Style

By creating the progress bar control with the PBS_MARQUEE style, you can animate it in a way that shows activity but does not indicate what proportion of the task is complete. The highlighted part of the progress bar moves repeatedly along the length of the bar. You can start and stop the animation, and control its speed, by sending the PBM_SETMARQUEE message. Marquee progress bars do not have a range or position.

#define PBS_MARQUEE 0x08
#define PBM_SETMARQUEE (WM_USER+10)

Utiliza el Estilo PBS_MARQUEE al crear el control .. modifica la clase ... eso no necesita explicación ...

y un ::SendMsg( PBM_SETMARQUE, nOn, nMilisegundos )

nOn = 1 o 0 , empezar a detener animacion

nMilisegundos = Numero de segundos de refresco de la animacion.

esto te debera de funcionar

Saludos,

Andres Reyes Hernandez

Esta solução que eu procuro, mas não deu certo!!

Re: Barra de progresso sem fim.

Posted: Mon Oct 26, 2009 12:52 pm
by Anderson.OL
How to convert?


Delphi

Code: Select all

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, XPMan, StdCtrls, ComCtrls;

type
  TForm1 = class(TForm)
    ProgressBar1: TProgressBar;
    XPManifest1: TXPManifest;
    procedure FormShow(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

const
  PBS_MARQUEE = 8;
  PBM_SETMARQUEE = WM_USER + 10;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
   SetWindowLong(ProgressBar1.Handle, GWL_STYLE, GetWindowLong(ProgressBar1.Handle, GWL_STYLE) or PBS_MARQUEE);
end;

procedure TForm1.FormShow(Sender: TObject);
begin
   SendMessage(ProgressBar1.Handle, PBM_SETMARQUEE, WPARAM(True), 100);
end;

end.
 
To Fivewin

Code: Select all

#define PBS_MARQUEE  8
#define PBM_SETMARQUEE  WM_USER + 10
#define GWL_STYLE -16

function MsgRun( cCaption, cTitle, bAction )

   local oDlg, oMeter, oText, oBtn, oFont
   local nVal := 50, Result := .T.

   DEFAULT bAction  := { || nil },;
           cCaption := "Processando...",; 
              cTitle   := "Por favor, aguarde..."

   DEFINE FONT      oFont           ;
             NAME      GetSysFont()    ;
             SIZE      0, -8

   DEFINE DIALOG    oDlg            ;
             FROM      5, 5 TO 10, 45  ;
             TITLE    cTitle          ;
             FONT     oFont
             
   oDlg:lHelpIcon := .F.
                                                
   @ 0.2, 0.5 SAY   oText           ;
           VAR       cCaption        ;
             SIZE      130, 10         ;
             OF        oDlg
             
   @ 1,   0.7 PROGRESS oMeter       ;
           POSITION  nVal            ;
             SIZE      150,10          ;
             OF        oDlg           

   // This block gets evaluated only the first time the DialogBox is painted !!!
   oDlg:bStart = { || SetWindowLong(oMeter:hWnd, GWL_STYLE, GetWindowLong(oMeter:hWnd, GWL_STYLE) .or. PBS_MARQUEE), Result := Eval( bAction) , oDlg:End() }
                      
   ACTIVATE DIALOG oDlg CENTERED ;
            on init (   SendMessage(oMeter:hwnd, PBM_SETMARQUEE, .T. , 10) )

   oFont:End()    

return Result

Error in line:
oDlg:bStart = { || SetWindowLong(oMeter:hWnd, GWL_STYLE, GetWindowLong(oMeter:hWnd, GWL_STYLE) .or. PBS_MARQUEE), Result := Eval( bAction), oDlg:End() }