-
Content Count
778 -
Joined
-
Last visited
-
Days Won
41
Everything posted by pyscripter
-
I suppose it does a bit. FMX is using DirectWrite on Windows, and its graphics engine matches the constructs of DirectX (FMX.Canvas.D2D). One would have to create a VCL abstraction of DirectX that it is similar (possibly identical) to that of FMX. It could be based on Vcl's Direct2DCanvas. That would be useful in porting not just SynEdit but other components from Vcl to FMX and the opposite.
-
- Update your SynEdit to the latest version from TurboPack/SynEdit: SynEdit is a syntax highlighting edit control, not based on the Windows common controls. (github.com) - Look at the SynGen folder. The file Highlighters-HowTo.htm explains the basic steps. You need to create a grammar file and then SynGen.exe will generate your highlighter.
-
Direct2D 1.1 canvas much slower that Direct2D 1.0
pyscripter replied to FPiette's topic in Windows API
I see you are using ID2D1HwndRenderTarget. However your project also refers to Vcl.Direct2D_1 which should be ..\..\Direct2D_1\Vcl.Direct2D_1.pas but that directory is not part of the project. I wonder whether you can share that as well. -
Direct2D 1.1 canvas much slower that Direct2D 1.0
pyscripter replied to FPiette's topic in Windows API
By the way FMX graphics on Windows are based on DirectX and they use the IDXGIDevice stuff (units FMX.Context.DX11 and FMX.Canvas.D2D). -
Direct2D 1.1 canvas much slower that Direct2D 1.0
pyscripter replied to FPiette's topic in Windows API
It has been a while, but did you get a better understanding of the differences in the two approaches and the reasons for the slowness? -
Demo 29 might be of help.
-
Looks like it is looking for python3.3. This is no longer supported. Just check the properties of TPythonEngine. Is UseLastKnownVersion checked?
-
See MaskFPUExceptions · pyscripter/python4delphi Wiki (github.com)
-
Return list from Delphi to python using DelphiWrapper
pyscripter replied to hsauro's topic in Python4Delphi
Something like Module := Import(ModuleName) if Module.__dir__().Contains(FunctionName) then Module.FunctionName() -
Return list from Delphi to python using DelphiWrapper
pyscripter replied to hsauro's topic in Python4Delphi
Wrong assumption. You need to call Free on the Python side or free it from Delphi. You can examine the ownership of a Delphi object in Python using the __owned__ attribute. If __owned__ is true it will be freed automatically. When you wrap objects yourself using DelphiWrappper.Wrap, you can specify the ownership. But here you are returning the object as a function result and you cannot tell who owns the object. Objects returned as function results or by accessing properties are wrapped using Wrap(obj, soReference); -
Return list from Delphi to python using DelphiWrapper
pyscripter replied to hsauro's topic in Python4Delphi
Wrapping of TStrings is fully supported. You can easily turn it into a Python list if needed. Look at Demo 31, python function testTStrings. -
python4delphi Python4Delphi module and Wrapping VCL classes
pyscripter replied to shineworld's topic in Python4Delphi
The TPythonModule is for using Delphi stuff in python scripts. To get started, look at the tutorials and demos. -
One of the new features of Delphi 10.4 was the new TEdgeBrowser component. It is nice. However the downside is that certain steps are needed for the use and delployment of this component: Install Edge WebView2 package via GetIt. This places a Dll called WebView2Loader.dll in the redist directory of Embarcadero studio (one for win32, one for win64). The appropriate WebView2Loader.dll needs to be deployed alongside your executable. (about 300Kb). While developing you can add a post-build event to do that. Now the difficult one was that you had to replace the stable version of Edge, installed and managed by Windows, with the unstable one from the Canary Edge update channel (daily updates). Event if you did that in your own machine, few users would accept it. The new thing, that is not mentioned in the documentation, is that there is a better alternative to the third requirement. You can use the WebView2 Runtime installer which works independently from and does not interfere with your browser, and can be safely deployed in customer sites. Give it a try.
-
Check with https://my.embarcadero.com. If the upgrades are there then they are free.
-
You can use the MultiInstaller. python4delphi/Install at master · pyscripter/python4delphi (github.com)
-
Have a look at this: In addition to SAX parsers you may want to consider XmlLite. XMLLite is a good alternative to SAX on Windows. See the note about push and pull parsers. Similar speed and much easier to program with. And there is a Delphi wrapper (just a single unit to add to your project). In my experience XMLLite was very fast. Microsoft is using XMLLite to parse SVG files.
-
I used it a couple of times and it worked well as far as instrumental profilers go.
-
If you want this done, you may open an issue with this request at the P4D issue tracker, or even better contribute a Pull Request implementing the events you want.
-
'Floating point division by zero' when running script
pyscripter replied to a topic in Python4Delphi
P4D provides the MaskFPUExceptions function for that purpose. -
Your Delphi verion does not support COMMAND
pyscripter replied to TimCruise's topic in Python4Delphi
Do you mean that if you open just one package in Delphi it causes Delphi to freeze? Is it a specific package or any of the packages? Can you reproduce it with a different Delphi installation (possibly in a different computer)? -
Your Delphi verion does not support COMMAND
pyscripter replied to TimCruise's topic in Python4Delphi
This is probably the result of an unstable Delphi installation. There are no similar issue reports in the P4D issue tracker. What happens if you open the packages one by one instead of opening the project group? -
The TMouseEvent is not handled currently by P4D. To see which events can be handled search the source code for "RegisterHandler". You could write some code to handle such events. Please see WrapDelphiEventHandlerTest under the Tests directory for how to do that and if you want submit a PR to add this to P4D.
-
You cant't, at least not easily. The input function writes to stdout the message and then reads from stdin the input. The two operations are separate. You may be able to guess from what was written to sys.stdout last. But what you can do is overwrite builtins.input with your own function.
-
I am sure this is well known but I recently discovered a new way to copy dynamic arrays: var A, B : TArray<Integer>; ... B = A; SetLength(B, Length(B)); ... Test procedure: procedure Test(); var A, B : TArray<Integer>; begin A := [1 , 2, 3]; B := A; SetLength(B, Length(B)); B[1] := 12; Assert(A[1] = 2); Assert(B[1] = 12); end; Of course Copy is simpler, but in my use case I did not want to create a copy unless it was necessary e.g. In one part of the code // create A SetLength(A, L); ... In another part of the code B = A // do stuff with B or store it as an object field If A is not recreated you save the copying operation. Not a big deal...
-
Interesting way to copy dynamic arrays.
pyscripter replied to pyscripter's topic in RTL and Delphi Object Pascal
Try to output a again at the end of your routine.