Page 1 of 1

btnget/fwh 02/2008/xharbour 1.1.0

Posted: Mon Mar 24, 2008 5:37 pm
by Wanderson
Olá, pulsando f2 não me valida mais o action del btnget, con xharbour 0.99.70 e fwh 10/2007 vai bien.

Gracias.

Posted: Mon Mar 24, 2008 6:24 pm
by karinha
Wanderson,

Code: Select all

METHOD Default() CLASS TBtnGet
   local nRectLen, l3Dlook
   Local nTop, nLeft, nWidth, nHeight

   IF empty( ::bAction )
      Return Nil
   ENDIF

   //MSGINFO( GetWindowLong( ::oWnd:hWnd, GWL_STYLE ))

   IF !lAnd( GetWindowLong( ::hWnd, GWL_STYLE ), ES_MULTILINE )
      //MsgStop("Sorry, but you need to define the ID " + ltrim( str( ::nId ) ) + " as MULTILINE ")
   endif

   if lAnd( GetWindowLong( ::hWnd, GWL_STYLE ) , ES_MULTILINE )
      //MsgInfo("Si soy")
   else
      //MsgInfo("no soy")
   Endif


   nRectLen := ::CalcDims( @nTop, @nLeft, @nWidth, @nHeight )

   ::oBtn := TBtnDown():New( nTop, nLeft, nWidth, nHeight, ;
                 ::cResName,, ::cResName,, {|| Self:SetFocus(), ;
                 eval( ::bAction ) }, Self,"",, .F., .F.,"", ,, , .f. )


   //-> Para nao ter acionamento duplo
   ::bKeyDown := { | nKey | If( nKey == VK_F2, ( Eval( ::bAction ), 0 ),) }

   ::oBtn:bGotFocus  := {|| ::bTmpValid := ::bValid, ::bValid := nil, ;
                            ::oWnd:nLastKey := 0 }
   ::oBtn:bLostFocus := {|| ::bValid := ::bTmpValid }

   GetBtn( ::hWnd, nRectLen )

Return Nil
Veja se voce nao tem uma chamada com o SETKEY() para a tecla F2 em seu
sistema e depois a esta desativando com o NIL.

Abracos.