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

UiEditor will now incrementally add new controls to the .bas source too.

Up until v1.2, overwriting an existing .bas/.frm project would result in 2 extra backup files and the code in the .bas would remain unaltered - that is, the DIM SHARED block with control declarations would be adapted but all SELECT CASE blocks would lack the new controls added since the last edits.

With this patch the existing .bas file is considered and SELECT CASE blocks are also updated with newly added controls.
This commit is contained in:
FellippeHeitor 2020-11-01 02:42:06 -03:00
parent f56ada72cc
commit 8a279744ef
2 changed files with 237 additions and 137 deletions

View file

@ -1110,7 +1110,7 @@ SUB __UI_UpdateDisplay
EXIT SUB EXIT SUB
END IF END IF
ON ERROR GOTO __UI_ErrorHandler 'ON ERROR GOTO __UI_ErrorHandler
'Clear frames canvases and count its children; 'Clear frames canvases and count its children;
FOR i = 1 TO UBOUND(Control) FOR i = 1 TO UBOUND(Control)

View file

@ -4251,10 +4251,8 @@ SUB SaveForm (ExitToQB64 AS _BYTE, SaveOnlyFrm AS _BYTE)
CLOSE #TextFileNum CLOSE #TextFileNum
IF i = 1 THEN IF i = 1 THEN
IF INSTR(b$, "': Event procedures: ---------------------------------------------------------------") > 0 THEN BackupCode$ = Replace$(b$, CHR$(13) + CHR$(10), CHR$(10), 0, 0)
BackupCode$ = MID$(b$, INSTR(b$, "': Event procedures: ---------------------------------------------------------------")) PreserveBackup = True
PreserveBackup = True
END IF
END IF END IF
END IF END IF
NEXT NEXT
@ -4350,17 +4348,17 @@ SUB SaveForm (ExitToQB64 AS _BYTE, SaveOnlyFrm AS _BYTE)
IF LEN(PreviewTexts(i)) > 0 THEN IF LEN(PreviewTexts(i)) > 0 THEN
SELECT CASE PreviewControls(i).Type SELECT CASE PreviewControls(i).Type
CASE __UI_Type_ListBox, __UI_Type_DropdownList CASE __UI_Type_ListBox, __UI_Type_DropdownList
DIM TempCaption$, TempText$, FindLF&, ThisItem%, ThisItemTop% DIM TempCaption$, TempText$, ThisItem%, ThisItemTop%
DIM LastVisibleItem AS INTEGER DIM LastVisibleItem AS INTEGER, findLF&
TempText$ = PreviewTexts(i) TempText$ = PreviewTexts(i)
ThisItem% = 0 ThisItem% = 0
DO WHILE LEN(TempText$) DO WHILE LEN(TempText$)
ThisItem% = ThisItem% + 1 ThisItem% = ThisItem% + 1
FindLF& = INSTR(TempText$, CHR$(10)) findLF& = INSTR(TempText$, CHR$(10))
IF FindLF& THEN IF findLF& THEN
TempCaption$ = LEFT$(TempText$, FindLF& - 1) TempCaption$ = LEFT$(TempText$, findLF& - 1)
TempText$ = MID$(TempText$, FindLF& + 1) TempText$ = MID$(TempText$, findLF& + 1)
ELSE ELSE
TempCaption$ = TempText$ TempCaption$ = TempText$
TempText$ = "" TempText$ = ""
@ -4561,143 +4559,245 @@ SUB SaveForm (ExitToQB64 AS _BYTE, SaveOnlyFrm AS _BYTE)
PRINT #TextFileNum, "END SUB" PRINT #TextFileNum, "END SUB"
CLOSE #TextFileNum CLOSE #TextFileNum
IF NOT SaveOnlyFrm THEN IF NOT SaveOnlyFrm THEN
OPEN BaseOutputFileName + ".bas" FOR OUTPUT AS #TextFileNum
PRINT #TextFileNum, "': This program uses"
PRINT #TextFileNum, "': InForm - GUI library for QB64 - "; __UI_Version
PRINT #TextFileNum, "': Fellippe Heitor, " + __UI_CopyrightSpan + " - fellippe@qb64.org - @fellippeheitor"
PRINT #TextFileNum, "': https://github.com/FellippeHeitor/InForm"
PRINT #TextFileNum, "'-----------------------------------------------------------"
PRINT #TextFileNum,
PRINT #TextFileNum, "': Controls' IDs: ------------------------------------------------------------------"
IF PreserveBackup THEN IF PreserveBackup THEN
PRINT #TextFileNum, "REM NOTICE: THIS FORM HAS BEEN RECENTLY EDITED" DIM insertionPoint AS LONG, endPoint AS LONG, firstCASE AS LONG
PRINT #TextFileNum, "'>> The controls in the list below may have been added or renamed," DIM temp$, thisBlock$, addedCASES$, indenting AS LONG
PRINT #TextFileNum, "'>> and previously existing controls may have been deleted since"
PRINT #TextFileNum, "'>> this program's structure was first generated."
PRINT #TextFileNum, "'>> Make sure to check your code in the events SUBs so that"
PRINT #TextFileNum, "'>> you can take your recent edits into consideration."
PRINT #TextFileNum, "': ---------------------------------------------------------------------------------"
END IF
FOR i = 1 TO UBOUND(PreviewControls)
IF PreviewControls(i).ID > 0 AND PreviewControls(i).Type <> __UI_Type_Font AND PreviewControls(i).Type <> __UI_Type_MenuPanel THEN
PRINT #TextFileNum, "DIM SHARED " + RTRIM$(__UI_TrimAt0$(PreviewControls(i).Name)) + " AS LONG"
END IF
NEXT
PRINT #TextFileNum,
PRINT #TextFileNum, "': External modules: ---------------------------------------------------------------"
IF AddGifExtension THEN
PRINT #TextFileNum, "'$INCLUDE:'InForm\extensions\gifplay.bi'"
END IF
PRINT #TextFileNum, "'$INCLUDE:'InForm\InForm.ui'"
PRINT #TextFileNum, "'$INCLUDE:'InForm\xp.uitheme'"
PRINT #TextFileNum, "'$INCLUDE:'" + MID$(BaseOutputFileName, LEN(CurrentPath$) + 2) + ".frm'"
IF AddGifExtension THEN
PRINT #TextFileNum, "'$INCLUDE:'InForm\extensions\gifplay.bm'"
END IF
PRINT #TextFileNum,
IF PreserveBackup THEN
PRINT #TextFileNum, BackupCode$
GOTO BackupRestored
END IF
PRINT #TextFileNum, "': Event procedures: ---------------------------------------------------------------"
FOR i = 0 TO 14
SELECT EVERYCASE i
CASE 0: PRINT #TextFileNum, "SUB __UI_BeforeInit"
CASE 1: PRINT #TextFileNum, "SUB __UI_OnLoad"
CASE 2
PRINT #TextFileNum, "SUB __UI_BeforeUpdateDisplay"
PRINT #TextFileNum, " 'This event occurs at approximately 30 frames per second."
PRINT #TextFileNum, " 'You can change the update frequency by calling SetFrameRate DesiredRate%"
CASE 3
PRINT #TextFileNum, "SUB __UI_BeforeUnload"
PRINT #TextFileNum, " 'If you set __UI_UnloadSignal = False here you can"
PRINT #TextFileNum, " 'cancel the user's request to close."
CASE 4: PRINT #TextFileNum, "SUB __UI_Click (id AS LONG)"
CASE 5: PRINT #TextFileNum, "SUB __UI_MouseEnter (id AS LONG)"
CASE 6: PRINT #TextFileNum, "SUB __UI_MouseLeave (id AS LONG)"
CASE 7: PRINT #TextFileNum, "SUB __UI_FocusIn (id AS LONG)"
CASE 8
PRINT #TextFileNum, "SUB __UI_FocusOut (id AS LONG)"
PRINT #TextFileNum, " 'This event occurs right before a control loses focus."
PRINT #TextFileNum, " 'To prevent a control from losing focus, set __UI_KeepFocus = True below."
CASE 9: PRINT #TextFileNum, "SUB __UI_MouseDown (id AS LONG)"
CASE 10: PRINT #TextFileNum, "SUB __UI_MouseUp (id AS LONG)"
CASE 11
PRINT #TextFileNum, "SUB __UI_KeyPress (id AS LONG)"
PRINT #TextFileNum, " 'When this event is fired, __UI_KeyHit will contain the code of the key hit."
PRINT #TextFileNum, " 'You can change it and even cancel it by making it = 0"
CASE 12: PRINT #TextFileNum, "SUB __UI_TextChanged (id AS LONG)"
CASE 13: PRINT #TextFileNum, "SUB __UI_ValueChanged (id AS LONG)"
CASE 14: PRINT #TextFileNum, "SUB __UI_FormResized"
CASE 0, 3, 14 'Find insertion points in BackupCode$ for eventual new controls
PRINT #TextFileNum, '1- Controls' IDs
insertionPoint = INSTR(BackupCode$, "DIM SHARED ")
CASE 1 FOR i = 1 TO UBOUND(PreviewControls)
IF PreviewDefaultButtonID > 0 THEN IF PreviewControls(i).ID > 0 AND PreviewControls(i).Type <> __UI_Type_Font AND PreviewControls(i).Type <> __UI_Type_MenuPanel THEN
PRINT #TextFileNum, " __UI_DefaultButtonID = " + RTRIM$(__UI_TrimAt0$(PreviewControls(PreviewDefaultButtonID).Name)) temp$ = "DIM SHARED " + RTRIM$(__UI_TrimAt0$(PreviewControls(i).Name)) + " AS LONG"
ELSE IF INSTR(BackupCode$, temp$) = 0 THEN
PRINT #TextFileNum, BackupCode$ = LEFT$(BackupCode$, insertionPoint - 1) + temp$ + CHR$(10) + MID$(BackupCode$, insertionPoint)
END IF END IF
END IF
NEXT
CASE 2 '2- Even procedures
IF AddGifExtension = True AND TotalGifLoaded > 0 THEN FOR i = 4 TO 13
SELECT EVERYCASE i
CASE 4: temp$ = "SUB __UI_Click (id AS LONG)"
CASE 5: temp$ = "SUB __UI_MouseEnter (id AS LONG)"
CASE 6: temp$ = "SUB __UI_MouseLeave (id AS LONG)"
CASE 7: temp$ = "SUB __UI_FocusIn (id AS LONG)"
CASE 8: temp$ = "SUB __UI_FocusOut (id AS LONG)"
CASE 9: temp$ = "SUB __UI_MouseDown (id AS LONG)"
CASE 10: temp$ = "SUB __UI_MouseUp (id AS LONG)"
CASE 11: temp$ = "SUB __UI_KeyPress (id AS LONG)"
CASE 12: temp$ = "SUB __UI_TextChanged (id AS LONG)"
CASE 13: temp$ = "SUB __UI_ValueChanged (id AS LONG)"
CASE 4 TO 13
insertionPoint = INSTR(BackupCode$, temp$)
endPoint = INSTR(insertionPoint, BackupCode$, "END SUB" + CHR$(10)) + 8
thisBlock$ = MID$(BackupCode$, insertionPoint, endPoint - insertionPoint)
CASE 4 TO 6, 9, 10 'All controls except for Menu panels, and internal context menus
IF INSTR(thisBlock$, "SELECT CASE id") THEN
firstCASE = _INSTRREV(INSTR(thisBlock$, " CASE "), thisBlock$, CHR$(10))
indenting = INSTR(firstCASE, thisBlock$, "CASE ") - firstCASE - 1
addedCASES$ = ""
IF firstCASE = 0 THEN firstCASE = INSTR(thisBlock$, " SELECT CASE id") + 2
FOR Dummy = 1 TO UBOUND(PreviewControls)
IF PreviewControls(Dummy).ID > 0 AND PreviewControls(Dummy).Type <> __UI_Type_Font AND PreviewControls(Dummy).Type <> __UI_Type_ContextMenu THEN
IF INSTR(thisBlock$, " CASE " + RTRIM$(PreviewControls(Dummy).Name) + CHR$(10)) = 0 THEN
addedCASES$ = addedCASES$ + SPACE$(indenting) + "CASE " + RTRIM$(PreviewControls(Dummy).Name) + CHR$(10) + CHR$(10)
END IF
END IF
NEXT
IF LEN(addedCASES$) THEN
thisBlock$ = LEFT$(thisBlock$, firstCASE) + addedCASES$ + MID$(thisBlock$, firstCASE + 1)
END IF
END IF
BackupCode$ = LEFT$(BackupCode$, insertionPoint - 1) + thisBlock$ + MID$(BackupCode$, endPoint)
CASE 7, 8, 11 'Controls that can have focus only
IF INSTR(thisBlock$, "SELECT CASE id") THEN
firstCASE = _INSTRREV(INSTR(thisBlock$, " CASE "), thisBlock$, CHR$(10))
indenting = INSTR(firstCASE, thisBlock$, "CASE ") - firstCASE - 1
addedCASES$ = ""
IF firstCASE = 0 THEN firstCASE = INSTR(thisBlock$, " SELECT CASE id") + 2
FOR Dummy = 1 TO UBOUND(PreviewControls)
IF PreviewControls(Dummy).ID > 0 AND PreviewControls(Dummy).CanHaveFocus THEN
IF INSTR(thisBlock$, " CASE " + RTRIM$(PreviewControls(Dummy).Name) + CHR$(10)) = 0 THEN
addedCASES$ = addedCASES$ + SPACE$(indenting) + "CASE " + RTRIM$(PreviewControls(Dummy).Name) + CHR$(10) + CHR$(10)
END IF
END IF
NEXT
IF LEN(addedCASES$) THEN
thisBlock$ = LEFT$(thisBlock$, firstCASE) + addedCASES$ + MID$(thisBlock$, firstCASE + 1)
END IF
END IF
BackupCode$ = LEFT$(BackupCode$, insertionPoint - 1) + thisBlock$ + MID$(BackupCode$, endPoint)
CASE 12 'Text boxes
IF INSTR(thisBlock$, "SELECT CASE id") THEN
firstCASE = _INSTRREV(INSTR(thisBlock$, " CASE "), thisBlock$, CHR$(10))
indenting = INSTR(firstCASE, thisBlock$, "CASE ") - firstCASE - 1
addedCASES$ = ""
IF firstCASE = 0 THEN firstCASE = INSTR(thisBlock$, " SELECT CASE id") + 2
FOR Dummy = 1 TO UBOUND(PreviewControls)
IF PreviewControls(Dummy).ID > 0 AND (PreviewControls(Dummy).Type = __UI_Type_TextBox) THEN
IF INSTR(thisBlock$, " CASE " + RTRIM$(PreviewControls(Dummy).Name) + CHR$(10)) = 0 THEN
addedCASES$ = addedCASES$ + SPACE$(indenting) + "CASE " + RTRIM$(PreviewControls(Dummy).Name) + CHR$(10) + CHR$(10)
END IF
END IF
NEXT
IF LEN(addedCASES$) THEN
thisBlock$ = LEFT$(thisBlock$, firstCASE) + addedCASES$ + MID$(thisBlock$, firstCASE + 1)
END IF
END IF
BackupCode$ = LEFT$(BackupCode$, insertionPoint - 1) + thisBlock$ + MID$(BackupCode$, endPoint)
CASE 13 'Dropdown list, List box, Track bar, ToggleSwitch, CheckBox
IF INSTR(thisBlock$, "SELECT CASE id") THEN
firstCASE = _INSTRREV(INSTR(thisBlock$, " CASE "), thisBlock$, CHR$(10))
indenting = INSTR(firstCASE, thisBlock$, "CASE ") - firstCASE - 1
addedCASES$ = ""
IF firstCASE = 0 THEN firstCASE = INSTR(thisBlock$, " SELECT CASE id") + 2
FOR Dummy = 1 TO UBOUND(PreviewControls)
IF PreviewControls(Dummy).ID > 0 AND (PreviewControls(Dummy).Type = __UI_Type_ListBox OR PreviewControls(Dummy).Type = __UI_Type_DropdownList OR PreviewControls(Dummy).Type = __UI_Type_TrackBar OR PreviewControls(Dummy).Type = __UI_Type_ToggleSwitch OR PreviewControls(Dummy).Type = __UI_Type_CheckBox OR PreviewControls(Dummy).Type = __UI_Type_RadioButton) THEN
IF INSTR(thisBlock$, " CASE " + RTRIM$(PreviewControls(Dummy).Name) + CHR$(10)) = 0 THEN
addedCASES$ = addedCASES$ + SPACE$(indenting) + "CASE " + RTRIM$(PreviewControls(Dummy).Name) + CHR$(10) + CHR$(10)
END IF
END IF
NEXT
IF LEN(addedCASES$) THEN
thisBlock$ = LEFT$(thisBlock$, firstCASE) + addedCASES$ + MID$(thisBlock$, firstCASE + 1)
END IF
END IF
BackupCode$ = LEFT$(BackupCode$, insertionPoint - 1) + thisBlock$ + MID$(BackupCode$, endPoint)
END SELECT
NEXT
OPEN BaseOutputFileName + ".bas" FOR BINARY AS #TextFileNum
PUT #TextFileNum, , BackupCode$
ELSE
OPEN BaseOutputFileName + ".bas" FOR OUTPUT AS #TextFileNum
PRINT #TextFileNum, "': This program uses"
PRINT #TextFileNum, "': InForm - GUI library for QB64 - "; __UI_Version
PRINT #TextFileNum, "': Fellippe Heitor, " + __UI_CopyrightSpan + " - fellippe@qb64.org - @fellippeheitor"
PRINT #TextFileNum, "': https://github.com/FellippeHeitor/InForm"
PRINT #TextFileNum, "'-----------------------------------------------------------"
PRINT #TextFileNum,
PRINT #TextFileNum, "': Controls' IDs: ------------------------------------------------------------------"
FOR i = 1 TO UBOUND(PreviewControls)
IF PreviewControls(i).ID > 0 AND PreviewControls(i).Type <> __UI_Type_Font AND PreviewControls(i).Type <> __UI_Type_MenuPanel THEN
PRINT #TextFileNum, "DIM SHARED " + RTRIM$(__UI_TrimAt0$(PreviewControls(i).Name)) + " AS LONG"
END IF
NEXT
PRINT #TextFileNum,
PRINT #TextFileNum, "': External modules: ---------------------------------------------------------------"
IF AddGifExtension THEN
PRINT #TextFileNum, "'$INCLUDE:'InForm\extensions\gifplay.bi'"
END IF
PRINT #TextFileNum, "'$INCLUDE:'InForm\InForm.ui'"
PRINT #TextFileNum, "'$INCLUDE:'InForm\xp.uitheme'"
PRINT #TextFileNum, "'$INCLUDE:'" + MID$(BaseOutputFileName, LEN(CurrentPath$) + 2) + ".frm'"
IF AddGifExtension THEN
PRINT #TextFileNum, "'$INCLUDE:'InForm\extensions\gifplay.bm'"
END IF
PRINT #TextFileNum,
PRINT #TextFileNum, "': Event procedures: ---------------------------------------------------------------"
FOR i = 0 TO 14
SELECT EVERYCASE i
CASE 0: PRINT #TextFileNum, "SUB __UI_BeforeInit"
CASE 1: PRINT #TextFileNum, "SUB __UI_OnLoad"
CASE 2
PRINT #TextFileNum, "SUB __UI_BeforeUpdateDisplay"
PRINT #TextFileNum, " 'This event occurs at approximately 30 frames per second."
PRINT #TextFileNum, " 'You can change the update frequency by calling SetFrameRate DesiredRate%"
CASE 3
PRINT #TextFileNum, "SUB __UI_BeforeUnload"
PRINT #TextFileNum, " 'If you set __UI_UnloadSignal = False here you can"
PRINT #TextFileNum, " 'cancel the user's request to close."
CASE 4: PRINT #TextFileNum, "SUB __UI_Click (id AS LONG)"
CASE 5: PRINT #TextFileNum, "SUB __UI_MouseEnter (id AS LONG)"
CASE 6: PRINT #TextFileNum, "SUB __UI_MouseLeave (id AS LONG)"
CASE 7: PRINT #TextFileNum, "SUB __UI_FocusIn (id AS LONG)"
CASE 8
PRINT #TextFileNum, "SUB __UI_FocusOut (id AS LONG)"
PRINT #TextFileNum, " 'This event occurs right before a control loses focus."
PRINT #TextFileNum, " 'To prevent a control from losing focus, set __UI_KeepFocus = True below."
CASE 9: PRINT #TextFileNum, "SUB __UI_MouseDown (id AS LONG)"
CASE 10: PRINT #TextFileNum, "SUB __UI_MouseUp (id AS LONG)"
CASE 11
PRINT #TextFileNum, "SUB __UI_KeyPress (id AS LONG)"
PRINT #TextFileNum, " 'When this event is fired, __UI_KeyHit will contain the code of the key hit."
PRINT #TextFileNum, " 'You can change it and even cancel it by making it = 0"
CASE 12: PRINT #TextFileNum, "SUB __UI_TextChanged (id AS LONG)"
CASE 13: PRINT #TextFileNum, "SUB __UI_ValueChanged (id AS LONG)"
CASE 14: PRINT #TextFileNum, "SUB __UI_FormResized"
CASE 0, 3, 14
PRINT #TextFileNum, PRINT #TextFileNum,
PRINT #TextFileNum, " 'The lines below ensure your GIFs will display properly;"
PRINT #TextFileNum, " 'Please refer to the documentation in 'InForm/extensions/README - gifplay.txt'" CASE 1
IF PreviewDefaultButtonID > 0 THEN
PRINT #TextFileNum, " __UI_DefaultButtonID = " + RTRIM$(__UI_TrimAt0$(PreviewControls(PreviewDefaultButtonID).Name))
ELSE
PRINT #TextFileNum,
END IF
CASE 2
IF AddGifExtension = True AND TotalGifLoaded > 0 THEN
PRINT #TextFileNum,
PRINT #TextFileNum, " 'The lines below ensure your GIFs will display properly;"
PRINT #TextFileNum, " 'Please refer to the documentation in 'InForm/extensions/README - gifplay.txt'"
FOR Dummy = 1 TO UBOUND(PreviewControls)
IF PreviewAnimatedGif(Dummy) THEN
PRINT #TextFileNum, " UpdateGif " + RTRIM$(PreviewControls(Dummy).Name)
END IF
NEXT
ELSE
PRINT #TextFileNum,
END IF
CASE 4 TO 6, 9, 10 'All controls except for Menu panels, and internal context menus
PRINT #TextFileNum, " SELECT CASE id"
FOR Dummy = 1 TO UBOUND(PreviewControls) FOR Dummy = 1 TO UBOUND(PreviewControls)
IF PreviewAnimatedGif(Dummy) THEN IF PreviewControls(Dummy).ID > 0 AND PreviewControls(Dummy).Type <> __UI_Type_Font AND PreviewControls(Dummy).Type <> __UI_Type_ContextMenu THEN
PRINT #TextFileNum, " UpdateGif " + RTRIM$(PreviewControls(Dummy).Name) PRINT #TextFileNum, " CASE " + RTRIM$(PreviewControls(Dummy).Name)
PRINT #TextFileNum,
END IF END IF
NEXT NEXT
ELSE PRINT #TextFileNum, " END SELECT"
PRINT #TextFileNum,
END IF
CASE 4 TO 6, 9, 10 'All controls except for Menu panels, and internal context menus CASE 7, 8, 11 'Controls that can have focus only
PRINT #TextFileNum, " SELECT CASE id" PRINT #TextFileNum, " SELECT CASE id"
FOR Dummy = 1 TO UBOUND(PreviewControls) FOR Dummy = 1 TO UBOUND(PreviewControls)
IF PreviewControls(Dummy).ID > 0 AND PreviewControls(Dummy).Type <> __UI_Type_Font AND PreviewControls(Dummy).Type <> __UI_Type_ContextMenu THEN IF PreviewControls(Dummy).ID > 0 AND PreviewControls(Dummy).CanHaveFocus THEN
PRINT #TextFileNum, " CASE " + RTRIM$(PreviewControls(Dummy).Name) PRINT #TextFileNum, " CASE " + RTRIM$(PreviewControls(Dummy).Name)
PRINT #TextFileNum, PRINT #TextFileNum,
END IF END IF
NEXT NEXT
PRINT #TextFileNum, " END SELECT" PRINT #TextFileNum, " END SELECT"
CASE 7, 8, 11 'Controls that can have focus only CASE 12 'Text boxes
PRINT #TextFileNum, " SELECT CASE id" PRINT #TextFileNum, " SELECT CASE id"
FOR Dummy = 1 TO UBOUND(PreviewControls) FOR Dummy = 1 TO UBOUND(PreviewControls)
IF PreviewControls(Dummy).ID > 0 AND PreviewControls(Dummy).CanHaveFocus THEN IF PreviewControls(Dummy).ID > 0 AND (PreviewControls(Dummy).Type = __UI_Type_TextBox) THEN
PRINT #TextFileNum, " CASE " + RTRIM$(PreviewControls(Dummy).Name) PRINT #TextFileNum, " CASE " + RTRIM$(PreviewControls(Dummy).Name)
PRINT #TextFileNum, PRINT #TextFileNum,
END IF END IF
NEXT NEXT
PRINT #TextFileNum, " END SELECT" PRINT #TextFileNum, " END SELECT"
CASE 12 'Text boxes CASE 13 'Dropdown list, List box, Track bar, ToggleSwitch, CheckBox
PRINT #TextFileNum, " SELECT CASE id" PRINT #TextFileNum, " SELECT CASE id"
FOR Dummy = 1 TO UBOUND(PreviewControls) FOR Dummy = 1 TO UBOUND(PreviewControls)
IF PreviewControls(Dummy).ID > 0 AND (PreviewControls(Dummy).Type = __UI_Type_TextBox) THEN IF PreviewControls(Dummy).ID > 0 AND (PreviewControls(Dummy).Type = __UI_Type_ListBox OR PreviewControls(Dummy).Type = __UI_Type_DropdownList OR PreviewControls(Dummy).Type = __UI_Type_TrackBar OR PreviewControls(Dummy).Type = __UI_Type_ToggleSwitch OR PreviewControls(Dummy).Type = __UI_Type_CheckBox OR PreviewControls(Dummy).Type = __UI_Type_RadioButton) THEN
PRINT #TextFileNum, " CASE " + RTRIM$(PreviewControls(Dummy).Name) PRINT #TextFileNum, " CASE " + RTRIM$(PreviewControls(Dummy).Name)
PRINT #TextFileNum, PRINT #TextFileNum,
END IF END IF
NEXT NEXT
PRINT #TextFileNum, " END SELECT" PRINT #TextFileNum, " END SELECT"
END SELECT
CASE 13 'Dropdown list, List box, Track bar, ToggleSwitch, CheckBox PRINT #TextFileNum, "END SUB"
PRINT #TextFileNum, " SELECT CASE id" PRINT #TextFileNum,
FOR Dummy = 1 TO UBOUND(PreviewControls) NEXT
IF PreviewControls(Dummy).ID > 0 AND (PreviewControls(Dummy).Type = __UI_Type_ListBox OR PreviewControls(Dummy).Type = __UI_Type_DropdownList OR PreviewControls(Dummy).Type = __UI_Type_TrackBar OR PreviewControls(Dummy).Type = __UI_Type_ToggleSwitch OR PreviewControls(Dummy).Type = __UI_Type_CheckBox OR PreviewControls(Dummy).Type = __UI_Type_RadioButton) THEN END IF
PRINT #TextFileNum, " CASE " + RTRIM$(PreviewControls(Dummy).Name)
PRINT #TextFileNum,
END IF
NEXT
PRINT #TextFileNum, " END SELECT"
END SELECT
PRINT #TextFileNum, "END SUB"
PRINT #TextFileNum,
NEXT
BackupRestored:
CLOSE #TextFileNum CLOSE #TextFileNum
END IF END IF