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

Reduces the number of times Edited is set to True.

This commit is contained in:
FellippeHeitor 2018-06-11 00:12:00 -03:00
parent 7429828435
commit 544360170b

View file

@ -293,7 +293,6 @@ SUB __UI_Click (id AS LONG)
AlignMenuDistributeH AlignMenuDistributeH
b$ = MKI$(0) b$ = MKI$(0)
SendData b$, Dummy SendData b$, Dummy
Edited = True
CASE OptionsMenuAutoName CASE OptionsMenuAutoName
AutoNameControls = NOT AutoNameControls AutoNameControls = NOT AutoNameControls
Control(id).Value = AutoNameControls Control(id).Value = AutoNameControls
@ -304,10 +303,8 @@ SUB __UI_Click (id AS LONG)
SaveSettings SaveSettings
CASE EditMenuSetDefaultButton CASE EditMenuSetDefaultButton
SendSignal -6 SendSignal -6
Edited = True
CASE EditMenuRestoreDimensions CASE EditMenuRestoreDimensions
SendSignal -7 SendSignal -7
Edited = True
CASE OptionsMenuSwapButtons CASE OptionsMenuSwapButtons
__UI_MouseButtonsSwap = NOT __UI_MouseButtonsSwap __UI_MouseButtonsSwap = NOT __UI_MouseButtonsSwap
Control(id).Value = __UI_MouseButtonsSwap Control(id).Value = __UI_MouseButtonsSwap
@ -319,11 +316,9 @@ SUB __UI_Click (id AS LONG)
CASE InsertMenuMenuBar CASE InsertMenuMenuBar
b$ = "NEWCONTROL>" + MKI$(__UI_Type_MenuBar) + "<END>" b$ = "NEWCONTROL>" + MKI$(__UI_Type_MenuBar) + "<END>"
PUT #Client, , b$ PUT #Client, , b$
Edited = True
CASE InsertMenuMenuItem CASE InsertMenuMenuItem
b$ = "NEWCONTROL>" + MKI$(__UI_Type_MenuItem) + "<END>" b$ = "NEWCONTROL>" + MKI$(__UI_Type_MenuItem) + "<END>"
PUT #Client, , b$ PUT #Client, , b$
Edited = True
CASE ViewMenuPreviewDetach CASE ViewMenuPreviewDetach
PreviewAttached = NOT PreviewAttached PreviewAttached = NOT PreviewAttached
Control(id).Value = PreviewAttached Control(id).Value = PreviewAttached
@ -346,57 +341,44 @@ SUB __UI_Click (id AS LONG)
AddToggleSwitch AddToggleSwitch
b$ = "NEWCONTROL>" + MKI$(Dummy) + "<END>" b$ = "NEWCONTROL>" + MKI$(Dummy) + "<END>"
PUT #Client, , b$ PUT #Client, , b$
Edited = True
CASE AddNumericBox CASE AddNumericBox
b$ = MKI$(0) b$ = MKI$(0)
SendData b$, 222 SendData b$, 222
Edited = True
CASE Stretch CASE Stretch
b$ = MKI$(Control(id).Value) b$ = MKI$(Control(id).Value)
SendData b$, 14 SendData b$, 14
Edited = True
CASE HasBorder CASE HasBorder
b$ = MKI$(Control(id).Value) b$ = MKI$(Control(id).Value)
SendData b$, 15 SendData b$, 15
Edited = True
CASE Transparent CASE Transparent
b$ = MKI$(Control(Transparent).Value) b$ = MKI$(Control(Transparent).Value)
SendData b$, 28 SendData b$, 28
Edited = True
CASE ShowPercentage CASE ShowPercentage
b$ = MKI$(Control(id).Value) b$ = MKI$(Control(id).Value)
SendData b$, 16 SendData b$, 16
Edited = True
CASE WordWrap CASE WordWrap
b$ = MKI$(Control(id).Value) b$ = MKI$(Control(id).Value)
SendData b$, 17 SendData b$, 17
Edited = True
CASE CanHaveFocus CASE CanHaveFocus
b$ = MKI$(Control(id).Value) b$ = MKI$(Control(id).Value)
SendData b$, 18 SendData b$, 18
Edited = True
CASE ColorPreview CASE ColorPreview
_CLIPBOARD$ = ColorPreviewWord$ _CLIPBOARD$ = ColorPreviewWord$
CASE Disabled CASE Disabled
b$ = MKI$(Control(id).Value) b$ = MKI$(Control(id).Value)
SendData b$, 19 SendData b$, 19
Edited = True
CASE Hidden CASE Hidden
b$ = MKI$(Control(id).Value) b$ = MKI$(Control(id).Value)
SendData b$, 20 SendData b$, 20
Edited = True
CASE CenteredWindow CASE CenteredWindow
b$ = MKI$(Control(id).Value) b$ = MKI$(Control(id).Value)
SendData b$, 21 SendData b$, 21
Edited = True
CASE Resizable CASE Resizable
b$ = MKI$(Control(id).Value) b$ = MKI$(Control(id).Value)
SendData b$, 29 SendData b$, 29
Edited = True
CASE PasswordMaskCB CASE PasswordMaskCB
b$ = MKI$(Control(id).Value) b$ = MKI$(Control(id).Value)
SendData b$, 33 SendData b$, 33
Edited = True
CASE ViewMenuPreview CASE ViewMenuPreview
$IF WIN THEN $IF WIN THEN
SHELL _DONTWAIT ".\InForm\UiEditorPreview.exe " + HostPort SHELL _DONTWAIT ".\InForm\UiEditorPreview.exe " + HostPort
@ -432,10 +414,10 @@ SUB __UI_Click (id AS LONG)
END IF END IF
__UI_Focus = 0 __UI_Focus = 0
Edited = False
LastFormData$ = "" LastFormData$ = ""
Stream$ = "" Stream$ = ""
FormDataReceived = False FormDataReceived = False
Edited = False
SendSignal -5 SendSignal -5
CASE FileMenuSaveFrm CASE FileMenuSaveFrm
SaveForm True, True SaveForm True, True
@ -491,7 +473,6 @@ SUB __UI_Click (id AS LONG)
PrevListValue = Control(ControlList).Value PrevListValue = Control(ControlList).Value
b$ = MKL$(zOrderIDs(Control(ControlList).Value)) + MKL$(zOrderIDs(Control(ControlList).Value - 1)) b$ = MKL$(zOrderIDs(Control(ControlList).Value)) + MKL$(zOrderIDs(Control(ControlList).Value - 1))
SendData b$, 211 SendData b$, 211
Edited = True
_DELAY .1 _DELAY .1
Moving = True: GOSUB ReloadZList Moving = True: GOSUB ReloadZList
Moving = False Moving = False
@ -502,7 +483,6 @@ SUB __UI_Click (id AS LONG)
PrevListValue = Control(ControlList).Value PrevListValue = Control(ControlList).Value
b$ = MKL$(zOrderIDs(Control(ControlList).Value)) + MKL$(zOrderIDs(Control(ControlList).Value + 1)) b$ = MKL$(zOrderIDs(Control(ControlList).Value)) + MKL$(zOrderIDs(Control(ControlList).Value + 1))
SendData b$, 212 SendData b$, 212
Edited = True
_DELAY .1 _DELAY .1
Moving = True: GOSUB ReloadZList Moving = True: GOSUB ReloadZList
Moving = False Moving = False
@ -617,26 +597,21 @@ SUB __UI_Click (id AS LONG)
CASE EditMenuUndo CASE EditMenuUndo
b$ = MKI$(0) b$ = MKI$(0)
SendData b$, 214 SendData b$, 214
Edited = True
CASE EditMenuRedo CASE EditMenuRedo
b$ = MKI$(0) b$ = MKI$(0)
SendData b$, 215 SendData b$, 215
Edited = True
CASE EditMenuCopy CASE EditMenuCopy
b$ = MKI$(0) b$ = MKI$(0)
SendData b$, 217 SendData b$, 217
CASE EditMenuPaste CASE EditMenuPaste
b$ = MKI$(0) b$ = MKI$(0)
SendData b$, 218 SendData b$, 218
Edited = True
CASE EditMenuCut CASE EditMenuCut
b$ = MKI$(0) b$ = MKI$(0)
SendData b$, 219 SendData b$, 219
Edited = True
CASE EditMenuDelete CASE EditMenuDelete
b$ = MKI$(0) b$ = MKI$(0)
SendData b$, 220 SendData b$, 220
Edited = True
CASE EditMenuSelectAll CASE EditMenuSelectAll
b$ = MKI$(0) b$ = MKI$(0)
SendData b$, 221 SendData b$, 221
@ -646,11 +621,9 @@ SUB __UI_Click (id AS LONG)
CASE EditMenuCP437 CASE EditMenuCP437
b$ = MKL$(437) b$ = MKL$(437)
SendData b$, 34 'Encoding SendData b$, 34 'Encoding
Edited = True
CASE EditMenuCP1252 CASE EditMenuCP1252
b$ = MKL$(1252) b$ = MKL$(1252)
SendData b$, 34 'Encoding SendData b$, 34 'Encoding
Edited = True
CASE ViewMenuShowPositionAndSize CASE ViewMenuShowPositionAndSize
__UI_ShowPositionAndSize = NOT __UI_ShowPositionAndSize __UI_ShowPositionAndSize = NOT __UI_ShowPositionAndSize
Control(id).Value = __UI_ShowPositionAndSize Control(id).Value = __UI_ShowPositionAndSize
@ -821,7 +794,6 @@ SUB __UI_MouseUp (id AS LONG)
'Compose a new color and send it to the preview 'Compose a new color and send it to the preview
SendNewRGB SendNewRGB
Caption(StatusBar) = "Color changed." Caption(StatusBar) = "Color changed."
Edited = True
END SELECT END SELECT
END SUB END SUB
@ -1117,12 +1089,10 @@ SUB __UI_BeforeUpdateDisplay
ELSEIF CVI(b$) = -7 THEN ELSEIF CVI(b$) = -7 THEN
'A new empty form has just been created or a file has just finished loading from disk 'A new empty form has just been created or a file has just finished loading from disk
Edited = False Edited = False
ELSEIF CVI(b$) = -8 THEN
'Preview form was resized
Edited = True
ELSEIF CVI(b$) = -9 THEN ELSEIF CVI(b$) = -9 THEN
'User attempted to close the preview form 'User attempted to close the preview form
__UI_Click FileMenuNew __UI_Click FileMenuNew
EXIT SUB
END IF END IF
LOOP LOOP
@ -1155,11 +1125,9 @@ SUB __UI_BeforeUpdateDisplay
IF (__UI_KeyHit = ASC("z") OR __UI_KeyHit = ASC("Z")) AND __UI_CtrlIsDown THEN IF (__UI_KeyHit = ASC("z") OR __UI_KeyHit = ASC("Z")) AND __UI_CtrlIsDown THEN
b$ = MKI$(0) b$ = MKI$(0)
SendData b$, 214 SendData b$, 214
Edited = True
ELSEIF (__UI_KeyHit = ASC("y") OR __UI_KeyHit = ASC("Y")) AND __UI_CtrlIsDown THEN ELSEIF (__UI_KeyHit = ASC("y") OR __UI_KeyHit = ASC("Y")) AND __UI_CtrlIsDown THEN
b$ = MKI$(0) b$ = MKI$(0)
SendData b$, 215 SendData b$, 215
Edited = True
END IF END IF
'Make ZOrdering menu enabled/disabled according to control list 'Make ZOrdering menu enabled/disabled according to control list
@ -2520,7 +2488,6 @@ SUB __UI_KeyPress (id AS LONG)
Caption(StatusBar) = "Ready." Caption(StatusBar) = "Ready."
END IF END IF
END IF END IF
Edited = True
ELSEIF __UI_KeyHit = 32 THEN ELSEIF __UI_KeyHit = 32 THEN
IF id = NameTB THEN IF id = NameTB THEN
__UI_KeyHit = 0 __UI_KeyHit = 0
@ -2534,10 +2501,6 @@ SUB __UI_KeyPress (id AS LONG)
ELSE ELSE
InputBox(GetInputBoxFromID(id)).Sent = False InputBox(GetInputBoxFromID(id)).Sent = False
END IF END IF
CASE AlignOptions
Edited = True
CASE VAlignOptions
Edited = True
END SELECT END SELECT
END SUB END SUB