-
Content Count
336 -
Joined
-
Last visited
-
Days Won
4
Everything posted by shineworld
-
I have always used and will always continue to use Delphi, as long as I am allowed in the company. Other languages and IDE environments have been added but it will be out of affection, I find the Delphi one very friendly, complex to the point and with things that are really needed. Of course, this depends a lot on the scope of the software, but in mine it is perfectly apt, where other environments become scattershot (too many things and not congruent with each other). What I admire about the Delphi RAD developers is their dedication. It has been dozens of years, that despite the fact that for many it is an outdated environment and language that they are dedicated to keeping it active, to meet new needs, limited as they all are by budget problems. But Delphi is still alive, and I easily shame the final products made by other colleagues with “newer” environments. Like everyone I would like to have more and more, and think that every problem it has can be magically solved in a short time, but you know, that is not the case for any of us who develop code for a living. You always look for a compromise between investment availability and goals to be achieved.
-
I'm approaching to install and try Delphi 12.3 in a clean VM. What is the "Eclipse Temurin JDK with Hotspot" version required to be installed before to start Delphi RAD package to enable Android development ?
-
Me too. However all worked fine.
-
What new features would you like to see in Delphi 13?
shineworld replied to PeterPanettone's topic in Delphi IDE and APIs
Import and ability to use common C++ DLL files (eg: OpenCV, VTK, OpenCascade, etc). Actually I use Python4Delphi to get access to some features of these DLL but it is just a workaround. -
Actually I've installaed Eclipse Temurin JDK with Hostspot 17.0.9+9 (x64) and shoud go fine ? PS: I'm used with RAD ISO which does not install JDK so it's necessary to be in the OS before to start. I don't know if web install does things to install also required JDK.
-
The status of "System.SysUtils.Now" timer resolution & accuracy
shineworld replied to Rollo62's topic in RTL and Delphi Object Pascal
Mmmm, I've tried a simple console program in Athens 12: program Project4; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils, System.DateUtils, Winapi.Windows; var I: Integer; T1: Int64; T2: Int64; TD: Double; D1: TDateTime; D2: TDateTime; DiffMs: Int64; Frequency: Int64; function Delay: Integer; var I: Integer; begin Result := 0; for I := 0 to 1000000 do Inc(Result); end; begin FormatSettings.DecimalSeparator := '.'; FormatSettings.ThousandSeparator := ','; try QueryPerformanceFrequency(Frequency); D1 := Now(); QueryPerformanceCounter(T1); Delay; D2 := Now(); QueryPerformanceCounter(T2); TD := (T2 - T1) * 1000 / Frequency; DiffMs := MilliSecondsBetween(D2, D1); Writeln(Format('Now() delta = %d ms', [DiffMs])); Writeln(Format('QueryPerformance delta = %f ms', [TD])); except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end; end. Result: Now() delta = 2 ms QueryPerformance delta = 2.15 ms The Delay is empirical, necessary just to have a little delay. Now() seems to capture 2ms of delta. Increasing delay of 10: Now() delta = 17 ms QueryPerformance delta = 16.42 ms I don't know why they report 1 sec of precision in the documentation, but if it can be so, is terribile, because my OPC UA server timings are based on TDateTime and 1ms of resolutions is already 10 time bigger than OPC-UA tick of 100ns. -
The status of "System.SysUtils.Now" timer resolution & accuracy
shineworld replied to Rollo62's topic in RTL and Delphi Object Pascal
I work only on Windows but to get precise timings (below 1ms of accuracy) I use QueryPerformanceFrequency() and QueryPerformanceCounter(). In case precise timings are not available I switch to timeGetTime() A messy unit is in attachment. PS: You can improve Windwos timeGetTime, gettickcount and sleep (DELPHI IDE does that) with: program XXX; uses System.SysUtils, Winapi.MMSystem, ...; {$R *.res} var TimeCaps: TTimeCaps; NeedToChangeTimerPrecsion: Boolean; begin // starts high precision timer if timeGetDevCaps(@TimeCaps, SizeOf(TTimeCaps)) = TIMERR_NOERROR then NeedToChangeTimerPrecsion := timeBeginPeriod(TimeCaps.wPeriodMin) = TIMERR_NOERROR else NeedToChangeTimerPrecsion := False; // initializes and runs application Application.Initialize; ...; Application.Run; // stops high precision timer if NeedToChangeTimerPrecsion then timeEndPeriod(TimeCaps.wPeriodMin); end. osTimeUtils.pas -
A native VCL, and not Windows-based, TComboBox cotrol. In one application I have hundreds and hundreds of TComboBoxes with values None and then from 1 to 256. I have used many strategies to enter values in these combos but the time required is enormous. The fastest system was to leave them empty, at FormCreate create the fields by hand by searching all TComboBox components ...... and on some PCs it takes almost 3 or more seconds.... // creates components hash and binds component events to code and adds inputs/outputs items C := ComponentCount - 1; for I := 0 to C do begin Component := Components[I]; FComponentsHashManager.Add(Component); if Component is TComboBox then begin with TComboBox(Component) do begin if Pos('InputNum', Name) <> 0 then begin SendMessage(Handle, WM_SETREDRAW, Ord(False), 0); SendMessage(Handle, CB_INITSTORAGE, I_O.MAX_DIGITAL_INPUTS + 1, COMBOBOX_MAX_TEXT_LENGTH * (I_O.MAX_DIGITAL_INPUTS + 1)); for J := 0 to I_O.MAX_DIGITAL_INPUTS do Items.Insert(J, InputsList.Strings[J]); SendMessage(Handle, WM_SETREDRAW, Ord(True), 0); Continue; end; if Pos('OutNum', Name) <> 0 then begin SendMessage(Handle, WM_SETREDRAW, Ord(False), 0); SendMessage(Handle, CB_INITSTORAGE, I_O.MAX_DIGITAL_OUTPUTS + 1, COMBOBOX_MAX_TEXT_LENGTH * (I_O.MAX_DIGITAL_OUTPUTS + 1)); for J := 0 to I_O.MAX_DIGITAL_OUTPUTS do Items.Insert(J, OutputsList.Strings[J]); SendMessage(Handle, WM_SETREDRAW, Ord(True), 0); Continue; end; end; end; ...
-
Delphi 12.3 presentation is cooming 🙂
-
I use UPX by decade without any issue also with Virustotal and installed BitDefender. I guess it expand program in RAM. My 38.681.088 byte exe are compressed with LZMA to 10.189.312 byte with "upx-4.2.2.exe --best --lzma normal-version.exe upx-version.exe"
-
There are other projects, eg: Chandra, Infero, jetLua, LMEngine, etc which are disapeared from git... Are become obsolete and replaced by some newone ?
-
Currently, working is only TLS 1.2, but there is a git to add TLS 1.3 ( https://github.com/JPeterMugaas/TaurusTLS.git ) I've downloaded and checket it but I haven't yet need time to try to extract sources use it... I try then from some weeks (I'm in releasing of current software version).
-
I've downloaded (cloned) Indy repository from github (https://github.com/IndySockets/Indy.git). Manually copied needed file in a source folder of my project. Added that folder in the project search path. Created the class only with code (no IDE objects placement) so I use only custom sources for Indy. This permitted me to add changes and work with latest git repository code, without remove native Indy tools from IDE.
-
What new features would you like to see in Delphi 13?
shineworld replied to PeterPanettone's topic in Delphi IDE and APIs
I use a lot of third-party libraries and exclusively from source so the compiled code grows a lot. I may not have understood what is meant by “code is generated” but it is almost all hand-made code. This also includes compilers of various languages used by the system, for which, yes some of it is auto-generated (I use Gold Parser), but a few thousand lines. The program also different script languages, server types, and there the code grows. Empirically maybe I wrote 40% by hand, the rest is libraries, data, and different versions of UI. -
What new features would you like to see in Delphi 13?
shineworld replied to PeterPanettone's topic in Delphi IDE and APIs
Personally, I held out as long as I could with BDS2006, whose problems I knew very well, which I had circumvented with tricks of all kinds. In the meantime, however, I always updated (purchased) the sucessive versions without ever using them. At a certain point I gave up, as, tired of using third-party libraries to have a partially Unicode program and of the memory limitations imposed by the 32-bit system (I use a lot of memory), I paid the price for years of dormancy and switched to Sydney and now Athens. Developing has become much easier, and all the things added to the language over the years allow me to greatly reduce the time required in going from concept to final code. I have fairly large projects (22 million lines of code) that I compile in both 32-bit and 64-bit, although recently I have been distributing only 64-bit versions, customers stick to the streetcar with their Win7 (it has not been supported by MS for years, and there is no point in persevering). Yes, 32-bit compilation is faster but as you can see from the image a complete build of the project I am working on, it is not that unbearable. The additional cost (twice the time) is worth the effort. -
I've found it, and used, in official page of 7Zip: https://7-zip.org/sdk.html https://www.birtles.org.uk/programming/ It is old, true, but I use it to compress and send data over TCP server/client and works fine for my projects. There is also a, I guess 9.2 version, at: https://github.com/TetzkatLipHoka/LZMA/tree/main
-
Today I'm getting crazy with Delphi Refactor > Rename Field (CTRL + SHIFT + E). Also starting a new IDE with a dummy project of only one variable the rename field get me the error: I don't know because message is in Italian language, but refactor is completly unusable. It notice that interface {B53A87B3-C809-4390-9BE2-6F1C168CF41D} is not registered. Athens 12.2 Patch 2. Any idea about that ?
-
THANKS, I missed this feature ! Now all works fine 🙂 #ITA: grazie mi hai salvato ore ed ore di pena nel dover reinstallare tutto da zero!.
-
How to register a TLB ? I'm used with regsvr32 DLL file but in this case Borland.Studio.Interop.dll don't is compatibile with regsvr32.
-
Ok but probably other things will go wrong with that. Seems that Borland.Studio.Interop interfaces are missing. There is a way to register them again without to reinstall the IDE ?
-
Hi all. There is a way to modify Bitmap contents (actually create content) of a DelphiFMX Image.Bitmap to add a text ? I've tried: bitmap = self.DIOImage.Bitmap bitmap.Width = int(self.DIOImage.Width) bitmap.Height = int(self.DIOImage.Height) bitmap.Clear(0xFF000000) canvas = bitmap.Canvas r = RectF(8 + 15, 10, bitmap.Width - 8, bitmap.Height - 10) ??? canvas.FillText(r, 'Hello World', False, 100, 0, 0, 0) ??? But the image remains EMPTY and doesn't show anything...
-
Seems that Canvas object is not usable in DelphiFMX. c.BeginScene() does not works also passing (None, 0) or any other combination: import delphifmx as fmx img = fmx.Image(None) bmp = img.Bitmap print(f'Initial Image Width : {img.Width}') print(f'Initial Image Height : {img.Height}') print(f'Initial Image.Bitmap Width : {img.Bitmap.Width}') print(f'Initial Image.Bitmap Height : {img.Bitmap.Height}') bmp.Width = 200 bmp.Height = 200 img.Width = bmp.Width img.Height = bmp.Height print(f'Actual Image Width : {img.Width}') print(f'Actual Image Height : {img.Height}') print(f'Actual Image.Bitmap Width : {img.Bitmap.Width}') print(f'Actual Image.Bitmap Height : {img.Bitmap.Height}') c = bmp.Canvas print(f'Canvas Width : {c.Width}') print(f'Canvas Height : {c.Height}') r = fmx.RectF(0.0, 0.0, 100.0, 100.0) c.BeginScene(None, 0) try: pass #c.FillText(r, 'hello', True, 1, [], 'Center', 'Center') finally: c.EndScene() *** Remote Interpreter Reinitialized *** Initial Image Width : 50.0 Initial Image Height : 50.0 Initial Image.Bitmap Width : 0 Initial Image.Bitmap Height : 0 Actual Image Width : 200.0 Actual Image Height : 200.0 Actual Image.Bitmap Width : 200 Actual Image.Bitmap Height : 200 Canvas Width : 200 Canvas Height : 200 Traceback (most recent call last): File "D:\x\develop\qem\cnc_api_client_core_1\python\api_client_fmx_demo\test-001.py", line 30, in <module> c.BeginScene(None, 0) TypeError: "BeginScene" called with invalid arguments. Error: Expected and actual arguments are incompatible >>>
-
python4delphi Add extra components without touch DelphiVCL
shineworld posted a topic in Python4Delphi
So far, when I wanted to add a new UI component to DelphiVCL, I always started from DelphiVCL source, added the new unit with classes and types, and created a “clone” of the package with the new functionality using that instead of DelphiVCL. It works but I would like to “not touch” the original version of DelphiVCL installed by PyPi but only create an extensive module (pyd) with only the new UI controls. At this point I don't know if this can be done. I still understand little about P4D but it seems to me that each new module requires a PyEngine which loads the python DLL and this is already instantiated by DelphiVCL and if I create a new package with my new module and controls I assume there will be conflicts. Is this a viable way ? Is there any way to reuse the egine already created by original DelphiVCL to use it in my custom PYD ? I thank in advance those who will help me to dispel these doubts. Best regards Silverio -
Hi all, I'm trying to convert an old DelphiVCL (python) application to DelphiFMX and I was not able to define the form title icon image. In Project Options I've set Icon resource, as I made with DelphiVCL version: But during the python run the icon is not visible: I've searched for Icon property in TForm and TApplication but not available. There is a way ? Thank you in advance for any suggestion. Best regards.
-
Hello everyone, after years I decided to migrate a big project from Sydney 10.4.2 to Athens 12.2 latest version. Most things went smoothly, others required some work in the code but it works fine. I am left with one problem and one solution to find. In Sydney the default font used was “Tahoma 8” and the entire software was reliant on it and its features, which must often take advantage of every available pixel in the screen. Now when I create a new form or frame or add an object, I always end up with “Segoe UI 9” as the default font which returns text that is wider in width and breaks the continuity of the existing form/frame hundreds for me. How can I make sure that the old “Tahoma 8” is used as the default font during development and execution ? Many controls have multiple fonts and it is nerve-wracking to have to go searching for each “Font” property within them to change them by hand each time. Thank you.