Page 1 of 1

xBrowse & Edit Cell

Posted: Thu Sep 03, 2009 2:33 pm
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

Re: xBrowse & Edit Cell

Posted: Fri Sep 04, 2009 11:40 am
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: