In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

Texto em TProgressBar

Foro público de Xailer en español
Responder
Mhacker
Mensajes: 5
Registrado: Mié Ago 25, 2010 3:41 am

Texto em TProgressBar

Mensaje por Mhacker »

Senhores,
Como posso fazer para colocar um texto em um TProgressBar, já tentei o Parí¢metro cText , mas não teve efeito nenhum.
Ex:
oProgressBar1:cText := "TESTE DE ESCRITA"
Desde já agradeço a ajuda,
Atenciosamente,
Marcelo Coelho Silva
Brasil
Marcelo Coelho Silva
Brasil.
Avatar de Usuario
bingen
Mensajes: 565
Registrado: Lun Jul 07, 2014 8:17 pm
Ubicación: Bilbao
Contactar:

Texto em TProgressBar

Mensaje por bingen »

Appdata:oWaitOnMeter:OnChange := {|| cProgressText:=IF(!Empty(cTexto),cTexto+" ",""),;
cProgressText+=IF(lVerCantidad,AllString(Appdata:oWaitOnMete r:nValue)+ " / "+AllString(nTotalValue),""),;
Appdata:oWaitOnMeter:cText:= cProgressText,;
Application:SetProgress(psNORMAL,Appdata:oWaitOnMeter:nValue ,nTotalValue),ProcessMessages() }
BiSoft Desarrollo de software profesional
http://www.bisoft.es
joselalinf
Mensajes: 291
Registrado: Jue Ene 31, 2013 1:10 pm

Texto em TProgressBar

Mensaje por joselalinf »

Marcelo,
este código es de hace tiempo pero deberí­a funcionar:
CLASS TProgressBar FROM XProgressBar
PUBLISHED:
PROPERTY cText INIT ""
PROPERTY nClrText INIT clWindowText
PUBLIC:
METHOD WMPaint()
ENDCLASS
//---------------------------------------------------------- ----------------
METHOD WMPaint( hDC ) CLASS TProgressBar
LOCAL cText
hDC := ::BeginPaint( hDC )
PrevWindowProc( ::Handle, WM_PAINT, hDC, 0 )
IF !Empty( ::cText )
cText := StrTran( ::cText, "%i", AllTrim( ToString( ::nValue ) ))
SetBkMode( hDC, TRANSPARENT )
SetTextColor( hDC, ::nClrText )
DrawText( hDC, cText, GetClientRect( ::Handle ), nOR( DT_CENTER,
DT_VCENTER, DT_SINGLELINE ) )
ENDIF
::Super:WmPaint()
RETURN ::EndPaint( hDC )
//---------------------------------------------------------- ----------------
Saludos,
José Lalí­n
Avatar de Usuario
Marcelo Coelho Silva
Mensajes: 269
Registrado: Sab May 31, 2008 4:49 pm
Ubicación: Brasil
Contactar:

Texto em TProgressBar

Mensaje por Marcelo Coelho Silva »

Funcionou Perfeito.
Obrigado.
Atenciosamente,
Marcelo Coelho Silva
Brasil.
Em 25/03/2015 09:34, José Lalí­n escreveu:
> Marcelo,
>
> este código es de hace tiempo pero deberí­a funcionar:
>
> CLASS TProgressBar FROM XProgressBar
>
> PUBLISHED:
> PROPERTY cText INIT ""
> PROPERTY nClrText INIT clWindowText
>
> PUBLIC:
> METHOD WMPaint()
>
> ENDCLASS
>
> //----------------------------------------------------------
> ----------------
>
> METHOD WMPaint( hDC ) CLASS TProgressBar
>
> LOCAL cText
>
> hDC := ::BeginPaint( hDC )
> PrevWindowProc( ::Handle, WM_PAINT, hDC, 0 )
>
> IF !Empty( ::cText )
> cText := StrTran( ::cText, "%i", AllTrim( ToString( ::nValue ) ))
> SetBkMode( hDC, TRANSPARENT )
> SetTextColor( hDC, ::nClrText )
> DrawText( hDC, cText, GetClientRect( ::Handle ), nOR( DT_CENTER,
> DT_VCENTER, DT_SINGLELINE ) )
> ENDIF
>
> ::Super:WmPaint()
>
> RETURN ::EndPaint( hDC )
>
> //----------------------------------------------------------
> ----------------
>
> Saludos,
> José Lalí­n
>
---
Este email foi escaneado pelo Avast antiví­rus.
http://www.avast.com
Att.

Marcelo Coelho Silva
Brasil.
Responder