FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Barra de progresso sem fim.
Posts: 92
Joined: Thu Feb 15, 2007 11:37 AM
Barra de progresso sem fim.
Posted: Wed Apr 22, 2009 07:59 PM
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:








As imagens acima foram editadas pra exemplificar a necessidade

FwxH 9.03 | xHb 1.1.0 | xDev 0.72 | SqlLib | MySql
FiveWin 9.03 + xHarbour !!
Posts: 23
Joined: Thu Apr 09, 2009 10:30 PM
Re: Barra de progresso sem fim.
Posted: Wed Apr 22, 2009 10:44 PM

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

Posts: 215
Joined: Fri Feb 02, 2007 03:38 PM
Re: Barra de progresso sem fim.
Posted: Thu Apr 23, 2009 12:46 AM

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......
Posts: 71
Joined: Fri Jan 11, 2008 06:55 AM
Re: Barra de progresso sem fim.
Posted: Thu Apr 23, 2009 02:57 AM
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
{{{ ---- xharbour + Borland C --- }}}
Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Re: Barra de progresso sem fim.
Posted: Thu Apr 23, 2009 02:35 PM

Tambien puedes utilizar:

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

Saludos.

Francisco J. Alegría P.

Chinandega, Nicaragua.



Fwxh-MySql-TMySql
Posts: 92
Joined: Thu Feb 15, 2007 11:37 AM
Re: Barra de progresso sem fim.
Posted: Fri Apr 24, 2009 12:11 PM
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 !!
Posts: 92
Joined: Thu Feb 15, 2007 11:37 AM
Re: Barra de progresso sem fim.
Posted: Mon Oct 26, 2009 12:52 PM
How to convert?


Delphi
Code (fw): Select all Collapse
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 (fw): Select all Collapse
#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 !!

Continue the discussion