├── .gitignore ├── AndroidManifest.template.xml ├── Changed.txt ├── Clean DCUs.cmd ├── Clean EXEs.cmd ├── Clean folder.cmd ├── Conditional compilation (Delphi) - RAD Studio.url ├── Demo ├── Clean binaries.cmd ├── Conditional Demo.groupproj ├── Conditionals and Platform detection │ ├── FMX │ │ ├── FMX_Demo_PlatformDetection.dpr │ │ ├── FMX_Demo_PlatformDetection.dproj │ │ ├── MainForm.fmx │ │ └── MainForm.pas │ ├── PlatformTest.pas │ └── VCL │ │ ├── MainForm.dfm │ │ ├── MainForm.pas │ │ ├── VCL_Demo_PlatformDetection.dpr │ │ └── VCL_Demo_PlatformDetection.dproj ├── Demo All Visual Controls │ ├── Demo_VisualControls.dpr │ ├── Demo_VisualControls.dproj │ ├── Demo_VisualControls.res │ ├── MainForm.dfm │ └── MainForm.pas ├── Demo AutoTranslator │ ├── AutoTranslatorDemo.res │ ├── Demo_AutoTranslator.dpr │ ├── Demo_AutoTranslator.dproj │ ├── Demo_AutoTranslator.res │ ├── FormMain.dfm │ ├── FormMain.pas │ ├── IniEditor.lnk │ ├── Lang │ │ ├── Chinese.ini │ │ ├── English.ini │ │ ├── German.ini │ │ └── How to translate.rtf │ └── competition.url ├── Demo Binary file 1 │ ├── Demo_Binary1.dpr │ ├── Demo_Binary1.dproj │ └── Demo_Binary1.res ├── Demo Binary file 2 │ ├── Demo_Binary2.dpr │ ├── Demo_Binary2.dproj │ └── Demo_Binary2.res ├── Demo Binary file 3 │ ├── Demo_Binary3.dpr │ ├── Demo_Binary3.dproj │ └── Demo_Binary3.res ├── Demo GUI Autosave │ ├── Demo_SaveGUI.dpr │ ├── Demo_SaveGUI.dproj │ ├── Demo_SaveGUI.res │ ├── MainForm.dfm │ ├── MainForm.pas │ ├── One function to rule them all – Saving the whole GUI one single procedure call – Delphi in all its glory.url │ ├── SaveGUI_Demo.res │ ├── SecondForm.dfm │ ├── SecondForm.pas │ └── github Dephi-GUI-AutoSave .url ├── Demo Internet │ ├── Demo_Internet.dpr │ ├── Demo_Internet.dproj │ ├── Demo_Internet.res │ ├── FormMain.dfm │ └── FormMain.pas ├── Demo LightCore WinVersion │ ├── Demo_WinVers.dpr │ ├── Demo_WinVers.dproj │ ├── FormMain.dfm │ └── FormMain.pas ├── Demo LightCore ccIO │ ├── Demo_ccIO.dpr │ ├── Demo_ccIO.dproj │ ├── Demo_ccIO.res │ ├── MainForm.dfm │ ├── MainForm.pas │ ├── Results.PNG │ └── Tester_ccIO.res ├── Demo LightCore ccStreamBuff │ ├── Demo_FileStream.dpr │ ├── Demo_FileStream.dproj │ ├── Demo_FileStream.res │ ├── FormMain.dfm │ ├── FormMain.pas │ └── Tester_FileStream.res ├── Demo LightLog │ ├── Demo_Log.dpr │ ├── Demo_Log.dproj │ ├── Demo_Log.res │ ├── FormMain.dfm │ └── FormMain.pas ├── Demo SystemReport │ ├── Demo_SystemReport.dpr │ ├── Demo_SystemReport.dproj │ ├── Demo_SystemReport.res │ ├── MainForm.dfm │ └── MainForm.pas ├── Demo binary file 1 │ ├── DemoBinary1.res │ ├── MainForm1.dfm │ ├── MainForm1.pas │ └── uSoldier_v1.pas ├── Demo binary file 2 │ ├── DemoBinary2.res │ ├── MainForm2.dfm │ ├── MainForm2.pas │ └── uSoldier_v2.pas ├── Demo binary file 3 │ ├── DemoBinary3.res │ ├── MainForm3.dfm │ ├── MainForm3.pas │ └── uSoldier_v3.pas ├── DemoProjects.groupproj ├── DemoSerializeToBinary.groupproj ├── FMX - Demo LightPanel │ ├── FMX_Demo_LightPanel.dpr │ ├── FMX_Demo_LightPanel.dproj │ ├── FormTest.fmx │ └── FormTest.pas ├── FMX - Demo Message boxes │ ├── FMX_Demo_MessageBoxes.dpr │ ├── FMX_Demo_MessageBoxes.dproj │ ├── FMX_Demo_MessageBoxes.res │ ├── MainForm.fmx │ └── MainForm.pas ├── FMX - Demo TDropDownSearchBox │ ├── FMX_Demo_TDropDownSearchBox.dpr │ ├── FMX_Demo_TDropDownSearchBox.dproj │ ├── Unit1.fmx │ └── Unit1.pas ├── More demos.url ├── Template App │ ├── FMX Minimal │ │ ├── MainForm.fmx │ │ ├── MainForm.pas │ │ ├── TemplateMicro.res │ │ ├── TemplateMicro_Fmx.dpr │ │ └── TemplateMicro_Fmx.dproj │ ├── ReadMe.md │ ├── VCL Full │ │ ├── FormMain.dfm │ │ ├── FormMain.pas │ │ ├── FormSettings.dfm │ │ ├── FormSettings.pas │ │ ├── Lang │ │ │ ├── Chinese.ini │ │ │ ├── English.ini │ │ │ ├── German.ini │ │ │ └── How to translate.rtf │ │ ├── System │ │ │ ├── About.PNG │ │ │ ├── Splash.png │ │ │ └── betatester │ │ ├── TemplateApp.res │ │ ├── TemplateFull.dpr │ │ ├── TemplateFull.dproj │ │ ├── TemplateFull.res │ │ └── uInitialization.pas │ ├── VCL Minimal │ │ ├── MainForm.dfm │ │ ├── MainForm.pas │ │ ├── TemplateMicro.dpr │ │ ├── TemplateMicro.dproj │ │ └── TemplateMicro.res │ └── VCL Simple │ │ ├── FormMain.dfm │ │ ├── FormMain.pas │ │ ├── System │ │ └── betatester │ │ ├── TemplateSimple.dpr │ │ ├── TemplateSimple.dproj │ │ └── TemplateSimple.res ├── Template Universal Uninstaller │ ├── Clean.cmd │ ├── DALL·E CD image.png │ ├── DebugMode- │ ├── SharedUninstaller.pas │ ├── Uninstaller.dpr │ ├── Uninstaller.dproj │ ├── Uninstaller.res │ ├── UninstallerForm.dfm │ ├── UninstallerForm.pas │ └── icon.ico └── Testers.lnk ├── Docs ├── Delphi in all its glory.url ├── Library architecture.png ├── Lightsaber logo.png └── Translator │ ├── TranslationCn.PNG │ ├── TranslationDe.PNG │ ├── TranslationEn.PNG │ └── Translator Code.PNG ├── Formatter_Gabriel.config ├── FrameFMX ├── FMX form event order.txt ├── Frameworks.inc ├── LightFMX.LogForm.fmx ├── LightFMX.LogForm.pas ├── LightFMX.lbAppData.Form.pas ├── LightFMX.lbAppData.pas ├── LightFMX.lbCenterControl.pas ├── LightFMX.lbDialogs.pas ├── LightFMX.lbDialogsBlocking.pas ├── LightFMX.lbHelpers.pas ├── LightFMX.lbIniFile.pas ├── LightFMX.lbLogFilter.pas ├── LightFMX.lcComboBox.pas ├── LightFMX.lcDropDownSearch.pas ├── LightFMX.lcLayout.pas ├── LightFMX.lcPanel.pas ├── LightFmx.lbLogViewer.pas ├── LightFmxBase.dpk ├── LightFmxBase.dproj ├── LightFmxCommon.dpk └── LightFmxCommon.dproj ├── FrameVCL ├── FormAbout.dfm ├── FormAbout.pas ├── FormAsyncMessage.dfm ├── FormAsyncMessage.pas ├── FormDrawing.dfm ├── FormDrawing.pas ├── FormEmailComposer.dfm ├── FormEmailComposer.pas ├── FormEmailServer.dfm ├── FormEmailServer.pas ├── FormPower.dfm ├── FormPower.pas ├── FormProxyList.dfm ├── FormProxyList.pas ├── FormReminder.dfm ├── FormReminder.pas ├── FormRichLog.dfm ├── FormRichLog.pas ├── FormSkinsDisk.dfm ├── FormSkinsDisk.pas ├── FormSkinsRes.dfm ├── FormSkinsRes.pas ├── FormSplashScreen.dfm ├── FormSplashScreen.pas ├── FormTranslEditor.dfm ├── FormTranslEditor.pas ├── FormTranslSelector.dfm ├── FormTranslSelector.pas ├── FormUniversalEula.dfm ├── FormUniversalEula.pas ├── FrameExplorer.dfm ├── FrameExplorer.pas ├── LightAppDataVCL.res ├── LightCom.AppData.pas ├── LightCom.AppDataForm.pas ├── LightCom.CenterControl.pas ├── LightCom.Clipboard.pas ├── LightCom.Colors.pas ├── LightCom.CursorGuard.pas ├── LightCom.Debugger.pas ├── LightCom.Dialogs.pas ├── LightCom.EllipsisText.pas ├── LightCom.EnvironmentVar.pas ├── LightCom.ExeVersion.pas ├── LightCom.ExecuteProc.pas ├── LightCom.ExecuteShell.pas ├── LightCom.GuiSettings.pas ├── LightCom.INIFile.pas ├── LightCom.INIFileQuick.pas ├── LightCom.IO.pas ├── LightCom.KeybShortcuts.pas ├── LightCom.Keyboard.pas ├── LightCom.LogFilter.pas ├── LightCom.LogViewer.pas ├── LightCom.MemoInputBox.pas ├── LightCom.MutexSingleInstance.pas ├── LightCom.PopUp.pas ├── LightCom.PowerUtils.pas ├── LightCom.Process.pas ├── LightCom.Shell.pas ├── LightCom.Sound.pas ├── LightCom.System.pas ├── LightCom.SystemPermissions.pas ├── LightCom.SystemSecurity.pas ├── LightCom.SystemTime.pas ├── LightCom.Translate.pas ├── LightCom.VclUtils.pas ├── LightCom.WMIResolution.pas ├── LightCom.WinVersion.pas ├── LightCom.WinVersionApi.pas ├── LightCom.Window.pas ├── LightCom.WindowMetrics.pas ├── LightVCL.LogForm.dfm ├── LightVCL.LogForm.pas ├── LightVclCommon.dpk ├── LightVclCommon.dproj ├── LightVclGraphics.dpk ├── LightVclGraphics.dproj ├── LightVclInternet.dpk ├── LightVclInternet.dproj ├── LightVisControls.dpk ├── LightVisControls.dproj ├── __history │ └── cmIO.Win.pas- merged. delete me ├── cGraphAlpha.pas ├── cGraphAviFrame.pas ├── cGraphBitmap.pas ├── cGraphBkgColor.pas ├── cGraphBkgColorEditor.dfm ├── cGraphBkgColorEditor.pas ├── cGraphBkgColorParams.pas ├── cGraphCache.pas ├── cGraphConvert.pas ├── cGraphDesktop.pas ├── cGraphFX.BorderEditor.dfm ├── cGraphFX.Gradient.pas ├── cGraphFX.Rotate.pas ├── cGraphFX.RotateGr32.pas ├── cGraphFX.pas ├── cGraphGif.pas ├── cGraphLoader.RainDrop.pas ├── cGraphLoader.RainEditorForm.dfm ├── cGraphLoader.RainEditorForm.pas ├── cGraphLoader.Resolution.pas ├── cGraphLoader.Thread.pas ├── cGraphLoader.WB1.pas ├── cGraphLoader.WBC.pas ├── cGraphLoader.pas ├── cGraphResize.pas ├── cGraphResizeFMX.pas ├── cGraphResizeGr32.pas ├── cGraphResizeParamFrame.dfm ├── cGraphResizeParamFrame.pas ├── cGraphResizeParams.pas ├── cGraphResizeVCL.pas ├── cGraphResizeWinBlt.pas ├── cGraphResizeWinGDI.pas ├── cGraphResizeWinThumb.pas ├── cGraphResizeWinWIC.pas ├── cGraphText.pas ├── cGraphUtil.pas ├── cGraphUtilGray.pas ├── ciCommonWebDown.pas ├── ciDownloadThread.pas ├── ciDownload_WinInet.pas ├── ciEmail.pas ├── ciEmailSender.pas ├── ciHtml.pas ├── ciHtmlImg.pas ├── ciHtmlWriter.pas ├── ciHtmlWriter.res ├── ciInetDonwIndy.pas ├── ciInternet.pas ├── cvActivityIndicator.pas ├── cvAssociateExt.pas ├── cvCalendarCanvas.pas ├── cvCaptionedThumb.pas ├── cvCheckBox.pas ├── cvCheckListBox.pas ├── cvComboBox.pas ├── cvCountDown.pas ├── cvCreationOrderTester.pas ├── cvDirectoryListBox.pas ├── cvDropDownSearch.pas ├── cvEdit.pas ├── cvFileFilter.pas ├── cvFileListBox.pas ├── cvFloatSpinEdit.dcr ├── cvFloatSpinEdit.pas ├── cvFreeDiskSpace.pas ├── cvFreeDiskSpace.res ├── cvGradientPanel.pas ├── cvGraphChart.pas ├── cvGroupbox.pas ├── cvINIFile.pas ├── cvLabelEdit.pas ├── cvListBox.pas ├── cvLstEditor.pas ├── cvMemo.pas ├── cvMinimalPathLabel.pas ├── cvMsgDispatcher.pas ├── cvPanel.pas ├── cvPathEdit.pas ├── cvPathEdit.res ├── cvProxyList.pas ├── cvRadioButton.pas ├── cvRichEdit.pas ├── cvRichEditResize.pas ├── cvScrollBox.pas ├── cvSpinEdit.pas ├── cvSpinEditDelayed.pas ├── cvSplitter.pas ├── cvSplitter.res ├── cvStatusBar.pas ├── cvStringGrid.pas ├── cvStringGrid.res ├── cvStringGridBase.pas ├── cvStringGridScrollFix.pas ├── cvStrongPasswordEdit.pas ├── cvThumbViewerM.pas ├── cvTimeLine.pas ├── cvTimer.pas ├── cvToolBox.pas ├── cvTrayIcon.pas ├── llRichLog.pas ├── llRichLogTrack.pas ├── llRichLogUtils.pas └── llRichRamLog.pas ├── Git - AutoTranslator.url ├── Git - LightSaber-Core.URL ├── Git - LightSaber-GUI AutoSave demo.URL ├── Git - LightSaber-Log.URL ├── HardwareID ├── HardwareIDExtractor.DLL.lnk ├── HardwareIDExtractorC.dll ├── HardwareIDExtractorPas.dll └── chHardID_C.pas ├── LightCore.dpk ├── LightCore.dproj ├── LightCore.res ├── LightSaberFMX.groupproj ├── LightSaberVCL.groupproj ├── README AutoTranslator.md ├── README.md ├── System ├── Copyright.txt ├── Credits.lnk └── video_player_icon.png ├── Updater ├── FormUpdaterNotifier.dfm ├── FormUpdaterNotifier.pas ├── FormUpdaterRecEditor.dfm ├── FormUpdaterRecEditor.pas ├── FormUpdaterSettings.dfm ├── FormUpdaterSettings.pas ├── ciUpdater.pas └── ciUpdaterRec.pas ├── ccAppData.pas ├── ccBinary.pas ├── ccCompiler.pas ├── ccCore.pas ├── ccDownload.pas ├── ccEncodeCRC.pas ├── ccEncodeMime.pas ├── ccEncodeXOR.pas ├── ccINIFile.pas ├── ccIO.pas ├── ccLogLinesAbstract.pas ├── ccLogLinesM.pas ├── ccLogLinesS.pas ├── ccLogRam.pas ├── ccLogTypes.pas ├── ccLogUtils.pas ├── ccMRU.pas ├── ccMath.pas ├── ccPascal.pas ├── ccPlatformFile.pas ├── ccRegistry.pas ├── ccRttiSetToString.pas ├── ccSearchResult.pas ├── ccStrBuilder.pas ├── ccStreamBuff.pas ├── ccStreamBuff2.pas ├── ccStreamFile.pas ├── ccStreamMem.pas ├── ccStreamMem2.pas ├── ccStringList.pas ├── ccStringListA.pas ├── ccTextFile.pas └── ccWrapString.pas /.gitignore: -------------------------------------------------------------------------------- 1 | *.~* 2 | *.dsk 3 | *.dcu 4 | *.local 5 | *.identcache 6 | *.dproj.local 7 | *.map 8 | *.~dsk 9 | *.~1~ 10 | *.tvsconfig 11 | *.vsf 12 | *.mes 13 | *.cbk 14 | *.drc 15 | *.ficfg 16 | 17 | desktop.ini 18 | uLinks.pas 19 | /__history 20 | /__recovery 21 | 22 | /21.0_Win32_Debug 23 | /22.0_Android64_Debug 24 | /22.0_Android_Debug 25 | /22.0_Linux64_Debug/ 26 | /22.0_Linux_Debug/ 27 | /22.0_Win32_Debug/ 28 | /22.0_Win32_Release 29 | /Demo/Tester All Visual Controls/21.0 30 | /Demo/Tester All Visual Controls/__recovery 31 | /Demo/Tester GUI Autosave/__recovery 32 | /Demo/Tester LightCore ccIO.pas/__recovery 33 | /Demo/Tester SystemReport/__recovery 34 | /FMX/22.0_Android64_Debug 35 | 1.pas 36 | 2.pas 37 | Demo/All Visual Controls/22.0/Win32_Debug/DemoAllVisualControls.exe 38 | Demo/Template App/TemplateApp.delphilsp.json 39 | Demo/Template Universal Uninstaller/BUG REPORTS.LNK 40 | Demo/Tester AutoTranslator/competition.url 41 | Demo/Tester LightCore ccStreamBuff.pas/TCubicBuffStream.bin 42 | Demo/Tester LightCore ccWinVersion.pas/Tester_WinVers.drc 43 | HardwareID/chHardID.pas 44 | System/Credits.lnk 45 | System/Eula.txt 46 | cbAppData mixed fmx vcl.pas 47 | Demo/Template Universal Uninstaller/Uninstaller.exe 48 | Demo/Template Universal Uninstaller/Uninstaller.res 49 | Demo/Template Universal Uninstaller/Uninstaller.res 50 | Demo/Template App/FMX Minimal/FMXTemplateMicro.exe 51 | Demo/Template App/FMX Minimal2/Win32/Debug/Project1.exe 52 | /Demo/Template App/FMX Minimal/Win32 53 | Demo/Template App/FMX Minimal2/Project1.exe 54 | *.o 55 | /Demo/Template App/FMX Minimal/FmxTemplateMicro/res 56 | *.xml 57 | *.deployproj 58 | Demo/Template App/FMX Minimal/TemplateMicro.exe 59 | Demo/Demo Binary file/DemoBinaryFile.exe 60 | Demo/Demo Binary file/Soldier.bin 61 | Demo/Tester All Visual Controls/Demo_VisualControls.prjmgc 62 | /FrameFMX/old 63 | *.dsv 64 | *.res 65 | Demo/FMX - Demo LightPanel/Win32/Debug/Demo_LightPanel.exe 66 | Demo/FMX - Demo TDropDownSearchBox/Win32/Debug/TesterFMX.exe 67 | *.exe 68 | FrameVCL/AI 69 | -------------------------------------------------------------------------------- /AndroidManifest.template.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | <%uses-permission%> 10 | 11 | 12 | <%queries-child-elements%> 13 | 14 | 25 | <%provider%> 26 | <%application-meta-data%> 27 | <%uses-libraries%> 28 | <%services%> 29 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | <%activity%> 47 | <%receivers%> 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /Changed.txt: -------------------------------------------------------------------------------- 1 | The Core package was made platform agnostic. This means that you can use it both from VCL and FMX. For this the following changes were made. 2 | Note: This is a breaking change. Your code will not compile anymore. However, in less than 5 minutes, with some batch replace, you will be back online. 3 | 4 | 1. The new library was moved to a new branch. 5 | 6 | Fix: Use this new branch to download the code. 7 | 8 | 2. Some files were moved into the Core packages and their prefix was changed from 'cb' to 'cc'. 9 | 10 | cbAppData.pas 11 | cbEncodeCRC.pas 12 | cbEncodeMime.pas 13 | cbEncodeXOR.pas 14 | cbLogLinesAbstract.pas 15 | cbLogLinesM.pas 16 | cbLogLinesS.pas 17 | cbLogRam.pas 18 | cbLogTypes.pas 19 | cbLogUtils.pas 20 | cbMath.pas 21 | cbMRU.pas 22 | cbPascal.pas 23 | cbPlatformFile.pas 24 | cbRttiSetToString.pas 25 | cbStrBuilder.pas 26 | cbStringList.pas 27 | cbStringListA.pas 28 | cbWrapString.pas 29 | 30 | Fix: You can apply a batch replace to fix this. 31 | 32 | 3. 'cb' files were moved from root to the "LightSaber\FrameVCL\" folder. 33 | The fmx were moved to the "LightSaber\FrameFMX\" folder. 34 | 35 | Fix: Add this new folder to your "Search paths" or "Library paths". 36 | 37 | 4. AppData was split into three classes: 38 | 39 | TAppDataCore (platform agnostic) 40 | -> TAppData (for VCL) 41 | -> TAppDataFMX (for FMX) 42 | 43 | Fix: Nothing to change here. The old code will work. 44 | 45 | 5. The global var AppData is now of TAppData. 46 | 47 | Fix: Nothing to change here. The old code will work because the class name remains the same. -------------------------------------------------------------------------------- /Clean DCUs.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | prompt $ 3 | cls 4 | 5 | del /s *.dcu 6 | 7 | c:\Windows\Delay.exe 3000 s b -------------------------------------------------------------------------------- /Clean EXEs.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | prompt $ 3 | cls 4 | 5 | del /s *.exe 6 | 7 | c:\Windows\Delay.exe 3000 s b -------------------------------------------------------------------------------- /Clean folder.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | prompt $ 3 | cls 4 | 5 | del /s *.exe 6 | del /s *.map 7 | del /s *.dsm 8 | del /s *.ddp 9 | del /s *.bak 10 | del /s *.drc 11 | del /s *.local 12 | del /s *.identcache 13 | del /s *.stat 14 | del /s *.~dsk 15 | del /s *.dproj.local 16 | del /s LogFile.log 17 | 18 | delay 500 s b -------------------------------------------------------------------------------- /Conditional compilation (Delphi) - RAD Studio.url: -------------------------------------------------------------------------------- 1 | [InternetShortcut] 2 | URL=http://docwiki.embarcadero.com/RADStudio/Athens/en/Conditional_compilation_(Delphi) 3 | IDList= 4 | HotKey=0 5 | IconFile=C:\Users\trei\AppData\Local\Mozilla\Firefox\Profiles\daecy5hr.default-release\shortcutCache\dyuuSLRlA_b4CeOJiAt9xw==.ico 6 | IconIndex=0 7 | -------------------------------------------------------------------------------- /Demo/Clean binaries.cmd: -------------------------------------------------------------------------------- 1 | echo off 2 | prompt $ 3 | cls 4 | 5 | del /s *.dcu 6 | del /s *.map 7 | del /s *.exe 8 | del /s *.rsm 9 | del /s *.bin 10 | 11 | delay 500 s b -------------------------------------------------------------------------------- /Demo/Conditional Demo.groupproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | {FEAFD301-FC4B-42D7-8A5C-4FF39EE54BB2} 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | Default.Personality.12 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 | -------------------------------------------------------------------------------- /Demo/Conditionals and Platform detection/FMX/FMX_Demo_PlatformDetection.dpr: -------------------------------------------------------------------------------- 1 | program FMX_Demo_PlatformDetection; 2 | 3 | uses 4 | System.StartUpCopy, 5 | FMX.Forms, 6 | MainForm in 'MainForm.pas' {Form3}, 7 | PlatformTest in '..\PlatformTest.pas', 8 | LightFMX.lbAppData.Form in '..\..\..\FrameFMX\LightFMX.lbAppData.Form.pas', 9 | LightFMX.lbIniFile in '..\..\..\FrameFMX\LightFMX.lbIniFile.pas', 10 | LightFMX.lbAppData in '..\..\..\FrameFMX\LightFMX.lbAppData.pas'; 11 | 12 | {$R *.res} 13 | 14 | begin 15 | Application.Initialize; 16 | Application.CreateForm(TForm3, Form3); 17 | AppData.Run; 18 | end. 19 | -------------------------------------------------------------------------------- /Demo/Conditionals and Platform detection/FMX/MainForm.fmx: -------------------------------------------------------------------------------- 1 | object Form3: TForm3 2 | Left = 0 3 | Top = 0 4 | Caption = 'S' 5 | ClientHeight = 116 6 | ClientWidth = 640 7 | FormFactor.Width = 320 8 | FormFactor.Height = 480 9 | FormFactor.Devices = [Desktop] 10 | DesignerMasterStyle = 0 11 | object Label1: TLabel 12 | Align = Top 13 | AutoSize = True 14 | Size.Width = 640.000000000000000000 15 | Size.Height = 16.000000000000000000 16 | Size.PlatformDefault = False 17 | Text = 'Build this app to see compiler switches in IDE (Messages panel)' 18 | TabOrder = 0 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /Demo/Conditionals and Platform detection/FMX/MainForm.pas: -------------------------------------------------------------------------------- 1 | unit MainForm; 2 | 3 | {============================================================================================================= 4 | 2025.04 5 | www.GabrielMoraru.com 6 | ============================================================================================================== 7 | 8 | Demo for c:\Projects\LightSaber\ccPlatformFile.pas 9 | You will see the results of this program during compilation in the "Messages" panel. 10 | 11 | =============================================================================================================} 12 | 13 | interface 14 | 15 | uses 16 | System.SysUtils, System.Types, System.UITypes, System.Classes, 17 | FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, 18 | LightFMX.lbAppData.Form, FMX.Controls.Presentation, FMX.StdCtrls; 19 | 20 | type 21 | TForm3 = class(TLightForm) 22 | Label1: TLabel; 23 | private 24 | public 25 | end; 26 | 27 | var 28 | Form3: TForm3; 29 | 30 | implementation {$R *.fmx} 31 | 32 | USES 33 | ccPlatformFile; 34 | 35 | end. 36 | -------------------------------------------------------------------------------- /Demo/Conditionals and Platform detection/VCL/MainForm.dfm: -------------------------------------------------------------------------------- 1 | object Form3: TForm3 2 | Left = 0 3 | Top = 0 4 | Caption = 'Demo' 5 | ClientHeight = 72 6 | ClientWidth = 709 7 | Color = clBtnFace 8 | Font.Charset = DEFAULT_CHARSET 9 | Font.Color = clWindowText 10 | Font.Height = -12 11 | Font.Name = 'Segoe UI' 12 | Font.Style = [] 13 | TextHeight = 15 14 | object Label1: TLabel 15 | AlignWithMargins = True 16 | Left = 3 17 | Top = 3 18 | Width = 703 19 | Height = 25 20 | Align = alTop 21 | Alignment = taCenter 22 | Caption = 'Build this app to see compiler switches in IDE (Messages panel)' 23 | Font.Charset = DEFAULT_CHARSET 24 | Font.Color = clWindowText 25 | Font.Height = -19 26 | Font.Name = 'Segoe UI' 27 | Font.Style = [] 28 | ParentFont = False 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /Demo/Conditionals and Platform detection/VCL/MainForm.pas: -------------------------------------------------------------------------------- 1 | unit MainForm; 2 | 3 | interface 4 | 5 | uses 6 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Classes, Vcl.Graphics, 7 | Vcl.Controls, Vcl.Forms, LightCom.AppDataForm, Vcl.Dialogs, Vcl.StdCtrls; 8 | 9 | type 10 | TForm3 = class(TLightForm) 11 | Label1: TLabel; 12 | private 13 | public 14 | end; 15 | 16 | var 17 | Form3: TForm3; 18 | 19 | IMPLEMENTATION 20 | {$R *.dfm} 21 | 22 | USES PlatformTest; 23 | 24 | end. 25 | -------------------------------------------------------------------------------- /Demo/Conditionals and Platform detection/VCL/VCL_Demo_PlatformDetection.dpr: -------------------------------------------------------------------------------- 1 | program VCL_Demo_PlatformDetection; 2 | 3 | uses 4 | Vcl.Forms, 5 | MainForm in 'MainForm.pas' {Form3}, 6 | ccPlatformFile in '..\..\..\ccPlatformFile.pas', 7 | PlatformTest in '..\PlatformTest.pas'; 8 | 9 | {$R *.res} 10 | 11 | begin 12 | Application.Initialize; 13 | Application.MainFormOnTaskbar := True; 14 | Application.CreateForm(TForm3, Form3); 15 | Application.Run; 16 | end. 17 | -------------------------------------------------------------------------------- /Demo/Demo All Visual Controls/Demo_VisualControls.dpr: -------------------------------------------------------------------------------- 1 | program Demo_VisualControls; 2 | 3 | uses 4 | {$IFDEF DEBUG} 5 | FastMM4, 6 | {$ENDIF } 7 | LightCom.AppData, 8 | MainForm in 'MainForm.pas' {frmMain}, 9 | ccAppData in '..\..\ccAppData.pas'; 10 | 11 | {$R *.res} 12 | 13 | begin 14 | ReportMemoryLeaksOnShutdown:= TRUE; 15 | 16 | AppData:= TAppData.Create('Light Demo Visual Controls'); 17 | AppData.CreateMainForm(TfrmMain, frmMain, TRUE, TRUE, asFull); 18 | AppData.Run; 19 | end. 20 | -------------------------------------------------------------------------------- /Demo/Demo All Visual Controls/Demo_VisualControls.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/Demo/Demo All Visual Controls/Demo_VisualControls.res -------------------------------------------------------------------------------- /Demo/Demo AutoTranslator/AutoTranslatorDemo.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/Demo/Demo AutoTranslator/AutoTranslatorDemo.res -------------------------------------------------------------------------------- /Demo/Demo AutoTranslator/Demo_AutoTranslator.dpr: -------------------------------------------------------------------------------- 1 | program Demo_AutoTranslator; 2 | 3 | uses 4 | {$IFDEF DEBUG} 5 | FastMM4, 6 | {$ENDIF } 7 | LightCom.AppData, 8 | FormMain in 'FormMain.pas' {MainForm}, 9 | FormTranslEditor in '..\..\FrameVCL\FormTranslEditor.pas' {frmTranslEditor}, 10 | FormTranslSelector in '..\..\FrameVCL\FormTranslSelector.pas' {frmTranslSelector}, 11 | ccAppData in '..\..\ccAppData.pas'; 12 | 13 | {$R *.res} 14 | 15 | begin 16 | ReportMemoryLeaksOnShutdown:= TRUE; 17 | 18 | AppData:= TAppData.Create('Light Demo Translator'); 19 | AppData.CreateMainForm(TMainForm, MainForm, TRUE, TRUE, asFull); 20 | AppData.Run; 21 | end. 22 | -------------------------------------------------------------------------------- /Demo/Demo AutoTranslator/Demo_AutoTranslator.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/Demo/Demo AutoTranslator/Demo_AutoTranslator.res -------------------------------------------------------------------------------- /Demo/Demo AutoTranslator/FormMain.dfm: -------------------------------------------------------------------------------- 1 | object MainForm: TMainForm 2 | Left = 450 3 | Top = 311 4 | Anchors = [] 5 | Caption = 'Translator Demo - www.GabrielMoraru.com' 6 | ClientHeight = 282 7 | ClientWidth = 456 8 | Color = clBtnFace 9 | Constraints.MinHeight = 300 10 | Constraints.MinWidth = 390 11 | DoubleBuffered = True 12 | Font.Charset = ANSI_CHARSET 13 | Font.Color = clWindowText 14 | Font.Height = -13 15 | Font.Name = 'Calibri' 16 | Font.Style = [] 17 | Position = poDesigned 18 | ScreenSnap = True 19 | ShowHint = True 20 | SnapBuffer = 4 21 | TextHeight = 15 22 | object CheckBox1: TCheckBox 23 | Left = 12 24 | Top = 37 25 | Width = 123 26 | Height = 17 27 | Caption = 'Demo checkbox' 28 | TabOrder = 3 29 | end 30 | object pnlRight: TPanel 31 | Left = 252 32 | Top = 0 33 | Width = 204 34 | Height = 282 35 | Align = alRight 36 | TabOrder = 0 37 | object lblCurLang: TLabel 38 | AlignWithMargins = True 39 | Left = 4 40 | Top = 4 41 | Width = 94 42 | Height = 15 43 | Align = alTop 44 | Caption = 'Current language' 45 | end 46 | object btnSelector: TButton 47 | AlignWithMargins = True 48 | Left = 4 49 | Top = 177 50 | Width = 196 51 | Height = 48 52 | Align = alBottom 53 | Caption = 'Select language' 54 | TabOrder = 0 55 | OnClick = btnSelectorClick 56 | end 57 | object btnEditor: TButton 58 | AlignWithMargins = True 59 | Left = 4 60 | Top = 231 61 | Width = 196 62 | Height = 48 63 | Align = alBottom 64 | Caption = 'Edit current translation' 65 | TabOrder = 1 66 | OnClick = btnEditorClick 67 | end 68 | end 69 | object Memo: TMemo 70 | Left = 12 71 | Top = 148 72 | Width = 185 73 | Height = 89 74 | Lines.Strings = ( 75 | 'Memo1') 76 | TabOrder = 1 77 | end 78 | object LabeledEdit: TLabeledEdit 79 | Left = 12 80 | Top = 88 81 | Width = 185 82 | Height = 23 83 | EditLabel.Width = 73 84 | EditLabel.Height = 15 85 | EditLabel.Caption = 'Some editbox' 86 | TabOrder = 2 87 | Text = '' 88 | end 89 | end 90 | -------------------------------------------------------------------------------- /Demo/Demo AutoTranslator/FormMain.pas: -------------------------------------------------------------------------------- 1 | UNIT FormMain; 2 | 3 | INTERFACE 4 | 5 | USES 6 | 7 | System.SysUtils, System.Classes, Vcl.StdCtrls, Vcl.Forms, Vcl.Controls, Vcl.ExtCtrls, 8 | LightCom.AppDataForm, Vcl.Mask; 9 | 10 | TYPE 11 | TMainForm = class(TLightForm) 12 | btnEditor : TButton; 13 | btnSelector : TButton; 14 | CheckBox1 : TCheckBox; 15 | LabeledEdit : TLabeledEdit; 16 | lblCurLang : TLabel; 17 | Memo : TMemo; 18 | pnlRight : TPanel; 19 | procedure btnSelectorClick(Sender: TObject); 20 | procedure btnEditorClick(Sender: TObject); 21 | protected 22 | private 23 | procedure TranslationLoaded(Sender: TObject); 24 | public 25 | procedure FormPostInitialize; override; // Called after the main form was fully created 26 | end; 27 | 28 | VAR 29 | MainForm: TMainForm; 30 | 31 | IMPLEMENTATION {$R *.dfm} 32 | 33 | USES 34 | LightCom.Translate, 35 | FormTranslEditor, 36 | FormTranslSelector; 37 | 38 | 39 | 40 | 41 | {-------------------------------------------------------------------------------------------------- 42 | APP START/CLOSE 43 | --------------------------------------------------------------------------------------------------} 44 | procedure TMainForm.FormPostInitialize; 45 | begin 46 | inherited FormPostInitialize; 47 | 48 | Translator.OnTranslationLoaded:= TranslationLoaded; // Event handler 49 | TranslationLoaded(Self); // Show current loaded translation 50 | end; 51 | 52 | 53 | 54 | 55 | {-------------------------------------------------------------------------------------------------- 56 | STUFF 57 | --------------------------------------------------------------------------------------------------} 58 | procedure TMainForm.btnEditorClick(Sender: TObject); 59 | begin 60 | TfrmTranslEditor.ShowEditor; 61 | end; 62 | 63 | 64 | procedure TMainForm.btnSelectorClick(Sender: TObject); 65 | begin 66 | TfrmTranslSelector.ShowSelector; 67 | end; 68 | 69 | 70 | // Show current loaded translation 71 | procedure TMainForm.TranslationLoaded(Sender: TObject); 72 | begin 73 | lblCurLang.Caption:= 'Current translation file: '+ Translator.CurLanguageName; 74 | end; 75 | 76 | 77 | end. 78 | -------------------------------------------------------------------------------- /Demo/Demo AutoTranslator/IniEditor.lnk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/Demo/Demo AutoTranslator/IniEditor.lnk -------------------------------------------------------------------------------- /Demo/Demo AutoTranslator/Lang/Chinese.ini: -------------------------------------------------------------------------------- 1 | [Authors] 2 | Name=Gabriel 3 | 4 | 5 | [frmTranslSelector] 6 | frmTranslSelector.Caption=Language/Sprache/Langue/Limba/Idioma/语言 7 | grpChoose.Caption=选择语言 8 | ListBox.Hint=点击加载 9 | btnApplyLang.Caption=好的 10 | btnRefresh.Hint=重新载入可用语言列表 11 | btnRefresh.Caption=刷新 12 | btnTranslate.Hint=创建自己的翻译或编辑现有翻译文件。 13 | btnTranslate.Caption=新译文... 14 | 15 | 16 | [MainForm] 17 | MainForm.Caption=演示 18 | CheckBox1.Caption=演示复选框 19 | lblCurLang.Caption= 20 | btnSelector.Caption=选择语言 21 | btnEditor.Caption=翻译助手 22 | LabeledEdit.SubLabel.Caption=某些编辑框 23 | -------------------------------------------------------------------------------- /Demo/Demo AutoTranslator/Lang/English.ini: -------------------------------------------------------------------------------- 1 | [Authors] 2 | Name=Gabriel 3 | 4 | 5 | [frmTranslSelector] 6 | frmTranslSelector.Caption=Language/Sprache/Langue/Limba/Idioma/语言 7 | grpChoose.Caption=Choose language 8 | ListBox.Hint=Click to load it 9 | btnApplyLang.Caption=OK 10 | btnRefresh.Hint=Reload the list of available languages 11 | btnRefresh.Caption=Refresh 12 | btnTranslate.Hint=Create your own translation or edit an existing translation file. 13 | btnTranslate.Caption=New translation... 14 | 15 | 16 | [MainForm] 17 | MainForm.Caption=Demo app 18 | CheckBox1.Caption=Demo checkbox 19 | lblCurLang.Caption= 20 | btnSelector.Caption=Select language 21 | btnEditor.Caption=Edit translation 22 | LabeledEdit.SubLabel.Caption=Some editbox 23 | -------------------------------------------------------------------------------- /Demo/Demo AutoTranslator/Lang/German.ini: -------------------------------------------------------------------------------- 1 | [Authors] 2 | Name=Gabriel 3 | 4 | 5 | [frmTranslSelector] 6 | frmTranslSelector.Caption=Language/Sprache/Langue/Limba/Idioma/语言 7 | grpChoose.Caption=Sprache wählen 8 | ListBox.Hint=Zum Laden anklicken 9 | btnApplyLang.Caption=GUT 10 | btnRefresh.Hint=Laden Sie die Liste der verfügbaren Sprachen neu 11 | btnRefresh.Caption=Aktualisieren 12 | btnTranslate.Hint=Erstellen Sie Ihre eigene Übersetzung oder bearbeiten Sie eine vorhandene Übersetzungsdatei. 13 | btnTranslate.Caption=Neue Übersetzung... 14 | 15 | 16 | [MainForm] 17 | MainForm.Caption=Licht-Übersetzer Demo 18 | CheckBox1.Caption=Demo-Kontrollkästchen 19 | lblCurLang.Caption=Aktuelle Übersetzungsdatei: 20 | btnSelector.Caption=Sprache auswählen 21 | btnEditor.Caption=Aktuelle Übersetzung bearbeiten 22 | LabeledEdit.SubLabel.Caption=Einige Editboxen 23 | -------------------------------------------------------------------------------- /Demo/Demo AutoTranslator/competition.url: -------------------------------------------------------------------------------- 1 | [InternetShortcut] 2 | URL=https://en.delphipraxis.net/topic/1865-ann-better-translation-manager-released/?page=6 3 | IDList= 4 | HotKey=0 5 | IconFile=C:\Users\trei\AppData\Local\Mozilla\Firefox\Profiles\daecy5hr.default-release\shortcutCache\er3Fm0P0DF8X4fjHug_Ulp4gPeVrKKU6eYTXHgx2C8g=.ico 6 | IconIndex=0 7 | -------------------------------------------------------------------------------- /Demo/Demo Binary file 1/Demo_Binary1.dpr: -------------------------------------------------------------------------------- 1 | program Demo_Binary1; 2 | 3 | uses 4 | {$IFDEF DEBUG} 5 | FastMM4, 6 | {$ENDIF } 7 | LightCom.AppData, 8 | ccINIFile, 9 | MainForm1 in 'MainForm1.pas' {frmMain}, 10 | uSoldier_v1 in 'uSoldier_v1.pas'; 11 | 12 | {$R *.res} 13 | 14 | begin 15 | AppData:= TAppData.Create('Light Demo Binary 1'); 16 | AppData.CreateMainForm(TfrmMain); 17 | AppData.Run; 18 | end. 19 | -------------------------------------------------------------------------------- /Demo/Demo Binary file 1/Demo_Binary1.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/Demo/Demo Binary file 1/Demo_Binary1.res -------------------------------------------------------------------------------- /Demo/Demo Binary file 2/Demo_Binary2.dpr: -------------------------------------------------------------------------------- 1 | program Demo_Binary2; 2 | 3 | uses 4 | {$IFDEF DEBUG} 5 | FastMM4, 6 | {$ENDIF } 7 | LightCom.AppData, 8 | ccINIFile, 9 | MainForm2 in 'MainForm2.pas' {frmMain}, 10 | uSoldier_v2 in 'uSoldier_v2.pas'; 11 | 12 | {$R *.res} 13 | 14 | begin 15 | AppData:= TAppData.Create('Light Demo Binary 2'); 16 | AppData.CreateMainForm(TfrmMain); 17 | AppData.Run; 18 | end. 19 | -------------------------------------------------------------------------------- /Demo/Demo Binary file 2/Demo_Binary2.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/Demo/Demo Binary file 2/Demo_Binary2.res -------------------------------------------------------------------------------- /Demo/Demo Binary file 3/Demo_Binary3.dpr: -------------------------------------------------------------------------------- 1 | program Demo_Binary3; 2 | 3 | uses 4 | {$IFDEF DEBUG} 5 | FastMM4, 6 | {$ENDIF } 7 | LightCom.AppData, 8 | ccINIFile, 9 | MainForm3 in 'MainForm3.pas' {frmMain}, 10 | uSoldier_v3 in 'uSoldier_v3.pas'; 11 | 12 | {$R *.res} 13 | 14 | begin 15 | AppData:= TAppData.Create('Light Demo Binary 2'); 16 | AppData.CreateMainForm(TfrmMain); 17 | AppData.Run; 18 | end. 19 | -------------------------------------------------------------------------------- /Demo/Demo Binary file 3/Demo_Binary3.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/Demo/Demo Binary file 3/Demo_Binary3.res -------------------------------------------------------------------------------- /Demo/Demo GUI Autosave/Demo_SaveGUI.dpr: -------------------------------------------------------------------------------- 1 | program Demo_SaveGUI; 2 | 3 | uses 4 | {$IFDEF DEBUG} 5 | FastMM4, 6 | {$ENDIF } 7 | System.SysUtils, 8 | MainForm in 'MainForm.pas' {frmTester}, 9 | SecondForm in 'SecondForm.pas' {frmContainer}, 10 | LightVcl.LogForm in '..\..\FrameVCL\FrameVCL\LightVcl.LogForm.pas', 11 | LightCom.AppData in '..\..\FrameVCL\FrameVCL\FrameVCL\LightCom.AppData.pas', 12 | ccAppData in '..\..\ccAppData.pas'; 13 | 14 | {$R *.res} 15 | 16 | procedure Main; 17 | begin 18 | ReportMemoryLeaksOnShutdown:= TRUE; 19 | 20 | AppData:= TAppData.Create('Light Demo Save GUI', 'Light_Unique_ID'); 21 | if AppData.InstanceRunning 22 | then 23 | { Send command line to the already running instance and restore (bring to front) that instance } 24 | AppData.ResurrectInstance(Trim(ParamStr(1))) //ToDo: I need to send the URestore message because I need to call RestoreBioniX (to remove icon fromsystray) on that side (BX first instance) 25 | else 26 | begin 27 | AppData.CreateMainForm(TfrmTester, frmTester, TRUE, TRUE, asFull); 28 | AppData.Run; 29 | end; 30 | end; 31 | 32 | begin 33 | Main; 34 | end. 35 | -------------------------------------------------------------------------------- /Demo/Demo GUI Autosave/Demo_SaveGUI.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/Demo/Demo GUI Autosave/Demo_SaveGUI.res -------------------------------------------------------------------------------- /Demo/Demo GUI Autosave/One function to rule them all – Saving the whole GUI one single procedure call – Delphi in all its glory.url: -------------------------------------------------------------------------------- 1 | [InternetShortcut] 2 | URL=https://gabrielmoraru.com/one-function-to-rule-them-all-saving-the-whole-gui-to-disk-with-one-single-procedure-call/ 3 | IDList= 4 | HotKey=0 5 | IconFile=C:\Users\trei\AppData\Local\Mozilla\Firefox\Profiles\daecy5hr.default-release\shortcutCache\DKHgVXph7Ty7iMuF_jf8XA==.ico 6 | IconIndex=0 7 | -------------------------------------------------------------------------------- /Demo/Demo GUI Autosave/SaveGUI_Demo.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/Demo/Demo GUI Autosave/SaveGUI_Demo.res -------------------------------------------------------------------------------- /Demo/Demo GUI Autosave/SecondForm.dfm: -------------------------------------------------------------------------------- 1 | object frmContainer: TfrmContainer 2 | Left = 0 3 | Top = 0 4 | Caption = 'Container' 5 | ClientHeight = 308 6 | ClientWidth = 377 7 | Color = clBtnFace 8 | DoubleBuffered = True 9 | Font.Charset = DEFAULT_CHARSET 10 | Font.Color = clWindowText 11 | Font.Height = -11 12 | Font.Name = 'Tahoma' 13 | Font.Style = [] 14 | Position = poDesigned 15 | TextHeight = 13 16 | object grpContainer: TGroupBox 17 | Left = 60 18 | Top = 16 19 | Width = 245 20 | Height = 139 21 | Caption = 'Second form' 22 | TabOrder = 0 23 | object Label1: TLabel 24 | Left = 2 25 | Top = 111 26 | Width = 241 27 | Height = 26 28 | Align = alBottom 29 | Alignment = taCenter 30 | Caption = 31 | 'This will test if the controls on the second form are saved corr' + 32 | 'ectly' 33 | WordWrap = True 34 | end 35 | object CheckBox1: TCheckBox 36 | Left = 40 37 | Top = 30 38 | Width = 97 39 | Height = 17 40 | Caption = 'CheckBox1' 41 | TabOrder = 0 42 | end 43 | object CubicCheckBox1: TCubicCheckBox 44 | Left = 40 45 | Top = 53 46 | Width = 104 47 | Height = 17 48 | Caption = 'CubicCheckBox1' 49 | TabOrder = 1 50 | AutoSize = True 51 | end 52 | end 53 | object GroupBox1: TGroupBox 54 | AlignWithMargins = True 55 | Left = 3 56 | Top = 191 57 | Width = 371 58 | Height = 110 59 | Margins.Bottom = 7 60 | Align = alBottom 61 | Caption = 'Checkboxes' 62 | TabOrder = 1 63 | object CubicCheckBox2: TCubicCheckBox 64 | AlignWithMargins = True 65 | Left = 40 66 | Top = 31 67 | Width = 101 68 | Height = 17 69 | Caption = 'Cubic Checkbox' 70 | TabOrder = 0 71 | AutoSize = True 72 | end 73 | object RadioButton1: TRadioButton 74 | AlignWithMargins = True 75 | Left = 40 76 | Top = 50 77 | Width = 132 78 | Height = 17 79 | Caption = 'VCL RadioButton' 80 | TabOrder = 1 81 | end 82 | object CubicRadioButton1: TCubicRadioButton 83 | Left = 40 84 | Top = 70 85 | Width = 115 86 | Height = 17 87 | Caption = 'Cubic RadioButton ' 88 | Checked = True 89 | TabOrder = 2 90 | TabStop = True 91 | AutoSize = True 92 | end 93 | end 94 | end 95 | -------------------------------------------------------------------------------- /Demo/Demo GUI Autosave/SecondForm.pas: -------------------------------------------------------------------------------- 1 | UNIT SecondForm; 2 | 3 | INTERFACE 4 | 5 | USES 6 | System.SysUtils, System.Variants, System.Classes, 7 | Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, cvCheckBox, Vcl.StdCtrls, cvRadioButton, LightCom.AppDataForm; 8 | 9 | TYPE 10 | TfrmContainer = class(TLightForm) 11 | Label1 : TLabel; 12 | CheckBox1 : TCheckBox; 13 | grpContainer : TGroupBox; 14 | CubicCheckBox1 : TCubicCheckBox; 15 | GroupBox1 : TGroupBox; 16 | CubicCheckBox2 : TCubicCheckBox; 17 | RadioButton1 : TRadioButton; 18 | CubicRadioButton1: TCubicRadioButton; 19 | end; 20 | 21 | 22 | 23 | IMPLEMENTATION {$R *.dfm} 24 | 25 | USES cvIniFile; 26 | 27 | 28 | end. 29 | -------------------------------------------------------------------------------- /Demo/Demo GUI Autosave/github Dephi-GUI-AutoSave .url: -------------------------------------------------------------------------------- 1 | [InternetShortcut] 2 | URL=https://github.com/GabrielOnDelphi/Dephi-GUI-AutoSave 3 | IDList= 4 | HotKey=0 5 | IconFile=C:\Users\trei\AppData\Local\Mozilla\Firefox\Profiles\daecy5hr.default-release\shortcutCache\bm58Sv_jcuNLIcCLozwWVw==.ico 6 | IconIndex=0 7 | -------------------------------------------------------------------------------- /Demo/Demo Internet/Demo_Internet.dpr: -------------------------------------------------------------------------------- 1 | program Demo_Internet; 2 | 3 | uses 4 | {$IFDEF DEBUG} 5 | FastMM4, 6 | {$ENDIF } 7 | WinApi.Windows, 8 | VCL.Forms, 9 | FormMain in 'FormMain.pas' {MainForm}, 10 | LightCom.AppData in '..\..\FrameVCL\LightCom.AppData.pas', 11 | LightVcl.LogForm in '..\..\FrameVCL\LightVcl.LogForm.pas', 12 | ciInetDonwIndy in '..\..\FrameVCL\ciInetDonwIndy.pas', 13 | ciInternet in '..\..\FrameVCL\ciInternet.pas', 14 | LightCom.AppDataForm in '..\..\FrameVCL\LightCom.AppDataForm.pas', 15 | ciDownloadThread in '..\..\FrameVCL\ciDownloadThread.pas', 16 | ciDownload_WinInet in '..\..\FrameVCL\ciDownload_WinInet.pas', 17 | ccDownload in '..\..\ccDownload.pas', 18 | ccAppData in '..\..\ccAppData.pas'; 19 | 20 | {$R *.res} 21 | 22 | begin 23 | ReportMemoryLeaksOnShutdown:= TRUE; 24 | 25 | AppData:= TAppData.Create('Light Demo Internet'); // This name is absolutelly critical if you use the SaveForm/LoadForm functionality. This string will be used as the name of the INI file. 26 | AppData.CreateMainForm(TMainForm, MainForm, True, True, asFull); 27 | AppData.Run; 28 | end. 29 | -------------------------------------------------------------------------------- /Demo/Demo Internet/Demo_Internet.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/Demo/Demo Internet/Demo_Internet.res -------------------------------------------------------------------------------- /Demo/Demo LightCore WinVersion/Demo_WinVers.dpr: -------------------------------------------------------------------------------- 1 | program Demo_WinVers; 2 | 3 | uses 4 | {$IFDEF DEBUG} 5 | FastMM4, 6 | {$ENDIF } 7 | LightCom.AppData, 8 | FormMain in 'FormMain.pas' {frmTester}, 9 | ccAppData in '..\..\ccAppData.pas'; 10 | 11 | {$R *.res} 12 | 13 | begin 14 | ReportMemoryLeaksOnShutdown:= TRUE; 15 | 16 | AppData:= TAppData.Create('Light Tester WinVer'); 17 | AppData.CreateMainForm(TfrmTester, frmTester, TRUE, TRUE, asFull); 18 | AppData.Run; 19 | end. 20 | -------------------------------------------------------------------------------- /Demo/Demo LightCore WinVersion/FormMain.dfm: -------------------------------------------------------------------------------- 1 | object frmTester: TfrmTester 2 | Left = 450 3 | Top = 311 4 | AlphaBlend = True 5 | AlphaBlendValue = 250 6 | Anchors = [] 7 | BorderIcons = [biSystemMenu, biMinimize] 8 | Caption = 'Show Windows version' 9 | ClientHeight = 543 10 | ClientWidth = 546 11 | Color = clBtnFace 12 | Constraints.MinHeight = 400 13 | Constraints.MinWidth = 490 14 | DoubleBuffered = True 15 | Font.Charset = ANSI_CHARSET 16 | Font.Color = clWindowText 17 | Font.Height = -13 18 | Font.Name = 'Calibri' 19 | Font.Style = [] 20 | Position = poDesigned 21 | ScreenSnap = True 22 | ShowHint = True 23 | SnapBuffer = 4 24 | OnCreate = FormCreate 25 | TextHeight = 15 26 | object pnlRight: TPanel 27 | Left = 428 28 | Top = 0 29 | Width = 118 30 | Height = 543 31 | Align = alRight 32 | TabOrder = 0 33 | object btnStart: TButton 34 | AlignWithMargins = True 35 | Left = 4 36 | Top = 4 37 | Width = 110 38 | Height = 45 39 | Align = alTop 40 | Caption = 'Refresh' 41 | TabOrder = 0 42 | OnClick = btnStartClick 43 | end 44 | end 45 | object Memo: TMemo 46 | Left = 0 47 | Top = 0 48 | Width = 428 49 | Height = 543 50 | Align = alClient 51 | Font.Charset = ANSI_CHARSET 52 | Font.Color = clWindowText 53 | Font.Height = -12 54 | Font.Name = 'Consolas' 55 | Font.Style = [] 56 | ParentFont = False 57 | TabOrder = 1 58 | end 59 | end 60 | -------------------------------------------------------------------------------- /Demo/Demo LightCore WinVersion/FormMain.pas: -------------------------------------------------------------------------------- 1 | UNIT FormMain; 2 | 3 | INTERFACE 4 | 5 | USES 6 | System.Classes, Vcl.StdCtrls, Vcl.Forms, Vcl.Controls, 7 | Vcl.ExtCtrls, LightCom.AppDataForm; 8 | 9 | const 10 | CRLF = #13#10; 11 | 12 | TYPE 13 | TfrmTester = class(TLightForm) 14 | pnlRight: TPanel; 15 | btnStart: TButton; 16 | Memo: TMemo; 17 | procedure btnStartClick(Sender: TObject); 18 | procedure FormCreate(Sender: TObject); 19 | protected 20 | private 21 | public 22 | procedure FormPostInitialize; override; // Called after the main form was fully created 23 | end; 24 | 25 | VAR 26 | frmTester: TfrmTester; 27 | 28 | IMPLEMENTATION {$R *.dfm} 29 | 30 | USES 31 | cvINIFile, LightCom.WinVersionApi, LightCom.WinVersion, LightCom.ExeVersion; 32 | 33 | 34 | procedure TfrmTester.FormCreate(Sender: TObject); 35 | begin 36 | // 37 | end; 38 | 39 | 40 | procedure TfrmTester.FormPostInitialize; 41 | begin 42 | inherited FormPostInitialize; 43 | btnStartClick(Self); 44 | end; 45 | 46 | 47 | procedure TfrmTester.btnStartClick(Sender: TObject); 48 | begin 49 | Memo.Clear; 50 | Memo.Lines.Add('LightCom.WinVersion.pas'); 51 | Memo.Lines.Add(''); 52 | Memo.Lines.Add(LightCom.WinVersion.GenerateReport); 53 | 54 | Memo.Lines.Add('_________________'); 55 | Memo.Lines.Add(''); 56 | Memo.Lines.Add('LightCom.WinVersionApi.pas'); 57 | Memo.Lines.Add(''); 58 | Memo.Lines.Add(LightCom.WinVersionApi.GenerateReport); 59 | LightCom.WinVersion.GenerateReport; 60 | 61 | Memo.Lines.Add('_________________'); 62 | Memo.Lines.Add(''); 63 | Memo.Lines.Add('LightCom.ExeVersion.pas'); 64 | Memo.Lines.Add(LightCom.ExeVersion.GetVersionInfo(ParamStr(0), TRUE)); 65 | end; 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | end. 74 | -------------------------------------------------------------------------------- /Demo/Demo LightCore ccIO/Demo_ccIO.dpr: -------------------------------------------------------------------------------- 1 | program Demo_ccIO; 2 | 3 | uses 4 | {$IFDEF DEBUG} 5 | FastMM4, 6 | {$ENDIF } 7 | MainForm in 'MainForm.pas' {frmTestIO}, 8 | LightCom.AppData, 9 | ccAppData in '..\..\ccAppData.pas'; 10 | 11 | {$R *.res} 12 | 13 | begin 14 | ReportMemoryLeaksOnShutdown:= TRUE; 15 | 16 | AppData:= TAppData.Create('Light Demo IO'); 17 | AppData.CreateMainForm(TfrmTestIO, frmTestIO, TRUE, TRUE, asFull); 18 | AppData.Run; 19 | end. 20 | -------------------------------------------------------------------------------- /Demo/Demo LightCore ccIO/Demo_ccIO.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/Demo/Demo LightCore ccIO/Demo_ccIO.res -------------------------------------------------------------------------------- /Demo/Demo LightCore ccIO/MainForm.dfm: -------------------------------------------------------------------------------- 1 | object frmTestIO: TfrmTestIO 2 | Left = 0 3 | Top = 0 4 | Caption = 'Test ccIO' 5 | ClientHeight = 334 6 | ClientWidth = 626 7 | Color = clBtnFace 8 | Font.Charset = DEFAULT_CHARSET 9 | Font.Color = clWindowText 10 | Font.Height = -11 11 | Font.Name = 'Tahoma' 12 | Font.Style = [] 13 | Position = poDesigned 14 | ScreenSnap = True 15 | ShowHint = True 16 | SnapBuffer = 3 17 | TextHeight = 13 18 | object Memo: TMemo 19 | AlignWithMargins = True 20 | Left = 3 21 | Top = 34 22 | Width = 620 23 | Height = 297 24 | Align = alClient 25 | Lines.Strings = ( 26 | 'Memo') 27 | TabOrder = 0 28 | end 29 | object Button1: TButton 30 | AlignWithMargins = True 31 | Left = 3 32 | Top = 3 33 | Width = 620 34 | Height = 25 35 | Align = alTop 36 | Caption = 'TEST' 37 | TabOrder = 1 38 | OnClick = Button1Click 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /Demo/Demo LightCore ccIO/MainForm.pas: -------------------------------------------------------------------------------- 1 | UNIT MainForm; 2 | 3 | INTERFACE 4 | 5 | USES 6 | //Winapi.Windows, Winapi.Messages, 7 | System.SysUtils, System.Classes, 8 | Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, 9 | LightCom.AppDataForm; 10 | 11 | TYPE 12 | TfrmTestIO = class(TLightForm) 13 | Memo: TMemo; 14 | Button1: TButton; 15 | procedure Button1Click(Sender: TObject); 16 | private 17 | public 18 | end; 19 | 20 | VAR 21 | frmTestIO: TfrmTestIO; 22 | 23 | IMPLEMENTATION {$R *.dfm} 24 | USES ccIO, ccTextFile, LightCom.IO; 25 | 26 | 27 | procedure TfrmTestIO.Button1Click(Sender: TObject); 28 | begin 29 | Memo.Clear; 30 | Memo.Lines.Add('Some functions will fail. This is normal!'); 31 | 32 | 33 | // Test "normal" 34 | Memo.Lines.Add('ForceDirectoriesB(''C:\1'') = '+ BoolToStr(ForceDirectoriesB('C:\1'), TRUE)); 35 | 36 | 37 | // Create an existing folder 38 | Memo.Lines.Add('Recreate same folder = '+ BoolToStr(ForceDirectoriesB('C:\1'), TRUE)); 39 | Memo.Lines.Add(''); 40 | 41 | 42 | // Test create a readonly folder (please prepare the folder first) 43 | Memo.Lines.Add('Readonly folder: ForceDirectoriesB(''C:\ReadOnly\1'') = '+ BoolToStr(ForceDirectoriesB('C:\ReadOnly\1'), TRUE)); // Returns true 44 | Memo.Lines.Add(''); 45 | 46 | 47 | // Test create on readonly drive (please enter here a CD drive or locked USB stick) 48 | Memo.Lines.Add('Readonly drive: ForceDirectoriesB(''i:\1'') = '+ BoolToStr(ForceDirectoriesB('i:\1'), TRUE)); // Returns false 49 | Memo.Lines.Add(''); 50 | 51 | 52 | // Test invalid path 53 | // This should crash with "Exception: Invalid characters in path" 54 | Memo.Lines.Add('ForceDirectoriesB(''C:\?'')'); 55 | TRY 56 | Memo.Lines.Add(' '+ BoolToStr(ForceDirectoriesB('C:\?'), TRUE)); 57 | EXCEPT 58 | on E: Exception DO 59 | Memo.Lines.Add('Exception: '+ E.Message); 60 | END; 61 | Memo.Lines.Add(''); 62 | 63 | 64 | // Test invalid parameters 65 | // This should crash with "Exception: Path is empty" 66 | Memo.Lines.Add('ForceDirectoriesB('''')'); 67 | TRY 68 | Memo.Lines.Add(' '+ BoolToStr(ForceDirectoriesB(''), TRUE)); 69 | EXCEPT 70 | on E: Exception DO 71 | Memo.Lines.Add('Exception: '+ E.Message); 72 | END; 73 | Memo.Lines.Add(''); 74 | 75 | 76 | // Test invalid drive 77 | // This will not raise an exception 78 | Memo.Lines.Add('ForceDirectoriesB(''W:\1'')'); 79 | Memo.Lines.Add(' '+ BoolToStr(ForceDirectoriesB('W:\1'), TRUE)); 80 | Memo.Lines.Add(''); 81 | end; 82 | 83 | 84 | end. 85 | -------------------------------------------------------------------------------- /Demo/Demo LightCore ccIO/Results.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/Demo/Demo LightCore ccIO/Results.PNG -------------------------------------------------------------------------------- /Demo/Demo LightCore ccIO/Tester_ccIO.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/Demo/Demo LightCore ccIO/Tester_ccIO.res -------------------------------------------------------------------------------- /Demo/Demo LightCore ccStreamBuff/Demo_FileStream.dpr: -------------------------------------------------------------------------------- 1 | program Demo_FileStream; 2 | 3 | uses 4 | {$IFDEF DEBUG} 5 | FastMM4, 6 | {$ENDIF } 7 | LightCom.AppData, 8 | FormMain in 'FormMain.pas' {MainForm}, 9 | LightVcl.LogForm in '..\..\FrameVCL\LightVcl.LogForm.pas', 10 | ccAppData in '..\..\ccAppData.pas'; 11 | 12 | {$R *.res} 13 | 14 | begin 15 | ReportMemoryLeaksOnShutdown:= TRUE; 16 | 17 | AppData:= TAppData.Create('Light Demo FileStream'); 18 | AppData.CreateMainForm(TMainForm, MainForm, True, True, asFull); // Main form 19 | AppData.Run; 20 | end. 21 | 22 | -------------------------------------------------------------------------------- /Demo/Demo LightCore ccStreamBuff/Demo_FileStream.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/Demo/Demo LightCore ccStreamBuff/Demo_FileStream.res -------------------------------------------------------------------------------- /Demo/Demo LightCore ccStreamBuff/Tester_FileStream.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/Demo/Demo LightCore ccStreamBuff/Tester_FileStream.res -------------------------------------------------------------------------------- /Demo/Demo LightLog/Demo_Log.dpr: -------------------------------------------------------------------------------- 1 | program Demo_Log; 2 | 3 | uses 4 | {$IFDEF DEBUG} 5 | FastMM4, 6 | {$ENDIF } 7 | FormMain in 'FormMain.pas' {MainForm}, 8 | ccINIFile in '..\..\ccINIFile.pas', 9 | LightCom.AppData in '..\..\FrameVCL\LightCom.AppData.pas', 10 | ccAppData in '..\..\ccAppData.pas', 11 | LightCom.LogFilter in '..\..\FrameVCL\LightCom.LogFilter.pas', 12 | LightCom.LogViewer in '..\..\FrameVCL\LightCom.LogViewer.pas'; 13 | 14 | {$R *.res} 15 | 16 | begin 17 | ReportMemoryLeaksOnShutdown:= TRUE; 18 | 19 | AppData:= TAppData.Create('Light Demo Logging System'); 20 | AppData.CreateMainForm(TMainForm, MainForm, TRUE, TRUE, asFull); 21 | AppData.Run; 22 | end. 23 | -------------------------------------------------------------------------------- /Demo/Demo LightLog/Demo_Log.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/Demo/Demo LightLog/Demo_Log.res -------------------------------------------------------------------------------- /Demo/Demo SystemReport/Demo_SystemReport.dpr: -------------------------------------------------------------------------------- 1 | program Demo_SystemReport; 2 | 3 | uses 4 | Vcl.Forms, 5 | MainForm in 'MainForm.pas' {frmMain}, 6 | LightCom.AppData in '..\..\FrameVCL\LightCom.AppData.pas', 7 | ccAppData in '..\..\ccAppData.pas'; 8 | 9 | {$R *.res} 10 | 11 | begin 12 | ReportMemoryLeaksOnShutdown:= TRUE; 13 | 14 | AppData:= TAppData.Create('Light Demo System Report'); 15 | AppData.CreateMainForm(TfrmMain, frmMain, True, True, asFull); 16 | AppData.Run; 17 | end. 18 | -------------------------------------------------------------------------------- /Demo/Demo SystemReport/Demo_SystemReport.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/Demo/Demo SystemReport/Demo_SystemReport.res -------------------------------------------------------------------------------- /Demo/Demo SystemReport/MainForm.dfm: -------------------------------------------------------------------------------- 1 | object frmMain: TfrmMain 2 | Left = 674 3 | Top = 393 4 | Caption = 'System and hardware report' 5 | ClientHeight = 888 6 | ClientWidth = 648 7 | Color = clBtnFace 8 | Font.Charset = DEFAULT_CHARSET 9 | Font.Color = clWindowText 10 | Font.Height = -13 11 | Font.Name = 'Segoe UI' 12 | Font.Style = [] 13 | Position = poDesigned 14 | TextHeight = 17 15 | object Memo: TMemo 16 | AlignWithMargins = True 17 | Left = 3 18 | Top = 3 19 | Width = 642 20 | Height = 882 21 | Align = alClient 22 | Font.Charset = ANSI_CHARSET 23 | Font.Color = clWindowText 24 | Font.Height = -13 25 | Font.Name = 'Consolas' 26 | Font.Style = [] 27 | ParentFont = False 28 | ScrollBars = ssVertical 29 | TabOrder = 0 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /Demo/Demo SystemReport/MainForm.pas: -------------------------------------------------------------------------------- 1 | unit MainForm; 2 | 3 | interface 4 | 5 | uses 6 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Classes, 7 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, ccAppData, LightCom.AppData, LightCom.AppDataForm; 8 | 9 | type 10 | TfrmMain = class(TLightForm) 11 | Memo: TMemo; 12 | private 13 | public 14 | procedure FormPostInitialize; override; 15 | end; 16 | 17 | var 18 | frmMain: TfrmMain; 19 | 20 | IMPLEMENTATION {$R *.dfm} 21 | USES LightCom.Debugger; 22 | 23 | 24 | 25 | procedure TfrmMain.FormPostInitialize; 26 | begin 27 | inherited FormPostInitialize; 28 | Memo.Text:= LightCom.Debugger.GenerateSystemRep; 29 | end; 30 | 31 | end. 32 | -------------------------------------------------------------------------------- /Demo/Demo binary file 1/DemoBinary1.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/Demo/Demo binary file 1/DemoBinary1.res -------------------------------------------------------------------------------- /Demo/Demo binary file 1/MainForm1.dfm: -------------------------------------------------------------------------------- 1 | object frmMain: TfrmMain 2 | Left = 0 3 | Top = 0 4 | Caption = 'Light Saber - Binary file demo' 5 | ClientHeight = 311 6 | ClientWidth = 427 7 | Color = clBtnFace 8 | Font.Charset = DEFAULT_CHARSET 9 | Font.Color = clWindowText 10 | Font.Height = -13 11 | Font.Name = 'Segoe UI' 12 | Font.Style = [] 13 | Position = poDesigned 14 | OnCreate = FormCreate 15 | OnDestroy = FormDestroy 16 | DesignSize = ( 17 | 427 18 | 311) 19 | TextHeight = 17 20 | object Label1: TLabel 21 | AlignWithMargins = True 22 | Left = 3 23 | Top = 3 24 | Width = 421 25 | Height = 34 26 | Align = alTop 27 | Caption = 28 | 'This demo demonstrates how to save some data to a binary file an' + 29 | 'd read it back' 30 | WordWrap = True 31 | end 32 | object Label2: TLabel 33 | Left = 26 34 | Top = 127 35 | Width = 20 36 | Height = 17 37 | Caption = 'Life' 38 | end 39 | object btnSave: TButton 40 | Left = 100 41 | Top = 266 42 | Width = 107 43 | Height = 37 44 | Anchors = [akBottom] 45 | Caption = 'Save' 46 | TabOrder = 0 47 | OnClick = btnSaveClick 48 | end 49 | object ntnLoad: TButton 50 | Left = 211 51 | Top = 266 52 | Width = 107 53 | Height = 37 54 | Anchors = [akBottom] 55 | Caption = 'Load' 56 | TabOrder = 1 57 | OnClick = ntnLoadClick 58 | end 59 | object spnLife: TSpinEdit 60 | Left = 56 61 | Top = 124 62 | Width = 55 63 | Height = 27 64 | MaxValue = 0 65 | MinValue = 0 66 | TabOrder = 2 67 | Value = 0 68 | end 69 | object edtName: TLabeledEdit 70 | Left = 26 71 | Top = 72 72 | Width = 121 73 | Height = 25 74 | EditLabel.Width = 77 75 | EditLabel.Height = 17 76 | EditLabel.Caption = 'Soldier name' 77 | TabOrder = 3 78 | Text = '' 79 | end 80 | end 81 | -------------------------------------------------------------------------------- /Demo/Demo binary file 1/MainForm1.pas: -------------------------------------------------------------------------------- 1 | UNIT MainForm1; 2 | 3 | {============================================================================================================= 4 | 2025.03.16 5 | www.GabrielMoraru.com 6 | -------------------------------------------------------------------------------------------------------------- 7 | This demonstrates how to save an simple object to a binary file. 8 | =============================================================================================================} 9 | 10 | INTERFACE 11 | 12 | USES 13 | System.SysUtils, System.Classes, 14 | Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.Mask, Vcl.ExtCtrls, Vcl.Samples.Spin, 15 | LightCom.AppDataForm, ccStreamBuff, ccStreamBuff2, uSoldier_v1; 16 | 17 | type 18 | TfrmMain = class(TLightForm) 19 | Label1 : TLabel; 20 | btnSave: TButton; 21 | ntnLoad: TButton; 22 | spnLife: TSpinEdit; 23 | edtName: TLabeledEdit; 24 | Label2 : TLabel; 25 | procedure FormCreate (Sender: TObject); 26 | procedure btnSaveClick(Sender: TObject); 27 | procedure ntnLoadClick(Sender: TObject); 28 | procedure FormDestroy (Sender: TObject); 29 | private 30 | Soldier: TSoldier; 31 | public 32 | end; 33 | 34 | 35 | IMPLEMENTATION {$R *.dfm} 36 | 37 | USES 38 | ccAppData, LightCom.AppData; 39 | 40 | 41 | procedure TfrmMain.FormCreate(Sender: TObject); 42 | begin 43 | if AppData.RunningFirstTime then 44 | begin 45 | spnLife.Value := 100; 46 | edtName.Text := 'Ryan'; 47 | end; 48 | 49 | Soldier:= TSoldier.Create; 50 | 51 | //btnSaveClick(Sender); 52 | end; 53 | 54 | 55 | procedure TfrmMain.FormDestroy(Sender: TObject); 56 | begin 57 | Soldier.Free; 58 | end; 59 | 60 | 61 | 62 | 63 | 64 | 65 | function GetBinaryFileName: string; 66 | CONST 67 | MyFile= 'Soldier.bin'; 68 | begin 69 | Result:= AppData.ExeFolder+ MyFile; // The files is saved where the EXE file is. 70 | end; 71 | 72 | 73 | procedure TfrmMain.btnSaveClick(Sender: TObject); 74 | begin 75 | // Read data from GUI 76 | Soldier.Life:= spnLife.Value; 77 | Soldier.Name:= edtName.Text; 78 | Soldier.Ammo:= 3; 79 | 80 | // Prepare binary file 81 | VAR Stream:= TCubicBuffStream2.CreateWrite(GetBinaryFileName); 82 | TRY 83 | Soldier.Save(Stream); // Write Soldier to binary file 84 | FINALLY 85 | FreeAndNil(Stream); 86 | END; 87 | end; 88 | 89 | 90 | procedure TfrmMain.ntnLoadClick(Sender: TObject); 91 | begin 92 | // Prepare binary file 93 | VAR Stream:= TCubicBuffStream2.CreateRead(GetBinaryFileName); 94 | TRY 95 | Soldier.Load(Stream); // Read Soldier from binary file 96 | FINALLY 97 | FreeAndNil(Stream); 98 | END; 99 | 100 | // Put data back into the GUI 101 | spnLife.Value := Soldier.Life; 102 | edtName.Text := Soldier.Name; 103 | end; 104 | 105 | 106 | 107 | end. 108 | -------------------------------------------------------------------------------- /Demo/Demo binary file 1/uSoldier_v1.pas: -------------------------------------------------------------------------------- 1 | UNIT uSoldier_v1; 2 | 3 | {============================================================================================================= 4 | 2025.03.16 5 | www.GabrielMoraru.com 6 | -------------------------------------------------------------------------------------------------------------- 7 | This demonstrates how to save/load a simple object from a binary file. 8 | =============================================================================================================} 9 | 10 | INTERFACE 11 | 12 | USES System.SysUtils, System.Generics.Collections, 13 | ccStreamBuff, ccStreamBuff2; 14 | 15 | TYPE 16 | TSoldier = class(TObject) 17 | private 18 | CONST StreamSignature: AnsiString= 'TSoldier'; 19 | public 20 | Life : Integer; 21 | Ammo : Integer; 22 | Name : string; 23 | 24 | procedure Load(Stream: TCubicBuffStream2); virtual; 25 | procedure Save(Stream: TCubicBuffStream2); virtual; 26 | end; 27 | 28 | 29 | IMPLEMENTATION 30 | 31 | 32 | procedure TSoldier.Save(Stream: TCubicBuffStream2); 33 | begin 34 | Stream.WriteHeader(StreamSignature, 1); // Header & version number 35 | 36 | Stream.WriteInteger(Life); 37 | Stream.WriteInteger(Ammo); 38 | Stream.WriteString(Name); 39 | 40 | Stream.WritePaddingDef; 41 | end; 42 | 43 | 44 | procedure TSoldier.Load(Stream: TCubicBuffStream2); 45 | VAR Version: Word; 46 | begin 47 | if NOT Stream.ReadHeaderVersion(StreamSignature, Version) then EXIT; // Header & version number 48 | 49 | Life := Stream.ReadInteger; 50 | Ammo := Stream.ReadInteger; 51 | Name := Stream.ReadString; 52 | 53 | Stream.ReadPaddingDef; 54 | end; 55 | 56 | 57 | end. 58 | -------------------------------------------------------------------------------- /Demo/Demo binary file 2/DemoBinary2.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/Demo/Demo binary file 2/DemoBinary2.res -------------------------------------------------------------------------------- /Demo/Demo binary file 2/MainForm2.dfm: -------------------------------------------------------------------------------- 1 | object frmMain: TfrmMain 2 | Left = 0 3 | Top = 0 4 | Caption = 'Light Saber - Binary file demo' 5 | ClientHeight = 312 6 | ClientWidth = 431 7 | Color = clBtnFace 8 | Font.Charset = DEFAULT_CHARSET 9 | Font.Color = clWindowText 10 | Font.Height = -13 11 | Font.Name = 'Segoe UI' 12 | Font.Style = [] 13 | Position = poDesigned 14 | OnCreate = FormCreate 15 | OnDestroy = FormDestroy 16 | DesignSize = ( 17 | 431 18 | 312) 19 | TextHeight = 17 20 | object Label1: TLabel 21 | AlignWithMargins = True 22 | Left = 3 23 | Top = 3 24 | Width = 425 25 | Height = 34 26 | Align = alTop 27 | Caption = 28 | 'This demo demonstrates how to save some data to a binary file an' + 29 | 'd read it back' 30 | WordWrap = True 31 | end 32 | object Label2: TLabel 33 | Left = 26 34 | Top = 127 35 | Width = 20 36 | Height = 17 37 | Caption = 'Life' 38 | end 39 | object btnSave: TButton 40 | Left = 103 41 | Top = 267 42 | Width = 107 43 | Height = 37 44 | Anchors = [akBottom] 45 | Caption = 'Save' 46 | TabOrder = 0 47 | OnClick = btnSaveClick 48 | end 49 | object btnLoad: TButton 50 | Left = 217 51 | Top = 267 52 | Width = 107 53 | Height = 37 54 | Anchors = [akBottom] 55 | Caption = 'Load' 56 | TabOrder = 1 57 | OnClick = btnLoadClick 58 | end 59 | object spnLife: TSpinEdit 60 | Left = 56 61 | Top = 124 62 | Width = 55 63 | Height = 27 64 | MaxValue = 0 65 | MinValue = 0 66 | TabOrder = 2 67 | Value = 0 68 | end 69 | object edtName: TLabeledEdit 70 | Left = 26 71 | Top = 72 72 | Width = 121 73 | Height = 25 74 | EditLabel.Width = 77 75 | EditLabel.Height = 17 76 | EditLabel.Caption = 'Soldier name' 77 | TabOrder = 3 78 | Text = '' 79 | end 80 | end 81 | -------------------------------------------------------------------------------- /Demo/Demo binary file 2/MainForm2.pas: -------------------------------------------------------------------------------- 1 | UNIT MainForm2; 2 | 3 | {============================================================================================================= 4 | 2025.03.16 5 | www.GabrielMoraru.com 6 | -------------------------------------------------------------------------------------------------------------- 7 | This demonstrates how to save/load a simple object from a binary file, using versioning. 8 | =============================================================================================================} 9 | 10 | 11 | INTERFACE 12 | 13 | USES 14 | System.SysUtils, System.Classes, 15 | Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.Mask, Vcl.ExtCtrls, Vcl.Samples.Spin, 16 | LightCom.AppDataForm, ccStreamBuff, ccStreamBuff2, uSoldier_v2; 17 | 18 | type 19 | TfrmMain = class(TLightForm) 20 | Label1 : TLabel; 21 | btnSave: TButton; 22 | btnLoad: TButton; 23 | spnLife: TSpinEdit; 24 | edtName: TLabeledEdit; 25 | Label2 : TLabel; 26 | procedure FormCreate (Sender: TObject); 27 | procedure btnSaveClick(Sender: TObject); 28 | procedure btnLoadClick(Sender: TObject); 29 | procedure FormDestroy (Sender: TObject); 30 | private 31 | Soldier2: TSoldier2; 32 | public 33 | end; 34 | 35 | 36 | IMPLEMENTATION {$R *.dfm} 37 | 38 | USES 39 | ccAppData, LightCom.AppData; 40 | 41 | 42 | procedure TfrmMain.FormCreate(Sender: TObject); 43 | begin 44 | if AppData.RunningFirstTime then 45 | begin 46 | spnLife.Value := 100; 47 | edtName.Text := 'Ryan'; 48 | end; 49 | 50 | Soldier2:= TSoldier2.Create; 51 | 52 | //btnSaveClick(Sender); 53 | end; 54 | 55 | 56 | procedure TfrmMain.FormDestroy(Sender: TObject); 57 | begin 58 | Soldier2.Free; 59 | end; 60 | 61 | 62 | 63 | 64 | 65 | 66 | function GetBinaryFileName: string; 67 | CONST 68 | MyFile= 'Soldier.bin'; 69 | begin 70 | Result:= AppData.ExeFolder+ MyFile; // The files is saved where the EXE file is. 71 | end; 72 | 73 | 74 | procedure TfrmMain.btnSaveClick(Sender: TObject); 75 | begin 76 | // Read data from GUI 77 | Soldier2.Life:= spnLife.Value; 78 | Soldier2.Name:= edtName.Text; 79 | Soldier2.Ammo:= 3; 80 | 81 | // Prepare binary file 82 | VAR Stream:= TCubicBuffStream2.CreateWrite(GetBinaryFileName); 83 | TRY 84 | Soldier2.Save(Stream); // Write Soldier to binary file 85 | FINALLY 86 | FreeAndNil(Stream); 87 | END; 88 | end; 89 | 90 | 91 | procedure TfrmMain.btnLoadClick(Sender: TObject); 92 | begin 93 | // Prepare binary file 94 | VAR Stream:= TCubicBuffStream2.CreateRead(GetBinaryFileName); 95 | TRY 96 | Soldier2.Load(Stream); // Read Soldier from binary file 97 | Caption:= Soldier2.ShowVersion; 98 | FINALLY 99 | FreeAndNil(Stream); 100 | END; 101 | 102 | // Put data back into the GUI 103 | spnLife.Value := Soldier2.Life; 104 | edtName.Text := Soldier2.Name; 105 | end; 106 | 107 | 108 | 109 | end. 110 | -------------------------------------------------------------------------------- /Demo/Demo binary file 2/uSoldier_v2.pas: -------------------------------------------------------------------------------- 1 | UNIT uSoldier_v2; 2 | 3 | {============================================================================================================= 4 | 2025.03.16 5 | www.GabrielMoraru.com 6 | -------------------------------------------------------------------------------------------------------------- 7 | This demonstrates how to save/load a simple object from a binary file, using versioning. 8 | =============================================================================================================} 9 | 10 | INTERFACE 11 | 12 | USES System.SysUtils, System.Generics.Collections, 13 | ccStreamBuff, ccStreamBuff2; 14 | 15 | TYPE 16 | TSoldier2 = class(TObject) 17 | private 18 | LoadedVersion: Word; 19 | CONST StreamSignature: AnsiString= 'TSoldier'; 20 | procedure Load_v1(Stream: TCubicBuffStream2); 21 | procedure Load_v2(Stream: TCubicBuffStream2); 22 | public 23 | Life : Integer; 24 | Ammo : Integer; 25 | Speed: Integer; 26 | Name : string; 27 | Gun : string; // GunType 28 | 29 | procedure Load(Stream: TCubicBuffStream2); virtual; 30 | procedure Save(Stream: TCubicBuffStream2); virtual; 31 | 32 | function ShowVersion: string; 33 | end; 34 | 35 | 36 | IMPLEMENTATION 37 | 38 | 39 | procedure TSoldier2.Save(Stream: TCubicBuffStream2); 40 | begin 41 | Stream.WriteHeader(StreamSignature, 2); // Header & version number 42 | 43 | Stream.WriteInteger(Life); 44 | Stream.WriteInteger(Ammo); 45 | Stream.WriteString(Name); 46 | Stream.WriteInteger(Speed); 47 | Stream.WriteString(Gun); 48 | end; 49 | 50 | 51 | procedure TSoldier2.Load(Stream: TCubicBuffStream2); 52 | VAR Version: Word; 53 | begin 54 | if NOT Stream.ReadHeaderVersion(StreamSignature, Version) then EXIT; // Header & version number 55 | 56 | case Version of 57 | 1: Load_v1(Stream); 58 | 2: Load_v2(Stream); 59 | end; 60 | 61 | end; 62 | 63 | 64 | procedure TSoldier2.Load_v1(Stream: TCubicBuffStream2); 65 | begin 66 | Life := Stream.ReadInteger; 67 | Ammo := Stream.ReadInteger; 68 | Name := Stream.ReadString; 69 | 70 | Stream.ReadPaddingDef; 71 | LoadedVersion:= 1; 72 | end; 73 | 74 | 75 | procedure TSoldier2.Load_v2(Stream: TCubicBuffStream2); 76 | begin 77 | Life := Stream.ReadInteger; 78 | Ammo := Stream.ReadInteger; 79 | Name := Stream.ReadString; 80 | Speed := Stream.ReadInteger; 81 | Gun := Stream.ReadString; 82 | 83 | LoadedVersion:= 2; 84 | end; 85 | 86 | 87 | function TSoldier2.ShowVersion: string; 88 | begin 89 | Result:= 'Loaded version is '+ IntToStr(LoadedVersion); 90 | end; 91 | 92 | end. 93 | -------------------------------------------------------------------------------- /Demo/Demo binary file 3/DemoBinary3.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/Demo/Demo binary file 3/DemoBinary3.res -------------------------------------------------------------------------------- /Demo/DemoSerializeToBinary.groupproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | {73116B00-773D-4D80-8D3E-CFD134F995CA} 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Default.Personality.12 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 | -------------------------------------------------------------------------------- /Demo/FMX - Demo LightPanel/FMX_Demo_LightPanel.dpr: -------------------------------------------------------------------------------- 1 | program FMX_Demo_LightPanel; 2 | 3 | uses 4 | System.StartUpCopy, 5 | FMX.Forms, 6 | FormTest in 'FormTest.pas' {Form2}; 7 | 8 | {$R *.res} 9 | 10 | begin 11 | Application.Initialize; 12 | Application.CreateForm(TForm2, Form2); 13 | Application.Run; 14 | end. 15 | -------------------------------------------------------------------------------- /Demo/FMX - Demo LightPanel/FormTest.fmx: -------------------------------------------------------------------------------- 1 | object Form2: TForm2 2 | Left = 0 3 | Top = 0 4 | Caption = 'Form2' 5 | ClientHeight = 231 6 | ClientWidth = 314 7 | FormFactor.Width = 320 8 | FormFactor.Height = 480 9 | FormFactor.Devices = [Desktop] 10 | OnCreate = FormCreate 11 | DesignerMasterStyle = 0 12 | object LightPanel1: TLightPanel 13 | Position.X = 8.000000000000000000 14 | Position.Y = 8.000000000000000000 15 | Size.Width = 297.000000000000000000 16 | Size.Height = 73.000000000000000000 17 | Size.PlatformDefault = False 18 | TabOrder = 1 19 | object Label1: TLabel 20 | Align = Top 21 | Size.Width = 297.000000000000000000 22 | Size.Height = 17.000000000000000000 23 | Size.PlatformDefault = False 24 | Text = 'VisibleAtRuntime:= True;' 25 | TabOrder = 0 26 | end 27 | end 28 | object LightPanel2: TLightPanel 29 | Position.X = 8.000000000000000000 30 | Position.Y = 89.000000000000000000 31 | Size.Width = 297.000000000000000000 32 | Size.Height = 73.000000000000000000 33 | Size.PlatformDefault = False 34 | TabOrder = 0 35 | VisibleAtRuntime = False 36 | object lblVisible: TLabel 37 | Align = Top 38 | Size.Width = 297.000000000000000000 39 | Size.Height = 17.000000000000000000 40 | Size.PlatformDefault = False 41 | Text = 'VisibleAtRuntime:= False;' 42 | TabOrder = 0 43 | end 44 | end 45 | object Button1: TButton 46 | Position.X = 104.000000000000000000 47 | Position.Y = 178.000000000000000000 48 | Size.Width = 105.000000000000000000 49 | Size.Height = 33.000000000000000000 50 | Size.PlatformDefault = False 51 | TabOrder = 2 52 | Text = 'Set Visible' 53 | TextSettings.Trimming = None 54 | OnClick = Button1Click 55 | end 56 | end 57 | -------------------------------------------------------------------------------- /Demo/FMX - Demo LightPanel/FormTest.pas: -------------------------------------------------------------------------------- 1 | UNIT FormTest; 2 | 3 | INTERFACE 4 | 5 | USES 6 | System.SysUtils, System.Types, System.UITypes, System.Classes, 7 | FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.Controls.Presentation, FMX.StdCtrls, 8 | LightFMX.Panel; 9 | 10 | TYPE 11 | TForm2 = class(TForm) 12 | LightPanel1: TLightPanel; 13 | LightPanel2: TLightPanel; 14 | lblVisible: TLabel; 15 | Label1: TLabel; 16 | Button1: TButton; 17 | procedure FormCreate(Sender: TObject); 18 | procedure Button1Click(Sender: TObject); 19 | private 20 | public 21 | end; 22 | 23 | var 24 | Form2: TForm2; 25 | 26 | IMPLEMENTATION 27 | {$R *.fmx} 28 | 29 | 30 | procedure TForm2.FormCreate(Sender: TObject); 31 | begin 32 | Caption:= 'LightPanel2.Visible is '+ BoolToStr(LightPanel2.Visible, TRUE); 33 | end; 34 | 35 | 36 | procedure TForm2.Button1Click(Sender: TObject); 37 | begin 38 | LightPanel2.Visible:= TRUE; 39 | end; 40 | 41 | 42 | end. 43 | -------------------------------------------------------------------------------- /Demo/FMX - Demo Message boxes/FMX_Demo_MessageBoxes.dpr: -------------------------------------------------------------------------------- 1 | program FMX_Demo_MessageBoxes; 2 | 3 | uses 4 | System.StartUpCopy, 5 | FMX.Forms, 6 | MainForm in 'MainForm.pas' {Form1}, 7 | LightFMX.lbAppData in '..\..\..\FrameFMX\LightFMX.lbAppData.pas', 8 | LightFMX.lbAppData.Form in '..\..\..\FrameFMX\LightFMX.lbAppData.Form.pas', 9 | LightFMX.lbIniFile in '..\..\..\FrameFMX\LightFMX.lbIniFile.pas', 10 | ccINIFile in '..\..\..\ccINIFile.pas', 11 | LightFMX.lbDialogs in '..\..\..\FrameFMX\LightFMX.lbDialogs.pas'; 12 | 13 | {$R *.res} 14 | 15 | begin 16 | ReportMemoryLeaksOnShutdown:= TRUE; 17 | 18 | AppData:= TAppData.Create('Light Demo FMX Messages'); 19 | AppData.CreateMainForm(TForm1, Form1, TRUE); 20 | AppData.Run; 21 | end. 22 | -------------------------------------------------------------------------------- /Demo/FMX - Demo Message boxes/FMX_Demo_MessageBoxes.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/Demo/FMX - Demo Message boxes/FMX_Demo_MessageBoxes.res -------------------------------------------------------------------------------- /Demo/FMX - Demo TDropDownSearchBox/FMX_Demo_TDropDownSearchBox.dpr: -------------------------------------------------------------------------------- 1 | program FMX_Demo_TDropDownSearchBox; 2 | 3 | uses 4 | System.StartUpCopy, 5 | FMX.Forms, 6 | Unit1 in 'Unit1.pas' {Form1}; 7 | 8 | {$R *.res} 9 | 10 | begin 11 | Application.Initialize; 12 | Application.CreateForm(TForm1, Form1); 13 | Application.Run; 14 | end. 15 | -------------------------------------------------------------------------------- /Demo/FMX - Demo TDropDownSearchBox/Unit1.fmx: -------------------------------------------------------------------------------- 1 | object Form1: TForm1 2 | Left = 0 3 | Top = 0 4 | Caption = 'TDropDownSearchBox demo' 5 | ClientHeight = 366 6 | ClientWidth = 544 7 | FormFactor.Width = 320 8 | FormFactor.Height = 480 9 | FormFactor.Devices = [Desktop] 10 | OnCreate = FormCreate 11 | DesignerMasterStyle = 0 12 | object Panel: TPanel 13 | Position.X = 104.000000000000000000 14 | Position.Y = 96.000000000000000000 15 | Size.Width = 329.000000000000000000 16 | Size.Height = 161.000000000000000000 17 | Size.PlatformDefault = False 18 | TabOrder = 1 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /Demo/FMX - Demo TDropDownSearchBox/Unit1.pas: -------------------------------------------------------------------------------- 1 | unit Unit1; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, System.Types, System.UITypes, System.Classes, 7 | FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, LightFMX.DropDownSearch, 8 | FMX.Controls.Presentation, FMX.StdCtrls; 9 | 10 | type 11 | TForm1 = class(TForm) 12 | Panel: TPanel; 13 | procedure FormCreate(Sender: TObject); 14 | private 15 | public 16 | SearchBox: TDropDownSearchBox; 17 | end; 18 | 19 | var 20 | Form1: TForm1; 21 | 22 | IMPLEMENTATION 23 | {$R *.fmx} 24 | 25 | procedure TForm1.FormCreate(Sender: TObject); 26 | begin 27 | SearchBox:= TDropDownSearchBox.Create(Panel); 28 | SearchBox.Parent := Panel; 29 | SearchBox.Visible := TRUE; 30 | SearchBox.Position.X:= 10; 31 | SearchBox.Position.Y:= 10; 32 | SearchBox.AddDemoStrings; 33 | end; 34 | 35 | end. 36 | -------------------------------------------------------------------------------- /Demo/More demos.url: -------------------------------------------------------------------------------- 1 | [InternetShortcut] 2 | URL=https://GabrielMoraru.com/ 3 | IDList= 4 | HotKey=0 5 | IconFile=C:\Users\trei\AppData\Local\Mozilla\Firefox\Profiles\daecy5hr.default-release\shortcutCache\HBeOsnPCEYaAo1368XkV+0DhgObFrf5xkKVmg+XJhuc=.ico 6 | IconIndex=0 7 | -------------------------------------------------------------------------------- /Demo/Template App/FMX Minimal/MainForm.fmx: -------------------------------------------------------------------------------- 1 | object Form1: TForm1 2 | Left = 0 3 | Top = 0 4 | Caption = 'Form1' 5 | ClientHeight = 342 6 | ClientWidth = 455 7 | FormFactor.Width = 320 8 | FormFactor.Height = 480 9 | FormFactor.Devices = [Desktop] 10 | OnCreate = FormCreate 11 | DesignerMasterStyle = 0 12 | object CheckBox1: TCheckBox 13 | ControlType = Platform 14 | Position.X = 40.000000000000000000 15 | Position.Y = 56.000000000000000000 16 | StyleLookup = 'checkboxstyle' 17 | TabOrder = 4 18 | Text = 'CheckBox1' 19 | object RadioButton1: TRadioButton 20 | Position.Y = 56.000000000000000000 21 | TabOrder = 18 22 | Text = 'RadioButton1' 23 | end 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /Demo/Template App/FMX Minimal/MainForm.pas: -------------------------------------------------------------------------------- 1 | unit MainForm; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, System.Types, System.UITypes, System.Classes, System.Rtti, 7 | FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.Controls.Presentation, FMX.StdCtrls, FMX.DialogService, 8 | FMX.Grid.Style, FMX.Presentation.Factory, FMX.Presentation.Style, 9 | LightFMX.lbAppData, LightFMX.lbAppData.Form, 10 | ccIniFile, ccLogRam, FMX.ScrollBox, FMX.Grid, 11 | LightFmx.lbLogViewer; 12 | 13 | TYPE 14 | TForm1 = class(TLightForm) 15 | CheckBox1: TCheckBox; 16 | RadioButton1: TRadioButton; 17 | procedure FormCreate(Sender: TObject); 18 | private 19 | public 20 | procedure FormPostInitialize; override; 21 | end; 22 | 23 | VAR 24 | Form1: TForm1; 25 | 26 | IMPLEMENTATION 27 | {$R *.fmx} 28 | 29 | USES ccAppData; 30 | 31 | 32 | 33 | procedure TForm1.FormCreate(Sender: TObject); 34 | begin 35 | VAR LogViewer:= TLogViewer.Create(Self); 36 | LogViewer.Parent:= Self; 37 | end; 38 | 39 | procedure TForm1.FormPostInitialize; 40 | begin 41 | AutoState:= asFull; // Must set it before inherited! 42 | inherited; // This will load the form's state from disk 43 | end; 44 | 45 | 46 | end. 47 | -------------------------------------------------------------------------------- /Demo/Template App/FMX Minimal/TemplateMicro.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/Demo/Template App/FMX Minimal/TemplateMicro.res -------------------------------------------------------------------------------- /Demo/Template App/FMX Minimal/TemplateMicro_Fmx.dpr: -------------------------------------------------------------------------------- 1 | program TemplateMicro_Fmx; 2 | 3 | uses 4 | {$IFDEF DEBUG} 5 | FastMM4, 6 | {$ENDIF} 7 | System.StartUpCopy, 8 | FMX.Forms, 9 | MainForm in 'MainForm.pas' {Form1}, 10 | LightFMX.lbAppData in '..\..\..\FrameFMX\LightFMX.lbAppData.pas', 11 | LightFMX.lbIniFile in '..\..\..\FrameFMX\LightFMX.lbIniFile.pas', 12 | LightFMX.lbAppData.Form in '..\..\..\FrameFMX\LightFMX.lbAppData.Form.pas'; 13 | 14 | {$R *.res} 15 | 16 | begin 17 | ReportMemoryLeaksOnShutdown:= TRUE; 18 | 19 | AppData:= TAppData.Create('Light Template FMX micro'); 20 | AppData.CreateMainForm(TForm1, Form1, TRUE); 21 | AppData.Run; 22 | end. 23 | -------------------------------------------------------------------------------- /Demo/Template App/ReadMe.md: -------------------------------------------------------------------------------- 1 | This shows you how to use the LightSaber library. 2 | I use it as a template for all my applications. 3 | 4 | [Minimal] 5 | The Minimal example shows you what you can achieve with the minimal amount of code: 6 | * Automatically save GUI's state on program shutdown (form position on screen, checkbox state, etc) 7 | * Automatically restore GUI's state on program startup. 8 | 9 | [Simple] 10 | Additional to the above example, this example has only a few lines of extra code: 11 | * Proper code initialization (in FormInitialize instead of FormCreate) 12 | * Create a desktop shortcut for your application 13 | * Associate your application with a file type/file extension, so your application starts automatically when someone double-clicks that file type in Explorer 14 | * Shows the BetaTesterMode capabilities 15 | * Show strings in the program's caption while still always showing the program's name and version. 16 | 17 | [Full] 18 | Demonstrates even more of LightSaber's capabilities (but not even by far all): 19 | * Translate the GUI in multiple languages 20 | * Program news (Check website for news and display news) 21 | * Program self update (check website for new versions) 22 | * User-selectable skins 23 | * Automatic logging 24 | * Automatically pop up the log on warnings and errors 25 | * Settings form 26 | * Convert the program to paid Trial/Shareware (via Proteus Library) 27 | * Minimize to system tray (via external library) 28 | * Single instance 29 | * Home page/Branding 30 | 31 | Automatically restoring the GUI 32 | A word of warning about this. In a well written program, the business logic should not be kept in the GUI. Any settings should not be read from the checkboxes of the GUI/form but from INI files or (much, much) better, binary objects. TfrmSettings.CreateFormModal is a good example of how to do this. 33 | 34 | Therefore, automatically saving and restoring the GUI (checkboxes, radio boxes, etc.) is not fully recommended and though simple and (extremely) time-efficient and cool, should be done only for simple forms! 35 | 36 | This is not a problem of the LightSaber library - this has to do with proper application architecture. 37 | 38 | -------------------------------------------------------------------------------- /Demo/Template App/VCL Full/Lang/Chinese.ini: -------------------------------------------------------------------------------- 1 | [Authors] 2 | Name= 3 | 4 | [frmLanguage] 5 | frmLanguage.Caption=Language/Sprache/Langue/Limba/Idioma/你好 6 | grpChoose.Caption=选择语言 7 | lblHint.Caption=提示:您可以创建自己的翻译。 8 | ListBox.Hint=双击文件加载。 9 | btnApplyLang.Caption=OK 10 | btnRefresh.Hint=重新载入可用语言列表 11 | btnRefresh.Caption=刷新 12 | btnTranslate.Hint=创建自己的翻译 13 | btnTranslate.Caption=翻译 14 | 15 | [frmTester] 16 | frmTester.Caption=测试仪 17 | CheckBox1.Caption=你好 18 | btnShowTranslator.Caption=语言 19 | btnHelper.Caption=翻译助手 20 | LabeledEdit.SubLabel.Caption=Chinese 21 | -------------------------------------------------------------------------------- /Demo/Template App/VCL Full/Lang/English.ini: -------------------------------------------------------------------------------- 1 | [Authors] 2 | Name=GM 3 | 4 | [frmLanguage] 5 | frmLanguage.Caption=Language/Sprache/Langue/Limba/Idioma/你好 6 | grpChoose.Caption=Select language 7 | lblHint.Caption=Tip: You can create your own translations. 8 | ListBox.Hint=Double-click on the file to load it. 9 | btnApplyLang.Caption=OK 10 | btnRefresh.Hint=Reload the list of available languages 11 | btnRefresh.Caption=Refresh 12 | btnTranslate.Hint=Create your own translation 13 | btnTranslate.Caption=Translate 14 | 15 | [frmTester] 16 | frmTester.Caption=Tester 17 | CheckBox1.Caption=CheckBox 18 | btnShowTranslator.Caption=Select language 19 | btnHelper.Caption=Translator helper 20 | LabeledEdit.SubLabel.Caption=English 21 | 22 | 23 | [frmLog] 24 | frmLog.Caption=Log 25 | chkAutoOpen.Hint=Show this Log window when it displays error or warning messages. 26 | chkAutoOpen.Caption=Show the log on error 27 | btnClear.Hint=Clear log 28 | btnClear.Caption=Clear 29 | 30 | -------------------------------------------------------------------------------- /Demo/Template App/VCL Full/Lang/German.ini: -------------------------------------------------------------------------------- 1 | [Authors] 2 | Name=GM 3 | 4 | [frmLanguage] 5 | frmLanguage.Caption=Language/Sprache/Langue/Limba/Idioma/你好 6 | grpChoose.Caption=Sprache wählen 7 | lblHint.Caption=Tipp: Sie können Ihre eigenen Übersetzungen erstellen. 8 | ListBox.Hint=Doppelklicken Sie auf die Datei, um sie zu laden. 9 | btnApplyLang.Caption=OK 10 | btnRefresh.Hint=Laden Sie die Liste der verfügbaren Sprachen neu 11 | btnRefresh.Caption=Aktualisieren 12 | btnTranslate.Hint=Erstellen Ihre eigene Übersetzung 13 | btnTranslate.Caption=Übersetzen 14 | 15 | [frmTester] 16 | frmTester.Caption=Programm-Tester 17 | CheckBox1.Caption=Kontrollkästchen 18 | btnShowTranslator.Caption=Language 19 | LabeledEdit.SubLabel.Caption=German 20 | -------------------------------------------------------------------------------- /Demo/Template App/VCL Full/System/About.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/Demo/Template App/VCL Full/System/About.PNG -------------------------------------------------------------------------------- /Demo/Template App/VCL Full/System/Splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/Demo/Template App/VCL Full/System/Splash.png -------------------------------------------------------------------------------- /Demo/Template App/VCL Full/System/betatester: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/Demo/Template App/VCL Full/System/betatester -------------------------------------------------------------------------------- /Demo/Template App/VCL Full/TemplateApp.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/Demo/Template App/VCL Full/TemplateApp.res -------------------------------------------------------------------------------- /Demo/Template App/VCL Full/TemplateFull.dpr: -------------------------------------------------------------------------------- 1 | program TemplateFull; 2 | 3 | uses 4 | {$IFDEF DEBUG} 5 | FastMM4, 6 | {$ENDIF } 7 | ccINIFile, 8 | LightCom.AppData, 9 | FormMain in 'FormMain.pas' {MainForm}, 10 | FormSettings in 'FormSettings.pas', 11 | uInitialization in 'uInitialization.pas', 12 | LightCom.AppDataForm in '..\..\..\FrameVCL\LightCom.AppDataForm.pas', 13 | ccAppData in '..\..\..\ccAppData.pas', 14 | LightCom.IniFile in '..\..\..\FrameVCL\LightCom.IniFile.pas'; 15 | 16 | {$R *.res} 17 | 18 | begin 19 | ReportMemoryLeaksOnShutdown:= TRUE; 20 | 21 | CONST 22 | MultiThreaded= FALSE; // True => Only if we need to use multithreading in the Log. 23 | CONST 24 | AppName= 'Light Template Full'; // Absolutelly critical if you use the SaveForm/LoadForm functionality. This string will be used as the name of the INI file. 25 | 26 | AppData:= TAppData.Create(AppName, '', MultiThreaded); 27 | AppData.CreateMainForm(TMainForm, MainForm, FALSE, TRUE, asFull); 28 | AppData.Run; 29 | end. 30 | -------------------------------------------------------------------------------- /Demo/Template App/VCL Full/TemplateFull.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/Demo/Template App/VCL Full/TemplateFull.res -------------------------------------------------------------------------------- /Demo/Template App/VCL Minimal/MainForm.dfm: -------------------------------------------------------------------------------- 1 | object frmMain: TfrmMain 2 | Left = 0 3 | Top = 0 4 | Caption = 'Light Saber - No code demo' 5 | ClientHeight = 180 6 | ClientWidth = 413 7 | Color = clBtnFace 8 | Font.Charset = DEFAULT_CHARSET 9 | Font.Color = clWindowText 10 | Font.Height = -12 11 | Font.Name = 'Segoe UI' 12 | Font.Style = [] 13 | Position = poDesigned 14 | TextHeight = 15 15 | object CheckBox: TCheckBox 16 | Left = 32 17 | Top = 40 18 | Width = 97 19 | Height = 17 20 | Caption = 'Check box' 21 | TabOrder = 0 22 | end 23 | object RadioButton1: TRadioButton 24 | Left = 32 25 | Top = 112 26 | Width = 113 27 | Height = 17 28 | Caption = 'Choice A' 29 | TabOrder = 1 30 | end 31 | object RadioButton2: TRadioButton 32 | Left = 32 33 | Top = 135 34 | Width = 113 35 | Height = 17 36 | Caption = 'Choice B' 37 | TabOrder = 2 38 | end 39 | object CheckBox1: TCheckBox 40 | Left = 32 41 | Top = 64 42 | Width = 97 43 | Height = 17 44 | Caption = 'CheckBox1' 45 | TabOrder = 3 46 | end 47 | object Panel1: TPanel 48 | Left = 168 49 | Top = 40 50 | Width = 201 51 | Height = 112 52 | TabOrder = 4 53 | object Button1: TButton 54 | Left = 64 55 | Top = 80 56 | Width = 75 57 | Height = 25 58 | Caption = 'Button1' 59 | TabOrder = 0 60 | end 61 | end 62 | end 63 | -------------------------------------------------------------------------------- /Demo/Template App/VCL Minimal/MainForm.pas: -------------------------------------------------------------------------------- 1 | UNIT MainForm; 2 | 3 | {============================================================================================================= 4 | 2025.03 5 | www.GabrielMoraru.com 6 | -------------------------------------------------------------------------------------------------------------- 7 | Use this as a template when you start a new mini application (usually for code-testing purposes) 8 | =============================================================================================================} 9 | 10 | INTERFACE 11 | 12 | USES 13 | System.SysUtils, System.Classes, 14 | Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, 15 | LightCom.AppDataForm, Vcl.ExtCtrls; 16 | 17 | type 18 | TfrmMain = class(TLightForm) 19 | CheckBox: TCheckBox; 20 | RadioButton1: TRadioButton; 21 | RadioButton2: TRadioButton; 22 | CheckBox1: TCheckBox; 23 | Panel1: TPanel; 24 | Button1: TButton; 25 | private 26 | public 27 | end; 28 | 29 | 30 | IMPLEMENTATION {$R *.dfm} 31 | 32 | end. 33 | -------------------------------------------------------------------------------- /Demo/Template App/VCL Minimal/TemplateMicro.dpr: -------------------------------------------------------------------------------- 1 | program TemplateMicro; 2 | 3 | uses 4 | {$IFDEF DEBUG} 5 | FastMM4, 6 | {$ENDIF } 7 | MainForm in 'MainForm.pas' {frmMain}, 8 | LightCom.AppData, 9 | ccINIFile, 10 | ccAppData in '..\..\..\ccAppData.pas'; 11 | 12 | {$R *.res} 13 | 14 | begin 15 | ReportMemoryLeaksOnShutdown:= TRUE; 16 | 17 | AppData:= TAppData.Create('Light Template Micro'); 18 | AppData.CreateMainForm(TfrmMain, TRUE, TRUE, asFull); 19 | AppData.Run; 20 | end. 21 | -------------------------------------------------------------------------------- /Demo/Template App/VCL Minimal/TemplateMicro.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/Demo/Template App/VCL Minimal/TemplateMicro.res -------------------------------------------------------------------------------- /Demo/Template App/VCL Simple/FormMain.dfm: -------------------------------------------------------------------------------- 1 | object MainForm: TMainForm 2 | Left = 891 3 | Top = 327 4 | AlphaBlendValue = 249 5 | Caption = 'Template App' 6 | ClientHeight = 370 7 | ClientWidth = 680 8 | Color = clBtnFace 9 | Constraints.MinHeight = 300 10 | Constraints.MinWidth = 350 11 | DoubleBuffered = True 12 | Font.Charset = ANSI_CHARSET 13 | Font.Color = clWindowText 14 | Font.Height = -13 15 | Font.Name = 'Segoe UI' 16 | Font.Style = [] 17 | GlassFrame.Enabled = True 18 | Menu = MainMenu 19 | Position = poDesigned 20 | ScreenSnap = True 21 | ShowHint = True 22 | SnapBuffer = 5 23 | OnClose = FormClose 24 | OnCreate = FormCreate 25 | TextHeight = 17 26 | object pgCtrl: TPageControl 27 | Left = 0 28 | Top = 0 29 | Width = 680 30 | Height = 370 31 | ActivePage = tabMain 32 | Align = alClient 33 | TabOrder = 0 34 | object tabMain: TTabSheet 35 | Caption = 'Main tab' 36 | object mmo: TMemo 37 | AlignWithMargins = True 38 | Left = 3 39 | Top = 3 40 | Width = 475 41 | Height = 332 42 | Align = alClient 43 | TabOrder = 1 44 | end 45 | object pnlRight: TPanel 46 | AlignWithMargins = True 47 | Left = 484 48 | Top = 3 49 | Width = 185 50 | Height = 332 51 | Align = alRight 52 | BevelOuter = bvNone 53 | TabOrder = 0 54 | object btnStart: TButton 55 | AlignWithMargins = True 56 | Left = 3 57 | Top = 276 58 | Width = 179 59 | Height = 53 60 | Align = alBottom 61 | Caption = 'START' 62 | TabOrder = 0 63 | OnClick = btnSTARTClick 64 | end 65 | object CheckBox1: TCheckBox 66 | Left = 8 67 | Top = 4 68 | Width = 97 69 | Height = 17 70 | Caption = 'Checkbox' 71 | TabOrder = 1 72 | end 73 | end 74 | end 75 | object tabSecondary: TTabSheet 76 | Caption = 'Another tab' 77 | ImageIndex = 1 78 | end 79 | end 80 | object MainMenu: TMainMenu 81 | Left = 63 82 | Top = 51 83 | end 84 | object Actions: TActionList 85 | Left = 130 86 | Top = 51 87 | end 88 | end 89 | -------------------------------------------------------------------------------- /Demo/Template App/VCL Simple/System/betatester: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/Demo/Template App/VCL Simple/System/betatester -------------------------------------------------------------------------------- /Demo/Template App/VCL Simple/TemplateSimple.dpr: -------------------------------------------------------------------------------- 1 | program TemplateSimple; 2 | 3 | uses 4 | {$IFDEF DEBUG} 5 | FastMM4, 6 | {$ENDIF } 7 | ccINIFile, 8 | LightCom.AppData, 9 | FormMain in 'FormMain.pas' {MainForm}, 10 | LightVcl.LogForm in '..\..\FrameVCL\LightVcl.LogForm.pas', 11 | ccAppData in '..\..\..\ccAppData.pas'; 12 | 13 | {$R *.res} 14 | 15 | begin 16 | ReportMemoryLeaksOnShutdown:= TRUE; 17 | 18 | CONST 19 | MultiThreaded= FALSE; // True => Only if we need to use multithreading in the Log. 20 | CONST 21 | AppName= 'Light Template Simple'; // Absolutelly critical if you use the SaveForm/LoadForm functionality. This string will be used as the name of the INI file. 22 | 23 | AppData:= TAppData.Create(AppName, '', MultiThreaded); 24 | AppData.CreateMainForm(TMainForm, MainForm, TRUE, TRUE, asFull); 25 | AppData.Run; 26 | end. 27 | -------------------------------------------------------------------------------- /Demo/Template App/VCL Simple/TemplateSimple.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/Demo/Template App/VCL Simple/TemplateSimple.res -------------------------------------------------------------------------------- /Demo/Template Universal Uninstaller/Clean.cmd: -------------------------------------------------------------------------------- 1 | del *.ddp 2 | del *.dcu 3 | del *.map 4 | del *.elf 5 | del BioniXWallpaper.bmp 6 | del TimeWallpaper.BMP 7 | del *.identcache 8 | del *.local 9 | del *.otares 10 | del *.~* 11 | del "BioniX Log.TXT" -------------------------------------------------------------------------------- /Demo/Template Universal Uninstaller/DALL·E CD image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/Demo/Template Universal Uninstaller/DALL·E CD image.png -------------------------------------------------------------------------------- /Demo/Template Universal Uninstaller/DebugMode-: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/Demo/Template Universal Uninstaller/DebugMode- -------------------------------------------------------------------------------- /Demo/Template Universal Uninstaller/SharedUninstaller.pas: -------------------------------------------------------------------------------- 1 | UNIT SharedUninstaller; 2 | 3 | {-------------------------------------------------------------------------------------------------- 4 | HeracleBioSoft 5 | 2023.03.02 6 | Utility functions for c:\MyProjects\Project support\Universal Uninstaller\Uninstaller.dpr 7 | 8 | Note: 9 | Do not add application specific dependinces/units to the Uses clause because you won't be able to compile the Uninstaller 10 | --------------------------------------------------------------------------------------------------} 11 | 12 | {done: the send feedback button should also take user to http://www.Bionixwallpaper.com/help/install/uninstall-reason.html#soft} 13 | 14 | INTERFACE 15 | USES 16 | Winapi.Windows; 17 | 18 | 19 | 20 | IMPLEMENTATION 21 | 22 | USES ccRegistry, ccAppData, LightCom.AppData 23 | ; 24 | 25 | 26 | {moved to 27 | 28 | TAppData.AddUninstallerToCtrlPanel 29 | TAppData.RegisterUninstaller; 30 | 31 | } 32 | 33 | 34 | 35 | end. 36 | 37 | 38 | -------------------------------------------------------------------------------- /Demo/Template Universal Uninstaller/Uninstaller.dpr: -------------------------------------------------------------------------------- 1 | program Uninstaller; 2 | 3 | uses 4 | {$IFDEF DEBUG} 5 | FastMM4, 6 | {$ENDIF } 7 | UninstallerForm in 'UninstallerForm.pas' {frmMain}, 8 | Vcl.Themes, 9 | Vcl.Styles, 10 | LightCom.AppData, 11 | cvCountDown in '..\..\FrameVCL\LightSaber\cvCountDown.pas', 12 | LightCom.Shell in '..\..\FrameVCL\LightSaber\LightCom.Shell.pas', 13 | ccAppData in '..\..\ccAppData.pas'; 14 | 15 | {$R *.res} 16 | 17 | begin 18 | ReportMemoryLeaksOnShutdown:= TRUE; 19 | 20 | AppData:= TAppData.Create('Light Template Uninstaller'); // stackoverflow.com/questions/75449673/is-it-ok-to-create-an-object-before-application-initialize 21 | UninstallerForm.CreateCopy; 22 | AppData.CreateMainForm(TfrmMain, frmMain, TRUE, TRUE, asFull); 23 | AppData.Run; 24 | end. 25 | 26 | 27 | -------------------------------------------------------------------------------- /Demo/Template Universal Uninstaller/Uninstaller.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/Demo/Template Universal Uninstaller/Uninstaller.res -------------------------------------------------------------------------------- /Demo/Template Universal Uninstaller/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/Demo/Template Universal Uninstaller/icon.ico -------------------------------------------------------------------------------- /Demo/Testers.lnk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/Demo/Testers.lnk -------------------------------------------------------------------------------- /Docs/Delphi in all its glory.url: -------------------------------------------------------------------------------- 1 | [InternetShortcut] 2 | URL=https://gabrielmoraru.com/ 3 | IDList= 4 | HotKey=0 5 | IconFile=C:\Users\trei\AppData\Local\Mozilla\Firefox\Profiles\daecy5hr.default-release\shortcutCache\HBeOsnPCEYaAo1368XkV+0DhgObFrf5xkKVmg+XJhuc=.ico 6 | IconIndex=0 7 | -------------------------------------------------------------------------------- /Docs/Library architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/Docs/Library architecture.png -------------------------------------------------------------------------------- /Docs/Lightsaber logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/Docs/Lightsaber logo.png -------------------------------------------------------------------------------- /Docs/Translator/TranslationCn.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/Docs/Translator/TranslationCn.PNG -------------------------------------------------------------------------------- /Docs/Translator/TranslationDe.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/Docs/Translator/TranslationDe.PNG -------------------------------------------------------------------------------- /Docs/Translator/TranslationEn.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/Docs/Translator/TranslationEn.PNG -------------------------------------------------------------------------------- /Docs/Translator/Translator Code.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/Docs/Translator/Translator Code.PNG -------------------------------------------------------------------------------- /FrameFMX/FMX form event order.txt: -------------------------------------------------------------------------------- 1 | As explained by Copilot. 2 | 3 | Step 1: Determine the Creation Order of FMX Forms 4 | 5 | Based on the obtained information, here is the creation order of FMX forms and the sequence of constructors/events called: 6 | 7 | Create - The constructor of the form is called. 8 | Loaded - This method is called after the form and its components are loaded. 9 | CreateWnd - Called when the window handle for the form is created. 10 | CreateWindowHandle - Called as part of CreateWnd to create the actual window handle. 11 | SetParent - The parent of the form is set, and this can be called multiple times during the form's lifecycle. 12 | AfterConstruction - Called after the form's constructor has finished executing. 13 | FormInitialize - A custom method provided by TLightForm that allows initialization after the form is fully created. 14 | Show - The form is shown if the Show parameter is True. 15 | 16 | The sequence for dynamic creation, DFM streaming, and other scenarios can be summarized as follows: 17 | 18 | Dropping control on a form: 19 | Create 20 | AfterConstruction 21 | SetParent 22 | CreateWnd 23 | CreateWindowHandle 24 | CreateWnd post 25 | SetParent post 26 | 27 | Executing the program (DFM streaming): 28 | Create 29 | AfterConstruction 30 | SetParent 31 | SetParent post 32 | SetParent 33 | SetParent post 34 | Loaded 35 | CreateWnd 36 | CreateWindowHandle 37 | CreateWnd post 38 | 39 | Dynamic creation of the control: 40 | Create 41 | AfterConstruction 42 | SetParent 43 | CreateWnd 44 | CreateWindowHandle 45 | CreateWnd post 46 | SetParent post 47 | 48 | 49 | -------------------------------------------------------------------------------- /FrameFMX/Frameworks.inc: -------------------------------------------------------------------------------- 1 | // Define FRAMEWORK_VCL and FRAMEWORK_FMX for Delphi versions prior to 11.1 2 | {$IF CompilerVersion < 35.0} // Delphi 11.1 = CompilerVersion 35.0 3 | {$IFDEF MSWINDOWS} 4 | {$DEFINE FRAMEWORK_VCL} 5 | {$ELSE} 6 | {$DEFINE FRAMEWORK_FMX} 7 | {$ENDIF} 8 | {$ENDIF} 9 | 10 | // For Delphi 11.1 and later, FRAMEWORK_VCL and FRAMEWORK_FMX are already defined 11 | -------------------------------------------------------------------------------- /FrameFMX/LightFMX.lbHelpers.pas: -------------------------------------------------------------------------------- 1 | unit LightFMX.lbHelpers; 2 | 3 | interface 4 | 5 | uses 6 | System.Classes, 7 | FMX.Types, FMX.Forms, FMX.Controls, FMX.Platform; 8 | 9 | function GetParentForm(Control: TControl; TopForm: Boolean = True): TCommonCustomForm; 10 | function FindImmediateParentForm(Obj: TFmxObject): TCommonCustomForm; 11 | 12 | function CopyToClipboard(CONST s: string): Boolean; 13 | 14 | 15 | 16 | IMPLEMENTATION 17 | 18 | USES 19 | LightFMX.lbDialogs; 20 | 21 | 22 | function FindImmediateParentForm(Obj: TFmxObject): TCommonCustomForm; 23 | begin 24 | while (Obj <> nil) 25 | AND NOT (Obj is TCommonCustomForm) 26 | DO Obj := Obj.Parent; 27 | 28 | if Obj is TCommonCustomForm 29 | then Result := TCommonCustomForm(Obj) 30 | else Result := nil; 31 | end; 32 | 33 | 34 | function GetParentForm(Control: TControl; TopForm: Boolean = True): TCommonCustomForm; 35 | var 36 | Form: TCommonCustomForm; 37 | begin 38 | // If the control is in design mode, override the "TopForm" parameter 39 | if csDesigning in Control.ComponentState then 40 | TopForm := False; 41 | 42 | // Find the immediate parent form 43 | Form := FindImmediateParentForm(Control); 44 | 45 | // If TopForm is True, traverse up to the topmost form 46 | if (Form <> NIL) and TopForm then 47 | begin 48 | while (Form.Parent <> nil) and (Form.Parent is TCommonCustomForm) do 49 | Form := TCommonCustomForm(Form.Parent); 50 | end; 51 | 52 | Result := Form; 53 | end; 54 | 55 | 56 | function CopyToClipboard(CONST s: string): Boolean; 57 | VAR 58 | ClipboardService: IFMXClipboardService; 59 | begin 60 | Result:= TPlatformServices.Current.SupportsPlatformService(IFMXClipboardService, ClipboardService); 61 | if Result 62 | then ClipboardService.SetClipboard(s) 63 | else messageError('Clipboard service not available.'); // Optional user feedback 64 | end; 65 | 66 | 67 | end. 68 | -------------------------------------------------------------------------------- /FrameFMX/LightFMX.lcDropDownSearch.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/FrameFMX/LightFMX.lcDropDownSearch.pas -------------------------------------------------------------------------------- /FrameFMX/LightFMX.lcLayout.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/FrameFMX/LightFMX.lcLayout.pas -------------------------------------------------------------------------------- /FrameFMX/LightFMX.lcPanel.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/FrameFMX/LightFMX.lcPanel.pas -------------------------------------------------------------------------------- /FrameFMX/LightFmx.lbLogViewer.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/FrameFMX/LightFmx.lbLogViewer.pas -------------------------------------------------------------------------------- /FrameFMX/LightFmxBase.dpk: -------------------------------------------------------------------------------- 1 | package LightFmxBase; 2 | 3 | {$R *.res} 4 | {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users} 5 | {$ALIGN 2} 6 | {$ASSERTIONS ON} 7 | {$BOOLEVAL OFF} 8 | {$DEBUGINFO OFF} 9 | {$EXTENDEDSYNTAX ON} 10 | {$IMPORTEDDATA ON} 11 | {$IOCHECKS ON} 12 | {$LOCALSYMBOLS ON} 13 | {$LONGSTRINGS ON} 14 | {$OPENSTRINGS ON} 15 | {$OPTIMIZATION OFF} 16 | {$OVERFLOWCHECKS ON} 17 | {$RANGECHECKS ON} 18 | {$REFERENCEINFO ON} 19 | {$SAFEDIVIDE OFF} 20 | {$STACKFRAMES ON} 21 | {$TYPEDADDRESS OFF} 22 | {$VARSTRINGCHECKS ON} 23 | {$WRITEABLECONST OFF} 24 | {$MINENUMSIZE 1} 25 | {$IMAGEBASE $400000} 26 | {$DEFINE DEBUG} 27 | {$ENDIF IMPLICITBUILDING} 28 | {$DESCRIPTION 'LightSaber - AppData FMX library'} 29 | {$LIBSUFFIX AUTO} 30 | {$IMPLICITBUILD ON} 31 | 32 | requires 33 | Rtl, 34 | LightCore, 35 | Fmx; 36 | 37 | contains 38 | LightFMX.lbAppData in 'LightFMX.lbAppData.pas', 39 | LightFMX.lbAppData.Form in 'LightFMX.lbAppData.Form.pas', 40 | LightFMX.lbLogFilter in 'LightFMX.lbLogFilter.pas', 41 | LightFmx.lbLogViewer in 'LightFmx.lbLogViewer.pas', 42 | LightFMX.lbCenterControl in 'LightFMX.lbCenterControl.pas', 43 | LightFMX.lbDialogs in 'LightFMX.lbDialogs.pas', 44 | LightFMX.lbIniFile in 'LightFMX.lbIniFile.pas', 45 | LightFMX.lbHelpers in 'LightFMX.lbHelpers.pas'; 46 | 47 | end. 48 | -------------------------------------------------------------------------------- /FrameFMX/LightFmxCommon.dpk: -------------------------------------------------------------------------------- 1 | package LightFmxCommon; 2 | 3 | {$R *.res} 4 | {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users} 5 | {$ALIGN 8} 6 | {$ASSERTIONS ON} 7 | {$BOOLEVAL OFF} 8 | {$DEBUGINFO OFF} 9 | {$EXTENDEDSYNTAX ON} 10 | {$IMPORTEDDATA ON} 11 | {$IOCHECKS ON} 12 | {$LOCALSYMBOLS ON} 13 | {$LONGSTRINGS ON} 14 | {$OPENSTRINGS ON} 15 | {$OPTIMIZATION OFF} 16 | {$OVERFLOWCHECKS ON} 17 | {$RANGECHECKS ON} 18 | {$REFERENCEINFO ON} 19 | {$SAFEDIVIDE OFF} 20 | {$STACKFRAMES ON} 21 | {$TYPEDADDRESS OFF} 22 | {$VARSTRINGCHECKS ON} 23 | {$WRITEABLECONST OFF} 24 | {$MINENUMSIZE 1} 25 | {$IMAGEBASE $400000} 26 | {$DEFINE DEBUG} 27 | {$ENDIF IMPLICITBUILDING} 28 | {$LIBSUFFIX AUTO} 29 | {$IMPLICITBUILD ON} 30 | 31 | requires 32 | rtl, 33 | fmx, 34 | LightCore, 35 | LightFmxBase; 36 | 37 | contains 38 | LightFMX.lcPanel in 'LightFMX.lcPanel.pas', 39 | LightFMX.lcDropDownSearch in 'LightFMX.lcDropDownSearch.pas', 40 | LightFMX.lcLayout in 'LightFMX.lcLayout.pas', 41 | LightFMX.lcComboBox in 'LightFMX.lcComboBox.pas'; 42 | 43 | end. 44 | -------------------------------------------------------------------------------- /FrameVCL/FormAsyncMessage.dfm: -------------------------------------------------------------------------------- 1 | object frmShowMsgAsync: TfrmShowMsgAsync 2 | Left = 0 3 | Top = 0 4 | AutoSize = True 5 | BorderStyle = bsDialog 6 | Caption = 'Caption' 7 | ClientHeight = 112 8 | ClientWidth = 408 9 | Color = clBtnFace 10 | Constraints.MaxHeight = 300 11 | Constraints.MaxWidth = 700 12 | Constraints.MinHeight = 140 13 | Constraints.MinWidth = 150 14 | DoubleBuffered = True 15 | Font.Charset = DEFAULT_CHARSET 16 | Font.Color = clWindowText 17 | Font.Height = -11 18 | Font.Name = 'Tahoma' 19 | Font.Style = [] 20 | FormStyle = fsStayOnTop 21 | Position = poOwnerFormCenter 22 | OnClose = FormClose 23 | TextHeight = 13 24 | object lblMessage: TLabel 25 | AlignWithMargins = True 26 | Left = 9 27 | Top = 20 28 | Width = 390 29 | Height = 13 30 | Margins.Left = 9 31 | Margins.Top = 20 32 | Margins.Right = 9 33 | Align = alTop 34 | Caption = 'Msg' 35 | ParentShowHint = False 36 | ShowHint = True 37 | Layout = tlCenter 38 | WordWrap = True 39 | end 40 | object Panel1: TPanel 41 | Left = 0 42 | Top = 71 43 | Width = 408 44 | Height = 41 45 | Align = alBottom 46 | BevelOuter = bvNone 47 | TabOrder = 0 48 | DesignSize = ( 49 | 408 50 | 41) 51 | object btnOK: TButton 52 | Left = 158 53 | Top = 5 54 | Width = 93 55 | Height = 31 56 | Anchors = [akBottom] 57 | Caption = 'Ok' 58 | TabOrder = 0 59 | OnClick = btnOKClick 60 | end 61 | end 62 | end 63 | -------------------------------------------------------------------------------- /FrameVCL/FormAsyncMessage.pas: -------------------------------------------------------------------------------- 1 | UNIT FormAsyncMessage; 2 | 3 | {============================================================================================================= 4 | Gabriel Moraru 5 | 2024.05 6 | www.GabrielMoraru.com 7 | See Copyright file 8 | -------------------------------------------------------------------------------------------------------------- 9 | A non-blocking message box. 10 | No dependences. 11 | =============================================================================================================} 12 | 13 | INTERFACE 14 | {.$DENYPACKAGEUNIT ON} {Prevents unit from being placed in a package. https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Packages_(Delphi)#Naming_packages } 15 | 16 | USES 17 | System.Classes, 18 | Vcl.Forms, Vcl.StdCtrls, Vcl.ExtCtrls, Vcl.Controls, 19 | LightCom.AppDataForm; 20 | 21 | type 22 | TfrmShowMsgAsync = class(TLightForm) 23 | lblMessage: TLabel; 24 | Panel1: TPanel; 25 | btnOK: TButton; 26 | procedure btnOKClick(Sender: TObject); 27 | procedure FormClose(Sender: TObject; var Action: TCloseAction); 28 | public 29 | end; 30 | 31 | procedure MesajAsync (CONST Msg: string; CONST Caption: string= ''; PopupParent: TCustomForm= NIL); 32 | procedure MessageInfoAsync (CONST Msg: string; PopupParent: TCustomForm= NIL); 33 | procedure MesajWarnAsync (CONST Msg: string; PopupParent: TCustomForm= NIL); 34 | procedure MessageErrorAsync(CONST Msg: string; PopupParent: TCustomForm= NIL); 35 | 36 | 37 | IMPLEMENTATION {$R *.dfm} 38 | 39 | 40 | procedure MesajAsync(CONST Msg: string; CONST Caption: string= ''; PopupParent: TCustomForm= NIL); 41 | VAR frm: TfrmShowMsgAsync; 42 | begin 43 | frm:= TfrmShowMsgAsync.Create(Application.MainForm); 44 | frm.Caption:= Caption; 45 | frm.lblMessage.Caption:= Msg; 46 | frm.BorderStyle:= bsDialog; 47 | frm.PopupParent:= PopupParent; 48 | frm.Show; 49 | end; 50 | 51 | 52 | procedure MessageInfoAsync(CONST Msg: string; PopupParent: TCustomForm= NIL); 53 | begin 54 | MesajAsync(Msg, 'Info', PopupParent); 55 | end; 56 | 57 | procedure MesajWarnAsync(CONST Msg: string; PopupParent: TCustomForm= NIL); 58 | begin 59 | MesajAsync(Msg, 'Warning', PopupParent); 60 | end; 61 | 62 | procedure MessageErrorAsync(CONST Msg: string; PopupParent: TCustomForm= NIL); 63 | begin 64 | MesajAsync(Msg, 'Error', PopupParent); 65 | end; 66 | 67 | 68 | 69 | 70 | 71 | procedure TfrmShowMsgAsync.btnOKClick(Sender: TObject); 72 | begin 73 | Close; 74 | end; 75 | 76 | procedure TfrmShowMsgAsync.FormClose(Sender: TObject; var Action: TCloseAction); 77 | begin 78 | // WARNING!!!!!!!!!!!!!!!!!!!!!!!!!! 79 | Action:= caFree; 80 | {Action:= caFree; Delphi bug: https://quality.embarcadero.com/browse/RSP-33140 } 81 | end; 82 | 83 | end. 84 | -------------------------------------------------------------------------------- /FrameVCL/FormDrawing.dfm: -------------------------------------------------------------------------------- 1 | object DrawingForm: TDrawingForm 2 | Tag = 128 3 | Left = 0 4 | Top = 0 5 | Margins.Left = 0 6 | Margins.Top = 0 7 | Margins.Right = 0 8 | Margins.Bottom = 0 9 | Anchors = [] 10 | Caption = 'DrawingForm' 11 | ClientHeight = 202 12 | ClientWidth = 304 13 | Color = clBlack 14 | DoubleBuffered = True 15 | Font.Charset = DEFAULT_CHARSET 16 | Font.Color = clWindowText 17 | Font.Height = -11 18 | Font.Name = 'Tahoma' 19 | Font.Style = [] 20 | OldCreateOrder = True 21 | SnapBuffer = 3 22 | StyleElements = [] 23 | PixelsPerInch = 96 24 | TextHeight = 13 25 | object pnlVideoDisplay: TPanel 26 | Left = 66 27 | Top = 50 28 | Width = 169 29 | Height = 91 30 | BevelOuter = bvNone 31 | Caption = 'Video display' 32 | Color = 16384 33 | ParentBackground = False 34 | TabOrder = 0 35 | Visible = False 36 | StyleElements = [] 37 | end 38 | end 39 | -------------------------------------------------------------------------------- /FrameVCL/FormRichLog.dfm: -------------------------------------------------------------------------------- 1 | object frmRichLog: TfrmRichLog 2 | Left = 549 3 | Top = 450 4 | AlphaBlend = True 5 | BorderIcons = [biSystemMenu, biMaximize] 6 | Caption = 'Log' 7 | ClientHeight = 512 8 | ClientWidth = 710 9 | Color = clBtnFace 10 | DoubleBuffered = True 11 | ParentFont = True 12 | Position = poDesigned 13 | ScreenSnap = True 14 | ShowHint = True 15 | SnapBuffer = 3 16 | OnDestroy = FormDestroy 17 | TextHeight = 15 18 | object Container: TPanel 19 | Left = 0 20 | Top = 0 21 | Width = 710 22 | Height = 512 23 | Align = alClient 24 | BevelOuter = bvNone 25 | ParentColor = True 26 | TabOrder = 0 27 | object Log: TRichLog 28 | AlignWithMargins = True 29 | Left = 3 30 | Top = 3 31 | Width = 708 32 | Height = 473 33 | Align = alClient 34 | Font.Charset = ANSI_CHARSET 35 | Font.Color = clWindowText 36 | Font.Height = -11 37 | Font.Name = 'Tahoma' 38 | Font.Style = [] 39 | HideSelection = False 40 | Lines.Strings = ( 41 | 'Log') 42 | MaxLength = 2147483632 43 | ParentColor = True 44 | ParentFont = False 45 | PlainText = True 46 | ScrollBars = ssBoth 47 | TabOrder = 1 48 | WordWrap = False 49 | OnError = LogError 50 | end 51 | object pnlBottom: TPanel 52 | Left = 0 53 | Top = 478 54 | Width = 710 55 | Height = 34 56 | Align = alBottom 57 | BevelOuter = bvNone 58 | ParentColor = True 59 | TabOrder = 0 60 | object chkAutoOpen: TCheckBox 61 | AlignWithMargins = True 62 | Left = 3 63 | Top = 3 64 | Width = 156 65 | Height = 28 66 | Hint = 'Show this Log window when it displays error or warning messages.' 67 | Align = alLeft 68 | Caption = 'Show the log on error' 69 | Checked = True 70 | State = cbChecked 71 | TabOrder = 0 72 | end 73 | object btnClear: TButton 74 | AlignWithMargins = True 75 | Left = 647 76 | Top = 1 77 | Width = 68 78 | Height = 32 79 | Hint = 'Clear log' 80 | Margins.Top = 1 81 | Margins.Bottom = 1 82 | Align = alRight 83 | Caption = 'Clear' 84 | TabOrder = 1 85 | OnClick = btnClearClick 86 | end 87 | object trkLogVerb: TRichLogTrckbr 88 | AlignWithMargins = True 89 | Left = 381 90 | Top = 3 91 | Width = 260 92 | Height = 28 93 | Align = alRight 94 | BevelOuter = bvNone 95 | ShowCaption = False 96 | TabOrder = 2 97 | TrackBar.Left = 110 98 | TrackBar.Top = 0 99 | TrackBar.Width = 150 100 | TrackBar.Height = 28 101 | TrackBar.Hint = 'Hide all messages below this level' 102 | TrackBar.Align = alRight 103 | TrackBar.Max = 5 104 | TrackBar.Position = 2 105 | TrackBar.TabOrder = 0 106 | Verbosity = lvrInfos 107 | Log = Log 108 | end 109 | end 110 | end 111 | end 112 | -------------------------------------------------------------------------------- /FrameVCL/FormSkinsDisk.dfm: -------------------------------------------------------------------------------- 1 | object frmSkinDisk: TfrmSkinDisk 2 | Left = 1104 3 | Top = 300 4 | AlphaBlend = True 5 | AlphaBlendValue = 249 6 | Anchors = [] 7 | BorderIcons = [biSystemMenu] 8 | BorderStyle = bsDialog 9 | Caption = 'Skin selector' 10 | ClientHeight = 464 11 | ClientWidth = 304 12 | Color = clBtnFace 13 | Constraints.MinHeight = 300 14 | Constraints.MinWidth = 200 15 | DoubleBuffered = True 16 | ParentFont = True 17 | KeyPreview = True 18 | Position = poDesigned 19 | ScreenSnap = True 20 | ShowHint = True 21 | SnapBuffer = 5 22 | OnClose = FormClose 23 | OnCreate = FormCreate 24 | OnDestroy = FormDestroy 25 | OnKeyPress = FormKeyPress 26 | TextHeight = 15 27 | object lblTop: TLabel 28 | AlignWithMargins = True 29 | Left = 3 30 | Top = 6 31 | Width = 298 32 | Height = 13 33 | Margins.Top = 6 34 | Margins.Bottom = 1 35 | Align = alTop 36 | Caption = 'Click skin to load it' 37 | Font.Charset = ANSI_CHARSET 38 | Font.Color = clWindowText 39 | Font.Height = -11 40 | Font.Name = 'Tahoma' 41 | Font.Style = [] 42 | ParentFont = False 43 | ParentShowHint = False 44 | ShowHint = True 45 | Layout = tlBottom 46 | OnClick = lblTopClick 47 | end 48 | object lblMoreSkinsTrial: TLabel 49 | AlignWithMargins = True 50 | Left = 3 51 | Top = 398 52 | Width = 298 53 | Height = 30 54 | Align = alBottom 55 | Alignment = taCenter 56 | Caption = 'Hint: Registered users can download more skins from our web site' 57 | Layout = tlCenter 58 | WordWrap = True 59 | end 60 | object lBox: TListBox 61 | AlignWithMargins = True 62 | Left = 3 63 | Top = 23 64 | Width = 298 65 | Height = 365 66 | Align = alClient 67 | ItemHeight = 15 68 | ScrollWidth = 6 69 | TabOrder = 1 70 | OnClick = lBoxClick 71 | end 72 | object pnlBottom: TPanel 73 | Left = 0 74 | Top = 391 75 | Width = 304 76 | Height = 4 77 | Align = alBottom 78 | TabOrder = 0 79 | end 80 | object pnlBtm: TPanel 81 | Left = 0 82 | Top = 428 83 | Width = 304 84 | Height = 36 85 | Align = alBottom 86 | TabOrder = 2 87 | object btnOK: TButton 88 | AlignWithMargins = True 89 | Left = 210 90 | Top = 4 91 | Width = 90 92 | Height = 28 93 | Hint = 94 | 'Save settings & close the window.'#13#10'Hint: You can also close the ' + 95 | 'window with ' 96 | Align = alRight 97 | Caption = 'OK' 98 | ModalResult = 1 99 | TabOrder = 0 100 | OnClick = btnOKClick 101 | end 102 | object btnSkinEditor: TButton 103 | AlignWithMargins = True 104 | Left = 4 105 | Top = 4 106 | Width = 129 107 | Height = 28 108 | Hint = 109 | 'Do you feel creative?'#13#10'Use this skin editor to create your own s' + 110 | 'kins. '#13#10'Feel free to share them with us. We will upload them on ' + 111 | 'our website together with your name.'#13#10#13#10'Please see the Help menu' + 112 | ' in the skin editor for details.' 113 | Align = alLeft 114 | Caption = 'Create your own skins' 115 | TabOrder = 1 116 | OnClick = btnSkinEditorClick 117 | end 118 | end 119 | end 120 | -------------------------------------------------------------------------------- /FrameVCL/FormSkinsRes.dfm: -------------------------------------------------------------------------------- 1 | object frmSkinRes: TfrmSkinRes 2 | Left = 1104 3 | Top = 300 4 | AlphaBlend = True 5 | AlphaBlendValue = 249 6 | Anchors = [] 7 | BorderIcons = [biSystemMenu] 8 | BorderStyle = bsDialog 9 | Caption = 'Skin selector' 10 | ClientHeight = 468 11 | ClientWidth = 320 12 | Color = clBtnFace 13 | Constraints.MinHeight = 300 14 | Constraints.MinWidth = 200 15 | DoubleBuffered = True 16 | ParentFont = True 17 | KeyPreview = True 18 | Position = poDesigned 19 | ScreenSnap = True 20 | ShowHint = True 21 | SnapBuffer = 5 22 | OnClose = FormClose 23 | OnCreate = FormCreate 24 | OnDestroy = FormDestroy 25 | OnKeyPress = FormKeyPress 26 | TextHeight = 15 27 | object lblTop: TLabel 28 | AlignWithMargins = True 29 | Left = 3 30 | Top = 6 31 | Width = 314 32 | Height = 13 33 | Margins.Top = 6 34 | Margins.Bottom = 1 35 | Align = alTop 36 | Caption = 'Click skin to load it' 37 | Font.Charset = ANSI_CHARSET 38 | Font.Color = clWindowText 39 | Font.Height = -11 40 | Font.Name = 'Tahoma' 41 | Font.Style = [] 42 | ParentFont = False 43 | ParentShowHint = False 44 | ShowHint = True 45 | Layout = tlBottom 46 | OnClick = lblTopClick 47 | end 48 | object lblMoreSkinsTrial: TLabel 49 | AlignWithMargins = True 50 | Left = 3 51 | Top = 402 52 | Width = 314 53 | Height = 30 54 | Align = alBottom 55 | Alignment = taCenter 56 | Caption = 'Hint: Registered users can download more skins from our web site' 57 | Layout = tlCenter 58 | WordWrap = True 59 | end 60 | object lBox: TListBox 61 | AlignWithMargins = True 62 | Left = 3 63 | Top = 23 64 | Width = 314 65 | Height = 369 66 | Align = alClient 67 | ItemHeight = 15 68 | ScrollWidth = 6 69 | TabOrder = 1 70 | OnClick = lBoxClick 71 | end 72 | object pnlBottom: TPanel 73 | Left = 0 74 | Top = 395 75 | Width = 320 76 | Height = 4 77 | Align = alBottom 78 | TabOrder = 0 79 | end 80 | object pnlBtm: TPanel 81 | Left = 0 82 | Top = 432 83 | Width = 320 84 | Height = 36 85 | Align = alBottom 86 | TabOrder = 2 87 | object btnOK: TButton 88 | AlignWithMargins = True 89 | Left = 238 90 | Top = 4 91 | Width = 90 92 | Height = 28 93 | Hint = 94 | 'Save settings & close the window.'#13#10'Hint: You can also close the ' + 95 | 'window with ' 96 | Align = alRight 97 | Caption = 'OK' 98 | ModalResult = 1 99 | TabOrder = 0 100 | OnClick = btnOKClick 101 | end 102 | object btnSkinEditor: TButton 103 | AlignWithMargins = True 104 | Left = 4 105 | Top = 4 106 | Width = 129 107 | Height = 28 108 | Hint = 109 | 'Do you feel creative?'#13#10'Use this skin editor to create your own s' + 110 | 'kins. '#13#10'Feel free to share them with us. We will upload them on ' + 111 | 'our website together with your name.'#13#10#13#10'Please see the Help menu' + 112 | ' in the skin editor for details.' 113 | Align = alLeft 114 | Caption = 'Create your own skins' 115 | TabOrder = 1 116 | OnClick = btnSkinEditorClick 117 | end 118 | end 119 | end 120 | -------------------------------------------------------------------------------- /FrameVCL/FormSplashScreen.dfm: -------------------------------------------------------------------------------- 1 | object frmSplash: TfrmSplash 2 | Left = 562 3 | Top = 500 4 | AlphaBlend = True 5 | AlphaBlendValue = 11 6 | AutoSize = True 7 | BorderIcons = [] 8 | BorderStyle = bsNone 9 | Caption = 'Welcome...' 10 | ClientHeight = 186 11 | ClientWidth = 810 12 | Color = 3092271 13 | TransparentColor = True 14 | TransparentColorValue = 3092271 15 | DoubleBuffered = True 16 | Font.Charset = ANSI_CHARSET 17 | Font.Color = clWindowText 18 | Font.Height = -11 19 | Font.Name = 'Arial' 20 | Font.Style = [] 21 | FormStyle = fsStayOnTop 22 | Position = poScreenCenter 23 | ScreenSnap = True 24 | ShowHint = True 25 | SnapBuffer = 3 26 | Visible = True 27 | StyleElements = [seFont, seBorder] 28 | OnClose = FormClose 29 | OnDestroy = FormDestroy 30 | TextHeight = 14 31 | object imgSplash: TImage 32 | Left = 0 33 | Top = 0 34 | Width = 810 35 | Height = 186 36 | AutoSize = True 37 | Center = True 38 | ParentShowHint = False 39 | Proportional = True 40 | ShowHint = True 41 | OnClick = imgSplashClick 42 | end 43 | object Timer: TTimer 44 | Enabled = False 45 | Interval = 50 46 | OnTimer = TimerTimer 47 | Left = 320 48 | Top = 38 49 | end 50 | end 51 | -------------------------------------------------------------------------------- /FrameVCL/FormTranslSelector.dfm: -------------------------------------------------------------------------------- 1 | object frmTranslSelector: TfrmTranslSelector 2 | AlignWithMargins = True 3 | Left = 549 4 | Top = 225 5 | AlphaBlend = True 6 | AlphaBlendValue = 250 7 | BorderIcons = [biSystemMenu, biMinimize] 8 | Caption = 'Language/Sprache/Langue/Limba/Idioma/'#35821#35328'/'#1071#1079#1099#1082 9 | ClientHeight = 336 10 | ClientWidth = 351 11 | Color = clBtnFace 12 | Font.Charset = DEFAULT_CHARSET 13 | Font.Color = clWindowText 14 | Font.Height = -11 15 | Font.Name = 'Tahoma' 16 | Font.Style = [] 17 | KeyPreview = True 18 | Position = poDesigned 19 | ScreenSnap = True 20 | ShowHint = True 21 | SnapBuffer = 3 22 | OnActivate = FormActivate 23 | OnClose = FormClose 24 | TextHeight = 13 25 | object grpChoose: TGroupBox 26 | AlignWithMargins = True 27 | Left = 3 28 | Top = 3 29 | Width = 345 30 | Height = 330 31 | Align = alClient 32 | Caption = 'Choose language' 33 | TabOrder = 0 34 | object lblAuthors: TLabel 35 | AlignWithMargins = True 36 | Left = 5 37 | Top = 273 38 | Width = 335 39 | Height = 13 40 | Align = alBottom 41 | Caption = '@Authors' 42 | Visible = False 43 | end 44 | object ListBox: TListBox 45 | AlignWithMargins = True 46 | Left = 5 47 | Top = 23 48 | Width = 335 49 | Height = 244 50 | Hint = 'Click to load it' 51 | Margins.Top = 8 52 | Align = alClient 53 | ItemHeight = 13 54 | ScrollWidth = 6 55 | TabOrder = 0 56 | OnClick = ListBoxDblClick 57 | OnDblClick = ListBoxDblClick 58 | end 59 | object Panel2: TPanel 60 | AlignWithMargins = True 61 | Left = 5 62 | Top = 289 63 | Width = 335 64 | Height = 36 65 | Align = alBottom 66 | BevelOuter = bvNone 67 | TabOrder = 1 68 | object btnApplyLang: TButton 69 | AlignWithMargins = True 70 | Left = 246 71 | Top = 3 72 | Width = 86 73 | Height = 30 74 | Align = alRight 75 | Caption = 'OK' 76 | TabOrder = 0 77 | OnClick = btnApplyLangClick 78 | end 79 | object btnRefresh: TButton 80 | AlignWithMargins = True 81 | Left = 159 82 | Top = 4 83 | Width = 81 84 | Height = 28 85 | Hint = 'Reload the list of available languages' 86 | Margins.Top = 4 87 | Margins.Bottom = 4 88 | Align = alRight 89 | Caption = 'Refresh' 90 | TabOrder = 1 91 | OnClick = btnRefreshClick 92 | end 93 | object btnTranslate: TButton 94 | AlignWithMargins = True 95 | Left = 3 96 | Top = 4 97 | Width = 117 98 | Height = 28 99 | Hint = 100 | 'Create your own translation or edit an existing translation file' + 101 | '.' 102 | Margins.Top = 4 103 | Margins.Bottom = 4 104 | Align = alLeft 105 | Caption = 'New translation...' 106 | TabOrder = 2 107 | OnClick = btnTranslateClick 108 | end 109 | end 110 | end 111 | end 112 | -------------------------------------------------------------------------------- /FrameVCL/FormUniversalEula.pas: -------------------------------------------------------------------------------- 1 | UNIT FormUniversalEula; 2 | {------------------------------------------------------------------------------------------------------------- 3 | 2022.03 4 | DON'T ADD IT TO ANY DPK! 5 | -------------------------------------------------------------------------------------------------------------} 6 | 7 | INTERFACE 8 | {$DENYPACKAGEUNIT ON} {Prevents unit from being placed in a package. https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Packages_(Delphi)#Naming_packages } 9 | 10 | USES 11 | Winapi.Windows, System.SysUtils, System.Classes, Vcl.Controls, Vcl.Forms, LightCom.AppDataForm,Vcl.StdCtrls; 12 | 13 | TYPE 14 | TfrmEULA = class(TLightForm) 15 | btnOK: TButton; 16 | mmoLicense: TMemo; 17 | procedure btnOKClick(Sender: TObject); 18 | procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); 19 | procedure FormClose(Sender: TObject; var Action: TCloseAction); 20 | public 21 | end; 22 | 23 | procedure ShowEulaModal; 24 | 25 | implementation {$R *.dfm} 26 | Uses 27 | ccTextFile, ccAppData, LightCom.AppData 28 | ; 29 | 30 | 31 | 32 | procedure ShowEulaModal; 33 | begin 34 | var frmEULA:= TfrmEULA.Create(Nil); 35 | 36 | Assert(frmEULA.FormStyle= fsStayOnTop, 'EULA form is not fsStayOnTop!'); 37 | Assert(frmEULA.Visible = False); // The form visibility must be False in the editor, otherwise ShowModal won't work! 38 | 39 | if FileExists(AppData.SysDir+ 'Eula.txt') 40 | then frmEULA.mmoLicense.Text:= StringFromFile(AppData.SysDir+ 'Eula.Text'); 41 | 42 | frmEULA.ShowModal; 43 | end; 44 | 45 | 46 | procedure TfrmEULA.btnOKClick(Sender: TObject); 47 | begin 48 | Close; 49 | end; 50 | 51 | 52 | procedure TfrmEULA.FormClose(Sender: TObject; var Action: TCloseAction); 53 | begin 54 | Action:= TCloseAction.caFree; 55 | end; 56 | 57 | 58 | procedure TfrmEULA.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); 59 | begin 60 | if (Key = 27) OR (Key = Winapi.Windows.VK_RETURN) then Close; 61 | end; 62 | 63 | 64 | end. 65 | -------------------------------------------------------------------------------- /FrameVCL/FrameExplorer.dfm: -------------------------------------------------------------------------------- 1 | object FrameWinExplorer: TFrameWinExplorer 2 | Left = 0 3 | Top = 0 4 | Width = 273 5 | Height = 585 6 | ParentShowHint = False 7 | ShowHint = True 8 | TabOrder = 0 9 | object lblTop: TLabel 10 | AlignWithMargins = True 11 | Left = 3 12 | Top = 3 13 | Width = 267 14 | Height = 13 15 | Hint = 'Refresh the filelist' 16 | Align = alTop 17 | Alignment = taCenter 18 | Caption = 'FILE EXPLORER' 19 | Transparent = True 20 | Layout = tlCenter 21 | WordWrap = True 22 | ExplicitWidth = 75 23 | end 24 | object Splitter: TSplitter 25 | Left = 0 26 | Top = 230 27 | Width = 273 28 | Height = 3 29 | Cursor = crVSplit 30 | Align = alTop 31 | AutoSnap = False 32 | Constraints.MaxHeight = 3 33 | Constraints.MinHeight = 3 34 | ResizeStyle = rsUpdate 35 | ExplicitTop = 232 36 | end 37 | object Directory: TDirectoryListBox 38 | AlignWithMargins = True 39 | Left = 3 40 | Top = 71 41 | Width = 267 42 | Height = 156 43 | Align = alTop 44 | FileList = FileList 45 | TabOrder = 0 46 | OnChange = DirectoryChange 47 | ExplicitTop = 73 48 | end 49 | object FileList: TCubicFileList 50 | AlignWithMargins = True 51 | Left = 3 52 | Top = 269 53 | Width = 267 54 | Height = 313 55 | Hint = 'Press the "Delete" key to delete the selected file from disk.' 56 | Align = alClient 57 | ItemHeight = 13 58 | TabOrder = 1 59 | ExplicitTop = 271 60 | ExplicitHeight = 311 61 | end 62 | object Panel2: TPanel 63 | AlignWithMargins = True 64 | Left = 3 65 | Top = 236 66 | Width = 267 67 | Height = 27 68 | Align = alTop 69 | AutoSize = True 70 | BevelOuter = bvNone 71 | ParentShowHint = False 72 | ShowHint = True 73 | TabOrder = 2 74 | ExplicitTop = 238 75 | object Filter: TCubicFilterBox 76 | AlignWithMargins = True 77 | Left = 3 78 | Top = 3 79 | Width = 227 80 | Height = 21 81 | Align = alClient 82 | FileList = FileList 83 | TabOrder = 0 84 | end 85 | object btnRefresh: TButton 86 | Left = 233 87 | Top = 0 88 | Width = 34 89 | Height = 27 90 | Align = alRight 91 | Caption = 'Ref' 92 | Default = True 93 | ParentShowHint = False 94 | ShowHint = True 95 | TabOrder = 1 96 | OnClick = btnRefreshClick 97 | end 98 | end 99 | object Path: TCubicPathEdit 100 | AlignWithMargins = True 101 | Left = 3 102 | Top = 22 103 | Width = 267 104 | Height = 43 105 | FileListBox = FileList 106 | Directory = Directory 107 | ShowCreateBtn = False 108 | Align = alTop 109 | Caption = 'Folder' 110 | Color = clBtnFace 111 | ParentBackground = False 112 | ParentColor = False 113 | TabOrder = 3 114 | TabStop = True 115 | ExplicitTop = 24 116 | end 117 | end 118 | -------------------------------------------------------------------------------- /FrameVCL/FrameExplorer.pas: -------------------------------------------------------------------------------- 1 | UNIT FrameExplorer; 2 | 3 | {Note: if this file is renamed/move, the IDE will complaing that it cannot find the file. 4 | So, I have to remove the component from the palete, and re-add by opening the file, at its new location. } 5 | 6 | INTERFACE 7 | 8 | USES 9 | System.Classes, Vcl.Controls, Vcl.Forms, LightCom.AppDataForm,Vcl.StdCtrls, cvPathEdit, Vcl.FileCtrl, cvFileFilter, 10 | cvFileListBox, Vcl.ExtCtrls; 11 | 12 | TYPE 13 | TFrameWinExplorer = class(TFrame) 14 | btnRefresh : TButton; 15 | Directory : TDirectoryListBox; 16 | FileList : TCubicFileList; 17 | Filter : TCubicFilterBox; 18 | lblTop : TLabel; 19 | Panel2 : TPanel; 20 | Path : TCubicPathEdit; 21 | Splitter : TSplitter; 22 | procedure DirectoryChange(Sender: TObject); 23 | procedure btnRefreshClick(Sender: TObject); 24 | private 25 | public 26 | end; 27 | 28 | 29 | 30 | procedure Register; 31 | 32 | 33 | IMPLEMENTATION {$R *.dfm} 34 | 35 | 36 | { Example of filter: Filter.Filter:= ccIO.FilterAllFiles + '|' + cGraphUtil.AllImgFlt; } 37 | 38 | 39 | procedure TFrameWinExplorer.DirectoryChange(Sender: TObject); 40 | begin 41 | Path.Path:= Directory.Directory; 42 | end; 43 | 44 | procedure TFrameWinExplorer.btnRefreshClick(Sender: TObject); 45 | begin 46 | FileList.Update; 47 | end; 48 | 49 | 50 | 51 | 52 | 53 | 54 | procedure Register; 55 | begin 56 | RegisterComponents('LightSaber', [TFrameWinExplorer]); 57 | end; 58 | 59 | 60 | end. 61 | -------------------------------------------------------------------------------- /FrameVCL/LightAppDataVCL.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/FrameVCL/LightAppDataVCL.res -------------------------------------------------------------------------------- /FrameVCL/LightCom.CursorGuard.pas: -------------------------------------------------------------------------------- 1 | UNIT LightCom.CursorGuard; 2 | 3 | {============================================================================================================= 4 | Gabriel Moraru 5 | 2024.05 6 | www.GabrielMoraru.com 7 | See Copyright file 8 | -------------------------------------------------------------------------------------------------------------- 9 | Allows you to sets the cursor to crHourglass and then back to crDefault without the need of the classic try-finally block. 10 | When the procedure where you use TCursorGuard exits, the cursor is put back automatically. 11 | 12 | Example: 13 | begin 14 | TCursorGuard.CursorBusy; 15 | SlowCode; 16 | end; // The interface is automatically released here, at the end of the procedure 17 | 18 | =============================================================================================================} 19 | 20 | INTERFACE 21 | 22 | USES 23 | Vcl.Controls, Vcl.Forms; 24 | 25 | TYPE 26 | TCursorGuard = class(TInterfacedObject, IUnknown) 27 | private 28 | FOldCursor: TCursor; 29 | constructor Create; 30 | public 31 | destructor Destroy; override; 32 | class function CursorBusy: IUnknown; 33 | end; 34 | 35 | 36 | IMPLEMENTATION 37 | 38 | 39 | constructor TCursorGuard.Create; 40 | begin 41 | inherited Create; 42 | FOldCursor := Screen.Cursor; 43 | Screen.Cursor := crHourglass; 44 | end; 45 | 46 | 47 | destructor TCursorGuard.Destroy; 48 | begin 49 | Screen.Cursor := FOldCursor; 50 | inherited; 51 | end; 52 | 53 | 54 | class function TCursorGuard.CursorBusy: IUnknown; 55 | begin 56 | Result := TCursorGuard.Create; 57 | end; 58 | 59 | 60 | end. 61 | -------------------------------------------------------------------------------- /FrameVCL/LightCom.ExeVersion.pas: -------------------------------------------------------------------------------- 1 | UNIT LightCom.ExeVersion; 2 | 3 | {============================================================================================================= 4 | 2025.03 5 | www.GabrielMoraru.com 6 | -------------------------------------------------------------------------------------------------------------- 7 | Features: 8 | Returns info (version no) about an exe file. 9 | ============================================================================================================== 10 | 11 | Tester: 12 | c:\Projects\LightSaber\Demo\Demo Detect WinVer\ 13 | 14 | Also see: 15 | LightCom.WinVersion 16 | LightCom.ExeVersion 17 | LightCom.WinVersionApi 18 | =============================================================================================================} 19 | 20 | INTERFACE 21 | 22 | USES 23 | WinApi.Windows, System.SysUtils; 24 | 25 | 26 | function GetVersionInfoFile(CONST FileName: string; VAR FixedInfo: TVSFixedFileInfo): Boolean; 27 | function GetVersionInfo (CONST FileName: string; ShowBuildNo: Boolean= False): string; 28 | 29 | 30 | IMPLEMENTATION 31 | USES LightCom.WinVersionApi; 32 | 33 | CONST 34 | TAB = #9; 35 | CRLF = #13#10; 36 | Win10FirstRel = 10240; //July 29, 2015 37 | Win11FirstRel = 22000; //October 4, 2021 38 | 39 | 40 | 41 | { Returns information (including version no) about an EXE file. 42 | Source: JCL } 43 | function GetVersionInfoFile(CONST FileName: string; VAR FixedInfo: TVSFixedFileInfo): Boolean; 44 | VAR 45 | Buffer: string; 46 | DummyHandle: DWORD; { The DummyHandle parameter is ignored by GetFileVersionInfo } 47 | InfoSize, FixInfoLen: DWORD; 48 | FixInfoBuf: PVSFixedFileInfo; 49 | begin 50 | Result := False; 51 | InfoSize := GetFileVersionInfoSize(PChar(FileName), DummyHandle); 52 | if InfoSize > 0 then 53 | begin 54 | FixInfoLen := 0; 55 | FixInfoBuf := Nil; 56 | 57 | SetLength(Buffer, InfoSize); 58 | if GetFileVersionInfo(PChar(FileName), DummyHandle, InfoSize, Pointer(Buffer)) 59 | AND VerQueryValue(Pointer(Buffer), '\', Pointer(FixInfoBuf), FixInfoLen) 60 | AND (FixInfoLen = SizeOf(TVSFixedFileInfo)) then 61 | begin 62 | Result := True; 63 | FixedInfo := FixInfoBuf^; 64 | end; 65 | end; 66 | end; 67 | 68 | 69 | function GetVersionInfo(CONST FileName: string; ShowBuildNo: Boolean= False): string; 70 | VAR FixedInfo: TVSFixedFileInfo; 71 | begin 72 | FixedInfo.dwSignature:= 0; 73 | if LightCom.ExeVersion.GetVersionInfoFile(FileName, FixedInfo) 74 | then 75 | begin 76 | Result:= IntToStr(HiWord(FixedInfo.dwFileVersionMS))+'.'+ IntToStr(LoWord(FixedInfo.dwFileVersionMS))+'.'+ IntToStr(HiWord(FixedInfo.dwFileVersionLS)); 77 | if ShowBuildNo 78 | then Result:= Result+ '.'+ IntToStr(LoWord(FixedInfo.dwFileVersionLS)); 79 | end 80 | else Result:= 'N/A'; 81 | end; 82 | 83 | 84 | 85 | end. 86 | -------------------------------------------------------------------------------- /FrameVCL/LightCom.GuiSettings.pas: -------------------------------------------------------------------------------- 1 | UNIT LightCom.GuiSettings; 2 | 3 | {============================================================================================================= 4 | 2025.05 5 | www.GabrielMoraru.com 6 | -------------------------------------------------------------------------------------------------------------- 7 | Saves settings for TfrmSettings in FormSettings.pas 8 | -------------------------------------------------------------------------------------------------------------- 9 | This is a template file. 10 | Do not link to it! Instead copy it in your project! 11 | -------------------------------------------------------------------------------------------------------------} 12 | 13 | INTERFACE 14 | 15 | USES 16 | System.SysUtils, ccStreamBuff2; 17 | 18 | TYPE 19 | 20 | TGuiSettings = class(TObject) 21 | private 22 | CONST Signature: AnsiString= 'TGuiSettings'; 23 | public 24 | bUser: Boolean; 25 | iUser: Integer; 26 | 27 | procedure Load; 28 | procedure Save; 29 | end; 30 | 31 | 32 | IMPLEMENTATION 33 | 34 | USES 35 | ccAppData, LightCom.AppData; 36 | 37 | 38 | procedure TGuiSettings.Save; 39 | begin 40 | VAR SettingsFile:= AppData.AppDataFolder(TRUE)+ 'GUISettings.bin'; 41 | 42 | VAR Stream:= TCubicBuffStream2.CreateWrite(SettingsFile); { This will give an AV if the file cannot be saved (folder readonly) } 43 | TRY 44 | Stream.WriteHeader(Signature, 1); 45 | Stream.WriteBoolean(bUser); 46 | Stream.WriteInteger(iUser); 47 | 48 | Stream.WritePaddingDef; 49 | FINALLY 50 | FreeAndNil(Stream); 51 | END; 52 | end; 53 | 54 | 55 | procedure TGuiSettings.Load; 56 | begin 57 | VAR SettingsFile:= AppData.AppDataFolder(TRUE)+ 'GUISettings.bin'; 58 | if NOT FileExists(SettingsFile) then EXIT; 59 | 60 | VAR Stream:= TCubicBuffStream2.CreateRead(SettingsFile); 61 | TRY 62 | Stream.ReadHeader(Signature, 1); 63 | 64 | bUser := Stream.ReadBoolean; 65 | iUser := Stream.ReadInteger; 66 | 67 | Stream.ReadPaddingDef; 68 | FINALLY 69 | FreeAndNil(Stream); 70 | END; 71 | end; 72 | 73 | 74 | 75 | end. 76 | -------------------------------------------------------------------------------- /FrameVCL/LightCom.PopUp.pas: -------------------------------------------------------------------------------- 1 | UNIT LightCom.PopUp; 2 | 3 | {============================================================================================================= 4 | 2023.01 5 | www.GabrielMoraru.com 6 | See Copyright file 7 | ============================================================================================================== 8 | 9 | Display the popup menu at coordinates above the cursor instead of the classical way (under the cursor). 10 | 11 | Example of usage: 12 | procedure TForm16.Button1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); 13 | VAR P: TPoint; 14 | begin 15 | GetCursorPos(P); 16 | PopupMenu.Popup(P.X, P.Y); 17 | end; 18 | 19 | See also: 20 | LightCom.KeybShortcuts.pas 21 | LightCom.VclUtils.pas (the Menu section) 22 | 23 | =============================================================================================================} 24 | 25 | INTERFACE 26 | 27 | USES 28 | Winapi.Windows, Winapi.Messages, System.Classes, Vcl.Menus; 29 | 30 | TYPE 31 | TPopupUpMenu = class(Vcl.Menus.TPopupMenu) 32 | public 33 | procedure Popup(X, Y: Integer); override; 34 | end; 35 | 36 | 37 | IMPLEMENTATION 38 | 39 | 40 | procedure TPopupUpMenu.Popup(X, Y: Integer); 41 | CONST 42 | Flags : array[Boolean, TPopupAlignment] of Word = ((TPM_LEFTALIGN, TPM_RIGHTALIGN, TPM_CENTERALIGN), (TPM_RIGHTALIGN, TPM_LEFTALIGN, TPM_CENTERALIGN)); 43 | Buttons: array[TTrackButton] of Word = (TPM_RIGHTBUTTON, TPM_LEFTBUTTON); 44 | VAR 45 | AFlags: Integer; 46 | begin 47 | PostMessage(PopupList.Window, WM_CANCELMODE, 0, 0); 48 | inherited; 49 | AFlags := Flags[UseRightToLeftAlignment, Alignment] 50 | OR Buttons[TrackButton] 51 | OR TPM_BOTTOMALIGN 52 | OR (Byte(MenuAnimation) shl 10); 53 | 54 | TrackPopupMenu(Items.Handle, AFlags, X, Y, 0 { reserved }, PopupList.Window, nil); 55 | end; 56 | 57 | 58 | end. 59 | -------------------------------------------------------------------------------- /FrameVCL/LightCom.SystemSecurity.pas: -------------------------------------------------------------------------------- 1 | UNIT LightCom.SystemSecurity; 2 | 3 | {============================================================================================================= 4 | 2025.05 5 | www.GabrielMoraru.com 6 | =============================================================================================================} 7 | 8 | INTERFACE 9 | USES 10 | Winapi.Windows, Winapi.Messages, Winapi.WinSock, Winapi.WinSvc, 11 | System.Classes, System.SysUtils, System.Win.Registry, System.UITypes, System.IOUtils, 12 | Vcl.Controls, Vcl.Forms, 13 | ccAppData, LightCom.AppData; 14 | 15 | procedure Hack_DisableSystemKeys(Disable: Boolean); 16 | function CalculatePasswordStrength(const Password: string): Integer; 17 | 18 | 19 | IMPLEMENTATION 20 | 21 | USES 22 | LightCom.Keyboard, ccIO, LightCom.IO, LightCom.WinVersion, LightCom.WinVersionAPI, LightCom.ExeVersion, ccRegistry; 23 | 24 | 25 | { Disable task switching 26 | Using the SystemParametersInfo API function you can trick Windows into thinking that the screen saver is running. Doing so disables the Ctrl-Alt-Delete key sequence from displaying the "Close Program" dialog and rebooting the computer and Alt-Tab from switching to another application. It also stops Ctrl-Esc from opening the Start Menu. 27 | If you wish to disable those keys while your application is running call the following SystemKeys function (place it in the Implementation section of your unit's code - and call from any procedure in your application - where needed). When you call SystemKeys, if Disable is True, the keys will be disabled, False otherwise. 28 | After a call to SystemKeys(True) the program runs, but you are unable to Alt-Tab to it nor switch to it in the task list. You can't invoke the Start button, either. } 29 | procedure Hack_DisableSystemKeys(Disable: Boolean); 30 | VAR OldVal : LongInt; 31 | begin 32 | SystemParametersInfo (SPI_SCREENSAVERRUNNING, Word(Disable), @OldVal, 0); 33 | end; 34 | 35 | 36 | function CalculatePasswordStrength(const Password: string): Integer; 37 | begin 38 | Result := 0; 39 | 40 | // Length criteria 41 | if Length(Password) >= 8 then Inc(Result); 42 | 43 | // Uppercase letter criteria 44 | if Password.ToUpper <> Password then Inc(Result); 45 | 46 | // Lowercase letter criteria 47 | if Password.ToLower <> Password then Inc(Result); 48 | 49 | // Digit criteria 50 | if Password.IndexOfAny(['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']) >= 0 then Inc(Result); 51 | 52 | // Special character criteria 53 | if Password.IndexOfAny(['!', '@', '#', '$', '%', '^', '&', '*', '(', ')']) >= 0 then Inc(Result); 54 | end; 55 | 56 | 57 | end. 58 | -------------------------------------------------------------------------------- /FrameVCL/LightVCL.LogForm.dfm: -------------------------------------------------------------------------------- 1 | object frmRamLog: TfrmRamLog 2 | Left = 549 3 | Top = 450 4 | AlphaBlend = True 5 | BorderIcons = [biSystemMenu, biMaximize] 6 | Caption = 'Log' 7 | ClientHeight = 507 8 | ClientWidth = 643 9 | Color = clBtnFace 10 | DoubleBuffered = True 11 | Font.Charset = DEFAULT_CHARSET 12 | Font.Color = clWindowText 13 | Font.Height = -13 14 | Font.Name = 'Segoe UI' 15 | Font.Style = [] 16 | Position = poDesigned 17 | ScreenSnap = True 18 | ShowHint = True 19 | SnapBuffer = 3 20 | OnClose = FormClose 21 | OnDestroy = FormDestroy 22 | TextHeight = 17 23 | object Container: TPanel 24 | Left = 0 25 | Top = 0 26 | Width = 643 27 | Height = 507 28 | Align = alClient 29 | BevelOuter = bvNone 30 | ParentColor = True 31 | TabOrder = 0 32 | object pnlBottom: TPanel 33 | Left = 0 34 | Top = 476 35 | Width = 643 36 | Height = 31 37 | Align = alBottom 38 | BevelOuter = bvNone 39 | ParentColor = True 40 | TabOrder = 0 41 | object chkLogOnError: TCheckBox 42 | AlignWithMargins = True 43 | Left = 204 44 | Top = 3 45 | Width = 138 46 | Height = 25 47 | Hint = 'Show this Log window when it displays error or warning messages.' 48 | Align = alLeft 49 | Caption = 'Show log on error' 50 | Checked = True 51 | State = cbChecked 52 | TabOrder = 0 53 | OnClick = chkLogOnErrorClick 54 | end 55 | object btnClear: TButton 56 | AlignWithMargins = True 57 | Left = 572 58 | Top = 1 59 | Width = 68 60 | Height = 29 61 | Hint = 'Clear log' 62 | Margins.Top = 1 63 | Margins.Bottom = 1 64 | Align = alRight 65 | Caption = 'Clear' 66 | TabOrder = 1 67 | OnClick = btnClearClick 68 | end 69 | object chkShowTime: TCheckBox 70 | AlignWithMargins = True 71 | Left = 103 72 | Top = 3 73 | Width = 95 74 | Height = 25 75 | Align = alLeft 76 | Caption = 'Show time' 77 | TabOrder = 3 78 | OnClick = chkShowTimeClick 79 | end 80 | object chkShowDate: TCheckBox 81 | AlignWithMargins = True 82 | Left = 3 83 | Top = 3 84 | Width = 94 85 | Height = 25 86 | Align = alLeft 87 | Caption = 'Show date' 88 | TabOrder = 2 89 | OnClick = chkShowDateClick 90 | end 91 | end 92 | end 93 | object PopupMenu: TPopupMenu 94 | Left = 460 95 | Top = 196 96 | object mnuCopy: TMenuItem 97 | Caption = 'Copy line' 98 | OnClick = mnuCopyClick 99 | end 100 | object mnuCopyFiltered: TMenuItem 101 | Caption = 'Copy all (filtered)' 102 | Enabled = False 103 | end 104 | object mnuCopyAll: TMenuItem 105 | Caption = 'Copy all (unfiltered)' 106 | Hint = 'Returns all lines, even if a filter is applied.' 107 | OnClick = mnuCopyAllClick 108 | end 109 | end 110 | end 111 | -------------------------------------------------------------------------------- /FrameVCL/LightVclCommon.dpk: -------------------------------------------------------------------------------- 1 | package LightVclCommon; 2 | 3 | {$R *.res} 4 | {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users} 5 | {$ALIGN 2} 6 | {$ASSERTIONS ON} 7 | {$BOOLEVAL OFF} 8 | {$DEBUGINFO OFF} 9 | {$EXTENDEDSYNTAX ON} 10 | {$IMPORTEDDATA ON} 11 | {$IOCHECKS ON} 12 | {$LOCALSYMBOLS ON} 13 | {$LONGSTRINGS ON} 14 | {$OPENSTRINGS ON} 15 | {$OPTIMIZATION OFF} 16 | {$OVERFLOWCHECKS ON} 17 | {$RANGECHECKS ON} 18 | {$REFERENCEINFO ON} 19 | {$SAFEDIVIDE OFF} 20 | {$STACKFRAMES ON} 21 | {$TYPEDADDRESS OFF} 22 | {$VARSTRINGCHECKS ON} 23 | {$WRITEABLECONST OFF} 24 | {$MINENUMSIZE 1} 25 | {$IMAGEBASE $400000} 26 | {$DEFINE DEBUG} 27 | {$ENDIF IMPLICITBUILDING} 28 | {$DESCRIPTION 'LightSaber - VCL library'} 29 | {$LIBSUFFIX AUTO} 30 | {$IMPLICITBUILD ON} 31 | 32 | requires 33 | rtl, 34 | vclimg, 35 | vcl, 36 | vclx, 37 | LightCore, 38 | vclWinx, 39 | VclSmp; 40 | 41 | contains 42 | LightCom.Debugger in 'LightCom.Debugger.pas', 43 | LightCom.EllipsisText in 'LightCom.EllipsisText.pas', 44 | LightCom.EnvironmentVar in 'LightCom.EnvironmentVar.pas', 45 | LightCom.ExecuteProc in 'LightCom.ExecuteProc.pas', 46 | LightCom.ExecuteShell in 'LightCom.ExecuteShell.pas', 47 | LightCom.GuiSettings in 'LightCom.GuiSettings.pas', 48 | LightCom.IO in 'LightCom.IO.pas', 49 | LightCom.Keyboard in 'LightCom.Keyboard.pas', 50 | LightCom.KeybShortcuts in 'LightCom.KeybShortcuts.pas', 51 | LightCom.MemoInputBox in 'LightCom.MemoInputBox.pas', 52 | LightCom.MutexSingleInstance in 'LightCom.MutexSingleInstance.pas', 53 | LightCom.PopUp in 'LightCom.PopUp.pas', 54 | LightCom.PowerUtils in 'LightCom.PowerUtils.pas', 55 | LightCom.Process in 'LightCom.Process.pas', 56 | LightCom.Shell in 'LightCom.Shell.pas', 57 | LightCom.Sound in 'LightCom.Sound.pas', 58 | LightCom.System in 'LightCom.System.pas', 59 | LightCom.SystemPermissions in 'LightCom.SystemPermissions.pas', 60 | LightCom.SystemSecurity in 'LightCom.SystemSecurity.pas', 61 | LightCom.SystemTime in 'LightCom.SystemTime.pas', 62 | LightCom.Window in 'LightCom.Window.pas', 63 | LightCom.WindowMetrics in 'LightCom.WindowMetrics.pas', 64 | LightCom.WinVersionApi in 'LightCom.WinVersionApi.pas', 65 | LightCom.WMIResolution in 'LightCom.WMIResolution.pas', 66 | LightCom.AppData in 'LightCom.AppData.pas', 67 | LightCom.AppDataForm in 'LightCom.AppDataForm.pas', 68 | LightCom.CenterControl in 'LightCom.CenterControl.pas', 69 | LightCom.Clipboard in 'LightCom.Clipboard.pas', 70 | LightCom.Colors in 'LightCom.Colors.pas', 71 | LightCom.Dialogs in 'LightCom.Dialogs.pas', 72 | LightCom.INIFile in 'LightCom.INIFile.pas', 73 | LightCom.INIFileQuick in 'LightCom.INIFileQuick.pas', 74 | LightCom.LogFilter in 'LightCom.LogFilter.pas', 75 | LightCom.LogViewer in 'LightCom.LogViewer.pas', 76 | LightCom.Translate in 'LightCom.Translate.pas', 77 | LightCom.VclUtils in 'LightCom.VclUtils.pas', 78 | LightCom.WinVersion in 'LightCom.WinVersion.pas', 79 | LightVCL.LogForm in 'LightVCL.LogForm.pas', 80 | FormAsyncMessage in 'FormAsyncMessage.pas', 81 | LightCom.CursorGuard in 'LightCom.CursorGuard.pas', 82 | LightCom.ExeVersion in 'LightCom.ExeVersion.pas'; 83 | 84 | end. 85 | 86 | -------------------------------------------------------------------------------- /FrameVCL/LightVclGraphics.dpk: -------------------------------------------------------------------------------- 1 | package LightVclGraphics; 2 | 3 | {$R *.res} 4 | {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users} 5 | {$ALIGN 2} 6 | {$ASSERTIONS ON} 7 | {$BOOLEVAL OFF} 8 | {$DEBUGINFO OFF} 9 | {$EXTENDEDSYNTAX ON} 10 | {$IMPORTEDDATA ON} 11 | {$IOCHECKS ON} 12 | {$LOCALSYMBOLS ON} 13 | {$LONGSTRINGS ON} 14 | {$OPENSTRINGS ON} 15 | {$OPTIMIZATION OFF} 16 | {$OVERFLOWCHECKS ON} 17 | {$RANGECHECKS ON} 18 | {$REFERENCEINFO ON} 19 | {$SAFEDIVIDE OFF} 20 | {$STACKFRAMES ON} 21 | {$TYPEDADDRESS OFF} 22 | {$VARSTRINGCHECKS ON} 23 | {$WRITEABLECONST OFF} 24 | {$MINENUMSIZE 1} 25 | {$IMAGEBASE $400000} 26 | {$DEFINE DEBUG} 27 | {$DEFINE CCRExif} 28 | {$DEFINE Jpg2000} 29 | {$DEFINE FastJpg} 30 | {$ENDIF IMPLICITBUILDING} 31 | {$DESCRIPTION 'LightSaber - Graphics lib'} 32 | {$LIBSUFFIX AUTO} 33 | {$RUNONLY} 34 | {$IMPLICITBUILD ON} 35 | 36 | requires 37 | rtl, 38 | vcl, 39 | LightCore, 40 | LightVclCommon, 41 | vclimg, 42 | vclwinx, 43 | vclie, 44 | GR32_R, 45 | CCRExif, 46 | ThirdPartyLibs; 47 | 48 | contains 49 | cGraphFX.RotateGr32 in 'cGraphFX.RotateGr32.pas', 50 | cGraphResizeParams in 'cGraphResizeParams.pas', 51 | cGraphAviFrame in 'cGraphAviFrame.pas', 52 | cGraphBitmap in 'cGraphBitmap.pas', 53 | cGraphBkgColor in 'cGraphBkgColor.pas', 54 | cGraphBkgColorEditor in 'cGraphBkgColorEditor.pas', 55 | cGraphCache in 'cGraphCache.pas', 56 | cGraphFX in 'cGraphFX.pas', 57 | cGraphFX.Gradient in 'cGraphFX.Gradient.pas', 58 | cGraphFX.Rotate in 'cGraphFX.Rotate.pas', 59 | cGraphGif in 'cGraphGif.pas', 60 | cGraphLoader in 'cGraphLoader.pas', 61 | cGraphLoader.Resolution in 'cGraphLoader.Resolution.pas', 62 | cGraphLoader.Thread in 'cGraphLoader.Thread.pas', 63 | cGraphLoader.WB1 in 'cGraphLoader.WB1.pas', 64 | cGraphLoader.WBC in 'cGraphLoader.WBC.pas', 65 | cGraphText in 'cGraphText.pas', 66 | cGraphUtil in 'cGraphUtil.pas', 67 | cGraphResizeParamFrame in 'cGraphResizeParamFrame.pas' {ResizeParameters: TFrame}, 68 | cGraphLoader.RainDrop in 'cGraphLoader.RainDrop.pas', 69 | cGraphBkgColorParams in 'cGraphBkgColorParams.pas', 70 | cGraphConvert in 'cGraphConvert.pas', 71 | cGraphAlpha in 'cGraphAlpha.pas', 72 | cGraphDesktop in 'cGraphDesktop.pas', 73 | cGraphResizeGr32 in 'cGraphResizeGr32.pas', 74 | cGraphResizeVCL in 'cGraphResizeVCL.pas', 75 | cGraphUtilGray in 'cGraphUtilGray.pas', 76 | cGraphResize in 'cGraphResize.pas', 77 | cGraphResizeWinBlt in 'cGraphResizeWinBlt.pas', 78 | cGraphResizeWinThumb in 'cGraphResizeWinThumb.pas', 79 | cGraphResizeWinWIC in 'cGraphResizeWinWIC.pas'; 80 | 81 | end. 82 | -------------------------------------------------------------------------------- /FrameVCL/LightVclInternet.dpk: -------------------------------------------------------------------------------- 1 | package LightVclInternet; 2 | 3 | {$R *.res} 4 | {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users} 5 | {$ALIGN 2} 6 | {$ASSERTIONS ON} 7 | {$BOOLEVAL OFF} 8 | {$DEBUGINFO OFF} 9 | {$EXTENDEDSYNTAX ON} 10 | {$IMPORTEDDATA ON} 11 | {$IOCHECKS ON} 12 | {$LOCALSYMBOLS ON} 13 | {$LONGSTRINGS ON} 14 | {$OPENSTRINGS ON} 15 | {$OPTIMIZATION OFF} 16 | {$OVERFLOWCHECKS ON} 17 | {$RANGECHECKS ON} 18 | {$REFERENCEINFO ON} 19 | {$SAFEDIVIDE OFF} 20 | {$STACKFRAMES ON} 21 | {$TYPEDADDRESS OFF} 22 | {$VARSTRINGCHECKS ON} 23 | {$WRITEABLECONST OFF} 24 | {$MINENUMSIZE 1} 25 | {$IMAGEBASE $400000} 26 | {$DEFINE DEBUG} 27 | {$ENDIF IMPLICITBUILDING} 28 | {$DESCRIPTION 'LightSaber - Internet'} 29 | {$LIBSUFFIX AUTO} 30 | {$RUNONLY} 31 | {$IMPLICITBUILD ON} 32 | 33 | requires 34 | Rtl, 35 | Vcl, 36 | LightCore, 37 | LightVclCommon, 38 | IndyProtocols, 39 | vclie; 40 | 41 | contains 42 | Vcl.IdAntiFreeze, 43 | ciHtml in 'ciHtml.pas', 44 | ciHtmlImg in 'ciHtmlImg.pas', 45 | ciHtmlWriter in 'ciHtmlWriter.pas', 46 | ciDownloadThread in 'ciDownloadThread.pas', 47 | ciEmail in 'ciEmail.pas', 48 | ciInternet in 'ciInternet.pas', 49 | ciCommonWebDown in 'ciCommonWebDown.pas', 50 | ciEmailSender in 'ciEmailSender.pas', 51 | ciUpdater in 'Updater\ciUpdater.pas', 52 | ciUpdaterRec in 'Updater\ciUpdaterRec.pas', 53 | ciDownload_WinInet in 'ciDownload_WinInet.pas'; 54 | 55 | end. 56 | 57 | -------------------------------------------------------------------------------- /FrameVCL/LightVisControls.dpk: -------------------------------------------------------------------------------- 1 | package LightVisControls; 2 | 3 | {$R *.res} 4 | {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users} 5 | {$ALIGN 2} 6 | {$ASSERTIONS ON} 7 | {$BOOLEVAL OFF} 8 | {$DEBUGINFO OFF} 9 | {$EXTENDEDSYNTAX ON} 10 | {$IMPORTEDDATA ON} 11 | {$IOCHECKS ON} 12 | {$LOCALSYMBOLS ON} 13 | {$LONGSTRINGS ON} 14 | {$OPENSTRINGS ON} 15 | {$OPTIMIZATION OFF} 16 | {$OVERFLOWCHECKS ON} 17 | {$RANGECHECKS ON} 18 | {$REFERENCEINFO ON} 19 | {$SAFEDIVIDE OFF} 20 | {$STACKFRAMES ON} 21 | {$TYPEDADDRESS OFF} 22 | {$VARSTRINGCHECKS ON} 23 | {$WRITEABLECONST OFF} 24 | {$MINENUMSIZE 1} 25 | {$IMAGEBASE $400000} 26 | {$DEFINE DEBUG} 27 | {$DEFINE CCRExif} 28 | {$DEFINE Jpg2000} 29 | {$DEFINE FastJpg} 30 | {$ENDIF IMPLICITBUILDING} 31 | {$DESCRIPTION 'LightSaber - Visual Controls'} 32 | {$LIBSUFFIX AUTO} 33 | {$IMPLICITBUILD ON} 34 | 35 | requires 36 | Vcl, 37 | CcrExif, 38 | LightCore, 39 | LightVclCommon, 40 | LightVclInternet, 41 | LightVclGraphics; 42 | 43 | contains 44 | cvCalendarCanvas in 'cvCalendarCanvas.pas', 45 | cvAssociateExt in 'cvAssociateExt.pas', 46 | cvCheckListBox in 'cvCheckListBox.pas', 47 | cvComboBox in 'cvComboBox.pas', 48 | cvCountDown in 'cvCountDown.pas', 49 | cvDirectoryListBox in 'cvDirectoryListBox.pas', 50 | cvEdit in 'cvEdit.pas', 51 | cvFileFilter in 'cvFileFilter.pas', 52 | cvFileListBox in 'cvFileListBox.pas', 53 | cvFreeDiskSpace in 'cvFreeDiskSpace.pas', 54 | cvGradientPanel in 'cvGradientPanel.pas', 55 | cvGraphChart in 'cvGraphChart.pas', 56 | cvGroupbox in 'cvGroupbox.pas', 57 | cvListBox in 'cvListBox.pas', 58 | cvLstEditor in 'cvLstEditor.pas', 59 | cvMemo in 'cvMemo.pas', 60 | cvMinimalPathLabel in 'cvMinimalPathLabel.pas', 61 | cvPanel in 'cvPanel.pas', 62 | cvPathEdit in 'cvPathEdit.pas', 63 | cvProxyList in 'cvProxyList.pas', 64 | cvRadioButton in 'cvRadioButton.pas', 65 | cvRichEdit in 'cvRichEdit.pas', 66 | cvScrollBox in 'cvScrollBox.pas', 67 | cvSplitter in 'cvSplitter.pas', 68 | cvStatusBar in 'cvStatusBar.pas', 69 | cvThumbViewerM in 'cvThumbViewerM.pas', 70 | cvTimer in 'cvTimer.pas', 71 | cvToolBox in 'cvToolBox.pas', 72 | cvTrayIcon in 'cvTrayIcon.pas', 73 | cvTimeLine in 'cvTimeLine.pas', 74 | cvCaptionedThumb in 'cvCaptionedThumb.pas', 75 | cvSpinEditDelayed in 'cvSpinEditDelayed.pas', 76 | cvCreationOrderTester in 'cvCreationOrderTester.pas', 77 | cvActivityIndicator in 'cvActivityIndicator.pas', 78 | cvFloatSpinEdit in 'cvFloatSpinEdit.pas', 79 | cvMsgDispatcher in 'cvMsgDispatcher.pas', 80 | cvSpinEdit in 'cvSpinEdit.pas', 81 | cvCheckBox in 'cvCheckBox.pas', 82 | cvINIFile in 'cvINIFile.pas', 83 | cvLabelEdit in 'cvLabelEdit.pas', 84 | cvStringGrid in 'cvStringGrid.pas', 85 | cvStringGridBase in 'cvStringGridBase.pas', 86 | cvStringGridScrollFix in 'cvStringGridScrollFix.pas', 87 | cvDropDownSearch in 'cvDropDownSearch.pas', 88 | cvStrongPasswordEdit in 'cvStrongPasswordEdit.pas', 89 | llRichLogTrack in 'llRichLogTrack.pas', 90 | llRichLogUtils in 'llRichLogUtils.pas', 91 | llRichLog in 'llRichLog.pas', 92 | cvRichEditResize in 'cvRichEditResize.pas'; 93 | 94 | end. 95 | -------------------------------------------------------------------------------- /FrameVCL/cGraphLoader.WB1.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/FrameVCL/cGraphLoader.WB1.pas -------------------------------------------------------------------------------- /FrameVCL/cGraphLoader.WBC.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/FrameVCL/cGraphLoader.WBC.pas -------------------------------------------------------------------------------- /FrameVCL/cGraphResizeWinBlt.pas: -------------------------------------------------------------------------------- 1 | UNIT cGraphResizeWinBlt; 2 | 3 | {============================================================================================================= 4 | Gabriel Moraru 5 | 2024.12 6 | www.GabrielMoraru.com 7 | See Copyright file 8 | -------------------------------------------------------------------------------------------------------------- 9 | 10 | Image resizer using Windows StretchBlt API 11 | 12 | TESTER: 13 | c:\Projects\LightSaber ImageResampler Test\ResamplerTester.dpr 14 | 15 | -------------------------------------------------------------------------------------------------------------} 16 | INTERFACE 17 | 18 | USES 19 | Winapi.Windows, System.SysUtils, Vcl.Dialogs, Vcl.Graphics, 20 | cGraphBitmap, cGraphResizeParams; 21 | 22 | { Not proportional } 23 | function StretchF (BMP: TBitmap; OutWidth, OutHeight: Integer): TBitmap; { Best of all algorithms. 2019.08 } 24 | procedure Stretch (BMP: TBitmap; OutWidth, OutHeight: Integer); 25 | 26 | 27 | IMPLEMENTATION 28 | 29 | USES 30 | ccMath, cGraphLoader, cGraphFX; 31 | 32 | 33 | {------------------------------------------------------------------------------------------------------------- 34 | Based on MS Windows StretchBlt 35 | BEST (see tester) 36 | 37 | Zoom: In/Out 38 | Keep aspect ration: No 39 | Stretch provided in: pixels 40 | 41 | Resize down: VERY smooth. Better than JanFX.SmoothResize. 42 | Resize up: better (sharper) than JanFX.SmoothResize 43 | Time: similar to JanFx 44 | 45 | BitBlt only does copy. NO STRETCH 46 | 47 | https://msdn.microsoft.com/en-us/library/windows/desktop/dd162950(v=vs.85).aspx 48 | -------------------------------------------------------------------------------------------------------------} 49 | function StretchF(BMP: TBitmap; OutWidth, OutHeight: Integer): TBitmap; 50 | begin 51 | if (BMP.Width < 12) OR (BMP.Height< 12) then 52 | begin { 'WinStretchBltF' will crash if the image size is too small (below 10 pixels)} 53 | ShowMessage('Cannot stretch images under 12 pixels!'); 54 | EXIT(NIL); 55 | end; 56 | 57 | Result:= TBitmap.Create; 58 | TRY 59 | Result.PixelFormat:= BMP.PixelFormat; { Make sure we use the same pixel format as the original image } 60 | SetLargeSize(Result, OutWidth, OutHeight); 61 | SetStretchBltMode(Result.Canvas.Handle, HALFTONE); 62 | SetBrushOrgEx (Result.Canvas.Handle, 0,0, NIL); 63 | StretchBlt(Result.Canvas.Handle, 0, 0, Result.Width, Result.Height, BMP.Canvas.Handle, 0, 0, BMP.Width, BMP.Height, SRCCOPY); 64 | EXCEPT 65 | FreeAndNil(Result); { Free the bitmap if something goes wrong } 66 | RAISE; 67 | END; 68 | end; 69 | 70 | 71 | { Uses MS Windows StretchBlt } 72 | procedure Stretch(BMP: TBitmap; OutWidth, OutHeight: Integer); 73 | VAR Temp: TBitmap; 74 | begin 75 | Temp:= StretchF(BMP, OutWidth, OutHeight); 76 | TRY 77 | BMP.Assign(Temp); 78 | FINALLY 79 | FreeAndNil(Temp); 80 | END; 81 | end; 82 | 83 | 84 | end. 85 | -------------------------------------------------------------------------------- /FrameVCL/cGraphResizeWinGDI.pas: -------------------------------------------------------------------------------- 1 | UNIT cGraphResizeWinGDI; 2 | 3 | {============================================================================================================= 4 | Gabriel Moraru 5 | 2024.05 6 | www.GabrielMoraru.com 7 | See Copyright file 8 | -------------------------------------------------------------------------------------------------------------- 9 | Tester: c:\MyProjects\Projects GRAPHICS Resamplers\GLOBAL Tester\ 10 | --------------------------------------------------------------------------------------------------} 11 | 12 | INTERFACE 13 | 14 | USES 15 | Winapi.Windows, 16 | System.SysUtils, System.Classes, Vcl.Graphics, System.Types, 17 | ccCore; 18 | 19 | procedure ResizeBitmapGDI(Source, Dest: TBitmap; OutWidth, OutHeight: integer); 20 | 21 | 22 | IMPLEMENTATION 23 | 24 | uses 25 | GDIPAPI, 26 | GDIPOBJ; 27 | 28 | procedure ResizeBitmapGDI(Source, Dest: TBitmap; OutWidth, OutHeight: integer); 29 | var 30 | src, dst: TGPBitmap; 31 | g: TGPGraphics; 32 | h: HBITMAP; 33 | begin 34 | src := TGPBitmap.Create(Source.Handle, 0); 35 | try 36 | dst := TGPBitmap.Create(OutWidth, OutHeight); 37 | try 38 | g := TGPGraphics.Create(dst); 39 | try 40 | g.SetInterpolationMode(InterpolationModeHighQuality); 41 | g.SetPixelOffsetMode(PixelOffsetModeHighQuality); 42 | g.SetSmoothingMode(SmoothingModeHighQuality); 43 | g.DrawImage(src, 0, 0, dst.GetWidth, dst.GetHeight); 44 | finally 45 | g.Free; 46 | end; 47 | dst.GetHBITMAP(0, h); 48 | Dest.Handle := h; 49 | finally 50 | dst.Free; 51 | end; 52 | finally 53 | src.Free; 54 | end; 55 | end; 56 | 57 | 58 | end. 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /FrameVCL/cGraphResizeWinWIC.pas: -------------------------------------------------------------------------------- 1 | UNIT cGraphResizeWinWIC; 2 | 3 | {============================================================================================================= 4 | Gabriel Moraru 5 | 2024.12 6 | www.GabrielMoraru.com 7 | See Copyright file 8 | -------------------------------------------------------------------------------------------------------------- 9 | Based on MS Windows WIC which is implemented in Delphi since 2010. 10 | 11 | Image quality: 12 | Same as StretchBlt but the time and RAM for WIC is way worse. 13 | -------------------------------------------------------------------------------------------------------------- 14 | 15 | TESTER: 16 | c:\Projects\LightSaber ImageResampler Test\ResamplerTester.dpr 17 | 18 | -------------------------------------------------------------------------------------------------------------} 19 | INTERFACE 20 | 21 | USES 22 | System.Classes, System.SysUtils, VCL.GraphUtil, Vcl.Graphics; 23 | 24 | procedure ResizeBitmapWic(const Bitmap: TBitmap; const NewWidth, NewHeight: Integer); // pf32 25 | 26 | 27 | IMPLEMENTATION 28 | 29 | procedure ResizeBitmapWic(const Bitmap: TBitmap; const NewWidth, NewHeight: Integer); // pf32 30 | var 31 | vImage, v2: TWICImage; 32 | begin 33 | v2 := NIL; 34 | vImage := TWICImage.Create; 35 | try 36 | // Ensure the input is pf32bit to preserve transparency for PNGs 37 | if Bitmap.PixelFormat <> pf32bit 38 | then Bitmap.PixelFormat := pf32bit; 39 | 40 | vImage.Assign(Bitmap); 41 | v2 := vImage.CreateScaledCopy(NewWidth, NewHeight, wipmHighQualityCubic); 42 | Bitmap.Assign(v2); 43 | finally 44 | v2.Free; 45 | vImage.Free; 46 | end; 47 | end; 48 | 49 | 50 | end. 51 | -------------------------------------------------------------------------------- /FrameVCL/ciCommonWebDown.pas: -------------------------------------------------------------------------------- 1 | UNIT ciCommonWebDown; 2 | 3 | {------------------------------------------------------------------------------------------------------------- 4 | Gabriel Moraru 5 | 2023.06 6 | www.GabrielMoraru.com 7 | See Copyright file 8 | 9 | Common WebSite Downloader 10 | This tool will locate the high resolution images on webpages of popular websites like: Unsplash.com, Pexels, pixabay.com, wallpaperscraft.com (work in progress) 11 | Unsplash.com 12 | The user provides the URL of a web page that holds an image. 13 | The program will try to automatically locate the high res image from that page. 14 | -------------------------------------------------------------------------------------------------------------} 15 | 16 | INTERFACE 17 | 18 | USES 19 | System.SysUtils, ccCore; 20 | 21 | function GetUnsplashImage(CONST URL, LocalFile: string): Boolean; 22 | 23 | IMPLEMENTATION 24 | 25 | USES ccDownload, ciHTML; 26 | 27 | 28 | 29 | 30 | 31 | 32 | {-------------------------------------------------------------------------------------------------- 33 | UNSPLASH 34 | --------------------------------------------------------------------------------------------------} 35 | { Receive the URL of a Unsplash.com webpage and extracts the main image from it. 36 | Returns the file name of the file downloaded to disk } 37 | function GetUnsplashImage(CONST URL, LocalFile: string): Boolean; 38 | VAR 39 | HighResImg, Tag, HTML, ErrorMsg: string; 40 | begin 41 | HTML:= DownloadAsString(URL); 42 | if HTML = '' then EXIT(FALSE); 43 | 44 | Tag:= ciHTML.ExtractLine(HTML, 'new name] DownloadToFile(URL, URL, FileName); 72 | Image.Picture.LoadFromFile(FileName); 73 | FINALLY 74 | CursorNotBusy; 75 | END; 76 | end; } 77 | 78 | 79 | 80 | end. 81 | -------------------------------------------------------------------------------- /FrameVCL/ciDownloadThread.pas: -------------------------------------------------------------------------------- 1 | UNIT ciDownloadThread; 2 | 3 | {------------------------------------------------------------------------------------------------------------- 4 | 2025.05 5 | www.GabrielMoraru.com 6 | -------------------------------------------------------------------------------------------------------------- 7 | DOWNLOADS A FILE FROM THE INTERNET 8 | Uses WinInet. 9 | -------------------------------------------------------------------------------------------------------------- 10 | 11 | Also see: 12 | c:\Users\Public\Documents\Embarcadero\Studio\21.0\Samples\Object Pascal\RTL\HttpAsyncDownload\HttpAsyncDownloadDemo.dpr 13 | 14 | Tester: 15 | c:\Projects\LightSaber\Demo\Demo Internet\ 16 | c:\Projects\Testers\Internet download tester images\ 17 | -------------------------------------------------------------------------------------------------------------} 18 | 19 | {$WARN GARBAGE OFF} {Silence the: 'W1011 Text after final END' warning } 20 | 21 | INTERFACE 22 | 23 | USES 24 | System.SysUtils, System.Classes; 25 | 26 | TYPE 27 | TWinInetObj = class(TThread) 28 | private 29 | FUrl: String; { URL that we are downloading } 30 | FData : TMemoryStream; { The downloaded file will be here } 31 | FOnDownloadDone: TNotifyEvent; 32 | procedure SetURL(CONST Value: string); 33 | protected 34 | procedure Execute; override; 35 | public 36 | UserAgent: string; 37 | Header : string; { Header to send to the server. Example: 'Accept-Charset: utf-8'#13#10; } 38 | Referer: string; 39 | SSL: Boolean; 40 | property URL : String read FUrl write SetUrl; 41 | property Data : TMemoryStream read FData; 42 | property OnDownloadDone: TNotifyEvent read FOnDownloadDone write FOnDownloadDone; 43 | end; 44 | 45 | 46 | IMPLEMENTATION 47 | 48 | USES 49 | ccDownload, ccCore; 50 | 51 | 52 | procedure TWinInetObj.Execute; 53 | VAR HttpRetCode: string; 54 | begin 55 | FData:= ccDownload.DownloadToStream(URL, HttpRetCode); 56 | if Assigned(FOnDownloadDone) 57 | then FOnDownloadDone(Self); 58 | end; 59 | 60 | 61 | procedure TWinInetObj.SetURL(const Value: string); 62 | begin 63 | if (Length(Value) < 5) { minimum address would be: domain.ro/x.htm } 64 | OR (PosInsensitive('http', Value) <= 0) 65 | then raise exception.Create('Invalid URL address. The URL does not start with ''http''.') 66 | else FURL:= Value; 67 | end; 68 | 69 | 70 | end. 71 | -------------------------------------------------------------------------------- /FrameVCL/ciEmailSender.pas: -------------------------------------------------------------------------------- 1 | UNIT ciEmailSender; 2 | 3 | {------------------------------------------------------------------------------------------------------------- 4 | Gabriel Moraru 5 | 2024.05 6 | www.GabrielMoraru.com 7 | See Copyright file 8 | 9 | Universal 'SendMail' function 10 | Used in: Power Email Extractor, PingMail, BX 11 | -------------------------------------------------------------------------------------------------------------} 12 | 13 | INTERFACE 14 | 15 | USES 16 | SysUtils, IdTCPConnection, IdSMTP, IdMessage; 17 | 18 | function SendEmail(SMTP: TIdSMTP; CONST AdrTo, AdrFrom, Subject, Body, HtmlImage, DownloadableAttachment: string; SendAsHtml: Boolean= FALSE): Boolean; 19 | 20 | IMPLEMENTATION 21 | 22 | USES 23 | IdMessageBuilder, ccAppData, LightCom.AppData 24 | ; 25 | 26 | 27 | 28 | function SendEmail; 29 | VAR MailMessage: TIdMessage; 30 | begin 31 | Result:= FALSE; 32 | Assert(SMTP <> NIL, 'SMTP in NIL!'); 33 | 34 | MailMessage:= TIdMessage.Create(NIL); 35 | TRY 36 | MailMessage.ConvertPreamble:= TRUE; 37 | MailMessage.Encoding := meDefault; 38 | MailMessage.Subject := Subject; 39 | MailMessage.From.Address := AdrFrom; 40 | MailMessage.Priority := mpNormal; 41 | MailMessage.Recipients.EMailAddresses := AdrTo; 42 | 43 | {How to send multi-part/attachment emails with Indy: 44 | www.indyproject.org/2005/08/17/html-messages 45 | www.indyproject.org/2008/01/16/new-html-message-builder-class } 46 | WITH IdMessageBuilder.TIdMessageBuilderHtml.Create DO 47 | TRY 48 | if SendAsHtml 49 | then Html.Text := Body 50 | else PlainText.Text := Body; 51 | 52 | { This will be visible ONLY if the email contains HTML! } 53 | if SendAsHtml AND FileExists(HtmlImage) 54 | then HtmlFiles.Add(HtmlImage); 55 | 56 | if FileExists(DownloadableAttachment) 57 | then Attachments.Add(DownloadableAttachment); 58 | FillMessage(MailMessage); 59 | FINALLY 60 | Free; 61 | END; 62 | 63 | { Connect } 64 | TRY 65 | if NOT SMTP.Connected 66 | then SMTP.Connect; 67 | EXCEPT 68 | on E: Exception DO 69 | begin 70 | AppData.LogError('Cannot connect to the email server.'); 71 | AppData.LogError(E.Message); 72 | end; 73 | END; 74 | 75 | { Send mail } 76 | if SMTP.Connected then 77 | TRY 78 | SMTP.Send(MailMessage); 79 | Result:= TRUE; 80 | EXCEPT 81 | on E:Exception DO 82 | begin 83 | AppData.LogError('Connected to server but could not send email!'); 84 | AppData.LogError(E.Message); 85 | end; 86 | END; 87 | 88 | if SMTP.Connected 89 | then SMTP.Disconnect; 90 | 91 | FINALLY 92 | FreeAndNil(MailMessage); 93 | END; 94 | end; 95 | 96 | 97 | 98 | end. 99 | -------------------------------------------------------------------------------- /FrameVCL/ciHtmlWriter.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/FrameVCL/ciHtmlWriter.res -------------------------------------------------------------------------------- /FrameVCL/cvActivityIndicator.pas: -------------------------------------------------------------------------------- 1 | UNIT cvActivityIndicator; 2 | 3 | {-------------------------------------------------------------------------------------------------- 4 | 2020-11-28 5 | 6 | Features: 7 | 8 | Dont set 'Parent:= Owner' in constructor. See this for details: http://stackoverflow.com/questions/6403217/how-to-set-a-tcustomcontrols-parent-in-create 9 | --------------------------------------------------------------------------------------------------} 10 | 11 | INTERFACE 12 | 13 | USES 14 | System.Classes, Vcl.Controls, Vcl.Graphics, Vcl.WinXCtrls; 15 | 16 | TYPE 17 | TActivityIndicatorC = class(TActivityIndicator) 18 | private 19 | protected 20 | procedure DrawFrame; override; 21 | public 22 | published 23 | property Align; 24 | property Visible; 25 | property OnClick; 26 | end; 27 | 28 | procedure Register; 29 | 30 | IMPLEMENTATION 31 | 32 | USES cGraphUtil; 33 | 34 | 35 | procedure TActivityIndicatorC.DrawFrame; 36 | begin 37 | if Animate 38 | then inherited DrawFrame 39 | else 40 | if HandleAllocated then 41 | begin 42 | Canvas.Pen.Style := psSolid; 43 | Canvas.Brush.Style := bsClear; 44 | Canvas.Pen.Color := clRed; 45 | cGraphUtil.DrawTriangle(Canvas, ClientWidth, ClientHeight, 8); 46 | end 47 | end; 48 | 49 | 50 | procedure Register; 51 | begin 52 | RegisterComponents('LightSaber', [TActivityIndicatorC]); 53 | end; 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | end. 63 | -------------------------------------------------------------------------------- /FrameVCL/cvDropDownSearch.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/FrameVCL/cvDropDownSearch.pas -------------------------------------------------------------------------------- /FrameVCL/cvFileFilter.pas: -------------------------------------------------------------------------------- 1 | UNIT cvFileFilter; 2 | 3 | {============================================================================================================= 4 | Gabriel Moraru 5 | 2024.05 6 | www.GabrielMoraru.com 7 | See Copyright file 8 | -------------------------------------------------------------------------------------------------------------- 9 | 10 | Allows access to Change method which I need to call after I load the controls from IniFile 11 | -----------------------------------------------------------------------------------------------------------------------} 12 | 13 | INTERFACE {.$WARN UNIT_PLATFORM OFF} 14 | 15 | USES 16 | System.Classes, vcl.filectrl; 17 | 18 | TYPE 19 | TCubicFilterBox = class(TFilterComboBox) 20 | public 21 | procedure Change; override; 22 | end; 23 | 24 | procedure Register; 25 | 26 | 27 | 28 | 29 | IMPLEMENTATION 30 | 31 | 32 | 33 | 34 | procedure TCubicFilterBox.Change; 35 | begin 36 | inherited; 37 | end; 38 | 39 | 40 | procedure Register; 41 | begin 42 | RegisterComponents('LightSaber', [TCubicFilterBox]); 43 | end; 44 | 45 | 46 | end. 47 | -------------------------------------------------------------------------------- /FrameVCL/cvFloatSpinEdit.dcr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/FrameVCL/cvFloatSpinEdit.dcr -------------------------------------------------------------------------------- /FrameVCL/cvFreeDiskSpace.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/FrameVCL/cvFreeDiskSpace.res -------------------------------------------------------------------------------- /FrameVCL/cvGradientPanel.pas: -------------------------------------------------------------------------------- 1 | 2 | UNIT cvGradientPanel; 3 | 4 | {-------------------------------------------------------------------------------------------------- 5 | 2018.02.16 6 | TPanel with gradient 7 | Source: http://embarcadero.newsgroups.archived.at/public.delphi.vcl.components.using/201001/1001154053.html 8 | 9 | 10 | Also see: 11 | c:\MyProjects\Packages\Third party packages\GradientPanel.pas 12 | --------------------------------------------------------------------------------------------------} 13 | {todo 2: draw 3D frame on it } 14 | 15 | INTERFACE 16 | {$D-} { NoDebugInfo switch } 17 | {$WARN GARBAGE OFF} { Silent the: 'W1011 Text after final END' warning } 18 | 19 | USES 20 | System.SysUtils, System.Classes, Vcl.ExtCtrls, Vcl.Graphics; 21 | 22 | 23 | TYPE 24 | TGradPanel = class(TPanel) 25 | private 26 | FShowGrad: Boolean; 27 | FColor1: TColor; 28 | FColor2: TColor; 29 | procedure SetGradientFill(const Value: Boolean); 30 | procedure SetColor1(const Value: TColor); 31 | procedure SetColor2(const Value: TColor); 32 | protected 33 | procedure Paint; override; 34 | public 35 | property Canvas; // if you want the panels canvas available elsewhere 36 | constructor Create(AOwner: TComponent); override; 37 | published 38 | property ShowGradient: Boolean read FShowGrad write SetGradientFill default TRUE; 39 | property Color1 : TColor read FColor1 write SetColor1 default $00D6D6D6; 40 | property Color2 : TColor read FColor2 write SetColor2 default $00FFA4A4; 41 | end; 42 | 43 | 44 | 45 | procedure Register; 46 | 47 | IMPLEMENTATION 48 | USES cGraphFX.Gradient; 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | constructor TGradPanel.Create(AOwner: TComponent); 60 | begin 61 | inherited Create(AOwner); //del Parent:= TWinControl(AOwner); Don't set 'Parent:= Owner' in constructor. Details: http://stackoverflow.com/questions/6403217/how-to-set-a-tcustomcontrols-parent-in-create 62 | FShowGrad := TRUE; 63 | FColor1 := $00D6D6D6; 64 | FColor2 := $00FFA4A4; 65 | end; 66 | 67 | 68 | procedure TGradPanel.Paint; 69 | begin 70 | inherited; 71 | if FShowGrad 72 | then GradientFill(Self, Color2, Color1); 73 | end; 74 | 75 | 76 | procedure TGradPanel.SetGradientFill(const Value: Boolean); 77 | begin 78 | if FShowGrad <> Value then 79 | begin 80 | FShowGrad := Value; 81 | Invalidate; 82 | end; 83 | end; 84 | 85 | 86 | procedure TGradPanel.SetColor1(const Value: TColor); 87 | begin 88 | if FColor1 <> Value then 89 | begin 90 | FColor1 := Value; 91 | Invalidate; 92 | end; 93 | end; 94 | 95 | 96 | procedure TGradPanel.SetColor2(const Value: TColor); 97 | begin 98 | if FColor2 <> Value then 99 | begin 100 | FColor2 := Value; 101 | Invalidate; 102 | end; 103 | end; 104 | 105 | 106 | 107 | 108 | 109 | procedure Register; 110 | begin 111 | RegisterComponents('LightSaber', [TGradPanel]); 112 | end; 113 | 114 | 115 | end. 116 | -------------------------------------------------------------------------------- /FrameVCL/cvLstEditor.pas: -------------------------------------------------------------------------------- 1 | UNIT cvLstEditor; 2 | 3 | interface 4 | uses 5 | System.SysUtils, System.Classes, Vcl.Controls, Vcl.ValEdit; 6 | 7 | TYPE 8 | TCubicValueListEditor = class(TValueListEditor) 9 | private 10 | protected 11 | public 12 | procedure SaveToFile (FileName: string); 13 | procedure LoadFromFile (FileName: string); 14 | procedure ClearAllRows; { CLEAR } 15 | published 16 | end; 17 | 18 | 19 | procedure Register; 20 | 21 | IMPLEMENTATION 22 | USES ccTextFile; 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | procedure TCubicValueListEditor.SaveToFile (FileName: string); 31 | VAR rw, cl: Integer; 32 | TS: TStringList; 33 | begin 34 | TS:= TStringList.Create; 35 | TS.Add(IntToStr(RowCount-1)); { nu salvez inforamtii despre capul de tabel } 36 | TS.Add(IntToStr(ColCount)); 37 | 38 | for rw:= 1 TO RowCount-1 DO 39 | for cl:= 0 TO ColCount-1 DO 40 | TS.Add(Cells[cl, rw]); 41 | 42 | StringToFile(FileName, TS.Text, woOverwrite, wpAuto); 43 | FreeAndNil(TS); 44 | end; 45 | 46 | 47 | 48 | procedure TCubicValueListEditor.LoadFromFile(FileName: string); 49 | VAR rw, cl, Rows, adres: Integer; 50 | TS: TStringList; OldOptions: TKeyOptions; 51 | begin 52 | ClearAllRows; { CLEAR } 53 | 54 | TS := StringFromFileTSL(FileName); 55 | Rows := StrToInt(TS.strings[0]); 56 | ColCount:= StrToInt(TS.strings[1]); { CREATE COLUMNS } 57 | 58 | { CREATE EMPTY ROWS } 59 | OldOptions:= KeyOptions; 60 | KeyOptions:= []; { daca keyUnique e prezent, atunci nu pot sa incar doua chei identice, asa ca trebuie sa disable asta temporar } 61 | for rw:= 1 to Rows 62 | DO InsertRow(' ', ' ', TRUE); { 1 pentru ca exista un rand gol creat 'by default' } 63 | KeyOptions:= OldOptions; { restore original options } 64 | 65 | { FILL CELLS WITH TEXT } 66 | Adres:= 2; 67 | for rw:= 1 TO Rows DO 68 | for cl:= 0 TO ColCount-1 DO 69 | begin 70 | Cells[cl, rw]:= TS.Strings[adres]; 71 | inc(adres); 72 | end; 73 | FreeAndNil(TS {} ); 74 | end; 75 | 76 | 77 | 78 | procedure TCubicValueListEditor.ClearAllRows; { CLEAR } 79 | VAR rw: Integer; 80 | begin 81 | for rw:= RowCount-1 downto 2 82 | DO DeleteRow(rw); { sterg randurile existente. Nu pot sa sterg capul de tabel si urmatorul rand dupa el. } 83 | Cells[0, 1]:= ''; 84 | Cells[1, 1]:= ''; 85 | end; 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | procedure Register; 95 | begin 96 | RegisterComponents('LightSaber', [TCubicValueListEditor]); 97 | end; 98 | 99 | 100 | end. 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /FrameVCL/cvMinimalPathLabel.pas: -------------------------------------------------------------------------------- 1 | UNIT cvMinimalPathLabel; 2 | 3 | {============================================================================================================= 4 | 2024.05 5 | www.GabrielMoraru.com 6 | -------------------------------------------------------------------------------------------------------------- 7 | 8 | When displaying a path, truncates the middle of the text if the entire path cannot fit into the visible area of the control. 9 | It ONLY works with filenames and paths because of MinimizeName! 10 | If ShowFullTextAsHint is true then the entire text will be shown into the Hint. 11 | 12 | --------------------------------------------------------------------------------------------------} 13 | 14 | INTERFACE 15 | {.$D-} { 'NoDebugInfo' switch } 16 | {.$WARN UNIT_PLATFORM OFF} {Silence the 'W1005 Unit Vcl.FileCtrl is specific to a platform' warning } 17 | 18 | USES 19 | System.SysUtils, System.Classes, Vcl.Controls, Vcl.StdCtrls, Vcl.FileCtrl; 20 | 21 | TYPE 22 | TMinimalPathLabel = class(TLabel) 23 | private 24 | FFulCaption: string; 25 | FShowFull: Boolean; 26 | procedure SetCaption(Value: string); 27 | public 28 | constructor Create(AOwner: TComponent); override; 29 | procedure Resize; override; 30 | published 31 | property CaptionMin: string read FFulCaption write SetCaption; 32 | property ShowFullTextAsHint: Boolean read FShowFull write FShowFull default TRUE; 33 | end; 34 | 35 | procedure Register; 36 | 37 | IMPLEMENTATION 38 | {$WARN GARBAGE OFF} {Silence the: 'W1011 Text after final END' warning } 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | constructor TMinimalPathLabel.Create(AOwner: TComponent); 47 | begin 48 | inherited Create(AOwner); // Note: Don't set 'Parent:= Owner' in constructor. Details: http://stackoverflow.com/questions/6403217/how-to-set-a-tcustomcontrols-parent-in-create 49 | ShowHint:= TRUE; 50 | FShowFull:= TRUE; 51 | FFulCaption:= 'Minimized text'; 52 | end; 53 | 54 | 55 | procedure TMinimalPathLabel.SetCaption(Value: string); 56 | begin 57 | FFulCaption:= Value; 58 | Caption:= Vcl.FileCtrl.MinimizeName(Value, Canvas, Width); 59 | if FShowFull 60 | then Hint:= Value; 61 | end; 62 | 63 | 64 | procedure TMinimalPathLabel.Resize; 65 | begin 66 | inherited; 67 | Caption:= MinimizeName(FFulCaption, Canvas, Width); 68 | end; 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | procedure Register; 84 | begin 85 | RegisterComponents('LightSaber', [TMinimalPathLabel]); 86 | end; 87 | 88 | end.{============================================================================ 89 | -------------------------------------------------------------------------------- /FrameVCL/cvPathEdit.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/FrameVCL/cvPathEdit.res -------------------------------------------------------------------------------- /FrameVCL/cvRichEditResize.pas: -------------------------------------------------------------------------------- 1 | UNIT cvRichEditResize; 2 | 3 | {============================================================================================================= 4 | Gabriel Moraru 5 | 2024.09 6 | www.GabrielMoraru.com 7 | See Copyright file 8 | -------------------------------------------------------------------------------------------------------------- 9 | 10 | This component resizes itself as we add lines to it (instead of showing the vert scrollbars) 11 | 12 | Tester: 13 | C:\Projects\LightSaber\Demo\Tester All Visual Controls 14 | 15 | Also see: 16 | cvRichEdit.pas 17 | =============================================================================================================} 18 | 19 | INTERFACE 20 | 21 | USES 22 | Winapi.Windows, Winapi.Messages, 23 | System.Classes, System.UITypes, 24 | Vcl.ExtCtrls, Vcl.StdCtrls, Vcl.Forms, LightCom.AppDataForm,Vcl.ComCtrls, Vcl.Controls, Vcl.Dialogs; 25 | 26 | 27 | TYPE 28 | TRichEditResize = class(TRichEdit) 29 | private 30 | FMinHeight: Integer; 31 | procedure ResizeRichEdit; 32 | protected 33 | procedure CreateWnd; override; 34 | procedure Change; override; 35 | public 36 | constructor Create(AOwner: TComponent); override; 37 | published 38 | property MinHeight: Integer read FMinHeight write FMinHeight; 39 | end; 40 | 41 | procedure Register; 42 | 43 | 44 | 45 | IMPLEMENTATION 46 | 47 | 48 | constructor TRichEditResize.Create(AOwner: TComponent); 49 | begin 50 | inherited Create(AOwner); 51 | FMinHeight:= 50; 52 | end; 53 | 54 | 55 | procedure TRichEditResize.CreateWnd; 56 | begin 57 | inherited CreateWnd; 58 | ScrollBars := ssNone; // Now that the handle is created, we can safely set the ScrollBars property 59 | end; 60 | 61 | 62 | procedure TRichEditResize.Change; 63 | begin 64 | inherited; 65 | ResizeRichEdit; 66 | end; 67 | 68 | 69 | procedure TRichEditResize.ResizeRichEdit; 70 | var 71 | LineHeight, NewHeight: Integer; 72 | DC: HDC; 73 | TextMetric: TTextMetric; 74 | LineCount: Integer; 75 | begin 76 | if (csDesigning in ComponentState) then EXIT; 77 | if Parent = NIL then 78 | begin 79 | ShowMessage('TRichEditResize - Parent not assigned'); // Temporary. Take it out later 80 | EXIT; 81 | end; 82 | 83 | // Calc single line height 84 | DC := GetDC(Handle); 85 | try 86 | GetTextMetrics(DC, TextMetric); 87 | LineHeight := TextMetric.tmHeight- TextMetric.tmInternalLeading; 88 | finally 89 | ReleaseDC(Handle, DC); 90 | end; 91 | 92 | // Calculate number of lines 93 | LineCount := Perform(EM_LINEFROMCHAR, WPARAM(MaxInt), 0) + 1; 94 | 95 | // Calculate heigh 96 | NewHeight := LineHeight * LineCount; 97 | if NewHeight < FMinHeight 98 | then NewHeight:= FMinHeight; 99 | 100 | // Prepare the parent 101 | if (Parent is TPanel) 102 | AND (TPanel(Parent).AutoSize) 103 | then ShowMessage('TRichEditResize - Parent panel cannot be set to autosize!'); 104 | 105 | NewHeight:= Top+ NewHeight + 5; // Add padding to the panel 106 | Parent.Height := NewHeight; 107 | 108 | // Self height 109 | Height := NewHeight; 110 | end; 111 | 112 | 113 | procedure Register; 114 | begin 115 | RegisterComponents('LightSaber', [TRichEditResize]); 116 | end; 117 | 118 | 119 | 120 | end. 121 | -------------------------------------------------------------------------------- /FrameVCL/cvSplitter.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/FrameVCL/cvSplitter.res -------------------------------------------------------------------------------- /FrameVCL/cvStatusBar.pas: -------------------------------------------------------------------------------- 1 | UNIT cvStatusBar; 2 | 3 | { 4 | v1.1 5 | allows other controls to be inserted into it. 6 | 7 | // todo: https://zarko-gajic.iz.hr/implementing-custom-hint-for-each-panel-on-a-status-bar/#more-640 8 | } 9 | 10 | INTERFACE 11 | 12 | USES 13 | System.Classes, Vcl.Controls, Vcl.ComCtrls; 14 | 15 | TYPE 16 | TcubicStatusBar = class(TStatusBar) 17 | public 18 | constructor Create(AOwner: TComponent); override; 19 | end; 20 | 21 | procedure Register; 22 | 23 | IMPLEMENTATION 24 | {$WARN GARBAGE OFF} {Silence the: 'W1011 Text after final END' warning } 25 | 26 | 27 | 28 | procedure Register; 29 | begin 30 | RegisterComponents('LightSaber', [TcubicStatusBar]); 31 | end; 32 | 33 | 34 | constructor TcubicStatusBar.Create(AOwner: TComponent); 35 | begin 36 | inherited Create(AOwner); 37 | ControlStyle := ControlStyle + [csAcceptsControls]; 38 | SimplePanel:= TRUE; 39 | end; 40 | 41 | 42 | end. 43 | 44 | -------------------------------------------------------------------------------- /FrameVCL/cvStringGrid.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/FrameVCL/cvStringGrid.res -------------------------------------------------------------------------------- /FrameVCL/cvStrongPasswordEdit.pas: -------------------------------------------------------------------------------- 1 | UNIT cvStrongPasswordEdit; 2 | 3 | {============================================================================================================= 4 | Gabriel Moraru 5 | 2024.05 6 | www.GabrielMoraru.com 7 | See Copyright file 8 | 9 | An edit box where you can enter a password. 10 | The strength of the password is color coded (green for strong password, red for poor password) 11 | -------------------------------------------------------------------------------------------------------------} 12 | 13 | INTERFACE 14 | 15 | USES 16 | Winapi.Messages, Winapi.Windows, vcl.Dialogs, 17 | System.SysUtils, System.Classes, Vcl.Controls, Vcl.StdCtrls, Vcl.Graphics; 18 | 19 | type 20 | TStrongPasswordEdit = class(TEdit) 21 | private 22 | procedure UpdateBackgroundColor; 23 | procedure CMTextChanged(var Message: TMessage); message CM_TEXTCHANGED; 24 | protected 25 | procedure Change; override; 26 | public 27 | constructor Create(AOwner: TComponent); override; 28 | end; 29 | 30 | procedure Register; 31 | 32 | IMPLEMENTATION 33 | 34 | USES 35 | System.Math, LightCom.SystemSecurity, LightCom.System; 36 | 37 | 38 | 39 | constructor TStrongPasswordEdit.Create(AOwner: TComponent); 40 | begin 41 | inherited Create(AOwner); 42 | Color := clRed; // Default background color 43 | Hint:= 'It is reccomended to use uppercase, lowercase, numbers & signs.' 44 | end; 45 | 46 | 47 | procedure TStrongPasswordEdit.CMTextChanged(var Message: TMessage); 48 | begin 49 | inherited; 50 | UpdateBackgroundColor; 51 | end; 52 | 53 | 54 | procedure TStrongPasswordEdit.Change; 55 | begin 56 | inherited Change; 57 | UpdateBackgroundColor; // Update the background color based on the new text 58 | end; 59 | 60 | 61 | 62 | procedure TStrongPasswordEdit.UpdateBackgroundColor; 63 | var 64 | Strength: Integer; 65 | GreenValue: Byte; 66 | begin 67 | Strength := CalculatePasswordStrength(Text); 68 | 69 | // Map strength to a green value (0 to 255) 70 | GreenValue := Min(255, Strength * 51); // 5 levels (0..5), 51 increment each level 71 | 72 | // Set the background color from red to green based on strength 73 | Color := RGB(255 - GreenValue, GreenValue, 0); 74 | end; 75 | 76 | 77 | 78 | 79 | 80 | procedure Register; 81 | begin 82 | RegisterComponents('LightSaber', [TStrongPasswordEdit]); 83 | end; 84 | 85 | 86 | end. 87 | -------------------------------------------------------------------------------- /FrameVCL/cvTimer.pas: -------------------------------------------------------------------------------- 1 | UNIT cvTimer; 2 | 3 | {============================================================================================================= 4 | Gabriel Moraru 5 | 2024.05 6 | www.GabrielMoraru.com 7 | See Copyright file 8 | -------------------------------------------------------------------------------------------------------------- 9 | 10 | Better Timer 11 | -----------------------------------------------------------------------------------------------------------------------} 12 | 13 | INTERFACE {.$WARN UNIT_PLATFORM OFF} 14 | 15 | USES 16 | System.Classes, Vcl.ExtCtrls; 17 | 18 | TYPE 19 | TCubicTimer = class(TTimer) 20 | private 21 | public 22 | procedure Restart; { Sets the countdown back to zero and starts the timer } 23 | procedure Reset; { Sets the countdown back to zero and starts the timer ONLY if was enabled before } 24 | procedure Stop; 25 | end; 26 | 27 | procedure ResetTimer(Timer: TTimer); 28 | procedure Register; 29 | 30 | 31 | 32 | IMPLEMENTATION 33 | 34 | 35 | 36 | procedure ResetTimer(Timer: TTimer); { Utility for those timers that are TTimer and not TCubicTimer } 37 | begin 38 | if NOT Timer.Enabled then EXIT; 39 | 40 | Timer.Enabled:= FALSE; { Stop timer } 41 | Timer.Enabled:= TRUE; { Start the timer ONLY if was enabled before } 42 | end; 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | procedure TCubicTimer.Reset; { Start the timer ONLY if was enabled before } 51 | begin 52 | if Enabled then Restart; 53 | end; 54 | 55 | 56 | procedure TCubicTimer.Restart; { Sets the countdown back to zero and starts the timer } 57 | begin 58 | Enabled:= FALSE; 59 | Enabled:= TRUE; 60 | end; 61 | 62 | 63 | procedure TCubicTimer.Stop; { Does nothing more special than Enabled=false, but has a better name... } 64 | begin 65 | Enabled:= FALSE; 66 | end; 67 | 68 | 69 | 70 | 71 | procedure Register; 72 | begin 73 | RegisterComponents('LightSaber', [TCubicTimer]); 74 | end; 75 | 76 | 77 | end. 78 | -------------------------------------------------------------------------------- /FrameVCL/cvTrayIcon.pas: -------------------------------------------------------------------------------- 1 | UNIT cvTrayIcon; 2 | 3 | {============================================================================================================= 4 | Gabriel Moraru 5 | 2024.05 6 | www.GabrielMoraru.com 7 | See Copyright file 8 | -------------------------------------------------------------------------------------------------------------- 9 | 10 | Features: 11 | PutIconInTaskbar 12 | PutIconInSystray 13 | 14 | How to use it: 15 | 16 | procedure TfrmTester.ApplicationEventsMinimize(Sender: TObject); 17 | begin 18 | TrayIcon.PutIconInSystray; 19 | end; 20 | 21 | procedure TfrmTester.TrayIconClick(Sender: TObject); 22 | begin 23 | TrayIcon.PutIconInTaskbar; 24 | end; 25 | 26 | 27 | IMPORTANT 28 | Set Application.ShowMainFormOnTaskbar := False;' to keep the application's button from appearing on the Windows Taskbar. 29 | 30 | Use ballon like this: 31 | BalloonTitle := 'Restoring the window.'; 32 | BalloonHint := 'Click the system tray icon to restore the window.'; 33 | BalloonFlags := bfInfo; 34 | =============================================================================================================} 35 | 36 | INTERFACE 37 | 38 | USES 39 | Winapi.Windows, System.Classes, 40 | Vcl.Forms, Vcl.ExtCtrls; 41 | 42 | TYPE 43 | TCubicTrayIcon = class(TTrayIcon) 44 | private 45 | public 46 | procedure PutIconInTaskbar; 47 | procedure PutIconInSystray; 48 | procedure PutIconInSystrayBallon; { This will also show the ballon IF BalloonHint is not empty. } 49 | end; 50 | 51 | procedure Register; 52 | 53 | IMPLEMENTATION 54 | 55 | 56 | procedure TCubicTrayIcon.PutIconInTaskbar; 57 | begin 58 | Self.Visible := FALSE; { Hide the tray icon and show the window, setting its state property to wsNormal. } 59 | Application.MainForm.Show; 60 | Application.MainForm.WindowState:= wsNormal; 61 | ShowWindow(Application.Handle, SW_SHOW); { This is mandatory with D2007 and up else the main form won't show when Application.MainFormOnTaskBar:= false; http://delphi.about.com/od/delphitips2008/qt/hide_taskbutton.htm } 62 | Application.Restore; 63 | Application.BringToFront; 64 | end; 65 | 66 | 67 | 68 | procedure TCubicTrayIcon.PutIconInSystray; 69 | begin 70 | { ShowWindow(Application.Handle, SW_HIDE); } 71 | Application.MainForm.Hide; 72 | Application.MainForm.WindowState:= wsMinimized; 73 | Self.Visible:= TRUE; { Show the animated tray icon } 74 | end; 75 | 76 | 77 | 78 | procedure TCubicTrayIcon.PutIconInSystrayBallon; { This will also show the ballon IF BalloonHint is not empty. } 79 | begin 80 | PutIconInSystray; 81 | ShowBalloonHint; 82 | end; 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | procedure Register; 94 | begin 95 | RegisterComponents('LightSaber', [TCubicTrayIcon]); 96 | end; 97 | 98 | 99 | 100 | 101 | end. 102 | -------------------------------------------------------------------------------- /FrameVCL/llRichLogUtils.pas: -------------------------------------------------------------------------------- 1 | UNIT llRichLogUtils; 2 | 3 | // OLD LOG based on RichEdit 4 | 5 | {============================================================================================================= 6 | 2023.06 7 | www.GabrielMoraru.com 8 | 9 | A simple but effective visual log control/library. 10 | The programmer can send messages to the log that will be shown or not, depending on the chousen verbosity level of the log (see Verbosity property). 11 | **Visual/Non-visual** 12 | There is a non-visual log (TRamLog) and a visual log (TRichLog). The idea is that your non-visual objects can send data to the non-viusal log, for example in a batch job. At the end of the batch all collected messages can be shown in the visual log. 13 | Alternativelly, if you connect the TRamLog to the visual log, the messages are shown in real time, as the batch job progreeses. 14 | There is a pre-defined form that holds the log. To show it, call CreateLogForm in FormLog.pas 15 | The purpose is to have one single log window per application that will receive messages from the entire application. 16 | **Verbosity:** 17 | Supports several verbosity levels (verbose, info, warnings, errors, etc). 18 | Receives only messages that are above the specified verbosity threshold. 19 | For example, if the log is set to show only warnings and errors and you send a messages marked as "verbose", then the messages will not be shown. 20 | Each verbosity level has a predefined color. 21 | **I/O** 22 | The log can be save to disk to a binary file so it can be restored when the next app startup. 23 | Tester: 24 | c:\Myprojects\LightSaber\Demo\LightLog\ 25 | =============================================================================================================} 26 | 27 | INTERFACE 28 | 29 | USES 30 | System.SysUtils, Vcl.Graphics, LightCom.Colors; 31 | 32 | TYPE 33 | TLogVerb= (lvrVerbose, lvrHints, lvrInfos, lvrImportant, lvrWarnings, lvrErrors); 34 | 35 | CONST 36 | ctLogVerb = clGray; 37 | ctLogHint = clDkGray; 38 | ctLogInfo = clBlack; 39 | ctLogImprt = clPurpleDk; // TColor($5E005E); 40 | ctLogWarn = clOrangeDark; // TColor($0058DF); 41 | ctLogError = clRed; 42 | 43 | CONST 44 | DefaultVerbosity= lvrInfos; 45 | 46 | function Verbosity2String(Verbosity: TLogVerb): string; 47 | 48 | 49 | 50 | IMPLEMENTATION 51 | 52 | 53 | function Verbosity2String(Verbosity: TLogVerb): string; 54 | begin 55 | case Verbosity of 56 | lvrVerbose : Result := 'Verbose'; 57 | lvrHints : Result := 'Hints'; 58 | lvrInfos : Result := 'Info'; { This is the default level of verbosity } 59 | lvrImportant : Result := 'Important'; 60 | lvrWarnings : Result := 'Warnings'; 61 | lvrErrors : Result := 'Errors'; 62 | else 63 | Raise Exception.Create('Invalid verbosity'); 64 | end; 65 | end; 66 | 67 | 68 | function Verbosity2Color(Verbosity: TLogVerb): TColor; 69 | begin 70 | CASE Verbosity of 71 | //lvDebug : Result:= clSilverLight; 72 | lvrVerbose : Result:= clSilverDark; 73 | lvrHints : Result:= clGray; 74 | lvrInfos : Result:= clBlack; 75 | lvrImportant: Result:= clOrangeDk; 76 | lvrWarnings : Result:= clOrange; 77 | lvrErrors : Result:= clRed; 78 | else 79 | RAISE exception.Create('Invalid log verbosity!'); 80 | end; 81 | end; 82 | 83 | 84 | 85 | 86 | 87 | 88 | end. 89 | -------------------------------------------------------------------------------- /Git - AutoTranslator.url: -------------------------------------------------------------------------------- 1 | [InternetShortcut] 2 | URL=https://github.com/GabrielOnDelphi/Delphi-GUI-Auto-Translator 3 | IDList= 4 | HotKey=0 5 | IconFile=C:\Users\trei\AppData\Local\Mozilla\Firefox\Profiles\daecy5hr.default-release\shortcutCache\mxLha2rNozye8wktmQK3fQ==.ico 6 | IconIndex=0 7 | -------------------------------------------------------------------------------- /Git - LightSaber-Core.URL: -------------------------------------------------------------------------------- 1 | [InternetShortcut] 2 | URL=https://github.com/GodModeUser/Delphi-LightSaber-CoreLib 3 | IDList= 4 | HotKey=0 5 | IconFile=C:\Users\GabrielMoraru\AppData\Local\Mozilla\Firefox\Profiles\daecy5hr.default-release\shortcutCache\Hf+2Ez4ryR4cq9N3OZ6n2w==.ico 6 | IconIndex=0 7 | -------------------------------------------------------------------------------- /Git - LightSaber-GUI AutoSave demo.URL: -------------------------------------------------------------------------------- 1 | [InternetShortcut] 2 | URL=https://github.com/GodModeUser/Dephi-LightSaber-GUI_AutoSave 3 | IDList= 4 | HotKey=0 5 | IconFile=C:\Users\GabrielMoraru\AppData\Local\Mozilla\Firefox\Profiles\daecy5hr.default-release\shortcutCache\sfTptsCN1bQlNo+mtgBxxg==.ico 6 | IconIndex=0 7 | -------------------------------------------------------------------------------- /Git - LightSaber-Log.URL: -------------------------------------------------------------------------------- 1 | [InternetShortcut] 2 | URL=https://github.com/GodModeUser/Delphi-LightSaber-LogLib 3 | IDList= 4 | HotKey=0 5 | IconFile=C:\Users\GabrielMoraru\AppData\Local\Mozilla\Firefox\Profiles\daecy5hr.default-release\shortcutCache\Aq+iScZSSco9aroAPY0S6A==.ico 6 | IconIndex=0 7 | -------------------------------------------------------------------------------- /HardwareID/HardwareIDExtractor.DLL.lnk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/HardwareID/HardwareIDExtractor.DLL.lnk -------------------------------------------------------------------------------- /HardwareID/HardwareIDExtractorC.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/HardwareID/HardwareIDExtractorC.dll -------------------------------------------------------------------------------- /HardwareID/HardwareIDExtractorPas.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/HardwareID/HardwareIDExtractorPas.dll -------------------------------------------------------------------------------- /LightCore.dpk: -------------------------------------------------------------------------------- 1 | package LightCore; 2 | 3 | {$R *.res} 4 | {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users} 5 | {$ALIGN 2} 6 | {$ASSERTIONS ON} 7 | {$BOOLEVAL OFF} 8 | {$DEBUGINFO OFF} 9 | {$EXTENDEDSYNTAX ON} 10 | {$IMPORTEDDATA ON} 11 | {$IOCHECKS ON} 12 | {$LOCALSYMBOLS ON} 13 | {$LONGSTRINGS ON} 14 | {$OPENSTRINGS ON} 15 | {$OPTIMIZATION OFF} 16 | {$OVERFLOWCHECKS ON} 17 | {$RANGECHECKS ON} 18 | {$REFERENCEINFO ON} 19 | {$SAFEDIVIDE OFF} 20 | {$STACKFRAMES ON} 21 | {$TYPEDADDRESS OFF} 22 | {$VARSTRINGCHECKS ON} 23 | {$WRITEABLECONST OFF} 24 | {$MINENUMSIZE 1} 25 | {$IMAGEBASE $400000} 26 | {$DEFINE DEBUG} 27 | {$ENDIF IMPLICITBUILDING} 28 | {$DESCRIPTION 'LightSaber - Core library'} 29 | {$LIBSUFFIX AUTO} 30 | {$RUNONLY} 31 | {$IMPLICITBUILD ON} 32 | 33 | requires 34 | Rtl, 35 | BindEngine, 36 | soaprtl; 37 | 38 | contains 39 | ccRegistry in 'ccRegistry.pas', 40 | ccIO in 'ccIO.pas', 41 | ccCore in 'ccCore.pas', 42 | ccBinary in 'ccBinary.pas', 43 | ccINIFile in 'ccINIFile.pas', 44 | ccCompiler in 'ccCompiler.pas', 45 | ccStreamMem in 'ccStreamMem.pas', 46 | ccStreamBuff in 'ccStreamBuff.pas', 47 | ccStreamBuff2 in 'ccStreamBuff2.pas', 48 | ccTextFile in 'ccTextFile.pas', 49 | ccStreamMem2 in 'ccStreamMem2.pas', 50 | ccStreamFile in 'ccStreamFile.pas', 51 | ccLogUtils in 'ccLogUtils.pas', 52 | ccLogTypes in 'ccLogTypes.pas', 53 | ccLogRam in 'ccLogRam.pas', 54 | ccLogLinesS in 'ccLogLinesS.pas', 55 | ccLogLinesAbstract in 'ccLogLinesAbstract.pas', 56 | ccLogLinesM in 'ccLogLinesM.pas', 57 | ccAppData in 'ccAppData.pas', 58 | ccMath in 'ccMath.pas', 59 | ccPascal in 'ccPascal.pas', 60 | ccPlatformFile in 'ccPlatformFile.pas', 61 | ccEncodeCRC in 'ccEncodeCRC.pas', 62 | ccEncodeMime in 'ccEncodeMime.pas', 63 | ccEncodeXOR in 'ccEncodeXOR.pas', 64 | ccMRU in 'ccMRU.pas', 65 | ccRttiSetToString in 'ccRttiSetToString.pas', 66 | ccStrBuilder in 'ccStrBuilder.pas', 67 | ccStringList in 'ccStringList.pas', 68 | ccStringListA in 'ccStringListA.pas', 69 | ccWrapString in 'ccWrapString.pas', 70 | ccSearchResult in 'ccSearchResult.pas', 71 | ccDownload in 'ccDownload.pas'; 72 | 73 | end. 74 | -------------------------------------------------------------------------------- /LightCore.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/LightCore.res -------------------------------------------------------------------------------- /System/Copyright.txt: -------------------------------------------------------------------------------- 1 | Copyright/Conditions 2 | 3 | Library provided by Gabriel Moraru 4 | 5 | 1. You can use this library for free in your personal/commercial applications as long as you don't modify it. 6 | If you modify/update/extend/change/improve this library you MUST share your modifications with the rest of the world. 7 | The only place where you can share the changes to the library, is here, on GitHub ( https://github.com/AdminUser0/Delphi-LightSaber/ ) 8 | 2. Keep this original copyright notice so people would know that the library is free. 9 | 3. This library cannot be used in applications/platforms that promote illegal/immoral activities such as (but not limited to) hate/piracy/racism/pseudo-science (including anti-vaccine and flat earth). 10 | 4. The owner of the library reserves the right to update/change these conditions at any time. 11 | 5. This library cannot be used in Russia. The ban applies 25 years after the Russia-Ukraine war ends. 12 | 6. The library name cannot be changed. 13 | 14 | Note: 15 | Most parts of this library were written by myself. Some other parts (small snippets) were inspired or simply copied from miscellaneous Internet sources (mostly StackOverflow). A link to the original source was provided in this case. 16 | -------------------------------------------------------------------------------- /System/Credits.lnk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/System/Credits.lnk -------------------------------------------------------------------------------- /System/video_player_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/System/video_player_icon.png -------------------------------------------------------------------------------- /ccCompiler.pas: -------------------------------------------------------------------------------- 1 | UNIT ccCompiler; 2 | 3 | {============================================================================================================= 4 | Gabriel Moraru 5 | 2024.05 6 | www.GabrielMoraru.com 7 | See Copyright file 8 | -------------------------------------------------------------------------------------------------------------- 9 | 10 | Compiler version definitions 11 | https://docwiki.embarcadero.com/RADStudio/Sydney/en/Compiler_Versions 12 | =============================================================================================================} 13 | 14 | INTERFACE 15 | 16 | { $I Frameworks.inc} 17 | 18 | CONST 19 | Delphi_Athenes = 36.0; // Product Version: 29 Delphi 12 20 | Delphi_Alexa = 35.0; // Product Version: 28 Delphi 11 21 | Delphi_Sydney = 34.0; // Product Version: 27 Delphi 10.4 22 | Delphi_Rio = 33.0; // Product Version: 26 Delphi 10.3 23 | Delphi_Tokyo = 32.0; // Product Version: 25 Delphi 10.2 24 | Delphi_Berlin = 31.0; // Product Version: 24 Delphi 10.1 25 | Delphi_Seattle = 30.0; // Product Version: 23 Delphi 10 26 | Delphi_XE8 = 29.0; // Product Version: 22 27 | Delphi_XE7 = 28.0; // Product Version: 21 28 | Delphi_XE6 = 27.0; // Product Version: 20 29 | Delphi_XE5 = 26.0; // Product Version: 19 30 | Delphi_XE4 = 25.0; // Product Version: 18 31 | Delphi_XE3 = 24.0; // Product Version: 17 32 | Delphi_XE2 = 23.0; // Product Version: 16 33 | Delphi_XE = 22.0; // Product Version: 15 34 | Delphi_2010 = 21.0; 35 | Delphi_2009 = 20.0; 36 | Delphi_2007 = 18.5; 37 | Delphi_2006 = 18.0; 38 | Delphi_2005 = 17.0; 39 | Delphi_8Net = 16.0; 40 | Delphi_7 = 15.0; 41 | 42 | (* 43 | Example of usage: 44 | 45 | {$IF RTLVersion > Delphi_7} 46 | Result := 'Modern Delphi'; 47 | {$ELSE} 48 | Result := 'Old Delphi'; 49 | {$ENDIF} 50 | *) 51 | 52 | 53 | IMPLEMENTATION 54 | 55 | (* 56 | Other alternatives: 57 | 58 | {$IFDEF VER350} 59 | Result := 'Delphi Alexa'; 60 | {$ELSE} 61 | Result := 'Older Delphi'; 62 | {$ENDIF} 63 | 64 | https://docwiki.embarcadero.com/RADStudio/Athens/en/Conditional_compilation_(Delphi) 65 | *) 66 | 67 | end. 68 | -------------------------------------------------------------------------------- /ccEncodeXOR.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GabrielOnDelphi/Delphi-LightSaber/26e0d3d0e8e5db5e64d54bb14aa74c1ff33ccb49/ccEncodeXOR.pas -------------------------------------------------------------------------------- /ccLogTypes.pas: -------------------------------------------------------------------------------- 1 | UNIT ccLogTypes; 2 | 3 | {============================================================================================================= 4 | Gabriel Moraru 5 | 2024.05 6 | www.GabrielMoraru.com 7 | See Copyright file 8 | 9 | A simple but effective visual log control/library. 10 | The programmer can send messages to the log that will be shown or not, depending on the chousen verbosity level of the log (see Verbosity property). 11 | **Visual/Non-visual** 12 | There is a non-visual log (TRamLog) and a visual log (TRichLog). The idea is that your non-visual objects can send data to the non-viusal log, for example in a batch job. At the end of the batch all collected messages can be shown in the visual log. 13 | Alternativelly, if you connect the TRamLog to the visual log, the messages are shown in real time, as the batch job progreeses. 14 | There is a pre-defined form that holds the log. To show it, call CreateLogForm in FormLog.pas 15 | The purpose is to have one single log window per application that will receive messages from the entire application. 16 | **Verbosity:** 17 | Supports several verbosity levels (verbose, info, warnings, errors, etc). 18 | Receives only messages that are above the specified verbosity threshold. 19 | For example, if the log is set to show only warnings and errors and you send a messages marked as "verbose", then the messages will not be shown. 20 | Each verbosity level has a predefined color. 21 | **I/O** 22 | The log can be save to disk to a binary file so it can be restored when the next app startup. 23 | Tester: 24 | c:\Myprojects\LightSaber\Demo\LightLog\ 25 | =============================================================================================================} 26 | 27 | INTERFACE 28 | { $I Frameworks.inc} 29 | 30 | USES 31 | System.SysUtils; 32 | { 33 | System.UITypes, 34 | ccLogTypes, ;} 35 | 36 | TYPE 37 | TLogVerbLvl= (lvDebug, lvVerbose, lvHints {Default}, lvInfos, lvImportant, lvWarnings, lvErrors); { Exist also 7 which is of type 'Msg' and it is always shown in log } 38 | 39 | CONST 40 | DefaultVerbosity= lvInfos; 41 | 42 | function Verbosity2String(Verbosity: TLogVerbLvl): string; 43 | 44 | 45 | IMPLEMENTATION 46 | 47 | 48 | function Verbosity2String(Verbosity: TLogVerbLvl): string; 49 | begin 50 | case Verbosity of 51 | lvDebug : Result := 'Debug'; 52 | lvVerbose : Result := 'Verbose'; 53 | lvHints : Result := 'Hints'; 54 | lvInfos : Result := 'Info'; { This is the default level of verbosity } 55 | lvImportant : Result := 'Important'; 56 | lvWarnings : Result := 'Warnings'; 57 | lvErrors : Result := 'Errors'; 58 | else 59 | RAISE Exception.Create('Invalid verbosity'); 60 | end; 61 | end; 62 | 63 | 64 | 65 | end. 66 | -------------------------------------------------------------------------------- /ccLogUtils.pas: -------------------------------------------------------------------------------- 1 | UNIT ccLogUtils; 2 | 3 | {============================================================================================================= 4 | 2025.03 5 | www.GabrielMoraru.com 6 | =============================================================================================================} 7 | 8 | INTERFACE 9 | 10 | 11 | 12 | // Vcl.Graphics, 13 | 14 | 15 | 16 | 17 | IMPLEMENTATION 18 | 19 | 20 | 21 | 22 | end. 23 | -------------------------------------------------------------------------------- /ccMRU.pas: -------------------------------------------------------------------------------- 1 | UNIT ccMRU; 2 | 3 | {============================================================================================================= 4 | 2025 5 | www.GabrielMoraru.com 6 | ============================================================================================================== 7 | 8 | MRU 9 | A list of the 'Most Recent Used' files. 10 | 11 | Also see: 12 | \Third party packages\Mru.pas 13 | AddFile2TaskbarMRU in LightCom.Shell.pas 14 | 15 | =============================================================================================================} 16 | 17 | INTERFACE 18 | USES System.SysUtils, System.Classes, System.AnsiStrings; 19 | 20 | TYPE 21 | TMRUList = class(TObject) 22 | protected 23 | FMaxItems: Integer; 24 | FIniFile : string; 25 | FChanged: TNotifyEvent; 26 | procedure SetMaxItems(Value: integer); 27 | procedure setFileName(Value: string); 28 | public 29 | List: TStringList; 30 | constructor Create; 31 | destructor Destroy; override; 32 | function AddToMRU(aFileName: string): Boolean; // Adds a new file to the MRU list 33 | property FileName : string read FIniFile Write setFileName; // Where we save the list? 34 | property MaxItems : integer read FMaxItems Write SetMaxItems; 35 | property OnChanged: TNotifyEvent read FChanged write FChanged; // Event triggered when the MRU list changes 36 | end; 37 | 38 | 39 | IMPLEMENTATION 40 | 41 | 42 | {-------------------------------------------------------------------------------------------------- 43 | 44 | --------------------------------------------------------------------------------------------------} 45 | constructor TMRUList.Create; 46 | begin 47 | inherited Create; 48 | FMaxItems:= 16; 49 | List:= TStringList.Create; 50 | end; 51 | 52 | 53 | destructor TMRUList.Destroy; 54 | begin 55 | FreeAndNil(List); 56 | inherited; 57 | end; 58 | 59 | 60 | 61 | 62 | {-------------------------------------------------------------------------------------------------- 63 | 64 | --------------------------------------------------------------------------------------------------} 65 | procedure TMRUList.setFileName(Value: string); 66 | begin 67 | FIniFile:= Value; 68 | if FileExists(FIniFile) then 69 | begin 70 | List.LoadFromFile(FIniFile); 71 | if Assigned(FChanged) 72 | then FChanged(Self); 73 | end; 74 | end; 75 | 76 | 77 | procedure TMRUList.SetMaxItems(Value: integer); 78 | begin 79 | FMaxItems:= Value; 80 | WHILE List.Count> FMaxItems 81 | DO List.Delete(List.Count-1); 82 | if FIniFile<> '' 83 | then List.SaveToFile(FIniFile); 84 | end; 85 | 86 | 87 | { Returns True if the file already existed in list } 88 | function TMRUList.AddToMRU(aFileName: string): Boolean; 89 | VAR i: Integer; 90 | begin 91 | Result:=FALSE; 92 | if FileExists(aFileName) then 93 | begin 94 | List.Insert(0, aFileName); 95 | for i:= List.Count-1 downto 1 DO 96 | if CompareText(List.Strings[i], aFileName)= 0 97 | then 98 | begin 99 | List.Delete(i); 100 | Result:= TRUE; 101 | end; 102 | SetMaxItems(FMaxItems); 103 | if Assigned(FChanged) then FChanged(Self); 104 | end; 105 | end; 106 | 107 | 108 | end. 109 | -------------------------------------------------------------------------------- /ccStrBuilder.pas: -------------------------------------------------------------------------------- 1 | UNIT ccStrBuilder; 2 | 3 | {============================================================================================================= 4 | 2023.01 5 | www.GabrielMoraru.com 6 | See Copyright file 7 | ============================================================================================================== 8 | 9 | Replacement for TStringBuilder which can be slow. 10 | 360 times faster than Result:= Result + s[i]. 11 | 12 | ------------------------ 13 | 14 | Speed test: 15 | 500x loop; 16 | test file: TesterForm.pas 2.7K; 17 | wrap after 20 chars; 18 | 19 | This -> 31ms 20 | SysUtils.WrapText -> 484ms 21 | Result:= Result+ s[i] -> 5788ms 22 | 23 | If you want to make it even faster, integrate it directly in your code. Example in ccCore.RemoveNumbers 24 | ------------------------ 25 | 26 | Also exists: 27 | System.SysUtils.WrapText 28 | It will nicely wrap the text by words, like in a Word document. 29 | This means that some lines will be shorter than MaxRowLenght intentionally in order to keep the words unbreaked. 30 | BUT it wraps the text also when it encounters a separator char (like space). 31 | If the separator is not encountered, the text is never wrapped !! 32 | So, it is great for splitting actual "text" (like in books) hence its name, and not "strings". 33 | 34 | =============================================================================================================} 35 | 36 | INTERFACE 37 | 38 | TYPE 39 | TCStringBuilder = class(TObject) 40 | private 41 | s: string; 42 | CurBuffLen, BuffPos: Integer; 43 | public 44 | BuffSize: Integer; 45 | constructor Create(InitialBuffSize: Integer= 10000); 46 | procedure AddChar(Ch: Char); 47 | procedure AddEnter; 48 | 49 | function AsText: string; 50 | procedure Clear; 51 | end; 52 | 53 | 54 | 55 | IMPLEMENTATION 56 | 57 | 58 | 59 | constructor TCStringBuilder.Create(InitialBuffSize: Integer= 10000); 60 | begin 61 | BuffSize:= InitialBuffSize; 62 | Clear; 63 | end; 64 | 65 | 66 | procedure TCStringBuilder.Clear; 67 | begin 68 | BuffPos:= 1; 69 | CurBuffLen:= 0; 70 | s:= ''; 71 | end; 72 | 73 | 74 | 75 | 76 | 77 | 78 | function TCStringBuilder.AsText: string; 79 | begin 80 | SetLength(s, BuffPos-1); { Cut down the pre-allocated buffer that we haven't used } 81 | Result:= s; 82 | end; 83 | 84 | 85 | procedure TCStringBuilder.AddChar(Ch: Char); 86 | begin 87 | if BuffPos > CurBuffLen then 88 | begin 89 | SetLength(s, CurBuffLen+ BuffSize); 90 | CurBuffLen:= Length(s) 91 | end; 92 | 93 | s[BuffPos]:= Ch; 94 | Inc(BuffPos); 95 | end; 96 | 97 | 98 | procedure TCStringBuilder.AddEnter; 99 | begin 100 | if BuffPos+1 > CurBuffLen then { +1 because we enter two characters into the string instead of 1 } 101 | begin 102 | SetLength(s, CurBuffLen+ BuffSize); 103 | CurBuffLen:= Length(s) 104 | end; 105 | 106 | s[BuffPos ]:= #13; //CR 107 | s[BuffPos+1]:= #10; //LF 108 | 109 | Inc(BuffPos, 2); 110 | end; 111 | 112 | 113 | end. 114 | -------------------------------------------------------------------------------- /ccStringListA.pas: -------------------------------------------------------------------------------- 1 | UNIT ccStringListA; 2 | 3 | {============================================================================================================= 4 | 2023.01 5 | www.GabrielMoraru.com 6 | See Copyright file 7 | ============================================================================================================== 8 | 9 | Ansi StringList class 10 | 11 | =============================================================================================================} 12 | 13 | INTERFACE 14 | 15 | USES 16 | System.SysUtils, System.Types, System.AnsiStrings, Generics.Collections; 17 | 18 | TYPE 19 | { ANSI TStringList } 20 | AnsiTSL = TList; 21 | TAnsiTSL= class(AnsiTSL) 22 | private 23 | function GetTextStr: AnsiString; 24 | procedure SetTextStr(const Value: AnsiString); 25 | public 26 | property Text: AnsiString read GetTextStr write SetTextStr; 27 | end; 28 | 29 | 30 | 31 | IMPLEMENTATION 32 | 33 | 34 | 35 | procedure TAnsiTSL.SetTextStr(const Value: AnsiString); 36 | var 37 | P, Start, LB: PAnsiChar; 38 | S: AnsiString; 39 | LineBreakLen: Integer; 40 | begin 41 | Clear; 42 | P := Pointer(Value); 43 | if P <> nil then 44 | if CompareStr(#13#10, sLineBreak) = 0 then 45 | begin 46 | // This is a lot faster than using StrPos/AnsiStrPos when LineBreak is the default (#13#10) 47 | while P^ <> #0 do 48 | begin 49 | Start := P; 50 | while not (P^ in [#0, #10, #13]) do Inc(P); 51 | SetString(S, Start, P - Start); 52 | Add(S); 53 | if P^ = #13 then Inc(P); 54 | if P^ = #10 then Inc(P); 55 | end; 56 | end 57 | else 58 | begin 59 | LineBreakLen := Length(#13#10); 60 | while P^ <> #0 DO 61 | begin 62 | Start := P; 63 | LB := System.AnsiStrings.AnsiStrPos(P, PAnsiChar(#13#10)); 64 | WHILE (P^ <> #0) AND (P <> LB) 65 | DO Inc(P); 66 | SetString(S, Start, P - Start); 67 | Add(S); 68 | if P = LB 69 | then Inc(P, LineBreakLen); 70 | end; 71 | end; 72 | end; 73 | 74 | 75 | function TAnsiTSL.GetTextStr: AnsiString; 76 | var 77 | I, L, Size: Integer; 78 | P: PAnsiChar; 79 | S, LB: AnsiString; 80 | begin 81 | //Count := GetCount; 82 | Size := 0; 83 | LB := #13#10; 84 | for I := 0 to Count - 1 do Inc(Size, Length(Self[I]) + Length(LB)); 85 | SetString(Result, nil, Size); 86 | P := Pointer(Result); 87 | for I := 0 to Count - 1 do 88 | begin 89 | S := Self[I]; 90 | L := Length(S); 91 | if L <> 0 then 92 | begin 93 | System.Move(Pointer(S)^, P^, L * SizeOf(Char)); 94 | Inc(P, L); 95 | end; 96 | L := Length(LB); 97 | if L <> 0 then 98 | begin 99 | System.Move(Pointer(LB)^, P^, L * SizeOf(Char)); 100 | Inc(P, L); 101 | end; 102 | end; 103 | end; 104 | 105 | 106 | end. 107 | 108 | --------------------------------------------------------------------------------