; --------------------------------------------------------------------------------------------; Copyright (c) Fantaisie Software. All rights reserved.; Dual licensed under the GPL and Fantaisie Software licenses.; See LICENSE and LICENSE-FANTAISIE in the project root for license information.; --------------------------------------------------------------------------------------------; Change: Now *every* file in the source tree is included from this main file; This will reduce the number of XIncludeFile's in each file, and there is no more need to check dependencies.; Even platform specific files are always included. Whether their code is compiled; is decided in each file.XIncludeFile "CompilerFlags.pb"XIncludeFile "Build/BuildInfo.pb"XIncludeFile ".." + #Separator + "DialogManager" + #Separator + "Common.pb" ; must be before Common.pbXIncludeFile "Common.pb" ; must be before DebuggerCommon.pbXIncludeFile #DEFAULT_DebuggerSource + "DebuggerCommon.pb" ; must be before Declarations.pbXIncludeFile "Declarations.pb"XIncludeFile "Macro.pb"XIncludeFile ".." + #Separator + "PureBasicConfigPath.pb" ; for the config directoryXIncludeFile "FormDesigner/declare.pb"; must be here to affect all OpenWindow() calls with a macroXIncludeFile "LinuxWindowIcon.pb"XIncludeFile "ZLib.pb"; include the TabBarGadget. Note: It has an EnableExplicit insideXIncludeFile "TabBarGadget.pbi"DisableExplicit; dialog manager; We need the explorer and scintilla support for it (for Templates window and Projects)#DIALOG_USE_SCINTILLA = 1#DIALOG_USE_EXPLORER = 1IncludePath ".." + #Separator + "DialogManager" + #Separator ; so that the dialog manager files are foundXIncludeFile "DialogManager.pb"IncludePath ""; debugging functions and macros (mostly active in debug mode only)XIncludeFile "WindowsDebugging.pb"XIncludeFile "LinuxDebugging.pb"; should be before the debugger files, as they need some of thisXIncludeFile "WindowsExtensions.pb"XIncludeFile "LinuxExtensions.pb"XIncludeFile "MacExtensions.pb"; debugger external filesXIncludeFile #DEFAULT_DebuggerSource + "Misc.pb"XIncludeFile #DEFAULT_DebuggerSource + "VariableGadget.pb"XIncludeFile #DEFAULT_DebuggerSource + "Communication_PipeWindows.pb"XIncludeFile #DEFAULT_DebuggerSource + "Communication_PipeUnix.pb"XIncludeFile #DEFAULT_DebuggerSource + "Communication.pb"XIncludeFile #DEFAULT_DebuggerSource + "DebugOutput.pb"XIncludeFile #DEFAULT_DebuggerSource + "AsmDebug.pb"XIncludeFile #DEFAULT_DebuggerSource + "MemoryViewer.pb"XIncludeFile #DEFAULT_DebuggerSource + "VariableDebug.pb"XIncludeFile #DEFAULT_DebuggerSource + "History.pb"XIncludeFile #DEFAULT_DebuggerSource + "WatchList.pb"XIncludeFile #DEFAULT_DebuggerSource + "DataBreakPoints.pb"XIncludeFile #DEFAULT_DebuggerSource + "Profiler.pb"XIncludeFile #DEFAULT_DebuggerSource + "LibraryViewer.pb"XIncludeFile #DEFAULT_DebuggerSource + "Purifier.pb"XIncludeFile #DEFAULT_DebuggerSource + "DebuggerGUI.pb"; Plugins for the LibraryViewerXIncludeFile #DEFAULT_DebuggerSource + "Plugin_Image.pb"XIncludeFile #DEFAULT_DebuggerSource + "Plugin_Xml.pb"; debugger ide-filesXIncludeFile "IDEDebugger.pb"XIncludeFile "CompilerInterface.pb"XIncludeFile "Language.pb"XIncludeFile "ZipManagement.pb"XIncludeFile "ToolbarManagement.pb"XIncludeFile "ThemeManagement.pb"XIncludeFile "HighlightingEngine.pb"XIncludeFile "HighlightingFunctions.pb"XIncludeFile "ShortcutManagement.pb"XIncludeFile "ProjectManagement.pb"XIncludeFile "FormDesigner/grid.pbi"XIncludeFile "FormDesigner/undoredo.pb"XIncludeFile "FormDesigner/helpingfunctions.pb"XIncludeFile "FormDesigner/gadgetitemswindow.pb"XIncludeFile "FormDesigner/imageslistwindow.pb"XIncludeFile "FormDesigner/splitterwindow.pb"XIncludeFile "FormDesigner/codeviewer.pb"XIncludeFile "FormDesigner/mainevents.pb"XIncludeFile "FormDesigner/copypaste.pb"XIncludeFile "FormDesigner/opensave.pb"XIncludeFile "FormDesigner/mainwindow.pb"XIncludeFile "FormDesigner/FormManagement.pb"XIncludeFile "SourceManagement.pb"XIncludeFile "SourceParser.pb"XIncludeFile "UserInterface.pb"XIncludeFile "Misc.pb"XIncludeFile "FileSystem.pb"XIncludeFile "IDEMisc.pb"XIncludeFile "RecentFiles.pb"XIncludeFile "AddTools.pb"XIncludeFile "AboutWindow.pb"XIncludeFile "FileViewer.pb"XIncludeFile "GotoWindow.pb"XIncludeFile "StructureViewer.pb"XIncludeFile "StructureFunctions.pb"XIncludeFile "FindWindow.pb"XIncludeFile "GrepWindow.pb"XIncludeFile "CompilerWindow.pb"XIncludeFile "CompilerWarnings.pb"XIncludeFile "CompilerOptions.pb"XIncludeFile "AddHelpFiles.pb"XIncludeFile "ColorSchemes.pb"XIncludeFile "AutoComplete.pb"XIncludeFile "Preferences.pb"XIncludeFile "Preferences.pb"XIncludeFile "StandaloneDebuggerControl.pb"XIncludeFile "ErrorHandler.pb"XIncludeFile "Commandline.pb"XIncludeFile "DiffAlgorithm.pb"XIncludeFile "DiffWindow.pb"XIncludeFile "LinuxHelp.pb"XIncludeFile "EditHistory.pb"XIncludeFile "UpdateCheck.pb"XIncludeFile "RadixTree.pb"CompilerIf #SpiderBasicXIncludeFile "CreateApp.pb"CompilerEndIf; compiled dialogsXIncludeFile "Build/Find.pb"XIncludeFile "Build/Grep.pb"XIncludeFile "Build/Diff.pb"XIncludeFile "Build/Goto.pb"XIncludeFile "Build/AddTools.pb"XIncludeFile "Build/About.pb"XIncludeFile "Build/Preferences.pb"XIncludeFile "Build/Templates.pb"XIncludeFile "Build/StructureViewer.pb"XIncludeFile "Build/Projects.pb"XIncludeFile "Build/Build.pb"XIncludeFile "Build/FileMonitor.pb"XIncludeFile "Build/History.pb"XIncludeFile "Build/HistoryShutdown.pb"XIncludeFile "Build/Updates.pb"CompilerIf #SpiderBasicXIncludeFile "Build/CreateApp.pb"CompilerEndIf; Here is the trick:; We need two slightly different versions of the Compiler options dialog,; so to not duplicate all the stuff, we generate the file once from the xml; and then include it here twice, with the #IDE_ProjectCompilerOptions defined; for only one of them to make the few changes.;; To not get a duplicate label error, the generated label in the file is actually; a macro which is replaced with the real label on compilation;Macro Dialog_CompilerOptionsMacro()CompilerIf Defined(IDE_ProjectCompilerOptions, #PB_Constant)Dialog_ProjectCompilerOptions:CompilerElseDialog_CompilerOptions:CompilerEndIfEndMacroIncludeFile "Build/CompilerOptions.pb"#IDE_ProjectCompilerOptions = 1IncludeFile "Build/CompilerOptions.pb"; toolspanel pluginsXIncludeFile "AsciiTable.pb"XIncludeFile "Explorer.pb"XIncludeFile "ProjectPanel.pb"XIncludeFile "ColorPicker.pb"XIncludeFile "ProcedureBrowser.pb"XIncludeFile "VariableViewer.pb"XIncludeFile "HelpTool.pb"XIncludeFile "Issues.pb"CompilerIf #SpiderBasicXIncludeFile "WebView.pb"CompilerEndIf; windows specificXIncludeFile "WindowsMisc.pb"XIncludeFile "WindowsHelp.pb"; linux specificXIncludeFile "LinuxMisc.pb"XIncludeFile "HelpViewer.pb"; macos specificXIncludeFile "MacMisc.pb"; highlighting filesXIncludeFile "ScintillaHighlighting.pb"XIncludeFile "CodeViewer.pb"XIncludeFile "DisplayMacroError.pb"XIncludeFile "Templates.pb"XIncludeFile "ToolsPanel.pb"; crossplatform debugging helpersXIncludeFile "Debugging.pb";W__time.q = ElapsedMilliseconds();- Editor Start; This must be before anything else, as it affects path settings and such;ParseCommandline()If CommandlineBuildOpenConsole()EndIfIf OSStartupCode() = 0EndEndIfInitToolbar() ; must be before LoadPreferences() !InitSyntaxCheckArrays() ; must be before LoadPreferences() ! (as it calls BuildFoldingVT() which needs this)LoadPreferences()CompilerIf #CompileMac; Avoid to be run from the image disk, as some feature won't work.;If FindString(LCase(PureBasicPath$), "/apptranslocation/")MessageRequester("Error", #ProductName$ + " can't be run directly from the dmg disk, it needs to be drag'n'dropped in Application or in any other place.", #FLAG_Error)OSEndCode()End 1EndIfCompilerEndIfCompilerIf #CompileMacIf OSVersion() >= #PB_OS_MacOSX_10_14; Force Appearance AquaIf Not DisplayDarkModeNSApp.i = CocoaMessage(0, 0, "NSApplication sharedApplication")NSAppearanceAqua = CocoaMessage(0, 0, "NSAppearance appearanceNamed:$", @"NSAppearanceNameAqua")CocoaMessage(0, NSApp, "setAppearance:", NSAppearanceAqua)EndIf; Init Apperance ObserverInitAppearanceObserver()EndIfCompilerEndIfIf Editor_RunOnce And CommandlineBuild = 0; New RunOnce handling, all in one OS-specifc routine; to allow a better method to be used on Windows (maybe also Linux);If RunOnce_Startup(InitialSourceLine) ; Returns true when IDE should closeOSEndCode()EndEndIfEndIfLoadLanguage() ; must be before StartCompiler()StartCompiler(@DefaultCompiler) ; gets the compiler version for the splash screenProcedure CloseSplashScreen()Static IsClosed = 0If IsClosed = 0 And NoSplashScreen = 0IsClosed = 1CompilerIf #PB_Compiler_Debugger; Prevent debugger errors when missing Scintilla.dll causes early exitIf IsWindow(#WINDOW_Startup)CloseWindow(#WINDOW_Startup)EndIfIf IsImage(#IMAGE_Startup)FreeImage(#IMAGE_Startup)EndIfCompilerElseCloseWindow(#WINDOW_Startup)FreeImage(#IMAGE_Startup)CompilerEndIfEndIfEndProcedureIf CommandlineBuild = 0 And NoSplashScreen = 0; display the startup logo, as loading could take a little on slower systems..; especially when lots of sources are reloaded.If OpenWindow(#WINDOW_Startup, 0, 0, 500, 200, #ProductName$ + " loading...", #PB_Window_ScreenCentered|#PB_Window_BorderLess|#PB_Window_Invisible)If CatchImage(#IMAGE_Startup, ?Image_Startup); Image is HDPI with twice the wanted size. So resize it according to current screen DPI.;ResizeImage(#IMAGE_Startup, DesktopScaledX(ImageWidth(#IMAGE_Startup)/2), DesktopScaledY(ImageHeight(#IMAGE_Startup)/2))If StartDrawing(ImageOutput(#IMAGE_Startup))DrawingMode(#PB_2DDrawing_Transparent | #PB_2DDrawing_NativeText)CompilerIf #SpiderBasicFrontColor(777777ドル) ; SpiderBasic splash screen background is white, so change the font color to a dark oneOffsetX = DesktopScaledX(130) ; Spider has a logo at the left of the window, so shift the text displayCompilerElseFrontColor($FFFFFF)OffsetX = 0CompilerEndIfCompilerIf #CompileWindowsDrawingFont(GetGadgetFont(#PB_Default)) ; The default GFX font on Windows is a bit ugly, so use the gadget oneCompilerEndIf; on linux, this string is too long, so move the copyright to a second lineVersion$ = DefaultCompiler\VersionString$If TextWidth(Version$) > 480 And FindString(Version,ドル "- (c)", 1) <> 0CopyRight$ = Trim(Right(Version,ドル Len(Version$) - FindString(Version,ドル "- (c)", 1))) ; will still include the (c)Version$ = Trim(Left(Version,ドル FindString(Version,ドル "- (c)", 1) - 1))DrawText((OutputWidth()-TextWidth(Version$)-OffsetX) / 2 + OffsetX, DesktopScaledY(145), Version$)DrawText((OutputWidth()-TextWidth(CopyRight$)-OffsetX) / 2 + OffsetX, DesktopScaledY(145) + TextHeight(Version$) + 1, CopyRight$)ElseDrawText((OutputWidth()-TextWidth(Version$)-OffsetX) / 2 + OffsetX, DesktopScaledY(145), Version$)DrawText((OutputWidth()-TextWidth("00/00/0000")-OffsetX) / 2 + OffsetX, DesktopScaledY(145) + TextHeight(Version$) + 1, FormatDate("%mm/%dd/%yyyy", #PB_Compiler_Date))EndIfStopDrawing()EndIfImageGadget(#GADGET_Startup_Image, 0, 0, 500, 200, ImageID(#IMAGE_Startup))SetWindowStayOnTop(#WINDOW_Startup, #True) ; force the window to the top ! Note: every messagerequester are now wrapped to MessageRequesterSafe() and will close this splash screen if still openedHideWindow(#WINDOW_Startup, #False)FlushEvents()EndIfEndIfEndIfIf CommandlineBuild = 0LoadTheme()If NoSplashScreen = 0: FlushEvents(): EndIfEndIfAddTools_Init() ; those must be before CreateGUI()If CommandlineBuild = 0 And NoSplashScreen = 0: FlushEvents(): EndIfAddHelpFiles_Init()If CommandlineBuild = 0 And NoSplashScreen = 0: FlushEvents(): EndIf; CPUMonitor_Init() ; before creategui!;- Commandline Project buildingIf CommandlineBuildCommandlineProjectBuild(); commandline building should not affect IDE prefs, so no need to save themKillCompiler()DeleteRegisteredFiles()CompilerCleanup()OSEndCode()CloseConsole()If CommandlineBuildSuccessEnd 0ElseEnd 1EndIfEndIf;- GUI creationIf CreateGUI() = 0MessageRequester(#ProductName,ドル"Critical Error! Can't create GUI!")EndEndIfIf NoSplashScreen = 0: FlushEvents(): EndIfFlushEvents()If NoSplashScreen = 0: FlushEvents(): EndIfCreateAutoCompleteWindow() ; prepare the autocomplete window (hidden)EnsureWindowOnDesktop(#WINDOW_Main)If IsWindowMaximizedShowWindowMaximized(#WINDOW_Main)ElseHideWindow(#WINDOW_Main, 0)EndIfFlushEvents() ; flush events even if no splashscreen is there, because of the main gui; setup the timer for the file changes monitorSetupFileMonitor(); Calculate the hidden width of the toolspanel (for autohide); Can be done only after the gadget is displayedCompilerIf #CompileLinuxToolsPanelHiddenWidth = GetGadgetAttribute(#GADGET_ToolsPanel, #PB_Panel_TabHeight)If ToolsPanelVisible = 0ResizeMainWindow()EndIfCompilerEndIf; apply the splitter positions now, as before all gadgets are 0 in size.;If ErrorLogVisibleSetGadgetState(#GADGET_LogSplitter, GadgetHeight(#GADGET_LogSplitter)-ErrorLogHeight)ElseErrorLogHeight_Hidden = ErrorLogHeight ; simply set the "hidden" value to the prefs oneEndIfIf ToolsPanelVisibleIf ToolsPanelSide = 0SetGadgetState(#GADGET_ToolsSplitter, GadgetWidth(#GADGET_ToolsSplitter)-ToolsPanelWidth)ElseSetGadgetState(#GADGET_ToolsSplitter, ToolsPanelWidth)EndIfElseToolsPanelWidth_Hidden = ToolsPanelWidthEndIfIf ToolsPanelAutoHide Or ToolsPanelMode = 0 ; hide the panel if we do not need itToolsPanel_Hide()EndIf; Initialize history session (do this before opening any files);StartHistorySession(); Now we can directly handle the OSX "open document" event;CompilerIf #CompileMacReadyForDocumentEvent = 1CompilerEndIf; First try to load a project if provided on the commandline; Do this before opening the last open project!; Note: if there are multiple projects, only open the last one (we can only have one project open at a time)CommandLineProject$ = ""ForEach OpenFilesCommandLine()If IsProjectFile(OpenFilesCommandLine())CommandLineProject$ = OpenFilesCommandLine()DeleteElement(OpenFilesCommandLine())EndIfNext OpenFilesCommandLine()If CommandLineProject$ <> ""LoadProject(CommandLineProject$)EndIf; Now load the default project (or LastOpen one) (only if there was not a project loaded from commandline); Always load the project first, so it does look better as all project files are also saved as opened file;If IsProject = 0; The last opened only if there is no default project!If AutoReload And LastOpenProjectFile$ And DefaultProjectFile$ = ""LoadProject(LastOpenProjectFile$)ElseIf DefaultProjectFile$ <> ""If LoadProject(DefaultProjectFile$) = 0DefaultProjectFile$ = "" ; do not try again next timeEndIfEndIf; switch back to the last commandline source, if the -l option was presentIf *LastLoadedSource And *LastLoadedSource <> *ActiveSourceChangeCurrentElement(FileList(), *LastLoadedSource)ChangeActiveSourceCode()EndIfEndIfLastOpenProjectFile$ = "" ; reset after loading; Now load any sourcefiles (both from commandline and preferences);If AutoReloadForEach OpenFiles()LoadSourceFile(OpenFiles()); Flush events. So when many sources are opened at once, the User can see a bit the; progress, instead of just an unresponsive window for quite a while.; There is almost no flicker anymore, so it actually looks quite good.;; Note: don't put this in the LoadSourceFile() routine as it can be call from the debugger and flushing the event will get another debug event !FlushEvents()Next OpenFiles()EndIfClearList(OpenFiles()) ; reset after loadingForEach OpenFilesCommandLine()LoadSourceFile(OpenFilesCommandLine()); Flush events. So when many sources are opened at once, the User can see a bit the; progress, instead of just an unresponsive window for quite a while.; There is almost no flicker anymore, so it actually looks quite good.;; Note: don't put this in the LoadSourceFile() routine as it can be call from the debugger and flushing the event will get another debug event !FlushEvents()Next OpenFilesCommandLine()ClearList(OpenFilesCommandLine()); apply the -l option (do this before opening the default project;If *ActiveSource And InitialSourceLine > 0 And InitialSourceLine < GetLinesCount(*ActiveSource)ChangeActiveLine(InitialSourceLine, -5)*LastLoadedSource = *ActiveSourceElse*LastLoadedSource = 0EndIf; Open a new source if nothing was loaded;If ListSize(FileList()) = 0 Or (ListSize(FileList()) = 1 And *ProjectInfo)NewSource("", #True)HistoryEvent(*ActiveSource, #HISTORY_Create)EndIfFlushEvents()CloseSplashScreen()FlushEvents()CompilerIf #DemoDemoText$ = "This is the free version of "+DefaultCompiler\VersionString$+#NewLineDemoText$ + "Please have a look at the 'Examples' folder for test programs."+#NewLine+#NewLineDemoText$ + "Free version limitations:"+#NewLineCompilerIf #SpiderBasicDemoText$ + "- Program size limited to about 800 lines."+#NewLine+#NewLineCompilerElseCompilerIf #CompileWindowsDemoText$ + "- No DLL creation"+#NewLineCompilerEndIfDemoText$ + "- Code size limitation (about 800 lines)"+#NewLine+#NewLineCompilerEndIfDemoText$ + "Thanks a lot for using " + #ProductName$ + " !"+#NewLine+#NewLineDemoText$ + "The Fantaisie Software Team."MessageRequester("Information", DemoText,ドル #FLAG_INFO)FlushEvents()CompilerEndIfStartupCheckScreenReader()AddTools_Execute(#TRIGGER_EditorStart, 0);MessageRequester("startup time", Str(ElapsedMilliseconds()-__time)); Detect possible crashed session and display info if soDetectCrashedHistorySession(); Wait for the compiler to be loaded. (calls FlushEvents(), so the user can already start editing)WaitForCompilerReady()CompilerIf #CompileMacCocoa; Oddly enough, the main window isn't activated on Cocoa after loading all the filesActivateMainWindow()CompilerEndIf; Check for updates; Do this after the WaitForCompilerReady() so we know the compiler version for the check!CheckForUpdatesSchedule(); Display a warm welcome :);AddGadgetItem(#GADGET_ErrorLog, -1, Language("Misc", "Welcome"));- Main loopQuitIDE = 0RepeatDispatchEvent(WaitWindowEvent())EventLoopCallback(); On Linux x64 and Cocoa, opening the files from the RunOnce message filter causes the IDE to lock up; So check for new files in this list (a ListSize() is a really fast check, so this is ok);CompilerIf #CompileLinux | #CompileMacCocoaIf ListSize(OpenFilesCommandLine()) > 0ForEach OpenFilesCommandLine()FileName$ = OpenFilesCommandLine()If Left(FileName,ドル 7) = "--LINE "; apply the current line commandline optionInitialSourceLine = Val(Right(FileName,ドル Len(FileName$)-7))If InitialSourceLine > 0 And InitialSourceLine < GetLinesCount(*ActiveSource) ; apply the -l optionChangeActiveLine(InitialSourceLine, -5)EndIfElseIf FileName$ <> ""LoadSourceFile(FileName$); Flush events. So when many sources are opened at once, the User can see a bit the; progress, instead of just an unresponsive window for quite a while.; There is almost no flicker anymore, so it actually looks quite good.;; Note: don't put this in the LoadSourceFile() routine as it can be call from the debugger and flushing the event will get another debug event !FlushEvents()EndIfNext OpenFilesCommandLine(); Empty list and make sure the IDE is in the foreground now;ClearList(OpenFilesCommandLine())SetWindowForeground(#WINDOW_Main)ResizeMainWindow()EndIfCompilerEndIfUntil QuitIDE;- Editor endShutdownIDE()EndProcedure ShutdownIDE(); This is now packed in a procedure, so the #WM_ENDSESSION message; can call it as well for an orderly shutdown.; (maybe this can be implemented for #SIGTERM on unix as well)AddTools_Execute(#TRIGGER_EditorEnd, 0); make sure the project is saved and all related windows closed;If IsProjectLastOpenProjectFile$ = ProjectFile$EndIfCloseProject(#True); Write close events for any remaining open filesHistoryShutdownEvents(); make sure all window settings are saved by closing them if they are open;If IsWindow(#WINDOW_FileViewer)FileViewerWindowEvents(#PB_Event_CloseWindow)EndIfIf IsWindow(#WINDOW_Find)FindWindowEvents(#PB_Event_CloseWindow)EndIfIf IsWindow(#WINDOW_StructureViewer)StructureViewerWindowEvents(#PB_Event_CloseWindow)EndIfIf IsWindow(#WINDOW_Grep)GrepWindowEvents(#PB_Event_CloseWindow)EndIfIf IsWindow(#WINDOW_GrepOutput)GrepOutputWindowEvents(#PB_Event_CloseWindow)EndIfIf IsWindow(#WINDOW_EditTools)AddTools_EditWindowEvents(#PB_Event_CloseWindow) ; close this one before the AddTools Window!EndIfIf IsWindow(#WINDOW_AddTools)AddTools_WindowEvents(#PB_Event_CloseWindow)EndIf;; If IsWindow(#WINDOW_CPUMonitor); CPUMonitorWindowEvents(#PB_Event_CloseWindow); EndIfIf IsWindow(#WINDOW_Template)TemplateWindowEvents(#PB_Event_CloseWindow)EndIfIf IsWindow(#WINDOW_MacroError)MacroErrorWindowEvents(#PB_Event_CloseWindow)EndIfIf IsWindow(#WINDOW_Warnings)WarningWindowEvents(#PB_Event_CloseWindow)EndIfIf IsWindow(#WINDOW_Diff)DiffWindowEvents(#PB_Event_CloseWindow)EndIfIf IsWindow(#WINDOW_DiffDialog)DiffDialogWindowEvents(#PB_Event_CloseWindow)EndIfIf IsWindow(#WINDOW_FileMonitor)FileMonitorWindowEvents(#PB_Event_CloseWindow)EndIf; OptionWindow is closed when the source is closedCompilerIf #CompileLinux | #CompileMacIf IsWindow(#WINDOW_Help)HelpWindowevents(#PB_Event_CloseWindow)EndIfCompilerEndIf; call the destroy function for all ToolsPanel items that have one;ForEach UsedPanelTools()*PanelToolData.ToolsPanelEntry = UsedPanelTools()If *PanelToolData\NeedDestroyFunctionPanelTool.ToolsPanelInterface = UsedPanelTools()PanelTool\DestroyFunction()EndIfNext UsedPanelTools(); Close any tools in external tool windows;ForEach AvailablePanelTools()If AvailablePanelTools()\IsSeparateWindowIf AvailablePanelTools()\NeedDestroyFunctionTool.ToolsPanelInterface = @AvailablePanelTools()Tool\DestroyFunction()EndIfIf MemorizeWindow And IsWindowMinimized(AvailablePanelTools()\ToolWindowID) = 0Window = AvailablePanelTools()\ToolWindowIDAvailablePanelTools()\ToolWindowX = WindowX(Window)AvailablePanelTools()\ToolWindowY = WindowY(Window)AvailablePanelTools()\ToolWindowWidth = WindowWidth(Window)AvailablePanelTools()\ToolWindowHeight = WindowHeight(Window)EndIfCloseWindow(AvailablePanelTools()\ToolWindowID)AvailablePanelTools()\ToolWindowID = -1AvailablePanelTools()\IsSeparateWindow = 0EndIfNext AvailablePanelTools(); memorize main window settings;If MemorizeWindow And IsWindowMinimized(#Window_Main) = 0IsWindowMaximized = IsWindowMaximized(#WINDOW_Main)EditorWindowWidth = Save_EditorWidthEditorWindowHeight = Save_EditorHeightEditorWindowX = Save_EditorXEditorWindowY = Save_EditorYElseEditorWindowWidth = Memorize_EditorWidthEditorWindowHeight = Memorize_EditorHeightEndIf; Save the splitter positions if the PB splitters are used.; This is done also when MemorizeWindow is off, to be the same as the non-PB splitters;If ErrorLogVisibleErrorLogHeight = GadgetHeight(#GADGET_LogSplitter) - GetGadgetState(#GADGET_LogSplitter)ElseErrorLogHeight = ErrorLogHeight_HiddenEndIfIf ToolsPanelVisibleIf ToolsPanelSide = 0ToolsPanelWidth = GadgetWidth(#GADGET_ToolsSplitter) - GetGadgetState(#GADGET_ToolsSplitter)ElseToolsPanelWidth = GetGadgetState(#GADGET_ToolsSplitter)EndIfElseToolsPanelWidth = ToolsPanelWidth_HiddenEndIf; Close main window, macOS hide window (Fix IDE Crash)CompilerIf #CompileMacHideWindow(#WINDOW_Main, #True)CompilerElseCloseWindow(#WINDOW_Main)CompilerEndIf; Fix IDE crash on macOS Big SurCompilerIf #CompileMacFlushEvents()CompilerEndIf; end history session. this could take a bit if many files were open (will display a small wait screen if so)EndHistorySession()Debugger_Quit() ; kills all running debugger programs (should be before SavePreferences())LibraryViewer_End() ; unload all libraryviewer plugin dllsSavePreferences()KillCompiler()DeleteRegisteredFiles()CompilerCleanup()OSEndCode()EndProcedureDataSectionImage_Startup:CompilerIf #SpiderBasicIncludeBinary "data/SpiderBasic/SplashScreen_hdpi.png"CompilerElseIncludeBinary "data/startuplogo_hdpi.png"CompilerEndIfEndDataSection
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。