Barra de progresso sem fim.

Post Reply
User avatar
Anderson.OL
Posts: 92
Joined: Thu Feb 15, 2007 11:37 am
Location: Itaocara - RJ - Brasil
Contact:

Barra de progresso sem fim.

Post 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
jefe
Posts: 23
Joined: Thu Apr 09, 2009 10:30 pm
Location: Valladolid, españa

Re: Barra de progresso sem fim.

Post 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
User avatar
Ramon Paredes
Posts: 215
Joined: Fri Feb 02, 2007 3:38 pm
Location: Managua, Nicaragua

Re: Barra de progresso sem fim.

Post 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
... Desde la Tierra de lagos y Volcanes......
User avatar
andresreyes_mzt
Posts: 70
Joined: Fri Jan 11, 2008 6:55 am
Location: Mexico
Contact:

Re: Barra de progresso sem fim.

Post 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
User avatar
FranciscoA
Posts: 1964
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: Barra de progresso sem fim.

Post by FranciscoA »

Tambien puedes utilizar:

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

Saludos.
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh1204-MySql-TMySql
User avatar
Anderson.OL
Posts: 92
Joined: Thu Feb 15, 2007 11:37 am
Location: Itaocara - RJ - Brasil
Contact:

Re: Barra de progresso sem fim.

Post 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!!
FiveWin 9.03 + xHarbour !!
User avatar
Anderson.OL
Posts: 92
Joined: Thu Feb 15, 2007 11:37 am
Location: Itaocara - RJ - Brasil
Contact:

Re: Barra de progresso sem fim.

Post 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() }
FiveWin 9.03 + xHarbour !!
Post Reply