Object Inspector Information Box lazarus / 31-LCL ---------------------------------------------------------------------- AL · 2021-03-27 23:58 I am trying my hands at my first component/package. I cannot find how to enter the information that is displayed in the object inspector information box for the different properties. Did not see any in some LCL components source that I checked, so I assume it might be in a .res file. Would be much appreciated is someone could point me to a documentation Thanks ---------------------------------------------------------------------- Gustavo 'Gus' Carreno · 2021-03-28 06:41 Hey Al, If I'm not mistaken, it's been a while since I attempted my own component, the object inspector only shows PUBLISHED properties and not PUBLIC. If that's not your case, I'm really sorry to have put my foot in mouth Cheers, Gus ---------------------------------------------------------------------- lucamar · 2021-03-28 07:12 Gus is right, declare as published the properties you want to be able to change in the object inspector and they will appear there once the control/component is installed in the IDE. You can find a little more info in the wiki: How To Write Lazarus Components, Lazarus Packages, etc. ---------------------------------------------------------------------- Gustavo 'Gus' Carreno · 2021-03-28 07:22 Hey Lucamar, Uff, thanks for the save. I wasn't quite sure. Just as a curiosity, does any of those links talk about the PITA that is to register custom editors for the properties that are a bit more complicated than the simple String, Integer, Float, you know, the basic ones? Cuz I'm guessing this would be his next question... Mine was, long time ago, when I tried my own component. Cheers, Gus ---------------------------------------------------------------------- lucamar · 2021-03-28 08:25 Yes, it talks about it though, of course, in a sketchy way. Most properties will fit in any of the miriad of default editors. It's not a piece of cake, granted (nothing ever seems to be in the end, isn't it? ), but it's not so difficult either, at least not for dialog-style editors: descend a class from TPropertyEditor, program it adequately and register it with RegisterPropertyEditor. But, yeah, that's glossing over a few captchas and gotchas you might find yourself mired in ... ---------------------------------------------------------------------- Gustavo 'Gus' Carreno · 2021-03-28 09:09 Hey Lucamar, I think that pretty much sums up my experience with it. Although I'm, now, not completely sure if I popped my cherry on Delphi or Lazarus. I did have to gloss over it when I started the qBittorrent component in Lazarus, but that's about it, a feeling, not a complete memory. I hate being old!!! But yeah, nevermind. @AL: First get the properties you want to edit on published, leave the rest on public and when you don't like the way the IDE let's you edit that property, just follow up on what Lucamar said: Quote from: lucamar on March 28, 2021, 10:25:37 amIt's not a piece of cake, granted (nothing ever seems to be in the end, isn't it? ), but it's not so difficult either, at least not for dialog-style editors: descend a class from TPropertyEditor, program it adequately and register it with RegisterPropertyEditor. Good luck my friend. You gonna need it. Component crafting is more akin to delicate magic than programming Cheers, Gus ---------------------------------------------------------------------- JuhaManninen · 2021-03-28 09:20 Hey guys, AL's question was about the information box in Object Inspector. Clearly his properties are already published. The information box shows documentation for the selected property. IIRC it comes from the XML documentation when available, but can also use a comment line above the property in source code. I am not 100% sure. Please test it yourself. I am applying many documentation patches but I am not involved in building the doc format files. Also it has been a while since I worked on the OI information box code. I should refresh my knowledge... ---------------------------------------------------------------------- lucamar · 2021-03-28 09:53 Quote from: JuhaManninen on March 28, 2021, 11:20:36 amHey guys, AL's question was about the information box in Object Inspector. Clearly his properties are already published. The information box shows documentation for the selected property. [etc] Yeah, I was beginning to suspect that I kind of recall, like you, that it was taken both from the XML help files and source comments, and I was looking for info on it but I don't remember where it came from: the wiki, this forum or somewhere else. And yes, a simple test should show whether we are remembering it right ---------------------------------------------------------------------- Gustavo 'Gus' Carreno · 2021-03-28 10:01 Hey all, Oh crap... Didn't I say that I most likely did a: Foot, meet mouth? Sorry AL for the detour, I'll just shut up  Cheers, Gus ---------------------------------------------------------------------- wp · 2021-03-28 10:13 I once took the time to add popup help to the TAChart package. Just repeated it for the ExCtrls package. These are the steps required: In the package folder create a directory for the xml help files, in my case (exctrls)/fpdoc where (exctrls) stands for the directory of the exctrls package.In the options of the package, go to "IDE Integration" and specify this folder name in the box "FPDoc settings" > "Search paths"Open the FPDoc editor (menu "View"), and move it to a place on the screen so that you always have access to it.Open the unit for which you want to write the documentation, in my case ExButtons.pas. Put the cursor in the source editor on the property to be documented (here: "property Alignment").Since the help file does not yet exist, click "Create help item" in the FPDoc editor. This creates the ExButtons.xml file in the fpdoc folder of the package.In the FPDoc editor, go to line "Short" and write a short description of that property. In my case: "Determines the alignment of the caption within the button (left, right, centered)". You can also add an extended description when you go to tab "Description" of the FPDoc editor, but normally "Short" is enough. In the side bar of the FPDoc editor, you can find some buttons which allow to highlight the selected text in the documentation. Click the Save button of the FPDoc editor.When you now move the mouse of the documented property in the source code editor the popup hint window will immediately show the new documentation text. And this happens also when you select the documented property in the Object Inspector and look at the Information BoxRepeat with the other properties, methods, procedures, declarations etc that you want to document.In principle, a chm help file can be created from the xml documentation files written this way. But so far, I could not find a way to integrate chm files of third- party components into the IDE so that the help appears in the chm reader when F1 is pressed. It looks that this is only possible for LCL and LazUtils. Warning: The FPDoc editor has its own ideas of xml formatting and this easily changes the formatting of the xml descriptions of all properties that it can find. This will create a lot of noise in the version control of the xml help files. I recommend to close the FPDoc editor when it is not needed any more. ---------------------------------------------------------------------- Soner · 2021-03-28 11:03 You don't need xml-files for this. As Juha said make comment above the property or behind in the same line. ---------------------------------------------------------------------- JuhaManninen · 2021-03-28 12:09 Quote from: wp on March 28, 2021, 12:13:11 pmIn principle, a chm help file can be created from the xml documentation files written this way. But so far, I could not find a way to integrate chm files of third- party components into the IDE so that the help appears in the chm reader when F1 is pressed. It looks that this is only possible for LCL and LazUtils. Does it work if you copy the CHM file into the directory known by IDE? With trunk I copied all CHM files to docs/chm directory and it works. I don't even know how the IDE finds them there. It is not configured anywhere. Must be hard-coded. My CHM files include RTL and FCL, they also work. Even the builtin functions like Delete() work now after Mattias fixed it. In the global options there is Help -> External. I have no idea how to use it. QuoteWarning: The FPDoc editor has its own ideas of xml formatting and this easily changes the formatting of the xml descriptions of all properties that it can find. This will create a lot of noise in the version control of the xml help files. I recommend to close the FPDoc editor when it is not needed any more. Yes and the formatting it generates is not nice to read. Somebody should take a project to make the FPDoc's XML output human readable. Sometimes it is useful to view and modify XML by any text editor. ---------------------------------------------------------------------- wp · 2021-03-28 13:00 Quote from: JuhaManninen on March 28, 2021, 02:09:58 pmQuote from: wp on March 28, 2021, 12:13:11 pmIn principle, a chm help file can be created from the xml documentation files written this way. But so far, I could not find a way to integrate chm files of third-party components into the IDE so that the help appears in the chm reader when F1 is pressed. It looks that this is only possible for LCL and LazUtils. Does it work if you copy the CHM file into the directory known by IDE? No. Certainly the new file must be registered somehow. I already had asked this question on the devs mailing list, and somebody had answered that the cml files of LCL, LazUtils, RTL etc are hard-coded, and then I gave up. ---------------------------------------------------------------------- marcov · 2021-03-28 13:10 A bit grepping yields Hardcoded in components\chmhelp\packages/idehelp chmprog.pas:    Result := '$(LazarusDir)/docs/chm;$(LazarusDir)/docs/html'; lazchmhelp.pas:    Result:='$(LazarusDir)/docs/chm;$(LazarusDir)/docs/ html;$(LazarusDir)/docs/html/lcl'; ---------------------------------------------------------------------- JuhaManninen · 2021-03-28 13:34 Ok, not perfect. There should be a way to configure a path for CHM files per package, similar with the current XML file configuration. ---------------------------------------------------------------------- minesadorada · 2021-03-28 14:00 @AL this wiki article may be of some help Example component code Note the comment: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i {     Published declarations (Displayed in the Object Inspector)     Note: Comments immediately above the property declarations are displayed in the Lazarus Object Inspector lower pane }  The ExamplePackage can be installed via OPM ---------------------------------------------------------------------- AL · 2021-03-28 14:03 Thank You All,  comments in code above property is working Is there a way to test a design time component without recompiling the IDE each time a change is made? ---------------------------------------------------------------------- JuhaManninen · 2021-03-28 19:04 Quote from: AL on March 28, 2021, 04:03:28 pmIs there a way to test a design time component without recompiling the IDE each time a change is made? For the design time features you must recompile the IDE. It can be sped up by having a minimal set of packages. Only the packages needed by the IDE itself + your own package. The "BigIde" target used for release builds contains many extra packages. Your component's functionality however can be tested by creating the comp in code and then testing + debugging. That is typically the biggest part of development. ---------------------------------------------------------------------- AL · 2021-03-30 18:40 @Wp Thanks for the complete instructions. I will surely keep that for future use! @minesadorada: Thank you for the examples, this was very usefull.