From 1b7ccb6891e71a1fa38a0f9f2c9965fe352b43b2 Mon Sep 17 00:00:00 2001 From: Samuel Gomes Date: Wed, 10 Jan 2024 04:47:01 +0530 Subject: [PATCH] Use Base64 library wherever Pack() & Unpack() were used --- InForm/InFormVersion.bas | 7 +- InForm/UiEditor.bas | 321 ++++++++----------------------------- InForm/UiEditorPreview.bas | 176 ++++---------------- InForm/vbdos2inform.bas | 12 +- InForm/xp.uitheme | 2 +- README.md | 4 +- 6 files changed, 109 insertions(+), 413 deletions(-) diff --git a/InForm/InFormVersion.bas b/InForm/InFormVersion.bas index 7a51613..2eb19ef 100644 --- a/InForm/InFormVersion.bas +++ b/InForm/InFormVersion.bas @@ -1,6 +1,3 @@ -'Starting with v1.0, __UI_VersionNumber is actually the current build. +' SemVer (Major.Minor.Patch) -CONST __UI_Version = "1.5" -CONST __UI_VersionNumber = 3 -CONST __UI_VersionIsBeta = TRUE -CONST __UI_CopyrightSpan = "2016-2024" +CONST __UI_Version = "1.5.3" diff --git a/InForm/UiEditor.bas b/InForm/UiEditor.bas index 342d036..a69e363 100644 --- a/InForm/UiEditor.bas +++ b/InForm/UiEditor.bas @@ -246,6 +246,9 @@ END IF DIM SHARED CurrentPath$, ThisFileName$ +CONST EDITOR_IMAGE_COMMONCONTROLS~%% = 1~%% +CONST EDITOR_IMAGE_DISK~%% = 2~%% + 'CheckPreviewTimer = _FREETIMER 'ON TIMER(CheckPreviewTimer, .003) CheckPreview @@ -355,10 +358,7 @@ SUB __UI_Click (id AS LONG) CASE AlignMenuAlignCenterH: Dummy = 208 CASE AlignMenuDistributeV: Dummy = 209 CASE AlignMenuDistributeH: Dummy = 210 -CASE AlignMenuAlignLeft, AlignMenuAlignRight, AlignMenuAlignTops, _ -AlignMenuAlignBottoms, AlignMenuAlignCentersV, AlignMenuAlignCentersH, _ -AlignMenuAlignCenterV, AlignMenuAlignCenterH, AlignMenuDistributeV, _ -AlignMenuDistributeH + CASE AlignMenuAlignLeft, AlignMenuAlignRight, AlignMenuAlignTops, AlignMenuAlignBottoms, AlignMenuAlignCentersV, AlignMenuAlignCentersH, AlignMenuAlignCenterV, AlignMenuAlignCenterH, AlignMenuDistributeV, AlignMenuDistributeH b$ = MKI$(0) SendData b$, Dummy CASE OptionsMenuAutoName @@ -405,10 +405,7 @@ AlignMenuDistributeH CASE AddPictureBox: Dummy = __UI_Type_PictureBox CASE AddFrame: Dummy = __UI_Type_Frame CASE AddToggleSwitch: Dummy = __UI_Type_ToggleSwitch -CASE AddButton, AddLabel, AddTextBox, AddCheckBox, _ -AddRadioButton, AddListBox, AddDropdownList, _ -AddTrackBar, AddProgressBar, AddPictureBox, AddFrame, _ -AddToggleSwitch + CASE AddButton, AddLabel, AddTextBox, AddCheckBox, AddRadioButton, AddListBox, AddDropdownList, AddTrackBar, AddProgressBar, AddPictureBox, AddFrame, AddToggleSwitch b$ = "NEWCONTROL>" + MKI$(Dummy) + "" Send Client, b$ CASE AddNumericBox @@ -580,9 +577,7 @@ AddToggleSwitch SaveForm TRUE, Control(SaveFrmOnlyCB).Value END IF CASE HelpMenuAbout - DIM isBeta$ - IF __UI_VersionIsBeta THEN isBeta$ = " Beta Version" ELSE isBeta$ = "" - MessageBox "InForm GUI for QB64-PE - Created by Fellippe Heitor (" + __UI_CopyrightSpan + ")" + STRING$(2, 13) + UiEditorTitle$ + " v" + __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", UiEditorTitle$ + " - About", MsgBox_Information + MessageBox "InForm GUI engine for QB64-PE" + CHR$(13) + "Fellippe Heitor, (2016 - 2022) - @FellippeHeitor" + chr$(13) + "George McGinn, 2023 - gbytes58@gmail.com"+ CHR$(13) + "Samuel Gomes, (2023 - 2024) - @a740g" + STRING$(2, 13) + UiEditorTitle$ + " v" + __UI_Version + STRING$(2, 13) + "https://github.com/a740g/InForm-PE", UiEditorTitle$ + " - About", MsgBox_Information CASE HelpMenuHelp MessageBox "Design a form and export the resulting code to generate an event-driven QB64-PE program.", UiEditorTitle$ + " - What's all this?", MsgBox_Information CASE FileMenuExit @@ -757,9 +752,7 @@ AddToggleSwitch __UI_Focus = 0 __UI_ForceRedraw = TRUE -CASE FileMenuRecent1, FileMenuRecent2, FileMenuRecent3, _ -FileMenuRecent4, FileMenuRecent5, FileMenuRecent6, _ -FileMenuRecent7, FileMenuRecent8, FileMenuRecent9 + CASE FileMenuRecent1, FileMenuRecent2, FileMenuRecent3, FileMenuRecent4, FileMenuRecent5, FileMenuRecent6, FileMenuRecent7, FileMenuRecent8, FileMenuRecent9 DIM RecentToOpen$ RecentToOpen$ = ToolTip(id) IF _FILEEXISTS(RecentToOpen$) THEN @@ -2814,8 +2807,7 @@ SUB __UI_OnLoad LINE INPUT #FreeFileNum, b$ b$ = LTRIM$(RTRIM$(b$)) uB$ = UCASE$(b$) -IF (LEFT$(b$, 1) = "'" OR LEFT$(uB$, 4) = "REM ") AND _ -INSTR(uB$, "$INCLUDE") > 0 THEN + IF (LEFT$(b$, 1) = "'" OR LEFT$(uB$, 4) = "REM ") AND INSTR(uB$, "$INCLUDE") > 0 THEN DIM FirstMark AS INTEGER, SecondMark AS INTEGER FirstMark = INSTR(INSTR(uB$, "$INCLUDE") + 8, uB$, "'") IF FirstMark > 0 THEN @@ -2985,7 +2977,7 @@ INSTR(uB$, "$INCLUDE") > 0 THEN 'Load toolbox images: DIM CommControls AS LONG - CommControls = LoadEditorImage("commoncontrols.bmp") + CommControls = LoadEditorImage(EDITOR_IMAGE_COMMONCONTROLS) __UI_ClearColor CommControls, 0, 0 i = 0 @@ -3047,7 +3039,7 @@ INSTR(uB$, "$INCLUDE") > 0 THEN _DEST prevDest - Control(FileMenuSave).HelperCanvas = LoadEditorImage("disk.png") + Control(FileMenuSave).HelperCanvas = LoadEditorImage(EDITOR_IMAGE_DISK) _FREEIMAGE CommControls @@ -3362,235 +3354,57 @@ SUB PreselectFile END IF END SUB -FUNCTION EditorImageData$ (FileName$) - DIM A$ - - SELECT CASE LCASE$(FileName$) - CASE "disk.png" - A$ = MKI$(16) + MKI$(16) - A$ = A$ + "0000005D@1AA15TB=MdA[`hQ7>c[ZZj<7:HOcPgL^=COc=g<0FGMbd7Nc=cH" - A$ = A$ + "NiE<:A4A]0000`0GHIUb854?oWiUFj_iUCno4;\`o;Nh" - A$ = A$ + "QoOjXSnoXO^ioKNiUo_k]cnoHFIUo7S8Rl?IOaeoQeEFoc3>hLCD:YdCJM5E" - A$ = A$ + "o33:SPOUC>io5Ckod>k\o[K^in?Mb9go9000n[dA5eoA35do`\b:e04?i`TA35doR\16lcWN" - A$ = A$ + "jmOYUFjo0000oOZYVn?^gNkod>k\oCk\cn_^iVkob5GLo3000lo@odCoo\S>" - A$ = A$ + "o_R9VDS=b83Cn\C>oga5D`oK]efoXNjYog7Olm_ZYVjoanj[ooZ[^n_[]fjo" - A$ = A$ + "b6K\o[FJYm?000`ojLS=mK3=bl_9R8B=bl2;<=3<_lO<^d2o^\R:oODA4m_G" - A$ = A$ + "L]eoFAeDo;5D@moDA5eoB15Do3UC=m??jTcoahB;o7S;]h?<]`boR8R8el2;" - A$ = A$ + "\`D<]dbo^\b:l[3>glo>iPcof@cgl??jTcolT3>ocS>ilO?jTcood3?" - A$ = A$ + "oK3=clO;ZTRo^\R:o;R8RD3?iT3C0000o7GK]aOe?kloEk\coG]c>oOe?klo" - A$ = A$ + "Eo\coGmc>oOe?kloEkLcoSMdAo_aonkojPc=nOb8Rlo:[\B=314?<1000l?Q" - A$ = A$ + "028oY;^ho?>gLo?iMgmoTgMgoCNgMo?iMgmoTgMgo?NgLo_iOomoKG=eoKd@" - A$ = A$ + "3eO7JTao`\b:e04?l`4000`o2fGOlSNhQo_hL_moSg=go?NgMoohMcmoSgMg" - A$ = A$ + "o?NgMo_hLcmoUomgoWmdCo_@01ToJHQ5o_b:[D3@l`3C0000o?8P0b_jUCno" - A$ = A$ + "To]goG>hOoOiPomoU3ngoG>hOoOiPomoUomgoS^hRo?gGKmo35d?mGA4@lo:" - A$ = A$ + "[\B=o`3?=1000lOQ2:8o]S>joO^hQo?jS;noX?^hoSnhRo?jS;noX?^hoO^h" - A$ = A$ + "Ro_jUGnoO_]fn;4@0mO4<``o\`2;d\c>kT40000h5:XPhc>jWg?jT?>oYG>i" - A$ = A$ + "lWNiTc?jT?NoXCnhmWNiTc?jT?>o[O^ilgMfHo?A294l3000Kg2:XTc9T@2E" - A$ = A$ + "0000OcUFImoS;^ho:NhQo_8R8noR8Rho;R8Ro_8R8noR8Rho;R8Ro_8R8n_R" - A$ = A$ + "7NholXC>iW@14X=9P02@<`03FLa5Gh4000`?000001000040000@00000100" - A$ = A$ + "0040000@000001000040000@0000o@0000loN21`ocU30o_W@0loLi0`ok940o?G>0loN21`ocU30o_W@0loN:1aoFKL[oK?0fo_cmFjoD^F>ok]c6ooooooooooooooo" - A$ = A$ + "oooooooooooooooooooooooooooooooooooooooo_O^goCiHal_emfjo0loooooooooooooooooooooooooooooooooooooo0000oooooooooooo" - A$ = A$ + "oooooooooooooooogOomo_W@0loN21`oooooooooooooooooooooooooooooooooooooo3000loooooooooooooooooooooogOom" - A$ = A$ + "oOoooooLi0`ocU30ooooooooooooooooo3000l?000`ooooooooooo?000`o0000o3000loooooooooooOomgook_Oook940o_W@" - A$ = A$ + "0lomooooooooooooooooooooooooo3000loooooo0000oooooooooooo0000oooooook_Ooo_Oomo?G>0loLi0`ogooooOomgooo" - A$ = A$ + "oooo0000o3000l?000`oooooo3000loooooogOomo3000lomgOooWonkoOnk_ooN21`ok940oonmgooooooo0000oOooooomgOoo" - A$ = A$ + "0000oOomgo?000`ogOomoOoooo?000`ogooooOni_ooi_onocU30o?G>0lomgOoo_OomoOomgo?000`o0000o3000lomgOoo0000" - A$ = A$ + "o3000l?000`ogOomoonmgooiWonoNOnio_W@0loN21`o_onkoOomgookgOoogOomoon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- A$ = A$ + "f3Pmok\c>o?000`o8000oK\a6o_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_@i4co6K\aoK?0fo_m0HooQP16" - A$ = A$ + "o3000loHJ9eof3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_c>klo0000o[T@ilO>a4co2UCo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hooc=VFo?VDBm_m0Hoof3PmoK?0fo_m0Hoo0000o3000loHJ9eof3PmoK?0fo_m" - A$ = A$ + "0Hoof3PmoK?0fo_m0Hoo6K\aoS14@l_a6Klof3PmoK?0fo_m0Hoof3Pmoc8Qkm?000`oQP16oK\a6o_m0Hoof3PmoK?0fo_m0Hoo" - A$ = A$ + "6K\ao7CgKYoK?0fo_m0Hoof3Pm" - A$ = A$ + "oK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK]cen?QB5boeBiLoKL_]noiWOno>gK[og:U[m?QB5bof3PmoK?0fo_m0Hoof3PmoK?0" - A$ = A$ + "fo_m0Hoof3Pmok]cmnOY4Zeo>KL]oOnk_ook_ono_onkoOomgookgOoomF:QoG:QJm_g>gkof3PmoK?0fo_m0Hoof3PmoK?0fo?Q" - A$ = A$ + "B5bo>gK[oOniWooi_onoWonkoonmgook_onogOomoOomgo_e>gko4:E8oK?0fo_m0Hoof3PmoK?0fo_cmFjo]BiLoOnk_ook_ono" - A$ = A$ + "Woniogjien_B6;eoUjMYoonm_ooooooooooooG;Ucm_cmFjof3PmoK?0fo_m0HooD^WFoKL_]noi_onoWonkogji]n_DF;eo2I\B" - A$ = A$ + "oWB[Yl?WFciogOomoooooo_e>gko<>WBoK?0fo_m0Hoof3PmoCXFQloiWOno_onkoOomgo_B6;eo2i\BoWC_ilO:]VboQ`I:oooo" - A$ = A$ + "oooooooooooooCXFQl_m0Hoof3PmoK?0foOYD^go>gK[oonmgook_onoUJMYoWB[YlO8UVbo@@94ocYcLnoooooooooook]cmn?S" - A$ = A$ + "[Ydof3PmoK?0fo_m0Hoo>gKYog:UcmokgOoogOomoonm_o?WFGjoY`I:ocYcLnokgOooooooooooooO]D>go>gKYoK?0fo_m0Hoo" - A$ = A$ + "f3PmoK?0fo?QB5boFKL]oOomgooooooogOomoooooooooooooooooooooo_gFKlo4:E8oK?0fo_m0Hoof3PmoK?0fo_m0HooNkL_" - A$ = A$ + "oG:QJm_g>gkooooooooooooooooooooooooooo_gFKlo]BhHok]cmn_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_g>gko4:E8oG;U" - A$ = A$ + "cm_e>gkooooook]cmnO]D>go4:E8ok]cmn_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_cmFjo]B9QoCXFQlO[" - A$ = A$ + "D^go>gKYoK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoo" - A$ = A$ + "f3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoof3Pm" - A$ = A$ + "oK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0" - A$ = A$ + "foO_UBhomb9QoKLY4nO_UBhomF:Qog;W4n_aUBhomF:QogKY4nO_LBho6G:QogKY4nO_UBhomb9QoKLY4n_m0Hoomb9Qoooooooo" - A$ = A$ + "ooooooooooooooooooooooooooooooom>GkookL]oO_aen_cUBiogkL]oo_cenO_L^gof3PmoKLY4noooooooooooooooooooooo" - A$ = A$ + "oooooooooooooooookL]oO_cen_cUBio0000okL[Dnom>GkomF:QoK?0foO_L^gooooooooooooooooooooooooooooooooooooo" - A$ = A$ + "oO_aenom>Gko0000oo_cen?000`ogkL]og;W4n_m0HoomF:Qoooooo?000`o0000o3000loooooooooooooooooo>GkogkL]oo_c" - A$ = A$ + "enom>GkookL]oO_cen_aUBhof3Pmog;W4noooooooooooooooooooooooooooooooooooooogkL]oo_cenom6GkogkL]oO_cenoo" - A$ = A$ + ">GkombiNoK?0fo_aUBhoooooo3000l?000`o0000o3000l?000`oooooooom_ooo_OnooOokoookWooogonoooniogKY4n_m0Hoo" - A$ = A$ + "mbiNooooooooooooooooooooooooooooooooooooooom6GkogkL]oO_cenoo>GkogKL]oO_cenO_LBhof3PmogKY4noooooo0000" - A$ = A$ + "o3000l?000`o0000oooooooooooookL]oO_cenoo>GkogkL]oo_cenom>Gko6G:QoK?0foO_LBhooooooooooooooooooooooooo" - A$ = A$ + "oooooooooooooO_cenoo>Gko0000oO_cen?000`ookL]og;Wkm_m0Hoo6G:Qoooooooooooooooooooooooooooooooooooooooo" - A$ = A$ + ">GkogkL]okLYDn?000`o>g:UoO_cenO_UBhof3Pmog;WkmoooooooooooooooooooooooooooooooooooooogKL]oO_cenom>Gko" - A$ = A$ + ">G:UoO_aenom>Gkomb9QoK?0foO_UBhomb9QoKLY4nO_UBhomF:Qog;W4n_aUBhomF:QogKY4nO_LBho6G:QogKY4nO_UBhomb9Q" - A$ = A$ + "oKLY4n_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0" - A$ = A$ + "fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m" - A$ = A$ + "0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0foO_UBhomb9QoKLY4nO_UBhomF:Qog;W4n_aUBho" - A$ = A$ + "mF:QogKY4nO_LBho6G:QoCXDHl?QB5bo4:56oCXFQl?QBQaomb9Qoooooooooooooooooooooooooooooooooooooooooooooooo" - A$ = A$ + "oooooo?QB5bo6K\aoK\a6o_a6Klo4:E8oKLY4noooooooooooooooooooooooooooooooooooooooooooooooooooooo4:56oCXF" - A$ = A$ + "Ql_a6Klo4:E8oCXDHlO_L^go4:E8oCXDHl?QB5bo4:56oCXDQl?QBQao4:E8oCXDHl?QB5bo4:56oCXDQl?QBQao4:E8oCXDHl?Q" - A$ = A$ + "B5bof3Pmog;W4noooooooooooooooooooooooooooooooooooooogkL]oo_cenom>Gko>G:UoO_cenoo>GkomF:QoK?0foO_UBho" - A$ = A$ + "oooooooooooooooooooooooooooooooooooooo_cenom6Gko>G:Uo3000l_cUBiogKL]ogKY4n_m0HoomF:Qoooooo?000`o0000" - A$ = A$ + "o3000looooooooooooooooom>GkookL]o3000loo>Gko0000oo_cenO_LBhof3PmogKY4noooooooooooooooooooooooooooooo" - A$ = A$ + "oooooooogkL]oO_cenoo>GkogKL]oO_cenom>GkomF:QoK?0foO_LBhoooooo3000l?000`o0000o3000l?000`oooooog;W4n_a" - A$ = A$ + "UBhomF:QogKY4nO_LBho6G:QogKY4n_m0HoomF:Qoooooooooooooooooooooooooooooooooooooooo>GkogKL]oO_cenom>Gko" - A$ = A$ + "okL]oO_aenO_UBhof3PmogKY4noooooo0000o3000l?000`o0000oooooooooooogkL]oo_cen?000`ookL]o3000loo>Gkomb9Q" - A$ = A$ + "oK?0foO_UBhooooooooooooooooooooooooooooooooooooooO_cenom>Gko>G:Uo3000l_cUBiogkL]ogKY4n_m0Hoomb9Qoooo" - A$ = A$ + "ooooooooooooooooooooooooooooooooooom>GkookL]oO_cen_cUBiogkL]oo_cenO_UBhof3PmogKY4nO_L^gomF:Qog;W4nO_" - A$ = A$ + "UBhombiNogKY4nO_LBhomF:Qog;WkmO_UBhomb9QogKY4nO_L^gomF:QoK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoo" - A$ = A$ + "f3PmoK?0fo_m0Hoof3Pm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+ "oK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0" - A$ = A$ + "fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m" - A$ = A$ + "0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoo" - A$ = A$ + "f3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoof3PmoK?0fo_m0Hoof3Pmo_fJ[moJ[]fo[]fJo_fJ[moJ[]fo[]fJ" - A$ = A$ + "o_fJ[moJ[]fo[]fJo_fJ[moJ[]fo[]fJo_fJ[moJ[]fof3Pmo_fJ[m_gNkmooooooooooooooooooooooooooooooooooooooooo" - A$ = A$ + "oooooooooooooooooooooooo_onko_fJ[moJ[]foooooo;Ug:m_DN;eoooooo;UgBm_DN[doooooo;Ug:m_DN;eooooooooooooo" - A$ = A$ + "oooooooooooooooJ[]fo[]fJooooooO>NWcoiHMNWcoihM>ooooooO>NWcoihM>oooooooooooooooooooooooooooo" - A$ = A$ + "[]fJo_fJ[mooooooaHM:o7SgalooooooaHMg:UokLYDn_aLBhomb9QoG;ScmO]<>go]^gHogjNSmOYc9eoU>WDoK?0fo_m0Hoo>g:Woooooooooooooooooooooooooooooooo" - A$ = A$ + "oooooooooooooOokooom_oooWkmooO^eoCX@Yl_m0Hoof3PmokL[Lnoooooooooooooooooooooooooooooooo_gNOooag:UoooooooooooooooooooooooooooooOomo7cHNooL6ooo:AYeo7RD>oooFgkoFg:WoCXBYl_m0Hoo" - A$ = A$ + "f3PmoKLYDnoooooooooooooooooooooooOokooom_o_e6KmoQXUeoSQD6o_eeFkookL]okL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= A$ + "fo_m0Hoof3PmoK?0%fo?" - END SELECT - - EditorImageData$ = A$ -END FUNCTION - '--------------------------------------------------------------------------------- -FUNCTION LoadEditorImage& (FileName$) - DIM MemoryBlock AS _MEM, TempImage AS LONG - DIM NewWidth AS INTEGER, NewHeight AS INTEGER, A$, BASFILE$ +' Use this to store editor images and bitmaps +' Take care not to call multiple times for the same image as it will create a new _IMAGE everytime it is called! +FUNCTION LoadEditorImage& (id AS _UNSIGNED _BYTE) + SELECT CASE id + CASE EDITOR_IMAGE_COMMONCONTROLS + CONST SIZE_COMMONCONTROLS_BMP_11386~& = 11386~& + CONST COMP_COMMONCONTROLS_BMP_11386%% = -1%% + CONST DATA_COMMONCONTROLS_BMP_11386 = _ + "eNpy8q3SYQC0W4UwsgJJdC5nRo4ceciRSCwSiRw7knO4wyKRyLZIkjNILBLZsi0S90e+q7x0SF96tj/MbvJ/NluZl6KYflVV3UWnKP8R/FtwEfxX" + _ + "8I/Tv07/PH0ksD9rvCG/Tr/wWXRdC6VadIp6t22578alD8Fn8haoPxdfuD/1f239Oj25mjDZ6UD9zvow3+1hPnvr/Xy8/n8VO6D/SnRljjq9oc4E" + _ + "aURU6RW1oEos4ovFmShvZ7j8Vis0gmpu8BhL5EOBWOW4tSmuTbLhViXIkht9bfzqjnGZ0C8D/dRzKz6qzUckPi6N8O4JinuGR54yB8tHXz3I1U8j" + _ + "ekTr5JH1BW4qQ54laKuSkGtTamJ8YmgKqK62PjS11IJyapjDQ+ob+w5D15I7tI3Ed/klnuvi+DDUUgcKyU2PA8w8kvscFQbVoE6uG39sa4iAPuqS" + _ + "3EHqKB4Z5l6hyFPWbAYFTB1G1aJy+JMin/JcDH10jeRkZmDRgJkgSQDzIOjFRcsztnzanjxXQk8a0V3jmk/Qw0AfkhP7w/LF9vjWxxPxw6CcgKwV" + _ + "P/nMPLTwpdccvsIHInyNcQXKEcxDEoIZOua/h28McyCkFu7HMnY74/v7gcUINL8Xl68HRT1Tt5i7lucyCqQ/COlTQ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W2+7/bx9fL5SMf" + _ + "/M/hbmjqitzo6vr2UT7ueOS5tf34j3senh3nmeuyNEESx0iTGJfLeePL/wE+QY6TI3MOxPagmhr3LHXzwVlAnzvP4nI+U0sd5Cfx7dg8WRaoiseR" + _ + "ur0cLJf1v9NTVcUzd+s+nIPthW8NPfWcaar0hDI5/U5z9pnHbuM2jxjj0GPWhpis/sgex4EcPfaosgvmecJqZ7Sdmj4kD+bkzIi7tOGMuLIWgfuf" + _ + "e8/4tl23CFd8MLaA70TANcDGc/Vz+x/kL6sT33IC84Pri1yBjU++J6H5YV1Zxxafsn9+YA7iY4sfEJfn8pmzjX+Yb30wdnO/wegJR2URjvQ8+7gt" + _ + "Eph5v491MWht/8o3QC157Ph2qNnzeiL30/gfg472/w==" - A$ = EditorImageData$(FileName$) - IF LEN(A$) = 0 THEN EXIT FUNCTION + LoadEditorImage = _LOADIMAGE(Base64_LoadResourceString(DATA_COMMONCONTROLS_BMP_11386, SIZE_COMMONCONTROLS_BMP_11386, COMP_COMMONCONTROLS_BMP_11386), 32, "memory") - NewWidth = CVI(LEFT$(A$, 2)) - NewHeight = CVI(MID$(A$, 3, 2)) - A$ = MID$(A$, 5) + CASE EDITOR_IMAGE_DISK + CONST SIZE_DISK_BMP_1146~& = 1146~& + CONST COMP_DISK_BMP_1146%% = -1%% + CONST DATA_DISK_BMP_1146 = _ + "eNpy8q1iYQCDKiDOAWIBKGZkUGBgZsAF/kMQjEMG4OHhERMXF/cDMu2B2IEIbA90qrOokJAHkM2urqISAqTvx0RF/u/v7v7f1d7+v7ujAxcGy9tY" + _ + "Wf7kZGW5paKg4AAgixwC64iDMJ5jbbtx8mxtbLO27V5q81j3Xtu2bTxbcW7Vvv06/dft4Rv/ZhYmk6mAePe61as/1odDkbDfx9cE/EwUf8sjP2K+" + _ + "LhTkHRYzsjMzm+mb2CSJiYY0jishHsTzDeEwQl4Pwj7vv6K6F7WBAFw2q5CZno6ObdpALBar0zmumHisWbmSrw344Xc5EXC7/pfLhTDtsL9/h6yM" + _ + "tEjXjh0gEok0P/nVy5bxYY8HXrsNPoed5PjlSVS3sx2W169B94Ve3boxPiud8VhL92tov4/m/DT/j9iuIPG2t2+Qm5UV6durJ+TEcwYD4+fNmsW/" + _ + "ff4Mb5/90PN/9OwpzC9f4t716zDqdUJCTDS7LxOLixUSCaQiEU91mAx6aNUq8jrQfwJHOXmkkNJSONaTJCcJUlEyoqOjNUqZuFgll0EhlfBUQ15O" + _ + "NkaPHIHB1VWoLC9HVUUF8+WlJWwPzYEkyCVixmuVyuJUkwF9u3fh58yahQP792PZ0qU4dPAgTh4/juPHjuHY0aM4dfIkpk+bBnpXGHXaiFatRDzx" + _ + "6ZyhODcrA9G9e/BLFy/G3r172cz+fftw4fx5nDl9munSxYuYP28e62WlpUTSTEaI4uM1edkZRaWF+VCKE/llSxYzrlvLljh44ADjz/7BL5w/Hy2j" + _ + "ooTCvJxIXlYG+/4VhYVlw4dUQ54Y83H71q24e+eOQDeE+/fvCw6HQzCbzYL5/XvB6XQKmzdtYr3K0uIvxQW5kMtFGsrbjBw6+FF+BofdO3cIwYAf" + _ + "d27dgtfjQU04jHAoiGAggMaGeuzavh2K6GhMHDMS40YNA6fX64iP+rqAgAABV0dHL193d+2e9nbj9atWGbc31RpXFOcZ1xYXGzeUlhrVVhQbJ8fF" + _ + "GXq5uOgG+/v4hgb5h3t6evIBAK70LyE=" - BASFILE$ = Unpack$(A$) + LoadEditorImage = _LOADIMAGE(Base64_LoadResourceString(DATA_DISK_BMP_1146, SIZE_DISK_BMP_1146, COMP_DISK_BMP_1146), 32, "memory") - TempImage = _NEWIMAGE(NewWidth, NewHeight, 32) - MemoryBlock = _MEMIMAGE(TempImage) - - __UI_MemCopy MemoryBlock.OFFSET, _OFFSET(BASFILE$), LEN(BASFILE$) - _MEMFREE MemoryBlock - - LoadEditorImage& = TempImage -END FUNCTION - -FUNCTION Unpack$ (PackedData$) - 'Adapted from Dav's BIN2BAS - 'http://www.qbasicnews.com/dav/qb64.php - DIM A$, i&, B$, C%, F$, C$, t%, B&, X$, btemp$ - - A$ = PackedData$ - - FOR i& = 1 TO LEN(A$) STEP 4: B$ = MID$(A$, i&, 4) - IF INSTR(1, B$, "%") THEN - FOR C% = 1 TO LEN(B$): F$ = MID$(B$, C%, 1) - IF F$ <> "%" THEN C$ = C$ + F$ - NEXT: B$ = C$ - END IF: FOR t% = LEN(B$) TO 1 STEP -1 - B& = B& * 64 + ASC(MID$(B$, t%)) - 48 - NEXT: X$ = "": FOR t% = 1 TO LEN(B$) - 1 - X$ = X$ + CHR$(B& AND 255): B& = B& \ 256 - NEXT: btemp$ = btemp$ + X$: NEXT - - Unpack$ = btemp$ + CASE ELSE + ERROR 51 + END SELECT END FUNCTION FUNCTION ReadSequential$ (Txt$, Bytes%) @@ -4065,9 +3879,10 @@ SUB SaveForm (ExitToQB64 AS _BYTE, SaveOnlyFrm AS _BYTE) TextFileNum = FREEFILE OPEN BaseOutputFileName + ".frm" FOR OUTPUT AS #TextFileNum PRINT #TextFileNum, "': This form was generated by" - PRINT #TextFileNum, "': InForm - GUI library for QB64 - v"; __UI_Version - PRINT #TextFileNum, "': Fellippe Heitor, " + __UI_CopyrightSpan + " - fellippe@qb64.org - @fellippeheitor" - PRINT #TextFileNum, "': https://github.com/FellippeHeitor/InForm" + PRINT #TextFileNum, "': InForm GUI engine for QB64-PE - v"; __UI_Version + PRINT #TextFileNum, "': Fellippe Heitor, (2016 - 2022) - @FellippeHeitor" + PRINT #TextFileNum, "': Samuel Gomes, (2023 - 2024) - @a740g" + PRINT #TextFileNum, "': https://github.com/a740g/InForm-PE" PRINT #TextFileNum, "'-----------------------------------------------------------" PRINT #TextFileNum, "SUB __UI_LoadForm" PRINT #TextFileNum, @@ -4514,15 +4329,10 @@ SUB SaveForm (ExitToQB64 AS _BYTE, SaveOnlyFrm AS _BYTE) FOR Dummy = 1 TO UBOUND(PreviewControls) GOSUB checkCondition IF checkConditionResult THEN - IF INSTR(thisBlock$, " CASE " + RTRIM$(PreviewControls(Dummy).Name) + CHR$(10)) = 0 AND _ - INSTR(thisBlock$, " CASE " + RTRIM$(PreviewControls(Dummy).Name) + " '<-- " + CHR$(34) + RTRIM$(PreviewControls(Dummy).Name) + CHR$(34) + " deleted from Form on ") = 0 THEN + IF INSTR(thisBlock$, " CASE " + RTRIM$(PreviewControls(Dummy).Name) + CHR$(10)) = 0 AND INSTR(thisBlock$, " CASE " + RTRIM$(PreviewControls(Dummy).Name) + " '<-- " + CHR$(34) + RTRIM$(PreviewControls(Dummy).Name) + CHR$(34) + " deleted from Form on ") = 0 THEN addedItems$ = addedItems$ + SPACE$(indenting) + "CASE " + RTRIM$(PreviewControls(Dummy).Name) + CHR$(10) + CHR$(10) ELSEIF INSTR(thisBlock$, " CASE " + RTRIM$(PreviewControls(Dummy).Name) + " '<-- " + CHR$(34) + RTRIM$(PreviewControls(Dummy).Name) + CHR$(34) + " deleted from Form on ") > 0 THEN - thisBlock$ = LEFT$(thisBlock$, INSTR(thisBlock$, " CASE " + RTRIM$(PreviewControls(Dummy).Name) + _ - " '<-- " + CHR$(34)) + 5 + LEN(RTRIM$(PreviewControls(Dummy).Name))) + _ - MID$(thisBlock$, INSTR(INSTR(thisBlock$, " CASE " + RTRIM$(PreviewControls(Dummy).Name) + _ - " '<-- " + CHR$(34) + RTRIM$(PreviewControls(Dummy).Name) + CHR$(34) + _ - " deleted from Form on "), thisBlock$, CHR$(10))) + thisBlock$ = LEFT$(thisBlock$, INSTR(thisBlock$, " CASE " + RTRIM$(PreviewControls(Dummy).Name) + " '<-- " + CHR$(34)) + 5 + LEN(RTRIM$(PreviewControls(Dummy).Name))) + MID$(thisBlock$, INSTR(INSTR(thisBlock$, " CASE " + RTRIM$(PreviewControls(Dummy).Name) + " '<-- " + CHR$(34) + RTRIM$(PreviewControls(Dummy).Name) + CHR$(34) + " deleted from Form on "), thisBlock$, CHR$(10))) END IF END IF NEXT @@ -4542,9 +4352,10 @@ SUB SaveForm (ExitToQB64 AS _BYTE, SaveOnlyFrm AS _BYTE) ELSE OPEN BaseOutputFileName + ".bas" FOR OUTPUT AS #TextFileNum PRINT #TextFileNum, "': This program uses" - PRINT #TextFileNum, "': InForm - GUI library for QB64 - v"; __UI_Version - PRINT #TextFileNum, "': Fellippe Heitor, " + __UI_CopyrightSpan + " - fellippe@qb64.org - @fellippeheitor" - PRINT #TextFileNum, "': https://github.com/FellippeHeitor/InForm" + PRINT #TextFileNum, "': InForm GUI engine for QB64-PE - v"; __UI_Version + PRINT #TextFileNum, "': Fellippe Heitor, (2016 - 2022) - @FellippeHeitor" + PRINT #TextFileNum, "': Samuel Gomes, (2023 - 2024) - @a740g" + PRINT #TextFileNum, "': https://github.com/a740g/InForm-PE" PRINT #TextFileNum, "'-----------------------------------------------------------" PRINT #TextFileNum, PRINT #TextFileNum, "': Controls' IDs: ------------------------------------------------------------------" diff --git a/InForm/UiEditorPreview.bas b/InForm/UiEditorPreview.bas index ca259c4..443548f 100644 --- a/InForm/UiEditorPreview.bas +++ b/InForm/UiEditorPreview.bas @@ -19,7 +19,7 @@ READ_KEYWORDS CHDIR ".." -CONST EmptyForm$ = "9iVA_9GK1P<000`ooO7000@00D006mVL]53;1`B000000000noO100006mVL]5cno760cEfI_EFMYi2MdIf?Q9GJQaV;dAWIol2CY9VLQ9GN_HdK^AgL_4TLY56K^@7MVmCB^IdKbef;bEfL_EWLSEfL_hdKdmFC_ifK]8EIWE7KQ9W;dAWIo are here, replace them with # and * - 'Just so there's no HTML tag problems with forums. - 'They'll be restored during the decoding process.. - 'IF g$ = "<" THEN g$ = "#" - 'IF g$ = ">" THEN g$ = "*" - c$ = c$ + g$ - NEXT - a$ = c$ - RETURN -END FUNCTION - -FUNCTION Unpack$ (PackedData$) - 'Adapted from: - '================== - ' BASFILE.BAS v0.10 - '================== - 'Coded by Dav for QB64 (c) 2009 - 'http://www.qbasicnews.com/dav/qb64.php - DIM A$, i&, B$, C%, F$, C$, t%, B&, X$, btemp$ - - A$ = PackedData$ - - FOR i& = 1 TO LEN(A$) STEP 4: B$ = MID$(A$, i&, 4) - IF INSTR(1, B$, "%") THEN - FOR C% = 1 TO LEN(B$): F$ = MID$(B$, C%, 1) - IF F$ <> "%" THEN C$ = C$ + F$ - NEXT: B$ = C$ - END IF: FOR t% = LEN(B$) TO 1 STEP -1 - B& = B& * 64 + ASC(MID$(B$, t%)) - 48 - NEXT: X$ = "": FOR t% = 1 TO LEN(B$) - 1 - X$ = X$ + CHR$(B& AND 255): B& = B& \ 256 - NEXT: btemp$ = btemp$ + X$: NEXT - - Unpack$ = btemp$ -END FUNCTION - FUNCTION ReadSequential$ (Txt$, Bytes%) ReadSequential$ = LEFT$(Txt$, Bytes%) Txt$ = MID$(Txt$, Bytes% + 1) @@ -2443,7 +2365,7 @@ SUB LoadPreview (Destination AS _BYTE) b$ = ReadSequential$(Clip$, VAL("&H" + ClipLen$)) b$ = Replace$(b$, CHR$(10), "", FALSE, 0) - Clip$ = Unpack$(b$) + Clip$ = Base64_Decode(b$) END IF IF NOT Disk THEN b$ = ReadSequential$(Clip$, 2) ELSE b$ = SPACE$(2): GET #BinaryFileNum, , b$ @@ -3077,13 +2999,13 @@ SUB LoadPreviewText 'Tooltip DummyText$ = MID$(b$, INSTR(b$, " = ") + 3) DummyText$ = RestoreCHR$(DummyText$) - ToolTip(TempValue) = removeQuotation$(DummyText$) + ToolTip(TempValue) = RemoveQuotation$(DummyText$) ELSEIF LEFT$(b$, 19) = "Text(__UI_NewID) = " THEN IF LogFileLoad THEN PRINT #LogFileNum, "TEXT" 'Text DummyText$ = MID$(b$, INSTR(b$, " = ") + 3) DummyText$ = RestoreCHR$(DummyText$) - Text(TempValue) = removeQuotation$(DummyText$) + Text(TempValue) = RemoveQuotation$(DummyText$) IF Control(TempValue).Type = __UI_Type_Form THEN IF ExeIcon <> 0 THEN _FREEIMAGE ExeIcon: ExeIcon = 0 @@ -3097,7 +3019,7 @@ SUB LoadPreviewText 'Mask DummyText$ = MID$(b$, INSTR(b$, " = ") + 3) DummyText$ = RestoreCHR$(DummyText$) - Mask(TempValue) = removeQuotation$(DummyText$) + Mask(TempValue) = RemoveQuotation$(DummyText$) ELSEIF LEFT$(b$, 38) = "__UI_RegisterResult = RegisterKeyCombo" THEN IF LogFileLoad THEN PRINT #LogFileNum, "KEYCOMBO" DummyText$ = nextParameter(b$) @@ -3215,21 +3137,21 @@ FUNCTION nextParameter$ (__text$) END IF IF position2 = 0 THEN position2 = LEN(text$) + 1 thisParameter$ = LTRIM$(RTRIM$(MID$(text$, position1, position2 - position1))) - nextParameter$ = removeQuotation$(thisParameter$) + nextParameter$ = RemoveQuotation$(thisParameter$) position1 = position2 + 1 END FUNCTION -FUNCTION removeQuotation$ (__text$) +FUNCTION RemoveQuotation$ (__text$) DIM text$, firstQ AS LONG, nextQ AS LONG text$ = __text$ firstQ = INSTR(text$, CHR$(34)) - IF firstQ = 0 THEN removeQuotation$ = text$: EXIT FUNCTION + IF firstQ = 0 THEN RemoveQuotation$ = text$: EXIT FUNCTION nextQ = INSTR(firstQ + 1, text$, CHR$(34)) - IF nextQ = 0 THEN removeQuotation$ = MID$(text$, firstQ + 1): EXIT FUNCTION + IF nextQ = 0 THEN RemoveQuotation$ = MID$(text$, firstQ + 1): EXIT FUNCTION - removeQuotation$ = MID$(text$, firstQ + 1, nextQ - firstQ - 1) + RemoveQuotation$ = MID$(text$, firstQ + 1, nextQ - firstQ - 1) END FUNCTION SUB SavePreview (Destination AS _BYTE) @@ -3639,7 +3561,7 @@ SUB SavePreview (Destination AS _BYTE) END IF ELSE Clip$ = Clip$ + b$ - b$ = Pack$(Clip$) + b$ = Base64_Encode(Clip$) IF LEN(b$) > 60 THEN a$ = "" @@ -3921,7 +3843,6 @@ SUB RestoreRedoImage LoadPreview ToUndoBuffer END SUB - SUB LoadDefaultFonts IF Control(__UI_FormID).Font = 8 OR Control(__UI_FormID).Font = 16 THEN Control(__UI_FormID).Font = SetFont("segoeui.ttf", 12) @@ -3946,57 +3867,22 @@ SUB LoadDefaultFonts END IF END SUB -FUNCTION EditorImageData$ (FileName$) - DIM A$ +' Use this to store editor images and bitmaps +' Take care not to call multiple times for the same image as it will create a new _IMAGE everytime it is called! +FUNCTION LoadEditorImage& (id AS _UNSIGNED _BYTE) + SELECT CASE id + CASE EDITOR_IMAGE_CONTEXTMENU + CONST SIZE_CONTEXTMENU_BMP_1146~& = 1146~& + CONST COMP_CONTEXTMENU_BMP_1146%% = -1%% + CONST DATA_CONTEXTMENU_BMP_1146 = _ + "eNpy8q1iYQCDKiDOAWIBKGZkUGBgZsAF/kMQjEMGADRLhkwBAkEU9qcZjUaamDQpCYy2uyQmPJNQ4CCAFKtG0vFrAKA8zx1mx1FHOcdgeLPp49vH" + _ + "Hg6Av8hDXiPJcyRFY1Mg1Q3utIbSj1Bliaxsad5XrU31kSd2GAaM40jpug5939NcloWzrit94zNfM2+enxBH53irp26vcXV6hOD4kPmv/KEQzMeR" + _ + "j2maiN/rvwnPYIyhiEvmoaT1e9bvfe8XFyfYbkg72OnQn/y8/8Zz2kz90J/873nef57nX/tfGg0ZeNTfwU+s9VNc/Zal+6cyojcgA3/P/fn/c393" + _ + "v/v7/wd5BeeEEdg=" - SELECT CASE LCASE$(FileName$) - CASE "contextmenu.bmp" - A$ = MKI$(16) + MKI$(16) - A$ = A$ + "o3`ooo?0oooo0looo3`ooo?0oooo0looo3`ooo?0oooo0looo3`ooo?0oooo" - A$ = A$ + "0looo3`ooo?0oooo0looo3`ooo?0oooo0looo3`ooo?0oooo0looo3`ooo?0" - A$ = A$ + "oooo0looo3`ooo?0oooo0looo3`ooo?0oooo0looo3`ooo?0oooo0looo3`o" - A$ = A$ + "okXMWm_UVJjoFNj[oKiYWn?XXnjoGR:ZoS9Z`n?VYVjoQVJ\oSIZYnOVZ6ko" - A$ = A$ + "IZZZoo?0oooo0looo3`ooo?0oooQ^meo0000oK_mfo_mfKoogOomoOomgo?n" - A$ = A$ + "hSooiWOnoWOnioOniWooj[_noWYZanoo0looo3`ooo?0oooo0loo>JgIoGOm" - A$ = A$ + "eo?000`o>o[]o3:RgmoSgQfo827HoSGH8m?L@1doiWOno[_njoOVZZjoo3`o" - A$ = A$ + "oo?0oooo0looo3`ooOXKOmOmeGoofK_mo3000lomgOoogOomoS?nhoOniWoo" - A$ = A$ + "iWOnoWOnio_nj[ooIZJ\oo?0oooo0looo3`ooo?0oo_SfMfoeGOmoK_mfo_m" - A$ = A$ + "fKoo0000o3l[Xn?R`QeohQ5Bo37D0mOniWooj[_noWYZZnoo0looo3`ooo?0" - A$ = A$ + "oooo0loo7jfGoGOmeo_mfKoofK_moOomgo?000`ohS?noWOnioOniWooiWOn" - A$ = A$ + "o[_njoOVZ6koo3`ooo?0oooo0looo3`ookXMWmOmeGoofK_moK_mfo?000`o" - A$ = A$ + "0000o3000lO\QRio`15@oWOnio_nj[ooIZZZoo?0oooo0looo3`ooo?0oooQ" - A$ = A$ + "^meo0000o3000l_mfKoo0000oolc?o?b8SloiWOnoWOnioOniWooj[_noWYZ" - A$ = A$ + "anoo0looo3`ooo?0oooo0loo>JgIok\c>o_c>klo7n6HoOomgo?000`oHR8P" - A$ = A$ + "oS7F8m?LH1doiWOno[_njoOVZZjoo3`ooo?0oooo0looo3`ooKgQ7nOmeGoo" - A$ = A$ + "fK_moohMPmomgOoo0000oS Close or with Alt+F4 (Windows only). - *FormResized*, triggered when a form with the CanResize property is resized at runtime. @@ -120,4 +120,4 @@ InForm/extensions/MessageBox.bas ## NOTES -- This requires the latest version of [QB64-PE](https://github.com/QB64-Phoenix-Edition/QB64pe/releases/latest). More accurately, it only works with QB64-PE v3.8.0 or above. +- This requires the latest version of [QB64-PE](https://github.com/QB64-Phoenix-Edition/QB64pe/releases/latest). QB64, or other forks of QB64 will not work!