FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour METHOD LButtonDown( nRow, nCol, nFlags ) CLASS TGet
Posts: 167
Joined: Thu Mar 22, 2007 11:24 AM
METHOD LButtonDown( nRow, nCol, nFlags ) CLASS TGet
Posted: Mon Nov 02, 2009 03: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 (fw): Select all Collapse
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 (fw): Select all Collapse
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(::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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: METHOD LButtonDown( nRow, nCol, nFlags ) CLASS TGet
Posted: Tue Nov 03, 2009 06: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
Posts: 167
Joined: Thu Mar 22, 2007 11:24 AM
Re: METHOD LButtonDown( nRow, nCol, nFlags ) CLASS TGet
Posted: 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 (fw): Select all Collapse
# 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

Continue the discussion