Hi Otto
As I see it I think u had the same prob as me a few years back.
People would type a line of text into a memo and then move onto the next task
but it wouldn't trigger a save unless they pressed <Return>.
I solved it as follows
Resource
Code: Select all
EDITTEXT 110, 16, 46, 342, 128, ES_MULTILINE | ES_WANTRETURN | WS_BORDER | WS_VSCROLL | WS_TABSTOP
Added Instance var to MGet
Code: Select all
...
DATA lChanged AS LOGIC INIT .F. // JH 01/07 For saving edits
...
METHOD KeyDown( nKey, nFlags ) CLASS TMultiGet
do case
case ( nKey == VK_INSERT .and. GetKeyState( VK_SHIFT ) ) .or. ;
( nKey == ASC("V") .and. GetKeyState( VK_CONTROL ) ) .or. ;
( nKey == ASC('X') .and. GetKeyState( VK_CONTROL ) )
::lChanged:=.t. // JH 01/07 For saving edits
if !::lReadOnly
CallWindowProc( ::nOldProc, ::hWnd, WM_KEYDOWN, nKey, nFlags )
if ::bChange != nil
Eval( ::bChange, nKey, nFlags, Self )
endif
endif
return 0
case nKey == VK_DELETE
::lChanged:=.t. // JH 01/07 For saving edits
if ::lReadOnly
return 0
endif
if ::bChange != nil
Eval( ::bChange, nKey, nFlags, Self )
endif
endcase
IF nKey>=32 .AND. nKey<127 // JH 01/07 For saving edits
::lChanged:=.t. // JH 01/07 For saving edits
ENDIF // JH 01/07 For saving edits
return Super:KeyDown( nKey, nFlags )
...
My code
Code: Select all
...
REDEFINE GET ::oMemo VAR ::oCreditor:Notes ; // NEED TO PRESS ENTER TO RECORD NEW TEXT
MEMO ;
...
::oMemo:bLostFocus:={|| IIF((::lChanged:=::oMemo:lChanged .OR. ::lChanged), (::oUndo:Enable(), ::oSave:Enable()), NIL) }
...
METHOD SaveIt() CLASS TDlg
IF ::lChanged
...
Maybe this will solve the problem.
The downside is that I have to update MGet each time I upgrade FW.