PROP:Edit

Top  Previous  Next

LIST control property which specifies the field equate label of the control to perform edit-in-place for a LIST box column. This is an array whose element number indicates the column number to edit. When non-zero, the control is unhidden and moved/resized over the current row in the column indicated to allow the user to input data. Assign zero to re-hide the data entry control.

Example:

Q   QUEUE

f1   STRING(15)

f2   STRING(15)

       END

Win1 WINDOW('List Edit In Place'),AT(0,1,308,172),SYSTEM

   LIST,AT(6,6,120,90),USE(?List),COLUMN,FORMAT('60L@s15@60L@s15@'),  |

     FROM(Q),ALRT(EnterKey)

      END

?EditEntry EQUATE(100)

CODE

OPEN(Win1)

CREATE(?EditEntry,CREATE:Entry)

SELECT(?List,1)

ACCEPT

 CASE FIELD()

 OF ?List

  CASE EVENT()

  OF EVENT:AlertKey

   IF KEYCODE() = EnterKey

    SETKEYCODE(MouseLeft2)

    POST(EVENT:Accepted,?List)

   END

  OF EVENT:NewSelection

   IF ?List{PROP:edit,?List{PROP:column}}

    GET(Q,CHOICE())

   END

  OF EVENT:Accepted

   IF KEYCODE() = MouseLeft2

    GET(Q,CHOICE())

    ?EditEntry{PROP:text} = ?List{PROPLIST:picture,?List{PROP:column}}

    CASE ?List{PROP:column}

    OF 1

     ?EditEntry{PROP:use} = Q.F1

    OF 2

     ?EditEntry{PROP:use} = Q.F2

    END

    ?List{PROP:edit,?List{PROP:column}} = ?EditEntry

  . .

 OF ?EditEntry

  CASE EVENT()

  OF EVENT:Selected

   ?EditEntry{PROP:Touched} = 1

  OF EVENT:Accepted

   PUT(Q)

   ?List{PROP:edit,?List{PROP:column}} = 0

. . .