开源 企业版 高校版 私有云 模力方舟 AI 队友
代码拉取完成,页面将自动刷新
加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
已有帐号? 立即登录
文件
devel
分支 (25)
devel
spiderbasic-3.10
v6.21
v6.20
spiderbasic-3.02
qt
v6.12
spiderbasic-3.01
enablejs-ignore-formatting
master
spiderbasic-3.00
webview-tool
v6.11
v6.10
v6.04
spiderbasic-2.51
v6.03
editor-fix-3
editor-slow-fix2
editor-slow-fix
devel
分支 (25)
devel
spiderbasic-3.10
v6.21
v6.20
spiderbasic-3.02
qt
v6.12
spiderbasic-3.01
enablejs-ignore-formatting
master
spiderbasic-3.00
webview-tool
v6.11
v6.10
v6.04
spiderbasic-2.51
v6.03
editor-fix-3
editor-slow-fix2
editor-slow-fix
克隆/下载
克隆/下载
提示
下载代码请复制以下命令到终端执行
为确保你提交的代码身份被 Gitee 正确识别,请执行以下命令完成配置
初次使用 SSH 协议进行代码克隆、推送等操作时,需按下述提示完成 SSH 配置
1 生成 RSA 密钥
2 获取 RSA 公钥内容,并配置到 SSH公钥
在 Gitee 上使用 SVN,请访问 使用指南
使用 HTTPS 协议时,命令行会出现如下账号密码验证步骤。基于安全考虑,Gitee 建议 配置并使用私人令牌 替代登录密码进行克隆、推送等操作
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # 私人令牌
devel
分支 (25)
devel
spiderbasic-3.10
v6.21
v6.20
spiderbasic-3.02
qt
v6.12
spiderbasic-3.01
enablejs-ignore-formatting
master
spiderbasic-3.00
webview-tool
v6.11
v6.10
v6.04
spiderbasic-2.51
v6.03
editor-fix-3
editor-slow-fix2
editor-slow-fix
purebasic
/
PureBasicIDE
/
PureBasic.pb
purebasic
/
PureBasicIDE
/
PureBasic.pb
PureBasic.pb 25.53 KB
一键复制 编辑 原始数据 按行查看 历史
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797
; --------------------------------------------------------------------------------------------
; 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.pb
XIncludeFile "Common.pb" ; must be before DebuggerCommon.pb
XIncludeFile #DEFAULT_DebuggerSource + "DebuggerCommon.pb" ; must be before Declarations.pb
XIncludeFile "Declarations.pb"
XIncludeFile "Macro.pb"
XIncludeFile ".." + #Separator + "PureBasicConfigPath.pb" ; for the config directory
XIncludeFile "FormDesigner/declare.pb"
; must be here to affect all OpenWindow() calls with a macro
XIncludeFile "LinuxWindowIcon.pb"
XIncludeFile "ZLib.pb"
; include the TabBarGadget. Note: It has an EnableExplicit inside
XIncludeFile "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 = 1
IncludePath ".." + #Separator + "DialogManager" + #Separator ; so that the dialog manager files are found
XIncludeFile "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 this
XIncludeFile "WindowsExtensions.pb"
XIncludeFile "LinuxExtensions.pb"
XIncludeFile "MacExtensions.pb"
; debugger external files
XIncludeFile #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 LibraryViewer
XIncludeFile #DEFAULT_DebuggerSource + "Plugin_Image.pb"
XIncludeFile #DEFAULT_DebuggerSource + "Plugin_Xml.pb"
; debugger ide-files
XIncludeFile "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 #SpiderBasic
XIncludeFile "CreateApp.pb"
CompilerEndIf
; compiled dialogs
XIncludeFile "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 #SpiderBasic
XIncludeFile "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:
CompilerElse
Dialog_CompilerOptions:
CompilerEndIf
EndMacro
IncludeFile "Build/CompilerOptions.pb"
#IDE_ProjectCompilerOptions = 1
IncludeFile "Build/CompilerOptions.pb"
; toolspanel plugins
XIncludeFile "AsciiTable.pb"
XIncludeFile "Explorer.pb"
XIncludeFile "ProjectPanel.pb"
XIncludeFile "ColorPicker.pb"
XIncludeFile "ProcedureBrowser.pb"
XIncludeFile "VariableViewer.pb"
XIncludeFile "HelpTool.pb"
XIncludeFile "Issues.pb"
CompilerIf #SpiderBasic
XIncludeFile "WebView.pb"
CompilerEndIf
; windows specific
XIncludeFile "WindowsMisc.pb"
XIncludeFile "WindowsHelp.pb"
; linux specific
XIncludeFile "LinuxMisc.pb"
XIncludeFile "HelpViewer.pb"
; macos specific
XIncludeFile "MacMisc.pb"
; highlighting files
XIncludeFile "ScintillaHighlighting.pb"
XIncludeFile "CodeViewer.pb"
XIncludeFile "DisplayMacroError.pb"
XIncludeFile "Templates.pb"
XIncludeFile "ToolsPanel.pb"
; crossplatform debugging helpers
XIncludeFile "Debugging.pb"
;W__time.q = ElapsedMilliseconds()
;- Editor Start
; This must be before anything else, as it affects path settings and such
;
ParseCommandline()
If CommandlineBuild
OpenConsole()
EndIf
If OSStartupCode() = 0
End
EndIf
InitToolbar() ; 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 1
EndIf
CompilerEndIf
CompilerIf #CompileMac
If OSVersion() >= #PB_OS_MacOSX_10_14
; Force Appearance Aqua
If Not DisplayDarkMode
NSApp.i = CocoaMessage(0, 0, "NSApplication sharedApplication")
NSAppearanceAqua = CocoaMessage(0, 0, "NSAppearance appearanceNamed:$", @"NSAppearanceNameAqua")
CocoaMessage(0, NSApp, "setAppearance:", NSAppearanceAqua)
EndIf
; Init Apperance Observer
InitAppearanceObserver()
EndIf
CompilerEndIf
If 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 close
OSEndCode()
End
EndIf
EndIf
LoadLanguage() ; must be before StartCompiler()
StartCompiler(@DefaultCompiler) ; gets the compiler version for the splash screen
Procedure CloseSplashScreen()
Static IsClosed = 0
If IsClosed = 0 And NoSplashScreen = 0
IsClosed = 1
CompilerIf #PB_Compiler_Debugger
; Prevent debugger errors when missing Scintilla.dll causes early exit
If IsWindow(#WINDOW_Startup)
CloseWindow(#WINDOW_Startup)
EndIf
If IsImage(#IMAGE_Startup)
FreeImage(#IMAGE_Startup)
EndIf
CompilerElse
CloseWindow(#WINDOW_Startup)
FreeImage(#IMAGE_Startup)
CompilerEndIf
EndIf
EndProcedure
If 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 #SpiderBasic
FrontColor(777777ドル) ; SpiderBasic splash screen background is white, so change the font color to a dark one
OffsetX = DesktopScaledX(130) ; Spider has a logo at the left of the window, so shift the text display
CompilerElse
FrontColor($FFFFFF)
OffsetX = 0
CompilerEndIf
CompilerIf #CompileWindows
DrawingFont(GetGadgetFont(#PB_Default)) ; The default GFX font on Windows is a bit ugly, so use the gadget one
CompilerEndIf
; on linux, this string is too long, so move the copyright to a second line
Version$ = DefaultCompiler\VersionString$
If TextWidth(Version$) > 480 And FindString(Version,ドル "- (c)", 1) <> 0
CopyRight$ = 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$)
Else
DrawText((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))
EndIf
StopDrawing()
EndIf
ImageGadget(#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 opened
HideWindow(#WINDOW_Startup, #False)
FlushEvents()
EndIf
EndIf
EndIf
If CommandlineBuild = 0
LoadTheme()
If NoSplashScreen = 0: FlushEvents(): EndIf
EndIf
AddTools_Init() ; those must be before CreateGUI()
If CommandlineBuild = 0 And NoSplashScreen = 0: FlushEvents(): EndIf
AddHelpFiles_Init()
If CommandlineBuild = 0 And NoSplashScreen = 0: FlushEvents(): EndIf
; CPUMonitor_Init() ; before creategui!
;- Commandline Project building
If CommandlineBuild
CommandlineProjectBuild()
; commandline building should not affect IDE prefs, so no need to save them
KillCompiler()
DeleteRegisteredFiles()
CompilerCleanup()
OSEndCode()
CloseConsole()
If CommandlineBuildSuccess
End 0
Else
End 1
EndIf
EndIf
;- GUI creation
If CreateGUI() = 0
MessageRequester(#ProductName,ドル"Critical Error! Can't create GUI!")
End
EndIf
If NoSplashScreen = 0: FlushEvents(): EndIf
FlushEvents()
If NoSplashScreen = 0: FlushEvents(): EndIf
CreateAutoCompleteWindow() ; prepare the autocomplete window (hidden)
EnsureWindowOnDesktop(#WINDOW_Main)
If IsWindowMaximized
ShowWindowMaximized(#WINDOW_Main)
Else
HideWindow(#WINDOW_Main, 0)
EndIf
FlushEvents() ; flush events even if no splashscreen is there, because of the main gui
; setup the timer for the file changes monitor
SetupFileMonitor()
; Calculate the hidden width of the toolspanel (for autohide)
; Can be done only after the gadget is displayed
CompilerIf #CompileLinux
ToolsPanelHiddenWidth = GetGadgetAttribute(#GADGET_ToolsPanel, #PB_Panel_TabHeight)
If ToolsPanelVisible = 0
ResizeMainWindow()
EndIf
CompilerEndIf
; apply the splitter positions now, as before all gadgets are 0 in size.
;
If ErrorLogVisible
SetGadgetState(#GADGET_LogSplitter, GadgetHeight(#GADGET_LogSplitter)-ErrorLogHeight)
Else
ErrorLogHeight_Hidden = ErrorLogHeight ; simply set the "hidden" value to the prefs one
EndIf
If ToolsPanelVisible
If ToolsPanelSide = 0
SetGadgetState(#GADGET_ToolsSplitter, GadgetWidth(#GADGET_ToolsSplitter)-ToolsPanelWidth)
Else
SetGadgetState(#GADGET_ToolsSplitter, ToolsPanelWidth)
EndIf
Else
ToolsPanelWidth_Hidden = ToolsPanelWidth
EndIf
If ToolsPanelAutoHide Or ToolsPanelMode = 0 ; hide the panel if we do not need it
ToolsPanel_Hide()
EndIf
; Initialize history session (do this before opening any files)
;
StartHistorySession()
; Now we can directly handle the OSX "open document" event
;
CompilerIf #CompileMac
ReadyForDocumentEvent = 1
CompilerEndIf
; 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())
EndIf
Next 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$) = 0
DefaultProjectFile$ = "" ; do not try again next time
EndIf
EndIf
; switch back to the last commandline source, if the -l option was present
If *LastLoadedSource And *LastLoadedSource <> *ActiveSource
ChangeCurrentElement(FileList(), *LastLoadedSource)
ChangeActiveSourceCode()
EndIf
EndIf
LastOpenProjectFile$ = "" ; reset after loading
; Now load any sourcefiles (both from commandline and preferences)
;
If AutoReload
ForEach 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()
EndIf
ClearList(OpenFiles()) ; reset after loading
ForEach 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 = *ActiveSource
Else
*LastLoadedSource = 0
EndIf
; Open a new source if nothing was loaded
;
If ListSize(FileList()) = 0 Or (ListSize(FileList()) = 1 And *ProjectInfo)
NewSource("", #True)
HistoryEvent(*ActiveSource, #HISTORY_Create)
EndIf
FlushEvents()
CloseSplashScreen()
FlushEvents()
CompilerIf #Demo
DemoText$ = "This is the free version of "+DefaultCompiler\VersionString$+#NewLine
DemoText$ + "Please have a look at the 'Examples' folder for test programs."+#NewLine+#NewLine
DemoText$ + "Free version limitations:"+#NewLine
CompilerIf #SpiderBasic
DemoText$ + "- Program size limited to about 800 lines."+#NewLine+#NewLine
CompilerElse
CompilerIf #CompileWindows
DemoText$ + "- No DLL creation"+#NewLine
CompilerEndIf
DemoText$ + "- Code size limitation (about 800 lines)"+#NewLine+#NewLine
CompilerEndIf
DemoText$ + "Thanks a lot for using " + #ProductName$ + " !"+#NewLine+#NewLine
DemoText$ + "The Fantaisie Software Team."
MessageRequester("Information", DemoText,ドル #FLAG_INFO)
FlushEvents()
CompilerEndIf
StartupCheckScreenReader()
AddTools_Execute(#TRIGGER_EditorStart, 0)
;MessageRequester("startup time", Str(ElapsedMilliseconds()-__time))
; Detect possible crashed session and display info if so
DetectCrashedHistorySession()
; 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 files
ActivateMainWindow()
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 loop
QuitIDE = 0
Repeat
DispatchEvent(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 | #CompileMacCocoa
If ListSize(OpenFilesCommandLine()) > 0
ForEach OpenFilesCommandLine()
FileName$ = OpenFilesCommandLine()
If Left(FileName,ドル 7) = "--LINE "
; apply the current line commandline option
InitialSourceLine = Val(Right(FileName,ドル Len(FileName$)-7))
If InitialSourceLine > 0 And InitialSourceLine < GetLinesCount(*ActiveSource) ; apply the -l option
ChangeActiveLine(InitialSourceLine, -5)
EndIf
ElseIf 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()
EndIf
Next OpenFilesCommandLine()
; Empty list and make sure the IDE is in the foreground now
;
ClearList(OpenFilesCommandLine())
SetWindowForeground(#WINDOW_Main)
ResizeMainWindow()
EndIf
CompilerEndIf
Until QuitIDE
;- Editor end
ShutdownIDE()
End
Procedure 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 IsProject
LastOpenProjectFile$ = ProjectFile$
EndIf
CloseProject(#True)
; Write close events for any remaining open files
HistoryShutdownEvents()
; make sure all window settings are saved by closing them if they are open
;
If IsWindow(#WINDOW_FileViewer)
FileViewerWindowEvents(#PB_Event_CloseWindow)
EndIf
If IsWindow(#WINDOW_Find)
FindWindowEvents(#PB_Event_CloseWindow)
EndIf
If IsWindow(#WINDOW_StructureViewer)
StructureViewerWindowEvents(#PB_Event_CloseWindow)
EndIf
If IsWindow(#WINDOW_Grep)
GrepWindowEvents(#PB_Event_CloseWindow)
EndIf
If IsWindow(#WINDOW_GrepOutput)
GrepOutputWindowEvents(#PB_Event_CloseWindow)
EndIf
If IsWindow(#WINDOW_EditTools)
AddTools_EditWindowEvents(#PB_Event_CloseWindow) ; close this one before the AddTools Window!
EndIf
If IsWindow(#WINDOW_AddTools)
AddTools_WindowEvents(#PB_Event_CloseWindow)
EndIf
;
; If IsWindow(#WINDOW_CPUMonitor)
; CPUMonitorWindowEvents(#PB_Event_CloseWindow)
; EndIf
If IsWindow(#WINDOW_Template)
TemplateWindowEvents(#PB_Event_CloseWindow)
EndIf
If IsWindow(#WINDOW_MacroError)
MacroErrorWindowEvents(#PB_Event_CloseWindow)
EndIf
If IsWindow(#WINDOW_Warnings)
WarningWindowEvents(#PB_Event_CloseWindow)
EndIf
If IsWindow(#WINDOW_Diff)
DiffWindowEvents(#PB_Event_CloseWindow)
EndIf
If IsWindow(#WINDOW_DiffDialog)
DiffDialogWindowEvents(#PB_Event_CloseWindow)
EndIf
If IsWindow(#WINDOW_FileMonitor)
FileMonitorWindowEvents(#PB_Event_CloseWindow)
EndIf
; OptionWindow is closed when the source is closed
CompilerIf #CompileLinux | #CompileMac
If IsWindow(#WINDOW_Help)
HelpWindowevents(#PB_Event_CloseWindow)
EndIf
CompilerEndIf
; call the destroy function for all ToolsPanel items that have one
;
ForEach UsedPanelTools()
*PanelToolData.ToolsPanelEntry = UsedPanelTools()
If *PanelToolData\NeedDestroyFunction
PanelTool.ToolsPanelInterface = UsedPanelTools()
PanelTool\DestroyFunction()
EndIf
Next UsedPanelTools()
; Close any tools in external tool windows
;
ForEach AvailablePanelTools()
If AvailablePanelTools()\IsSeparateWindow
If AvailablePanelTools()\NeedDestroyFunction
Tool.ToolsPanelInterface = @AvailablePanelTools()
Tool\DestroyFunction()
EndIf
If MemorizeWindow And IsWindowMinimized(AvailablePanelTools()\ToolWindowID) = 0
Window = AvailablePanelTools()\ToolWindowID
AvailablePanelTools()\ToolWindowX = WindowX(Window)
AvailablePanelTools()\ToolWindowY = WindowY(Window)
AvailablePanelTools()\ToolWindowWidth = WindowWidth(Window)
AvailablePanelTools()\ToolWindowHeight = WindowHeight(Window)
EndIf
CloseWindow(AvailablePanelTools()\ToolWindowID)
AvailablePanelTools()\ToolWindowID = -1
AvailablePanelTools()\IsSeparateWindow = 0
EndIf
Next AvailablePanelTools()
; memorize main window settings
;
If MemorizeWindow And IsWindowMinimized(#Window_Main) = 0
IsWindowMaximized = IsWindowMaximized(#WINDOW_Main)
EditorWindowWidth = Save_EditorWidth
EditorWindowHeight = Save_EditorHeight
EditorWindowX = Save_EditorX
EditorWindowY = Save_EditorY
Else
EditorWindowWidth = Memorize_EditorWidth
EditorWindowHeight = Memorize_EditorHeight
EndIf
; 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 ErrorLogVisible
ErrorLogHeight = GadgetHeight(#GADGET_LogSplitter) - GetGadgetState(#GADGET_LogSplitter)
Else
ErrorLogHeight = ErrorLogHeight_Hidden
EndIf
If ToolsPanelVisible
If ToolsPanelSide = 0
ToolsPanelWidth = GadgetWidth(#GADGET_ToolsSplitter) - GetGadgetState(#GADGET_ToolsSplitter)
Else
ToolsPanelWidth = GetGadgetState(#GADGET_ToolsSplitter)
EndIf
Else
ToolsPanelWidth = ToolsPanelWidth_Hidden
EndIf
; Close main window, macOS hide window (Fix IDE Crash)
CompilerIf #CompileMac
HideWindow(#WINDOW_Main, #True)
CompilerElse
CloseWindow(#WINDOW_Main)
CompilerEndIf
; Fix IDE crash on macOS Big Sur
CompilerIf #CompileMac
FlushEvents()
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 dlls
SavePreferences()
KillCompiler()
DeleteRegisteredFiles()
CompilerCleanup()
OSEndCode()
EndProcedure
DataSection
Image_Startup:
CompilerIf #SpiderBasic
IncludeBinary "data/SpiderBasic/SplashScreen_hdpi.png"
CompilerElse
IncludeBinary "data/startuplogo_hdpi.png"
CompilerEndIf
EndDataSection
Loading...
举报
举报成功
我们将于2个工作日内通过站内信反馈结果给你!
请认真填写举报原因,尽可能描述详细。
请选择举报类型
取消
发送
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

简介

PureBasic是由Fantaisie Software所开发的商用BASIC程序语言及集成开发环境。特点是语法简单直接,不依赖运行时库,因此能编译出相当小巧的程序,包含命令列或GUI执行档、DLL等。而且不使用各系统的API,所以有高度的跨平台特性,支持Windows 32/64位元、Linux 32/64位元、Mac OS X、Amiga。
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
编辑仓库简介
简介内容
主页
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/PureBasic/purebasic.git
git@gitee.com:PureBasic/purebasic.git
PureBasic
purebasic
PureBASIC
devel
点此查找更多帮助

搜索帮助

评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册

AltStyle によって変換されたページ (->オリジナル) /