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 10 OCT 2020 04:48:11AM cmeyer wrote:

Is there a way of putting a cell in edit mode (F2) on the poschanged event when the cell is blank.

There have been many occasions where the user wants to paste into and edit table cell and every time I have to remind the user to press F2 (edit mode) on the highlighted cell before right clicking and paste.

Any advice would be appreciated.

Chris


At 10 OCT 2020 05:04PM Barry Stevens wrote:

Is there a way of putting a cell in edit mode (F2) on the poschanged event when the cell is blank.

There have been many occasions where the user wants to paste into and edit table cell and every time I have to remind the user to press F2 (edit mode) on the highlighted cell before right clicking and paste.

Any advice would be appreciated.

Chris

try:

bEditing = Exec_Method( ctrlEntiD, "BEGINEDIT", colNum, rowNum )


At 10 OCT 2020 05:14PM Carl Pates wrote:

Hi Barry,

That will work for v10 - for v9 it needs direct Windows SendMessage calls:

   equ DTM_EDITCURRCELL$      to ( 1024 + 95 )

   equ DT_BEGINEDIT$          to 1

   equ DT_ENDEDIT$            to 2

   equ DT_ABORTEDIT$          to 3



editCell:

   * // This method puts the current cell into edit mode

   * //

   * // object ->  Name of the edit table

   * // 

   * // param1 ->  EditFlag : TRUE$ (the default) to begin editing, FALSE$ to

   * //            turn off the editing.

   * //

   * // param2 ->  SelectFlag:  If EditFlag is TRUE then setting this argument

   * //            to TRUE turns off the automatic selection of text when the 

   * //            edit table cell is edited

   

   hwndEdt = ps_Get_Property( object, "HANDLE" )

   if hwndEdt then

      if len( param1 ) then

         if param1 then

            editFlag = DT_BEGINEDIT$

         end else

            editFlag = DT_ENDEDIT$

         end

      end else

         editFlag = DT_BEGINEDIT$

      end   

      

      call sendMessage( hwndEdt, DTM_EDITCURRCELL$, editFlag, 0 ) 

      

      if ( editFlag = DT_BEGINEDIT$ ) then

         if param2 then

            call set_Property( object, "SELECTION", 1 : @fm : 0 )

         end

      end

      

   end

   

return

Carl Pates


At 11 OCT 2020 12:06AM cmeyer wrote:

Thanks Carl,

That worked perfectly.

Chris

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/31bce3defd9e43448401c18c0c8f63b5.txt
  • Last modified: 2024/01/04 20:57
  • by 127.0.0.1