Edit the cell of xBrowse

Edit the cell of xBrowse

Postby Natter » Thu Apr 20, 2017 3: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 ?
Natter
 
Posts: 1119
Joined: Mon May 14, 2007 9:49 am

Re: Edit the cell of xBrowse

Postby nageswaragunupudi » Thu Apr 20, 2017 3:07 pm

Is it possible to activate editing a cell, not a double click, and keystroke on the keyboard ?

Yes.
Either set
Code: Select all  Expand view
oBrw:lFastEdit := .t.

or
create XBROWSE with clause FASTEDIT.

In this case, keystroke will invoke edit just Excel
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10241
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Edit the cell of xBrowse

Postby Natter » Thu Apr 20, 2017 3: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
Natter
 
Posts: 1119
Joined: Mon May 14, 2007 9:49 am

Re: Edit the cell of xBrowse

Postby nageswaragunupudi » Thu Apr 20, 2017 5: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: Select all  Expand view
oCol:bLDClickData := { || nil }


To prevent EnterKey from invoking edit
Code: Select all  Expand view
oBrw:lEnterKey2Edit := .f.


If we want F2 key to invoke edit like Excel
Code: Select all  Expand view
oBrw:lF2KeyToEdit := .t.


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

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10241
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Edit the cell of xBrowse

Postby Natter » Thu Apr 20, 2017 7: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 ?
Natter
 
Posts: 1119
Joined: Mon May 14, 2007 9:49 am

Re: Edit the cell of xBrowse

Postby nageswaragunupudi » Fri Apr 21, 2017 2: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
User avatar
nageswaragunupudi
 
Posts: 10241
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

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