FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xBrowse & Edit Cell
Posts: 41
Joined: Thu Dec 22, 2005 07:39 AM

xBrowse & Edit Cell

Posted: Thu Sep 03, 2009 02:33 PM
Hi!
It's necessary for me, that cell editing in some xBrowse cells started with the end of value of a cell.
(User input the address. He selects street from the another browse, then the pointer in a cell has to go on the end of streets name, and then the user input house and apartment numbers)
I tried :
Code (fw): Select all Collapse
   oBrw:aCols[ 6 ]:bEditWhen:={|uVal,self,nkey|(SelectStreet(@uVal,@nkey),oBrw:aCols[ 6 ]:Edit(VK_END),.F.)}

   Function SelectStreet(uVal,nkey)
         ...
         uVal:=oemtoansi(ALLTRIM(street->NAMES))+space(30)
   return .t.

but it doesn't work...
How can I make it?

Thank's
Best regards!

Sergey (Loach) Abelev

fwh 9.04/xHarbour 1.2.1 (Rev. 6406)/Bcc55
Posts: 41
Joined: Thu Dec 22, 2005 07:39 AM

Re: xBrowse & Edit Cell

Posted: Fri Sep 04, 2009 11:40 AM
So... I made it by changing this string in the end of method Edit(nKey) in class TXBrwColumn:
Instead
Code (fw): Select all Collapse
        if nKey != nil
          PostMessage( ::oEditGet:hWnd, WM_CHAR, nKey )
       endif

I put:
Code (fw): Select all Collapse
    if nKey != nil
       if !GetKeyState( VK_SHIFT ).and.(nKey IN {VK_END,VK_HOME})
          PostMessage( ::oEditGet:hWnd, WM_KEYDOWN, nKey )
       else
          PostMessage( ::oEditGet:hWnd, WM_CHAR, nKey )
       endif
    endif

In that case the code above (in first post) is work fine. But I don't know, is this way correct? :-)
Best regards!

Sergey (Loach) Abelev

fwh 9.04/xHarbour 1.2.1 (Rev. 6406)/Bcc55

Continue the discussion