1
1
Fork 0
mirror of https://github.com/FellippeHeitor/InForm.git synced 2025-01-15 11:59:34 +00:00

Properly reset exchange data when a form is created or open.

This commit is contained in:
FellippeHeitor 2018-06-10 22:54:47 -03:00
parent 876c57a435
commit 5c86170281
2 changed files with 968 additions and 970 deletions

View file

@ -429,9 +429,12 @@ SUB __UI_Click (id AS LONG)
END IF END IF
END IF END IF
SendSignal -5
__UI_Focus = 0 __UI_Focus = 0
Edited = False Edited = False
LastFormData$ = ""
Stream$ = ""
FormDataReceived = False
SendSignal -5
CASE FileMenuSaveFrm CASE FileMenuSaveFrm
SaveForm True, True SaveForm True, True
CASE FileMenuSave CASE FileMenuSave
@ -574,6 +577,10 @@ SUB __UI_Click (id AS LONG)
OpenDialogOpen = False OpenDialogOpen = False
Caption(StatusBar) = "Ready." Caption(StatusBar) = "Ready."
__UI_Focus = 0 __UI_Focus = 0
Edited = False
LastFormData$ = ""
Stream$ = ""
FormDataReceived = False
ELSE ELSE
Answer = MessageBox("File not found.", "", MsgBox_OkOnly + MsgBox_Critical) Answer = MessageBox("File not found.", "", MsgBox_OkOnly + MsgBox_Critical)
Control(FileList).Value = 0 Control(FileList).Value = 0
@ -864,7 +871,7 @@ SUB __UI_BeforeUpdateDisplay
DIM b$, c$, PreviewChanged AS _BYTE, UiEditorFile AS INTEGER DIM b$, c$, PreviewChanged AS _BYTE, UiEditorFile AS INTEGER
DIM PreviewHasMenuActive AS INTEGER, i AS LONG, j AS LONG, Answer AS _BYTE DIM PreviewHasMenuActive AS INTEGER, i AS LONG, j AS LONG, Answer AS _BYTE
STATIC OriginalImageWidth AS INTEGER, OriginalImageHeight AS INTEGER STATIC OriginalImageWidth AS INTEGER, OriginalImageHeight AS INTEGER
STATIC MidRead AS _BYTE, PrevFirstSelected AS LONG STATIC PrevFirstSelected AS LONG
STATIC CheckUpdateDone AS _BYTE STATIC CheckUpdateDone AS _BYTE
STATIC UndoPointer AS INTEGER, TotalUndoImages AS INTEGER STATIC UndoPointer AS INTEGER, TotalUndoImages AS INTEGER
@ -961,8 +968,6 @@ SUB __UI_BeforeUpdateDisplay
CheckPreview CheckPreview
IF NOT MidRead THEN
MidRead = True
DIM incomingData$, Signal$ DIM incomingData$, Signal$
GET #Client, , incomingData$ GET #Client, , incomingData$
@ -1055,7 +1060,11 @@ SUB __UI_BeforeUpdateDisplay
CASE "FORMDATA" CASE "FORMDATA"
LastFormData$ = thisData$ LastFormData$ = thisData$
LoadPreview LoadPreview
IF NOT FormDataReceived THEN
FormDataReceived = True FormDataReceived = True
ELSE
Signal$ = Signal$ + MKI$(-1)
END IF
CASE "UNDOPOINTER" CASE "UNDOPOINTER"
UndoPointer = CVI(thisData$) UndoPointer = CVI(thisData$)
CASE "TOTALUNDOIMAGES" CASE "TOTALUNDOIMAGES"
@ -1960,11 +1969,6 @@ SUB __UI_BeforeUpdateDisplay
PrevColorPropertiesListValue = Control(ColorPropertiesList).Value PrevColorPropertiesListValue = Control(ColorPropertiesList).Value
UpdateColorPreview Control(ColorPropertiesList).Value, ThisColor, ThisBackColor UpdateColorPreview Control(ColorPropertiesList).Value, ThisColor, ThisBackColor
END IF END IF
MidRead = False
'CLOSE #UiEditorFile
END IF
END SUB END SUB
SUB __UI_BeforeUnload SUB __UI_BeforeUnload

View file

@ -29,6 +29,7 @@ REDIM SHARED UndoImage(100) AS STRING
DIM SHARED IsCreating AS _BYTE DIM SHARED IsCreating AS _BYTE
DIM SHARED Host AS LONG, HostPort AS STRING DIM SHARED Host AS LONG, HostPort AS STRING
DIM SHARED Stream$, RestoreCrashData$ DIM SHARED Stream$, RestoreCrashData$
DIM SHARED LastPreviewDataSent$
REDIM SHARED QB64KEYWORDS(0) AS STRING REDIM SHARED QB64KEYWORDS(0) AS STRING
READ_KEYWORDS READ_KEYWORDS
@ -103,7 +104,6 @@ $END IF
'Event procedures: --------------------------------------------------------------- 'Event procedures: ---------------------------------------------------------------
SUB __UI_Click (id AS LONG) SUB __UI_Click (id AS LONG)
SendSignal -1
END SUB END SUB
SUB __UI_MouseEnter (id AS LONG) SUB __UI_MouseEnter (id AS LONG)
@ -437,6 +437,7 @@ SUB __UI_BeforeUpdateDisplay
LoadPreview InDisk LoadPreview InDisk
LoadDefaultFonts LoadDefaultFonts
LastPreviewDataSent$ = ""
UndoPointer = 0 UndoPointer = 0
TotalUndoImages = 0 TotalUndoImages = 0
_ICON _ICON
@ -2357,7 +2358,6 @@ SUB SavePreview (Destination AS _BYTE)
DIM BinFileNum AS INTEGER, TxtFileNum AS INTEGER DIM BinFileNum AS INTEGER, TxtFileNum AS INTEGER
DIM Clip$, Disk AS _BYTE, TCP AS _BYTE, UndoBuffer AS _BYTE DIM Clip$, Disk AS _BYTE, TCP AS _BYTE, UndoBuffer AS _BYTE
DIM PreviewData$ DIM PreviewData$
STATIC LastPreviewDataSent$
CONST Debug = False CONST Debug = False
@ -2709,14 +2709,8 @@ END SUB
SUB SendSignal (Value AS INTEGER) SUB SendSignal (Value AS INTEGER)
DIM b$ DIM b$
'DIM FileNum AS INTEGER, b$
'FileNum = FREEFILE
'OPEN "InForm/UiEditor.dat" FOR BINARY AS #FileNum
'b$ = MKI$(Value): PUT #FileNum, OffsetNewDataFromPreview, b$
b$ = "SIGNAL>" + MKI$(Value) + "<END>" b$ = "SIGNAL>" + MKI$(Value) + "<END>"
PUT #Host, , b$ PUT #Host, , b$
'CLOSE #FileNum
END SUB END SUB
FUNCTION AdaptName$ (tName$, TargetID AS LONG) FUNCTION AdaptName$ (tName$, TargetID AS LONG)