Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

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:

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.

The Sprezzatura Group

The Sprezzatura Blog

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.

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/b21e4154eff4bc178525783d003e3afd.txt
  • Last modified: 2023/12/30 11:57
  • by 127.0.0.1