METHOD LButtonDown( nRow, nCol, nFlags ) CLASS TGet

METHOD LButtonDown( nRow, nCol, nFlags ) CLASS TGet

Postby demont frank » Mon Nov 02, 2009 3:54 pm

Hello,

I try :

oGet[3]:bLClicked := {|nRow,nCol,,oGet|IIF(oGet:nPos==1 ,tracelog(nRow,nCol,oGet:nPos),)}

And got a error , oGet seems to be nil

So we have to change the method :

Code: Select all  Expand view

if ::bLClicked != nil
# ifdef FRANKDEMONT
  Eval( ::bLClicked, nRow, nCol, nFlags, Self )
# else
  Eval( ::bLClicked )
# endif
endif
 


Then we have the same parameters as in window.prg :

Code: Select all  Expand view

METHOD LButtonDown( nRow, nCol, nKeyFlags ) CLASS TWindow

   if ::bLClicked != nil
      return Eval( ::bLClicked, nRow, nCol, nKeyFlags, Self )
   endif

return nil
 


oGet:bLClicked := {|nRow,nCol,,oGet|IIF(oGet:nPos==1 .AND. "K" $ upper(::oGet:Picture),oGet:Refresh(),)}
Using this block PICTURE "@K" seems to work also when we use the mouse.

Only one problem : When we move in the same get (i.e. from second character to first character) , the K-clausule should not be activated , refresh not called.

Any Idea ?

Frank
demont frank
 
Posts: 167
Joined: Thu Mar 22, 2007 11:24 am

Re: METHOD LButtonDown( nRow, nCol, nFlags ) CLASS TGet

Postby Antonio Linares » Tue Nov 03, 2009 6:25 pm

Frank,

Implemented for next FWH build, thanks :-)

> Only one problem : When we move in the same get

Do you mean using the mouse or the keyboard ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: METHOD LButtonDown( nRow, nCol, nFlags ) CLASS TGet

Postby demont frank » Wed Nov 04, 2009 12:54 pm

Antonio Linares wrote:Frank,

Implemented for next FWH build, thanks :-)

> Only one problem : When we move in the same get

Do you mean using the mouse or the keyboard ?


Only the mouse. The normal beheviour from Picture "@K" in clipper and xharbour is that erasing only occurs when the get receive focus on the first character (mouse). To prevend erasing when only the first character must be changed , we can use arrow right - left arrow . Also when we return in the get with the mouse to the first character , no erasing should be performed (tested in clipper and xharbour)

I have changed method lButtonDown as:

Code: Select all  Expand view

# ifdef FRANKDEMONT
   if ::bLClicked != nil
      Eval( ::bLClicked, nRow, nCol, nFlags, Self )
   endif
   IF ::nPos==1 .AND. "K" $ upper(::cPicture)
      ::Refresh() // Activates erasing get with first character
                       // bLClicked must not be set
   END
# else
   if ::bLClicked != nil
       Eval( ::bLClicked )
   endif
# endif
 


Also keydown is changed to accept Ctrl-Del (erase input field) and Ctrl-U , Undo as in clipper
demont frank
 
Posts: 167
Joined: Thu Mar 22, 2007 11:24 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 54 guests