Barra de progresso sem fim.

Barra de progresso sem fim.

Postby Anderson.OL » Wed Apr 22, 2009 7: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:

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

Re: Barra de progresso sem fim.

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

Re: Barra de progresso sem fim.

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

Re: Barra de progresso sem fim.

Postby andresreyes_mzt » Thu Apr 23, 2009 2: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
User avatar
andresreyes_mzt
 
Posts: 71
Joined: Fri Jan 11, 2008 6:55 am
Location: Mexico

Re: Barra de progresso sem fim.

Postby FranciscoA » Thu Apr 23, 2009 2:35 pm

Tambien puedes utilizar:

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

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

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2114
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: Barra de progresso sem fim.

Postby Anderson.OL » 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 !!
User avatar
Anderson.OL
 
Posts: 92
Joined: Thu Feb 15, 2007 11:37 am
Location: Itaocara - RJ - Brasil

Re: Barra de progresso sem fim.

Postby Anderson.OL » Mon Oct 26, 2009 12:52 pm

How to convert?


Delphi
Code: Select all  Expand view
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  Expand view

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


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 31 guests