PeterPanettone 157 Posted July 23, 2021 Does anybody know a tool for Delphi 10.4.2 that can inspect the properties of all classes and objects in a Delphi program at run-time? Once there has been such a tool by Marco Cantu: OBJECT DEBUGGER But it seems its development stopped at Delphi 5? Share this post Link to post
pyscripter 689 Posted July 23, 2021 MahdiSafsafi/zControls: zControls (github.com) Share this post Link to post
PeterPanettone 157 Posted July 23, 2021 Thanks, this component looks very interesting. But I was looking for a tool similar to that created by Marco Cantu. Share this post Link to post
PeterPanettone 157 Posted July 23, 2021 I have found the source of the Cantu Tool (officially for Delphi 10 Seattle): https://github.com/marcocantu/ObjectDebugger I Will try if I can compile it in Sydney. Share this post Link to post
PeterPanettone 157 Posted July 23, 2021 Yes, it works in Sydney: I could change the Caption of the TPanel, but not its color. However, just inspecting all the properties is very useful! Share this post Link to post
PeterPanettone 157 Posted July 23, 2021 When closing and then reopening my test project the IDE displayed this error message: I had to click on 'Ignore'. If not, the Designer was not accessible. Then I tried to show the Object Debugger at run-time: procedure TForm1.btn1Click(Sender: TObject); begin pnl1.Color := clYellow; OD.Show; end; But that produces an AV: So, in its current state, the ObjectDebugger is unusable: It would be nice if Marco could fix these bugs. Does anybody have Marco's email address? Share this post Link to post
Nigel Thomas 35 Posted July 24, 2021 3 hours ago, PeterPanettone said: Does anybody have Marco's email address? marco.cantu[at]embarcadero.com. He has contributed to this forum before so may respond to you here. You can find other ways to contact him via his website: https://www.marcocantu.com/ 1 Share this post Link to post
PeterPanettone 157 Posted July 24, 2021 This looks very promising: http://www.greatis.com/delphicb/objinsp/ 1 Share this post Link to post
PeterPanettone 157 Posted July 24, 2021 And it works without bugs in Delphi 10.4.2: Share this post Link to post
Wagner Landgraf 43 Posted July 24, 2021 TMS Scripter has an object inspector control (it's an evolution from the Greatis one): https://www.tmssoftware.com/site/scriptstudiopro.asp. And of course, many other things, a full scripter engine and full IDE. Share this post Link to post
PeterPanettone 157 Posted July 24, 2021 (edited) From the screenshot, I can see that the Objectspector is part of Scripter Studio. But can that ObjectInspector also be used as a component in your application? Edited July 24, 2021 by PeterPanettone Share this post Link to post
Anders Melander 1783 Posted July 24, 2021 4 hours ago, Wagner Landgraf said: TMS Scripter has an object inspector control (it's an evolution from the Greatis one) Are you sure about that? I believe TMS purchased their run-time design controls (OI, form designer, etc) from some Chinese gentleman. AFAIK the same person that was the author of the K-Wizard controls. I'm using his original controls in my Resource Editor: Share this post Link to post
Wagner Landgraf 43 Posted July 25, 2021 8 hours ago, PeterPanettone said: From the screenshot, I can see that the Objectspector is part of Scripter Studio. But can that ObjectInspector also be used as a component in your application? Yes, form designer, object inspector, component combo, all can be used separately. Share this post Link to post
Wagner Landgraf 43 Posted July 25, 2021 4 hours ago, Anders Melander said: Are you sure about that? Well, I was the one who made the agreement directly with Dmitry from Greatis. So yes, pretty sure. 🙂 Share this post Link to post
SwiftExpat 65 Posted July 25, 2021 Also worth mentioning from TMS is with the FNC UI pack you get an object inspector. Note in the documentation it calls out that you are inspecting published properties only. TMS FNC Object Inspector does not populate a tree of the application components, it is just the Inspector. https://www.tmssoftware.com/site/tmsfncuipack.asp?s=fncobjectinspector#features To your original question of all classes and objects, it is worth considering visibility and ownership. The component tree is populated based forms / data modules owned by the application, then components owned by the form. Consider if you are creating components at runtime and the owner is assigned to the form, if not then the component will not be visible. I have used it to inspect some of by business objects, with the condition that the property is published. It also has events so that you can make properties read only at runtime. Take a look through the PDF and see if it fits your needs. If you desire a component tree you could build / buy something like my product, I do not include a license to FNC UI pack, it is a separate purchase. Some youtube videos are available at https://swiftexpat.com that will give you an overview. 1 Share this post Link to post
PeterPanettone 157 Posted July 25, 2021 Important features of a Runtime Inspector would be: • Retrieve any global variables, class field variables • Any non-local expression (!) Share this post Link to post
PeterPanettone 157 Posted July 25, 2021 1 hour ago, SwiftExpat said: my product As you have different Application tabs - how is the connection made between a running Application and your tool? Share this post Link to post
SwiftExpat 65 Posted July 25, 2021 At runtime my component "Marshal" creates a form dedicated for inspection. This is where you inspect and have access to the components. My offline application "Caddie" captures your actions in Marshal and lets you review them later. This is organized by application and is not connected to the runtime copy. Together they make up the Runtime Toolkit. The challenge I attempt to solve is documenting modifications at runtime so you can ensure the correct changes are made in your source code. I like Marco's original tool, but I found myself not remembering what I modified to fix my issue. I appreciate your features requirement clarification, but at this point I only do component inspection. Share this post Link to post
PeterPanettone 157 Posted July 25, 2021 (edited) 5 hours ago, SwiftExpat said: At runtime my component "Marshal" creates a form dedicated for inspection. This is where you inspect and have access to the components. My offline application "Caddie" captures your actions in Marshal and lets you review them later. This is organized by application and is not connected to the runtime copy. Together they make up the Runtime Toolkit. The challenge I attempt to solve is documenting modifications at runtime so you can ensure the correct changes are made in your source code. I like Marco's original tool, but I found myself not remembering what I modified to fix my issue. I appreciate your features requirement clarification, but at this point I only do component inspection. That is an interesting concept. So I suppose in my Application, I would have to insert a small component (or create it dynamically) that creates a form holding the RunTime Inspector and maintains a mutual connection with that form? So when the Inspector asks for a specific (updated) component property or when my app has to change a property value, then this connection gets these things done? Is that correct? Edited July 25, 2021 by PeterPanettone Share this post Link to post
Wagner Landgraf 43 Posted July 25, 2021 11 hours ago, SwiftExpat said: Also worth mentioning from TMS is with the FNC UI pack you get an object inspector That is a different one. There is an object inspector control in FNC UI pack, which is cross-platform, and there is an object inspector in TMS Scripter, which is VCL-only. They have no code in common. Share this post Link to post
SwiftExpat 65 Posted July 26, 2021 (edited) 15 hours ago, PeterPanettone said: I would have to insert a small component (or create it dynamically) that creates a form holding the RunTime Inspector and maintains a mutual connection with that form? This is correct, you can see sample source code on Github here with compiled demos here. The component is a simple button which is appropriate for starting out. In an established application I take the approach to not use any extra space on the form by utilizing an onclick event handler of a label. The FMX sample shows a click 3 times on a label to invoke, similar to the 7 long presses in Android. This design allows you to ifdef out the code for your release and not modify the form. Note the ifdefs in the samples. 15 hours ago, PeterPanettone said: So when the Inspector asks for a specific (updated) component property or when my app has to change a property value, then this connection gets these things done? Is that correct? This is correct. This code maintains the tree of forms, data modules, components. The Inspector loads the component details but is not automatically aware of changes that occur. On the Inspector tab there is a button that always allows you to reload. In general workflow it stays up to date, but depending on what events are assigned on the component you may need to reload. An example would be modifying the align edit1 from center to client, The Inspector updates the align property because it is aware it made the change. The width still shows 100 as in the Inspector because it is unaware of the new width due to alignment. A click on the reload button will force it to load the current values. Edited July 26, 2021 by SwiftExpat Better example case. 1 Share this post Link to post
dummzeuch 1505 Posted July 26, 2021 There is also an object inspector component in the jvcl. 1 Share this post Link to post
Marco Cantu 78 Posted July 27, 2021 On 7/24/2021 at 2:43 AM, Nigel Thomas said: marco.cantu[at]embarcadero.com. He has contributed to this forum before so may respond to you here. You can find other ways to contact him via his website: https://www.marcocantu.com/ Yes, I dwell here from time to time. I'll have a look, I know there are other tools doing the same but I'll update mine, should not be a big deal... time permitting. 1 Share this post Link to post
Marco Cantu 78 Posted August 2, 2021 Just FYI, I've updated my component for 10.4.2: https://blog.marcocantu.com/blog/2021-august-delphi-objectdebugger-updated.html Contributions are welcome... there is ample room for improvements 1 Share this post Link to post
PeterPanettone 157 Posted August 3, 2021 Marco, thank you very much! This is an invaluable debugging tool that saves me a lot of time. Share this post Link to post