-
Content Count
779 -
Joined
-
Last visited
-
Days Won
42
Posts posted by pyscripter
-
-
1 hour ago, David Millington said:We were thinking of writing a blog post about it
Looking forward to reading it!
-
58 minutes ago, Gustav Schubert said:Detail noticed: Order is initially ok, IF the default style is not Windows (but for example Iceberg Classico) and only becomes problematic after switching to another VCL Style (other than Windows).
// order with default VCL style <> Windows, immediately after startup TScrollingStyleHook.TScrollWindow TScrollingStyleHook.TScrollWindow TScrollingStyleHook.TScrollWindow TScrollingStyleHook.TScrollWindow TListView TTreeView // order after switching to VCL style <> Windows TListView TScrollingStyleHook.TScrollWindow TScrollingStyleHook.TScrollWindow TScrollingStyleHook.TScrollWindow TScrollingStyleHook.TScrollWindow TTreeView
( The order we always get with the workaround is the same as the initial order without workaround. )
The question still remains why the change in the order results in the Treeview not receiving the WM_DESTROY message. Why is the order important anyway in this issue?
-
@Vincent Parrett@Attila KovacsI am afraid you are both off-topic. If you want to rant about Vcl, Vcl.Styles, Embarcadero etc. please do it in a new thread.
-
@David MillingtonThe features of Parnassus Debugger are great, but I am getting assertion errors with the Parnassus Debugger and Delphi 10.4.2. I am also getting Index out of bounds errors. These occurred while debugging simple Vcl apps (nothing fancy) and they don't occur in the absence of the Parnassus Debugger.
Is https://quality.embarcadero.com/ the right place to report issues related to the Parnassus Debugger.
- 2
-
The issue results from the TListView being recreated as a response to the CM_STYLECHANGED message (see CustomListView.WndProc).
If you add the following at the top of UMainForm.pas
TListView = class(Vcl.ComCtrls.TListView) protected procedure WndProc(var Message: TMessage); override; end;
with the following implementation
procedure TListView.WndProc(var Message: TMessage); begin if (Message.Msg = CM_STYLECHANGED) then begin if ViewStyle = vsReport then UpdateColumns; end else inherited; end;
the error does not happen. There does not appear to be much point in recreating the ListView, since its handle would have already been recreated, when the form it resides gets recreated. Still it remains a mystery why the recreation of the ListView affects the TreeView!
The memory leak is also prevented by calling RecreateWnd after changing the style.
In the process of debugging, I discovered another Vcl bug: [RSP-33221] CM_STYLEDCHANGE is broadcast twice - Embarcadero Technologies
- 2
-
3 minutes ago, emailx45 said:hi @balabuev
trying just building, no executing Debug or Release: why your project try execute "Powershell later building..."?
hug
You need to remove the build event from the project options. This was stated earlier in this thread.
- 1
-
On 2/24/2021 at 3:26 PM, balabuev said:What is interesting: removing the bottom list view will stop the bug from occurring.
This is indeed weird. In fact, just turning the Visible property of the ListView to False prevents the error.
Some further observations:
- I confirm that WMDestroy is not received by the treeview
- The bug is definitely related to Vcl.Styles. If you change the style to a Vcl.Style and then back to Windows, the error does not occur
- You can prevent the error by calling Treeview.Items.Clear in the FormCloseQuery event handler. Strangely calling RecreateWnd in the same handler also prevents the error.
-
You need to add:
{$I Definition.inc}
to the Demo 31 Unit1.pasIt was accidentally deleted in a recent commit. This is now fixed.
-
@David MillingtonMaybe you could enlighten us as to the nature of the changes that made the Delphi IDE behave better with RD. Are there any lessons to be learnt by Delphi developers?
- 1
-
Delphi 10.4.2 is advertised to be "Remote desktop friendly". Does anyone know what it takes to make Delphi applications remote desktop friendly?
-
Please update to the most recent version.
- Demo7 is fixed.
- I can run Demo31 without any issues.
-
6 minutes ago, balabuev said:I've found the reason. Auto invoke need to be unchecked
This makes sense. "Finish incomplete properties" can be very annoying when combined with "Auto invoke" so it is disabled.
-
-
18 hours ago, vmishka said:To make doubly sure that I don't mess anything up in the future: To arrange to develop 64-bit Windows applications using Python4Delphi, I can go back to the groupproj, change the target to Windows 64-bit for Python270.bpl, PythonVcl270.bpl, and PythonFmx270.bpl and then build each of those individually (no Build All). If I understand correctly, if that is successful, I am good to go (nothing else to install). Is that correct?
No need for any of that, if you are not building applications with run-time packages and most likely you are not. Just change the platform of your project to Win64 and build it.
-
Fixed in version control.
See https://github.com/pyscripter/python4delphi/issues/292
Now SystemExit results in a EPySystemExit exception which can be handled in Delphi code. Process termination is prevented.
- 2
-
3 hours ago, David Heffernan said:We use interfaces to wrap Python objects, and because they are also reference counter, that fits really nicely with the Python ref count.
P4D does something similar with custom variants and the Varpyth unit.
-
3 hours ago, David Heffernan said:I was able to catch SystemExit when I ran a single line of code using PyRun_StringFlags
Which flag do you pass to PyRun_StringFlags?
-
On 2/25/2021 at 1:56 PM, David Heffernan said:in my own wrapper of embedded Python,
Any reason for not using P4D?
-
4 hours ago, zMotoR said:All these decisions are on the Python side. 😞
All of these suggestions can be implemented without modifying your python code.
For example you can just add the suggested code to the PythonEngine.InitScript.
-
@vmishkaYou are using Delphi 10.4 (which is the reason for the problems you are facing). You need to upgrade to 10.4.1 or even better to the just released10.4.2. This is a new installation. You need to download the installer from Registered Products Portal (embarcadero.com)
-
exit() raises the SystemExit exception, which unlike other exceptions, results in process termination before control gets back to Delphi. To prevent process termination you can do one of the following:
- wrap the python code in a try: except SystemExit: as suggested by @fjames above
- "overwrite" the exit method by for example running the following code after the python engine is initialized:
def _exit(): print("exit prevented") __builtins__.exit = _exit import sys sys.exit = _exit del(_exit)
- overwrite the SystemExit exception!
-
1 hour ago, vmishka said:I did not add them to Windows 32-bit
The design time packages are 32-bit so you need to add the paths to the 32-bit target.
The group project contains runtime and designtime packages.
You first need to compile/build the runtime packages for target 32-bits. Optionally and only if you want to build 64-bit applications with runtime package, build 64-bit runtime packages:
- Python270.bpl
- PythonVcl270.bpl
- PythonFmx270.bpl
Then install the Design time packages (these are always 32-bits)
- dclPython270.bpl
- dclPythonVcl270.bpl
- dclPythonFmx270.bpl
-
4 hours ago, Steve Maughan said:I made the mistake of updating as soon as it was released. After installing (all default option) I found it had scrubbed my Win64 component path. The Win32 path is in tact but it'll be a right old pain to manually copy between the two. Also had to re-install OnGuard and Konopka components via GetIt (a modest pain).
I was bitten by this a few times in previous upgrades. This time I knew better...
-
I think a (the) highlight of this release is fixing [RSP-27375] Compiler generates disadvantageous code for try/finally - Embarcadero Technologies. Thanks to @Mahdi Safsafifor coming up with a great suggestion and @Stefan Glienkefor creating the issue and pushing hard for its resolution.
- 5
Window hooking
in Python4Delphi
Posted
See python4delphi/Tutorials/Webinar II at master · pyscripter/python4delphi (github.com)
Both video and source code.