xBrowse & Edit Cell

Post Reply
Loach
Posts: 41
Joined: Thu Dec 22, 2005 7:39 am
Location: Gomel, Belarus

xBrowse & Edit Cell

Post by Loach »

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: Select all

   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
Loach
Posts: 41
Joined: Thu Dec 22, 2005 7:39 am
Location: Gomel, Belarus

Re: xBrowse & Edit Cell

Post by Loach »

So... I made it by changing this string in the end of method Edit(nKey) in class TXBrwColumn:
Instead

Code: Select all

        if nKey != nil
          PostMessage( ::oEditGet:hWnd, WM_CHAR, nKey )
       endif
 
I put:

Code: Select all

    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? :roll:
Best regards!
Sergey (Loach) Abelev
fwh 9.04/xHarbour 1.2.1 (Rev. 6406)/Bcc55
Post Reply