FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour question about xBrowse and Fastedit
Posts: 417
Joined: Tue Feb 23, 2010 03:09 PM
question about xBrowse and Fastedit
Posted: Fri Jul 15, 2011 09:10 AM
Hello,

I want to set on Fast Edit to edit a cell by pressing Enter.

But if I press double click, I want to execute an action:

Code (fw): Select all Collapse
   oBrw:blDblClick := { || msgalert("my function") }


   oBrw:nEditTypes := EDIT_GET  // insert this line
   oBrw:lFastEdit := .t.



But if I set fastedit to .f. blDblClick is ignored.

How is possible to work as I need?.

Thank you.
FWH 11.11, Harbour 3.1 and Borland C++ 5.82
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: question about xBrowse and Fastedit
Posted: Fri Jul 15, 2011 09:34 AM
I want to set on Fast Edit to edit a cell by pressing Enter.

Enter key any way triggers edit, whether fast edit is set to true or not if the column's nEditType > 0

if I press double click, I want to execute an action:

oCol:bLDClickData := { |r,c,f,oCol| YourAction( r,c,f,oCol ) }
This codeblock gets executed when the user double clicks on any cell of the column, whether the cell is editable or not and whether fastedit is true or not.
Note: oBrw:blDblClick is not recommended way in xbrowse, though it works. Instead we better set the columns' bLDClickData.
Regards



G. N. Rao.

Hyderabad, India
Posts: 417
Joined: Tue Feb 23, 2010 03:09 PM
Re: question about xBrowse and Fastedit
Posted: Fri Jul 15, 2011 09:57 AM

Thank you for so quick reply.

I define the xBrowse

@ 0,0 XBROWSE oBrw OF oWnd AUTOCOLS ALIAS "CUSTOMER" CELL LINES

I insert:
oBrw:nEditTypes := EDIT_GET // insert this line
oBrw:lFastEdit := .t.

So when I press enter, I edit the field. If I press enter again, I move to next field.

That is perfect.

But if I double click on wtahtever field, I need to invoke my action.

So that is why I used oBrw:blDblClick

But it is ignored. Double click edits the field. I want to invoke my function.

Is it possible?.

Thank you very much!!

FWH 11.11, Harbour 3.1 and Borland C++ 5.82
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: question about xBrowse and Fastedit
Posted: Fri Jul 15, 2011 10:32 AM
So that is why I used oBrw:blDblClick

But it is ignored. Double click edits the field. I want to invoke my function.

That is what I advised you about in my previous post.

Please do not use oBrw:bLDblClick. This is not the preferred way of specifying double click action for xbrowse.

If you want a specific double click action for specific columns, you use
oCol:bLDClickData := { |nRow,nCol,nFlags,oColObject| your function(...)}

If you want the same action for all columns, then
oBrw:bLDClickDatas := { |nRow,nCol,nFlags,oColObject| your function(...)}
Regards



G. N. Rao.

Hyderabad, India
Posts: 417
Joined: Tue Feb 23, 2010 03:09 PM
Re: question about xBrowse and Fastedit
Posted: Fri Jul 15, 2011 10:48 AM

Thanks a lot, it works perfect.

I see that there are old features that should not be used.

Please, when you have time it will be very interesing a fixed topic about best practices with xBrowse, shown at the top of forums (like How to do my question?).

Thanks again.

FWH 11.11, Harbour 3.1 and Borland C++ 5.82

Continue the discussion