FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Edit the cell of xBrowse
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Edit the cell of xBrowse
Posted: Thu Apr 20, 2017 03:00 PM

Hi, all !

XBrowse column is of type :nEditType:= EDIT_GET
Standard GET-object editing is invoked by double-clicking. Is it possible to activate editing a cell, not a double click, and keystroke on the keyboard ?

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Edit the cell of xBrowse
Posted: Thu Apr 20, 2017 03:07 PM
Is it possible to activate editing a cell, not a double click, and keystroke on the keyboard ?

Yes.
Either set
Code (fw): Select all Collapse
oBrw:lFastEdit := .t.

or
create XBROWSE with clause FASTEDIT.

In this case, keystroke will invoke edit just Excel
Regards



G. N. Rao.

Hyderabad, India
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: Edit the cell of xBrowse
Posted: Thu Apr 20, 2017 03:38 PM

Yes, I did lFirstEdit:=.T. But I don't understand how you can prevent the double click and enter your key combination to activate the edit

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Edit the cell of xBrowse
Posted: Thu Apr 20, 2017 05:09 PM
Natter wrote:Yes, I did lFirstEdit:=.T. But I don't understand how you can prevent the double click and enter your key combination to activate the edit


It is rather unusual requirement. But, ...

Not to invoke edit when double click
Code (fw): Select all Collapse
oCol:bLDClickData := { || nil }


To prevent EnterKey from invoking edit
Code (fw): Select all Collapse
oBrw:lEnterKey2Edit := .f.


If we want F2 key to invoke edit like Excel
Code (fw): Select all Collapse
oBrw:lF2KeyToEdit := .t.


If we want a key combination Eg. Ctrl-E to invoke edit
Code (fw): Select all Collapse
oCol:bKeyChar      := { |k| If( k == 5, oCol:Edit(), nil ) }
Regards



G. N. Rao.

Hyderabad, India
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: Edit the cell of xBrowse
Posted: Thu Apr 20, 2017 07:09 PM

Thank You, Mr. Rao. This is what you need !

Another question - can I handle the event of movement of the mouse cursor on the header of xBrowse ?

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Edit the cell of xBrowse
Posted: Fri Apr 21, 2017 02:35 AM

You can handle mouse movement by assigning oBrw:bMMoved := { |nRow, nCol, nFlags| <yourfunc>( nRow, nCol, nFlags ) }
Within your function you can check if nRow < oBrw:nHeaderHeight to check if the mouse is on header.

Regards



G. N. Rao.

Hyderabad, India

Continue the discussion