Property Grid / object inspector lazarus / 31-LCL ---------------------------------------------------------------------- SaraT · 2023-06-19 20:53 Hi coders How can I hide properties from TIPropertyGrid component? I want to show only a few properties. or, Is there any other custom object inspector component for Lazarus? "TJvInspector" is a good one but for Delphi only :/ Any suggestions are welcome. Thanks in advance. ---------------------------------------------------------------------- JuhaManninen · 2023-06-19 21:50 Quote from: SaraT on June 19, 2023, 10:53:45 pmHow can I add custom properties to a TIPropertyGrid component? I want to show only a few properties. or, Is there any other custom object inspector component for Lazarus? I am not an expert with TTIPropertyGrid but AFAIK it shows existing published properties. You cannot add new properties. ... maybe I misunderstood your question. BTW, the actual Object Inspector used in Lazarus IDE is also a reusable component located in IdeIntf package. ---------------------------------------------------------------------- wp · 2023-06-19 22:17 The TIPropertyGrid has an event OnEditorFilter which you can use to filter the properties to be added to the grid depending on their PropertyEditors. And since a PropertyEditor has a GetName function to return the name of the property handled by it you can use the following code to include or exclude specific properties from the grid: 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 procedure TForm1.TIPropertyGrid1EditorFilter(Sender: TObject;  aEditor: TPropertyEditor; var aShow: boolean);const  ALLOWED_PROPERTY_NAMES: array[0..6] of string = (    'Caption', 'Name', 'Width', 'Height', 'Left', 'Top', 'Align'  );var  propName: String;  allowed: String;begin  propName := aEditor.GetName();  for allowed in ALLOWED_PROPERTY_NAMES do    if propName = allowed then    begin      aShow := true;      exit;    end;  aShow := false;end; See attached demo for filtered properties of a TButton. ---------------------------------------------------------------------- SaraT · 2023-06-19 22:36 Quote from: wp on June 20, 2023, 12:17:55 amSee attached demo for filtered properties of a TButton. Thanks a lot, it worked like a charm. Is it possible to group some properties ? Well, if not, at least I will use your code. Regards ---------------------------------------------------------------------- jamie · 2023-06-19 22:41 This could be shorter  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 procedure TForm1.TIPropertyGrid1EditorFilter(Sender: TObject;  aEditor: TPropertyEditor; var aShow: boolean);begin  aShow:= Boolean(Pos(aEditor.Getname,   'Caption,Name,Width,Height,Left,Top,Align'));end; ---------------------------------------------------------------------- SaraT · 2023-06-20 22:19 Hi @wp @jamie Can you help me please? I would like to group some properties like attached image as reference. Thanks in advanced if anybody has a fast working code or idea. Regards ---------------------------------------------------------------------- jamie · 2023-06-20 23:27 That control is pretty much integrated and I don't see a built in method to sort them list of classes for each row. The ROWS are a TFPLIST object that houses a Class for each row and it does not look like it gives easy access to the list. However,     You could build a group of these PropertyGrids inside a panel all anchored together.    Assign each one the same object you are looking at but have a different filter for each group.    You will end up with getting a scrollbar for each group if the list goes beyond current client per group. If I get time I will see if I can make a demo of what I Am referring to.