Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community

At 04 FEB 2003 09:00:32PM Mark Ford wrote:

We have designed a window. The window includes an edittable. Data can is entered into each cell of the table. A Lost Focus has been defined to verify the cell data as it is entered. If the data is invalid the original cell value has to be restored. What is the best method to achieve this? Is there an Orig_cell_value Property?


At 05 FEB 2003 03:16AM Oystein Reigem wrote:

Mark,

I use the edit table's GOTFOCUS and POSCHANGED handlers for this purpose. I let the handlers store the value of the current cell in a user-defined property.

In POSCHANGED I program like this:

CellValue=Get_Property( CtrlEntID, "DEFPROP", NextColumn : @FM : NextRow )

UnUsed=Set_Property( CtrlEntID, "@VALUE_AT_ENTRY", CellValue )

A GOTFOCUS handler is necessary because POSCHANGED doesn't happen when the edit table gets focus, only when you change from one cell to another. With GOTFOCUS there are two possibilities. Either (1) GOTFOCUS must do something similar to what the POSCHANGED handler does, or (2) it must fake a POSCHANGED to get POSCHANGED to do the job.

(1):

Pos=Get_Property( CtrlEntID, "SELPOS" )

CellValue=Get_Property( CtrlEntID, "CELLPOS", Pos )

UnUsed=Set_Property( CtrlEntID, "@VALUE_AT_ENTRY", CellValue )

(2):

Forward_Event( PrevFocusID )

if PrevFocusID1, "."=@Window then

Pos=Get_Property( CtrlEntID, "SELPOS" )

Dum=Send_Event( CtrlEntID, "POSCHANGED", Pos, Pos )

end

- Oystein -

View this thread on the forum...

  • third_party_content/community/commentary/forums_nonworks/b2095a6919ed157585256cc4000b093f.txt
  • Last modified: 2023/12/28 07:40
  • by 127.0.0.1