Hello Serge,serge_girard wrote:Hello,
When I 'drop' a drawing on the picture it seems OK but when the window/form is minimized and opened again my draw has disappeared Almost like an UNDO...
Any idea how to make it mot disappear?
You should to add your drawing to HMG internal array for painting after minimizing of the window.
Example:
Code: Select all
FUNCTION Draw_Figure()
/*********************/
LOCAL i := GetFormIndex ( 'Win1' )
STATIC struct := {NIL,NIL,NIL,NIL,NIL,NIL}
...
IF lCopy1 .OR. lCopy2 .OR. lCopy3
IF nMouse_Row >= 10 .and. nMouse_Row <= 480 .AND. nMouse_Col >= 100 .AND. nMouse_Col <= 840 // op de foto
IF lCopy1
BT_DrawEllipse (hDC, nMouse_Row-15, nMouse_Col-15, 30, 30, RED, 1)
struct[1] := nMouse_Row-15
struct[2] := nMouse_Col-15
AAdd( _HMG_SYSDATA [ 102 ] [i] , { || BT_DrawEllipse (hDC, struct[1], struct[2], 30, 30, RED, 1) } )
SetProperty('Win1','Label_1', 'Value', ALLTRIM(STR(nMouse_Row)) + ' ' + ALLTRIM(STR(nMouse_Col)) )
lCopy1 := .F.
ENDIF
IF lCopy2
BT_DrawEllipse (hDC, nMouse_Row-15, nMouse_Col-15, 30, 30, GREEN, 1)
struct[3] := nMouse_Row-15
struct[4] := nMouse_Col-15
AAdd( _HMG_SYSDATA [ 102 ] [i] , { || BT_DrawEllipse (hDC, struct[3], struct[4], 30, 30, GREEN, 1) } )
SetProperty('Win1','Label_2', 'Value', ALLTRIM(STR(nMouse_Row)) + ' ' + ALLTRIM(STR(nMouse_Col)) )
lCopy2 := .F.
ENDIF
IF lCopy3
BT_DrawEllipse (hDC, nMouse_Row-30, nMouse_Col-30, 60, 60, ORANGE, 1)
struct[5] := nMouse_Row-30
struct[6] := nMouse_Col-30
AAdd( _HMG_SYSDATA [ 102 ] [i] , { || BT_DrawEllipse (hDC, struct[5], struct[6], 60, 60, ORANGE, 1) } )
SetProperty('Win1','Label_3', 'Value', ALLTRIM(STR(nMouse_Row)) + ' ' + ALLTRIM(STR(nMouse_Col)) )
lCopy3 := .F.
ENDIF
ENDIF
...