Edit long field in xBrowse

Edit long field in xBrowse

Postby Rick Lipkin » Sat Apr 07, 2012 5: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

Image

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

Image
Last edited by Rick Lipkin on Thu Apr 26, 2012 12:40 pm, edited 1 time in total.
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Edit long field in xBrowse

Postby Rick Lipkin » Mon Apr 09, 2012 1: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
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Edit long field in xBrowse

Postby Rick Lipkin » 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
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Edit long field in xBrowse

Postby ukoenig » Thu Apr 26, 2012 1: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 ).

Image

Best Regards
Uwe :?:
Last edited by ukoenig on Thu Apr 26, 2012 3:37 pm, edited 1 time in total.
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Edit long field in xBrowse

Postby Rick Lipkin » Thu Apr 26, 2012 3: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.

Image

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
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Edit long field in xBrowse

Postby ukoenig » Thu Apr 26, 2012 3: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 :lol:
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Edit long field in xBrowse

Postby Rick Lipkin » Sat Apr 28, 2012 1: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: Select all  Expand view

oLbxB:aCols[5]:bOnPreEdit  := { || __Keyboard( Chr( VK_HOME )) }
 
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Edit long field in xBrowse

Postby lucasdebeltran » Sat Apr 28, 2012 2: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.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: Edit long field in xBrowse

Postby Rick Lipkin » Sat Apr 28, 2012 3: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: Select all  Expand view

 // 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
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Edit long field in xBrowse

Postby lucasdebeltran » Sat Apr 28, 2012 3: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.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: Edit long field in xBrowse

Postby anserkk » Sun Apr 29, 2012 3:23 am

lucasdebeltran wrote:Rick,

Thank you very much.

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

Best regards,


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


Regards
Anser

 
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 104 guests