mirror of
https://github.com/FellippeHeitor/InForm.git
synced 2025-01-14 19:49:33 +00:00
Add 0.1 sec. delay before calling common dialogs so the interface can redraw correctly
This commit is contained in:
parent
7f39847ce2
commit
3ca90982c6
3 changed files with 28 additions and 28 deletions
|
@ -461,7 +461,7 @@ AddToggleSwitch
|
||||||
SendData b$, 44
|
SendData b$, 44
|
||||||
CASE AddGifExtensionToggle
|
CASE AddGifExtensionToggle
|
||||||
IF Control(AddGifExtensionToggle).Value = False AND TotalGifLoaded > 0 THEN
|
IF Control(AddGifExtensionToggle).Value = False AND TotalGifLoaded > 0 THEN
|
||||||
Answer = _MESSAGEBOX(UiEditorTitle$, "Removing the GIF extension will load the existing animations as static frames. Proceed?", "yesno", "question", 0)
|
_DELAY 0.1: Answer = _MESSAGEBOX(UiEditorTitle$, "Removing the GIF extension will load the existing animations as static frames. Proceed?", "yesno", "question", 0)
|
||||||
IF Answer = 0 THEN
|
IF Answer = 0 THEN
|
||||||
Control(AddGifExtensionToggle).Value = True
|
Control(AddGifExtensionToggle).Value = True
|
||||||
ELSE
|
ELSE
|
||||||
|
@ -485,13 +485,13 @@ AddToggleSwitch
|
||||||
END IF
|
END IF
|
||||||
NEXT
|
NEXT
|
||||||
IF LEN(Temp$) THEN
|
IF LEN(Temp$) THEN
|
||||||
_MESSAGEBOX UiEditorTitle$ + " - Loaded fonts", Temp$, "info"
|
_DELAY 0.1: _MESSAGEBOX UiEditorTitle$ + " - Loaded fonts", Temp$, "info"
|
||||||
ELSE
|
ELSE
|
||||||
_MESSAGEBOX UiEditorTitle$, "There are no fonts loaded.", "error"
|
_DELAY 0.1: _MESSAGEBOX UiEditorTitle$, "There are no fonts loaded.", "error"
|
||||||
END IF
|
END IF
|
||||||
CASE FileMenuNew
|
CASE FileMenuNew
|
||||||
IF Edited THEN
|
IF Edited THEN
|
||||||
Answer = _MESSAGEBOX(UiEditorTitle$, "Save the current form?", "yesnocancle", "question", 1)
|
_DELAY 0.1: Answer = _MESSAGEBOX(UiEditorTitle$, "Save the current form?", "yesnocancle", "question", 1)
|
||||||
IF Answer = 0 THEN
|
IF Answer = 0 THEN
|
||||||
EXIT SUB
|
EXIT SUB
|
||||||
ELSEIF Answer = 1 THEN
|
ELSEIF Answer = 1 THEN
|
||||||
|
@ -574,12 +574,12 @@ AddToggleSwitch
|
||||||
CASE HelpMenuAbout
|
CASE HelpMenuAbout
|
||||||
DIM isBeta$
|
DIM isBeta$
|
||||||
IF __UI_VersionIsBeta THEN isBeta$ = " Beta Version" ELSE isBeta$ = ""
|
IF __UI_VersionIsBeta THEN isBeta$ = " Beta Version" ELSE isBeta$ = ""
|
||||||
_MESSAGEBOX "About " + UiEditorTitle$, "InForm GUI for QB64-PE - Created by Fellippe Heitor (2016-2021)\n\n" + UiEditorTitle$ + " " + __UI_Version + " (build" + STR$(__UI_VersionNumber) + isBeta$ + ")\nby George McGinn (gbytes58@gmail.com)\n Samuel Gomes\n\nGitHub: https://github.com/a740g/InForm-PE", "info"
|
_DELAY 0.1: _MESSAGEBOX UiEditorTitle$ + " - About", "InForm GUI for QB64-PE - Created by Fellippe Heitor (2016-2021)" + STRING$(2, 13) + UiEditorTitle$ + " " + __UI_Version + " (build" + STR$(__UI_VersionNumber) + isBeta$ + ")" + STRING$(2, 13) + "Updates by George McGinn (gbytes58@gmail.com)" + STRING$(2, 13) + "QB64-PE port by Samuel Gomes (a740g)" + STRING$(2, 13) + "GitHub: https://github.com/a740g/InForm-PE", "info"
|
||||||
CASE HelpMenuHelp
|
CASE HelpMenuHelp
|
||||||
_MESSAGEBOX UiEditorTitle$ + " What's all this?", "Design a form and export the resulting code to generate an event-driven QB64-PE program.", "info"
|
_DELAY 0.1: _MESSAGEBOX UiEditorTitle$ + " - What's all this?", "Design a form and export the resulting code to generate an event-driven QB64-PE program.", "info"
|
||||||
CASE FileMenuExit
|
CASE FileMenuExit
|
||||||
IF Edited THEN
|
IF Edited THEN
|
||||||
Answer = _MESSAGEBOX(UiEditorTitle$, "Save the current form before leaving?", "yesnocancel", "question", 1)
|
_DELAY 0.1: Answer = _MESSAGEBOX(UiEditorTitle$, "Save the current form before leaving?", "yesnocancel", "question", 1)
|
||||||
IF Answer = 0 THEN
|
IF Answer = 0 THEN
|
||||||
EXIT SUB
|
EXIT SUB
|
||||||
ELSEIF Answer = 1 THEN
|
ELSEIF Answer = 1 THEN
|
||||||
|
@ -705,7 +705,7 @@ AddToggleSwitch
|
||||||
__UI_ValueChanged ControlList
|
__UI_ValueChanged ControlList
|
||||||
CASE FileMenuOpen
|
CASE FileMenuOpen
|
||||||
IF Edited THEN
|
IF Edited THEN
|
||||||
Answer = _MESSAGEBOX(UiEditorTitle$, "Save the current form?", "yesnocancle", "question", 1)
|
_DELAY 0.1: Answer = _MESSAGEBOX(UiEditorTitle$, "Save the current form?", "yesnocancle", "question", 1)
|
||||||
IF Answer = 0 THEN
|
IF Answer = 0 THEN
|
||||||
EXIT SUB
|
EXIT SUB
|
||||||
ELSEIF Answer = 1 THEN
|
ELSEIF Answer = 1 THEN
|
||||||
|
@ -766,7 +766,7 @@ FileMenuRecent7, FileMenuRecent8, FileMenuRecent9
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
IF Edited THEN
|
IF Edited THEN
|
||||||
Answer = _MESSAGEBOX(UiEditorTitle$, "Save the current form?", "yesnocancle", "question", 1)
|
_DELAY 0.1: Answer = _MESSAGEBOX(UiEditorTitle$, "Save the current form?", "yesnocancle", "question", 1)
|
||||||
IF Answer = 0 THEN
|
IF Answer = 0 THEN
|
||||||
EXIT SUB
|
EXIT SUB
|
||||||
ELSEIF Answer = 1 THEN
|
ELSEIF Answer = 1 THEN
|
||||||
|
@ -778,7 +778,7 @@ FileMenuRecent7, FileMenuRecent8, FileMenuRecent9
|
||||||
OpenDialogOpen = True
|
OpenDialogOpen = True
|
||||||
__UI_Click OpenBT
|
__UI_Click OpenBT
|
||||||
ELSE
|
ELSE
|
||||||
_MESSAGEBOX UiEditorTitle$, "File not found.", "error"
|
_DELAY 0.1: _MESSAGEBOX UiEditorTitle$, "File not found.", "error"
|
||||||
RemoveFromRecentList RecentToOpen$
|
RemoveFromRecentList RecentToOpen$
|
||||||
END IF
|
END IF
|
||||||
CASE OpenBT
|
CASE OpenBT
|
||||||
|
@ -833,7 +833,7 @@ FileMenuRecent7, FileMenuRecent8, FileMenuRecent9
|
||||||
FormDataReceived = False
|
FormDataReceived = False
|
||||||
InitialControlSet = ""
|
InitialControlSet = ""
|
||||||
ELSE
|
ELSE
|
||||||
_MESSAGEBOX UiEditorTitle$, "File not found.", "error"
|
_DELAY 0.1: _MESSAGEBOX UiEditorTitle$, "File not found.", "error"
|
||||||
Control(FileList).Value = 0
|
Control(FileList).Value = 0
|
||||||
END IF
|
END IF
|
||||||
END IF
|
END IF
|
||||||
|
@ -1200,7 +1200,7 @@ SUB SelectFontInList (FontSetup$)
|
||||||
BypassShowFontList = True
|
BypassShowFontList = True
|
||||||
IF AttemptToShowFontList THEN
|
IF AttemptToShowFontList THEN
|
||||||
AttemptToShowFontList = False
|
AttemptToShowFontList = False
|
||||||
i = _MESSAGEBOX(UiEditorTitle$, "The current font isn't a system font.\nReset this control to the built-in font?", "yesno", "question", 1)
|
_DELAY 0.1: i = _MESSAGEBOX(UiEditorTitle$, "The current font isn't a system font.\nReset this control to the built-in font?", "yesno", "question", 1)
|
||||||
IF i = 1 THEN
|
IF i = 1 THEN
|
||||||
thisFile$ = ",16"
|
thisFile$ = ",16"
|
||||||
thisFile$ = MKL$(LEN(thisFile$)) + thisFile$
|
thisFile$ = MKL$(LEN(thisFile$)) + thisFile$
|
||||||
|
@ -1354,7 +1354,7 @@ __UI_PreviousMouseDownOnID = Red OR __UI_PreviousMouseDownOnID = Green OR __UI_P
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
IF Edited THEN
|
IF Edited THEN
|
||||||
Answer = _MESSAGEBOX(UiEditorTitle$, "Save the current form?", "yesnocancle", "question", 1)
|
_DELAY 0.1: Answer = _MESSAGEBOX(UiEditorTitle$, "Save the current form?", "yesnocancle", "question", 1)
|
||||||
IF Answer = 0 THEN
|
IF Answer = 0 THEN
|
||||||
CLOSE InstanceClient
|
CLOSE InstanceClient
|
||||||
InstanceClient = 0
|
InstanceClient = 0
|
||||||
|
@ -1581,7 +1581,7 @@ PreviewControls(FirstSelected).Width - (PreviewControls(FirstSelected).BorderSiz
|
||||||
__UI_ForceRedraw = True
|
__UI_ForceRedraw = True
|
||||||
ELSEIF CVI(b$) = -4 THEN
|
ELSEIF CVI(b$) = -4 THEN
|
||||||
'User attempted to load an icon file that couldn't be previewed
|
'User attempted to load an icon file that couldn't be previewed
|
||||||
_MESSAGEBOX UiEditorTitle$, "Icon couldn't be previewed. Make sure it's a valid icon file.", "warning"
|
_DELAY 0.1: _MESSAGEBOX UiEditorTitle$, "Icon couldn't be previewed. Make sure it's a valid icon file.", "warning"
|
||||||
ELSEIF CVI(b$) = -5 THEN
|
ELSEIF CVI(b$) = -5 THEN
|
||||||
'Context menu was successfully shown on the preview
|
'Context menu was successfully shown on the preview
|
||||||
IF __UI_TotalActiveMenus > 0 THEN __UI_CloseAllMenus
|
IF __UI_TotalActiveMenus > 0 THEN __UI_CloseAllMenus
|
||||||
|
@ -1589,7 +1589,7 @@ PreviewControls(FirstSelected).Width - (PreviewControls(FirstSelected).BorderSiz
|
||||||
__UI_ForceRedraw = True
|
__UI_ForceRedraw = True
|
||||||
ELSEIF CVI(b$) = -6 THEN
|
ELSEIF CVI(b$) = -6 THEN
|
||||||
'User attempted to load an invalid icon file
|
'User attempted to load an invalid icon file
|
||||||
_MESSAGEBOX UiEditorTitle$, "Only .ico files are accepted.", "warning"
|
_DELAY 0.1: _MESSAGEBOX UiEditorTitle$, "Only .ico files are accepted.", "warning"
|
||||||
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
|
||||||
|
@ -2555,7 +2555,7 @@ END SUB
|
||||||
SUB __UI_BeforeUnload
|
SUB __UI_BeforeUnload
|
||||||
DIM Answer AS _BYTE
|
DIM Answer AS _BYTE
|
||||||
IF Edited THEN
|
IF Edited THEN
|
||||||
Answer = _MESSAGEBOX(UiEditorTitle$, "Save the current form before leaving?", "yesnocancel", "question", 1)
|
_DELAY 0.1: Answer = _MESSAGEBOX(UiEditorTitle$, "Save the current form before leaving?", "yesnocancel", "question", 1)
|
||||||
IF Answer = 0 THEN
|
IF Answer = 0 THEN
|
||||||
__UI_UnloadSignal = False
|
__UI_UnloadSignal = False
|
||||||
ELSEIF Answer = 1 THEN
|
ELSEIF Answer = 1 THEN
|
||||||
|
@ -2645,7 +2645,7 @@ SUB Handshake
|
||||||
LOOP UNTIL TIMER - start! > TIMEOUT
|
LOOP UNTIL TIMER - start! > TIMEOUT
|
||||||
|
|
||||||
IF UiPreviewPID = 0 THEN
|
IF UiPreviewPID = 0 THEN
|
||||||
_MESSAGEBOX UiEditorTitle$, "UiEditorPreview component not found or failed to load.", "error"
|
_DELAY 0.1: _MESSAGEBOX UiEditorTitle$, "UiEditorPreview component not found or failed to load.", "error"
|
||||||
SYSTEM
|
SYSTEM
|
||||||
END IF
|
END IF
|
||||||
END SUB
|
END SUB
|
||||||
|
@ -2703,7 +2703,7 @@ SUB __UI_OnLoad
|
||||||
LOOP UNTIL Host <> 0 OR HostAttempts > 1000
|
LOOP UNTIL Host <> 0 OR HostAttempts > 1000
|
||||||
|
|
||||||
IF Host = 0 THEN
|
IF Host = 0 THEN
|
||||||
_MESSAGEBOX UiEditorTitle$, "Unable to open communication port.", "error"
|
_DELAY 0.1: _MESSAGEBOX UiEditorTitle$, "Unable to open communication port.", "error"
|
||||||
SYSTEM
|
SYSTEM
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
|
@ -3080,7 +3080,7 @@ INSTR(uB$, "$INCLUDE") > 0 THEN
|
||||||
|
|
||||||
EXIT SUB
|
EXIT SUB
|
||||||
UiEditorPreviewNotFound:
|
UiEditorPreviewNotFound:
|
||||||
_MESSAGEBOX UiEditorTitle$, "UiEditorPreview component not found or failed to load.", "error"
|
_DELAY 0.1: _MESSAGEBOX UiEditorTitle$, "UiEditorPreview component not found or failed to load.", "error"
|
||||||
SYSTEM
|
SYSTEM
|
||||||
|
|
||||||
ShowMessage:
|
ShowMessage:
|
||||||
|
@ -3823,7 +3823,7 @@ SUB LoadPreview
|
||||||
IF LoadedWithGifExtension = 1 THEN LoadedWithGifExtension = False
|
IF LoadedWithGifExtension = 1 THEN LoadedWithGifExtension = False
|
||||||
IF PrevTotalGifLoaded <> TotalGifLoaded THEN
|
IF PrevTotalGifLoaded <> TotalGifLoaded THEN
|
||||||
IF PrevTotalGifLoaded = 0 AND LoadedWithGifExtension = False THEN
|
IF PrevTotalGifLoaded = 0 AND LoadedWithGifExtension = False THEN
|
||||||
Answer = _MESSAGEBOX(UiEditorTitle$, "You loaded an animated GIF file.\nDo you want to include the GIF extension?", "yesno", "question", 1)
|
_DELAY 0.1: Answer = _MESSAGEBOX(UiEditorTitle$, "You loaded an animated GIF file.\nDo you want to include the GIF extension?", "yesno", "question", 1)
|
||||||
IF Answer = 1 THEN
|
IF Answer = 1 THEN
|
||||||
Control(AddGifExtensionToggle).Value = True
|
Control(AddGifExtensionToggle).Value = True
|
||||||
ELSE
|
ELSE
|
||||||
|
@ -4015,14 +4015,14 @@ SUB SaveForm (ExitToQB64 AS _BYTE, SaveOnlyFrm AS _BYTE)
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
IF LEN(b$) > 0 THEN
|
IF LEN(b$) > 0 THEN
|
||||||
Answer = _MESSAGEBOX(UiEditorTitle$, b$, "yesno", "question", 0)
|
_DELAY 0.1: Answer = _MESSAGEBOX(UiEditorTitle$, b$, "yesno", "question", 0)
|
||||||
IF Answer = 0 THEN EXIT SUB
|
IF Answer = 0 THEN EXIT SUB
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
AddGifExtension = Control(AddGifExtensionToggle).Value
|
AddGifExtension = Control(AddGifExtensionToggle).Value
|
||||||
|
|
||||||
IF (AddGifExtension OR Control(AddGifExtensionToggle).Value) AND LoadedWithGifExtension = False AND TotalGifLoaded = 0 THEN
|
IF (AddGifExtension OR Control(AddGifExtensionToggle).Value) AND LoadedWithGifExtension = False AND TotalGifLoaded = 0 THEN
|
||||||
Answer = _MESSAGEBOX(UiEditorTitle$, "Are you sure you want to include the GIF extension?\n(no animated GIFs have been added to this form)", "yesno", "question", 0)
|
_DELAY 0.1: Answer = _MESSAGEBOX(UiEditorTitle$, "Are you sure you want to include the GIF extension?\n(no animated GIFs have been added to this form)", "yesno", "question", 0)
|
||||||
AddGifExtension = (Answer = 1)
|
AddGifExtension = (Answer = 1)
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
|
@ -4675,18 +4675,18 @@ SUB SaveForm (ExitToQB64 AS _BYTE, SaveOnlyFrm AS _BYTE)
|
||||||
IF ExitToQB64 AND NOT SaveOnlyFrm THEN
|
IF ExitToQB64 AND NOT SaveOnlyFrm THEN
|
||||||
IF _FILEEXISTS(QB64_EXE_PATH) THEN
|
IF _FILEEXISTS(QB64_EXE_PATH) THEN
|
||||||
b$ = b$ + CHR$(10) + CHR$(10) + "Exit to " + QB64_DISPLAY + "?"
|
b$ = b$ + CHR$(10) + CHR$(10) + "Exit to " + QB64_DISPLAY + "?"
|
||||||
Answer = _MESSAGEBOX(UiEditorTitle$, b$, "yesno", "question", 0)
|
_DELAY 0.1: Answer = _MESSAGEBOX(UiEditorTitle$, b$, "yesno", "question", 0)
|
||||||
IF Answer = 0 THEN Edited = False: EXIT SUB
|
IF Answer = 0 THEN Edited = False: EXIT SUB
|
||||||
IF _FILEEXISTS("InForm/UiEditorPreview.frmbin") THEN KILL "InForm/UiEditorPreview.frmbin"
|
IF _FILEEXISTS("InForm/UiEditorPreview.frmbin") THEN KILL "InForm/UiEditorPreview.frmbin"
|
||||||
SHELL _DONTWAIT QB64_EXE_PATH + " " + QuotedFilename$(BaseOutputFileName + ".bas")
|
SHELL _DONTWAIT QB64_EXE_PATH + " " + QuotedFilename$(BaseOutputFileName + ".bas")
|
||||||
SYSTEM
|
SYSTEM
|
||||||
ELSE
|
ELSE
|
||||||
b$ = b$ + CHR$(10) + CHR$(10) + "Close the editor?"
|
b$ = b$ + CHR$(10) + CHR$(10) + "Close the editor?"
|
||||||
Answer = _MESSAGEBOX(UiEditorTitle$, b$, "yesno", "question", 0)
|
_DELAY 0.1: Answer = _MESSAGEBOX(UiEditorTitle$, b$, "yesno", "question", 0)
|
||||||
IF Answer = 0 THEN Edited = False: EXIT SUB
|
IF Answer = 0 THEN Edited = False: EXIT SUB
|
||||||
END IF
|
END IF
|
||||||
ELSE
|
ELSE
|
||||||
_MESSAGEBOX UiEditorTitle$, b$, "info"
|
_DELAY 0.1: _MESSAGEBOX UiEditorTitle$, b$, "info"
|
||||||
Edited = False
|
Edited = False
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
|
|
|
@ -397,7 +397,7 @@ SUB __UI_BeforeUpdateDisplay
|
||||||
IF EditorWasActive = False THEN
|
IF EditorWasActive = False THEN
|
||||||
'Preview was launched by user
|
'Preview was launched by user
|
||||||
_SCREENHIDE
|
_SCREENHIDE
|
||||||
_MESSAGEBOX "InForm Preview", "__UI_BeforeUpdateDisplay: InForm Designer is not running. Please run the main program.", "error"
|
_DELAY 0.1: _MESSAGEBOX "InForm Preview", "__UI_BeforeUpdateDisplay: InForm Designer is not running. Please run the main program.", "error"
|
||||||
END IF
|
END IF
|
||||||
IF _FILEEXISTS("InForm/UiEditorPreview.frmbin") THEN KILL "InForm/UiEditorPreview.frmbin"
|
IF _FILEEXISTS("InForm/UiEditorPreview.frmbin") THEN KILL "InForm/UiEditorPreview.frmbin"
|
||||||
SYSTEM
|
SYSTEM
|
||||||
|
@ -1705,7 +1705,7 @@ SUB __UI_OnLoad
|
||||||
IF VAL(HostPort) < 60000 THEN
|
IF VAL(HostPort) < 60000 THEN
|
||||||
ForceQuit:
|
ForceQuit:
|
||||||
_SCREENHIDE
|
_SCREENHIDE
|
||||||
_MESSAGEBOX "InForm Preview", "__UI_OnLoad: InForm Designer is not running. Please run the main program.", "error"
|
_DELAY 0.1: _MESSAGEBOX "InForm Preview", "__UI_OnLoad: InForm Designer is not running. Please run the main program.", "error"
|
||||||
SYSTEM
|
SYSTEM
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ SUB __UI_Click (id AS LONG)
|
||||||
Caption(LoadBT) = "globe.gif loaded"
|
Caption(LoadBT) = "globe.gif loaded"
|
||||||
Control(LoadBT).Disabled = True
|
Control(LoadBT).Disabled = True
|
||||||
ELSE
|
ELSE
|
||||||
_MESSAGEBOX "GIFPlay Sample", "File 'globe.gif' could not be found.", "error"
|
_DELAY 0.1: _MESSAGEBOX "GIFPlay Sample", "File 'globe.gif' could not be found.", "error"
|
||||||
END IF
|
END IF
|
||||||
CASE PlayBT
|
CASE PlayBT
|
||||||
IF GifIsPlaying(PictureBox1) THEN
|
IF GifIsPlaying(PictureBox1) THEN
|
||||||
|
|
Loading…
Reference in a new issue