FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Edit long field in xBrowse
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Edit long field in xBrowse
Posted: Sat Apr 07, 2012 05:28 PM
To All

I have an xbrowse that has some very long charactor fields I need to edit. When I click into the field the entire field length gets hi-lited, yet the actual text in only a few charactors and out of range to the left of the field.

Is there a way to move the cursor to the very left of the field so the data can be seen and edited without having to hit the 'home' key or the user accidentally deleting what is already there ?

Thanks
Rick Lipkin



Clicked into field .. is there a way to programatically go to the beginning of the text ?

Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Edit long field in xBrowse
Posted: Mon Apr 09, 2012 01:43 PM

To All

Just a follow up .. all I want to do when you click into a line and hit Enter is to pass the keystroke __Keyboard( Chr( VK_HOME )) to move the cursor to the beginning of the text.

I found a bOnPostEdit code block but that fires after you hit Enter a second time .. Is there a PrePostEdit block ?? or another way I can move the cursor once you enter a field?

Thanks
Rick Lipkin

Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Edit long field in xBrowse
Posted: Thu Apr 26, 2012 12:40 PM

To All

Just wanted to follow up to see if anyone has an answer .. this field is 250 char long and when you click into the cell to edit the text .. the entire line ( 250 char ) is hi-lited and if anyone errantly struck any key un-knowingly they would delete the entire text.

Any help would be appreciated.

Rick

Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Edit long field in xBrowse
Posted: Thu Apr 26, 2012 01:26 PM
Hello Rick,

using long fields,
maybe it ts a better solution to change fields inside a Dialog.
You can have a small column but display the full fieldlength to edit the field.
There is a sample Rowedit.prg, shows how to do it ( with Save- and Undo-function ).



Best Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Edit long field in xBrowse
Posted: Thu Apr 26, 2012 03:36 PM
Uwe

I have searched several Fwh versions up through 1203 and I can not find RowEdit.prg .. Currently I know how to double click on the row and create dialog box ..

The project I am working on dictates that I mimic the same behavior as this older VB application and all navigation is Excel Style editing where all you do is navigate into the cell and edit. In the picture below .. the cursor only hi-lites the visible text and not the full length of the un-used space in the field.



I am using the very same Access database with the same tables (fields and lengths) as the old legacy program.

There has to be a way to move the cursor to the first character in the cell ( like hitting the home key ) ??

Thanks
Rick Lipkin
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Edit long field in xBrowse
Posted: Thu Apr 26, 2012 03:48 PM
Rick, sorry

the correct sample-name is < xbrowed.prg > ( maybe new, not included yet )
but let*s find a solution for Your problem, keeping celledit.

Best Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Edit long field in xBrowse
Posted: Sat Apr 28, 2012 01:55 PM
To All

With thanks to Rao and Armando .. here is the solution to the long edit string using the bOnPreEdit code block. This takes the cursor to position 0.

Rick Lipkin

Code (fw): Select all Collapse
oLbxB:aCols[5]:bOnPreEdit  := { || __Keyboard( Chr( VK_HOME )) }
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
Re: Edit long field in xBrowse
Posted: Sat Apr 28, 2012 02:52 PM

Thank you very much for sharing.

And how can be done for all columns?.

Muchas gracias. Many thanks.



Un saludo, Best regards,



Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]



Implementando MSVC 2010, FWH64 y ADO.



Abandonando uso xHarbour y SQLRDD.
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Edit long field in xBrowse
Posted: Sat Apr 28, 2012 03:01 PM
Lucas

You have to define your additional row attributes manually .. after you create your browse you can add code blocks to the rows you wish .. like this :

Code (fw): Select all Collapse
 // part number
       oLbxB:aCols[3]:bEditWhen   := { || If(oRsDetail:fields("LockedDown"):Value = .f., .t.,.f.) }
       oLbxB:aCols[3]:bOnPreEdit  := { ||  __Keyboard( Chr( VK_HOME )) }
       oLbxB:aCols[3]:bOnPostEdit := {|o,v| _InvtLook( v, oRsDetail, oRsRepair, "3", oLbxB, lTaxable ) }


Rick Lipkin
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
Re: Edit long field in xBrowse
Posted: Sat Apr 28, 2012 03:19 PM

Rick,

Thank you very much.

I thaugh it was another way to do it for all columns.

Best regards,

Muchas gracias. Many thanks.



Un saludo, Best regards,



Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]



Implementando MSVC 2010, FWH64 y ADO.



Abandonando uso xHarbour y SQLRDD.
Posts: 1335
Joined: Fri Jun 13, 2008 11:04 AM
Re: Edit long field in xBrowse
Posted: Sun Apr 29, 2012 03:23 AM
lucasdebeltran wrote:Rick,

Thank you very much.

I thaugh it was another way to do it for all columns.

Best regards,


Code (fw): Select all Collapse
AEval( oBrw:aCols, { |o| o:bOnPreEdit  := { || __Keyboard( Chr( VK_HOME )) } }


Regards
Anser

 

Continue the discussion