Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
¿Cómo crear una marquesina o banner en vfp5?
Message
From
03/03/1999 16:38:13
 
 
To
03/03/1999 15:15:02
General information
Forum:
Visual FoxPro
Category:
Pictures and Image processing
Miscellaneous
Thread ID:
00193750
Message ID:
00193779
Views:
14
>Quiero saber cómo puedo crear una marquesina que se desplace sin necesidad de interrumpir algún otro proceso, como captura de información. Es decir que si vfp5 soporta multihilo (multithreading)
>
> A T E N T A M E N T E
>
> DAVID CARREÑO REYES
> INGENIERO EN COMPUTACION (U.N.A.M.)
Hola David,

Lo puedes hacer con un timer. Esto implica que tu marquesina sea implementada en una forma de VFP. Hice una prueba sencilla con una forma con tres controles (ademas del control de tiempo (timer): Una caja de texto, un boton y una etiqueta. A la forma (formulario) le agregue una propiedad llamada counter que mantiene el caracter siguiente de la cadena tecleada en la caja de texto. El codigo es como sigue:
**************************************************
*-- Class:        marquee (c:\test\test.vcx)
*-- ParentClass:  form
*-- BaseClass:    form
*
DEFINE CLASS marquee AS form


	Top = 0
	Left = 0
	Height = 191
	Width = 375
	DoCreate = .T.
	Caption = "Marquee"
	ControlBox = .T.
	Name = "Form1"
	counter = .F.


	ADD OBJECT label1 AS label WITH ;
		FontSize = 28, ;
		Alignment = 1, ;
		Caption = "", ;
		Height = 61, ;
		Left = 24, ;
		Top = 72, ;
		Width = 325, ;
		Name = "Label1"


	ADD OBJECT text1 AS textbox WITH ;
		Height = 23, ;
		Left = 120, ;
		Top = 24, ;
		Width = 144, ;
		Name = "Text1"


	ADD OBJECT label2 AS label WITH ;
		AutoSize = .T., ;
		Caption = "Type your text:", ;
		Height = 17, ;
		Left = 36, ;
		Top = 24, ;
		Width = 78, ;
		Name = "Label2"


	ADD OBJECT command1 AS commandbutton WITH ;
		Top = 24, ;
		Left = 276, ;
		Height = 24, ;
		Width = 84, ;
		Caption = "\<Start", ;
		Default = .T., ;
		Name = "Command1"


	ADD OBJECT timer1 AS timer WITH ;
		Top = 156, ;
		Left = 252, ;
		Height = 23, ;
		Width = 23, ;
		Interval = 0, ;
		Name = "Timer1"


	PROCEDURE Load
		this.counter = 0
	ENDPROC


	PROCEDURE command1.Click
		Local lcText
		lcText = Thisform.Text1.Value
		If Empty(lcText) Then
		  messagebox("No data", 48, "Error")
		  Thisform.Text1.Setfocus
		  Return .f.
		Endif

		If This.Caption = "\<Start" Then
		  Thisform.Timer1.Interval = 500
		  This.Caption = "\<Stop"
		Else
		  Thisform.Timer1.Interval = 0
		  This.Caption = "\<Start"
		  Thisform.Label1.Caption = ""
		  Thisform.Text1.Setfocus
		Endif

		Thisform.Counter = 0
	ENDPROC


	PROCEDURE timer1.Timer
		Local lcText
		lcText = Thisform.Text1.Value

		Thisform.Counter = Thisform.Counter + 1
		Do Case
		Case Thisform.Counter <= Len(lcText)
		  Thisform.Label1.Caption = Substr(lcText, 1, Thisform.Counter)
		Case Thisform.Counter < 40
		  Thisform.Label1.Caption = lcText + Space(Thisform.Counter - Len(lcText))
		Otherwise
		  Thisform.Counter = 0
		EndCase
	ENDPROC


ENDDEFINE
*
*-- EndDefine: marquee
**************************************************
Espero sea de ayuda
Previous
Reply
Map
View

Click here to load this message in the networking platform