Emulate F2 function key in edit table. (OpenInsight 32-Bit)
At 20 FEB 2011 06:19:43AM Chris Meyer wrote:
How does one program the pressing of the F2 function key on the poschanged event in an edit table. This is the avoid the user having to press the F2 function key to paste text into en edit table cell.
TIA
Chris
At 20 FEB 2011 01:08PM Barry Stevens wrote:
On the PosChanged event…..call this at the appropriate colpos's
0001 function bsbs_EditCell(CtrlEntID, EditMode) 0002 0003 declare function Get_Property, SendMessage, GetAsyncKeyState, Send_Message 0004 declare subroutine Yield 0005 0006 $insert Logical 0007 0008 *bsbs 17/11 0009 SelPos=get_property(CtrlEntId,"SELPOS") 0010 CellValue=get_property(CtrlEntId,"DEFPROP",SelPos) 0011 Col=SelPos<1> 0012 Curstyle=Send_Message(CtrlEntID,"COLSTYLE",Col,"") 0013 if BITAND(Curstyle,8) then return 0 0014 0015 equ WM_USER$ to 1024 0016 equ&nb
sp;DTM_EDITCURCELL$ to WM_USER$ + 95 0017 equ TAB$ to 9 0018 0019 equ DT_BEGINEDIT$ to 1 ;* begin edit mode 0020 equ DT_ENDEDIT$ to 2 ;* end the edit 0021 equ DT_ABORTEDIT$ to 3 ;* Esc will undo changes 0022 0023 * get the window handle for the edit table 0024 hTable = Get_Property(CtrlEntID, 'HANDLE') 0025 if hTable else 0026 return FALSE$ 0027 end 0028 0029 * the DTM_EDITCURCELL$ message is used to toggle the 0030 * edit table's edit mode 0031 Message = DTM_EDITCURCELL$ 0032 0033 * default to edit mode 0034 if assigned(EditMode) else EditMode = "" 0035 if len(EditMode) else EditMode = DT_BEGINEDIT$ 0036 0037 * if the user is tabbing, wait until they release the tab key 0038 loop 0039 while bitand(GetAsyncKeyState(TAB$), 32768) 0040 Yield() 0041 repeat 0042 Yield() 0043 0044 if EditMode = DT_BEGINEDIT$ then 0045 * first exit then re-enter edit mode 0046 Result = SendMessage(hTable, Message, DT_ENDEDIT$ , 0) 0047 *bsbs 0048 if CellValue then 0049 Result = SendMessage(hTable, Message, DT_BEGINEDIT$, 0) 0050 end 0051 end else 0052 Result = SendMessage(hTable, Message, EditMode, 0) 0053 end 0054 0055 return Result
At 20 FEB 2011 01:09PM Barry Stevens wrote:
Oh Crap!…now what was that wrapper.
At 20 FEB 2011 01:15PM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:
http://www.revelation.com/__85256DC1002A4A9E.nsf/0/80883C37DFC4E743852575F3004EC69B?Open
World leaders in all things RevSoft
At 20 FEB 2011 01:17PM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:
Whoops - meant to be in response to DIR post sorry.
World leaders in all things RevSoft
At 20 FEB 2011 01:18PM Barry Stevens wrote:
Poschanged event. call this at the apropriate colpos
0001 function bsbs_EditCell(CtrlEntID, EditMode) 0002 0003 declare function Get_Property, SendMessage, GetAsyncKeyState, Send_Message 0004 declare subroutine Yield 0005 0006 $insert Logical 0007 0008 *bsbs 17/11 0009 SelPos=get_property(CtrlEntId,"SELPOS") 0010 CellValue=get_property(CtrlEntId,"DEFPROP",SelPos) 0011 Col=SelPos<1> 0012 Curstyle=Send_Message(CtrlEntID,"COLSTYLE",Col,"") 0013 if BITAND(Curstyle,8) then return 0 0014 0015 equ WM_USER$ to 1024 0016 equ&n
bsp;DTM_EDITCURCELL$ to WM_USER$ + 95 0017 equ TAB$ to 9 0018 0019 equ DT_BEGINEDIT$ to 1 ;* begin edit mode 0020 equ DT_ENDEDIT$ to 2 ;* end the edit 0021 equ DT_ABORTEDIT$ to 3 ;* Esc will undo changes 0022 0023 * get the window handle for the edit table 0024 hTable = Get_Property(CtrlEntID, 'HANDLE') 0025 if hTable else 0026 return FALSE$ 0027 end 0028 0029 * the DTM_EDITCURCELL$ message is used to toggle the 0030 * edit table's edit mode 0031 Message = DTM_EDITCURCELL$ 0032 0033 * default to edit mode 0034 if assigned(EditMode) else EditMode = "" 0035 if len(EditMode) else EditMode = DT_BEGINEDIT$ 0036 0037 * if the user is tabbing, wait until they release the tab key 0038 loop 0039 while bitand(GetAsyncKeyState(TAB$), 32768) 0040 Yield() 0041 repeat 0042 Yield() 0043 0044 if EditMode = DT_BEGINEDIT$ then 0045 * first exit then re-enter edit mode 0046 Result = SendMessage(hTable, Message, DT_ENDEDIT$ , 0) 0047 *bsbs 0048 if CellValue then 0049 Result = SendMessage(hTable, Message, DT_BEGINEDIT$, 0) 0050 end0051 end else 0052 Result = SendMessage(hTable, Message, EditMode, 0) 0053 end 0054 0055 return Result
At 20 FEB 2011 01:19PM Barry Stevens wrote:
Yeh, buzz off…
At 20 FEB 2011 03:21PM Barry Stevens wrote:
Chris, I have emailed you the source code.