FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Problema con bLClicked
Posts: 199
Joined: Tue Apr 22, 2008 09:54 AM
Problema con bLClicked
Posted: Sun Nov 29, 2009 10:44 AM
Hola compa帽eros,

El siguiente trocito de c贸digo, no consigo que me funcione correctamente (ver l铆nea de comentada):

Code (fw): Select all Collapse
 聽 DEFINE WINDOW oWndChild MDICHILD OF oWndPrinc ;
聽 聽 聽 聽 聽 FROM 5,5 TO 6,6;
聽 聽 聽 聽 聽 COLOR "N/W" ;
聽 聽 聽 聽 聽 BORDER NONE 
聽 聽oWndChild:bGotFocus 聽= { || oDlg:SetFocus() }

聽 聽DEFINE DIALOG oDlg RESOURCE "Articulos" OF oWndChild
聽 聽
聽 聽REDEFINE SAY oSayTec_Nom PROMPT CargaFicTec( oArt ) ID 500 OF oDlg UPDATE

聽 聽oSayTec_Nom:SetColor( CLR_WHITE, GetSysColor( COLOR_BTNFACE ) ) 
聽 聽oSayTec_Nom:lWantClick := .t.
聽 聽oSayTec_Nom:bLClicked := { || MsgInfo("TAMOS") } 聽 聽 聽 聽// ESTA LINEA NO SE EJECUTA AL HACER CLIC SOBRE oSayTec_Nom
聽 聽oSayTec_Nom:oCursor := oCursorHand

聽 聽for n = 1 to Len( oDlg:aControls )
聽 聽 聽 oDlg:aControls[ n ]:bLClicked = GenBlock( oWndChild, oDlg:aControls[ n ] )
聽 聽next 聽 聽 聽

聽 聽ACTIVATE DIALOG oDlg NOWAIT CENTERED;
聽 聽 聽 ON INIT ( oDlg:Move( 0, 0 ) );
聽 聽 聽 VALID 聽( oWndChild:End(), .t. )


聽 聽oWndChild:nWidth := oDlg:nWidth+7
聽 聽oWndChild:nHeight := oDlg:nHeight+32

聽 聽ACTIVATE WINDOW oWndChild ON INIT oWndPrinc:paint()



El funcionamiento deber铆a ser una al estilo de un link en una p谩gina web, es decir, es un texto que aparece de distinto color, al pasar por encima de el, el cursor cambia y al hacer click sobre el, ejecuta una funci贸n, en este caso el MsgInfo("RAMOS").
Alguna sugerencia? alg煤n error a simple vista de esos que tenemos los novatos?

GRACIAS!
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Problema con bLClicked
Posted: Sun Nov 29, 2009 11:28 AM

David,

En ese bucle for next que tienes a continuaci贸n le est谩s cambiando nuevamente el valor bLClicked :-)

Haz la asignaci贸n de BLClicked despu茅s del bucle for next

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 199
Joined: Tue Apr 22, 2008 09:54 AM
Re: Problema con bLClicked
Posted: Sun Nov 29, 2009 11:34 AM
Antonio,

Error de novato, claro!.
C贸mo puedo saber qu茅 control es oSayTec_nom en el array de controles del di谩logo para hacer algo as铆?:

Code (fw): Select all Collapse
   oSayTec_Nom:bLClicked := { || ( GenBlock( oWndChild, oDlg:aControls[ n ] ), MsgInfo("TAMOS") ) }


GRACIAS!
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Problema con bLClicked
Posted: Sun Nov 29, 2009 11:46 AM

David,

Al ser el primer control redefinido, est谩 en la posici贸n 1 (uno)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 199
Joined: Tue Apr 22, 2008 09:54 AM
Re: Problema con bLClicked
Posted: Sun Nov 29, 2009 11:48 AM

Gracias Antonio!

Continue the discussion