[Solved]Creating custom property editor lazarus / 9-Editor ---------------------------------------------------------------------- AlphaHaxor · 2018-10-19 17:32 I have created a custom object - "ChessPiece" - that has 2 custom string properties: "PieceType" and "PieceOwner". I have tested them by instantiating them and giving their values to label captions and they worked. However I was unable to figure out how to create a property editor so that these properties would appear in object inspector. Would anyone be so kind and help me with this issue? 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 unit ChessPiece; {$mode objfpc}{$H+} interface uses  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ExtCtrls; type  TChessPiece = class(TImage)  private    GetPieceType: string;    GetPieceOwner: string;    procedure SetPieceType(AValue: string);    procedure SetPieceOwner(AValue: string);  public    //TChessPiece properties    property PieceType: string read GetPieceType write SetPieceType;    property PieceOwner: string read GetPieceOwner write GetPieceOwner;  published    //TImage properties    property Align;  property Anchors;    property AutoSize;    property BorderSpacing;    property Center;    property Constraints;    property DragCursor;    property DragMode;    property Enabled;    property OnChangeBounds;  property OnClick;    property OnDblClick;    property OnDragDrop;    property OnDragOver;    property OnEndDrag;    property OnMouseDown;  property OnMouseEnter;    property OnMouseLeave;    property OnMouseMove;    property OnMouseUp;    property OnMouseWheel;    property OnMouseWheelDown;    property OnMouseWheelUp;    property OnPaint;    property OnPictureChanged;    property OnResize;    property OnStartDrag;    property ParentShowHint;    property Picture;    property PopupMenu;    property Proportional;    property ShowHint;    property Stretch;    property Transparent;    property Visible;  end; procedure Register; implementation procedure TChessPiece.SetPieceType(AValue: string);begin  if GetPieceType=AValue then Exit;  GetPieceType:=AValue;end; procedure TChessPiece.SetPieceOwner(AValue: string);begin  if GetPieceOwner=AValue then Exit;  GetPieceOwner:=AValue;end; procedure Register;begin  {$I chesspiece_icon.lrs}  RegisterComponents('Additional',[TChessPiece]);end; end. ---------------------------------------------------------------------- Blaazen · 2018-10-19 17:40 Move those two properties to published section. ---------------------------------------------------------------------- AlphaHaxor · 2018-10-19 18:10 I have done so but the property is nowhere to be found... ---------------------------------------------------------------------- Blaazen · 2018-10-19 18:30 Your component must be part of package which is installed to IDE and you have to rebuild IDE after this change to make those properties appear in OI. ---------------------------------------------------------------------- AlphaHaxor · 2018-10-19 18:32 How do I rebuild IDE? ---------------------------------------------------------------------- howardpc · 2018-10-19 18:44 Use the Package->Open package file (.lpk) or Package-> Open recent package to locate the package containing your component. This opens the Package Editor. Test your package compiles OK using the Compile toolbutton. Then click the Use toolbutton, and Install. The Package Editor will ask if you want to rebuild the IDE in order to install the component. Click OK. ---------------------------------------------------------------------- Blaazen · 2018-10-19 18:48 Tools -> Configure Build Lazarus ... -> Build is another way how to rebuild IDE. But in this case, follow howardpc's advice above. ---------------------------------------------------------------------- AlphaHaxor · 2018-10-19 19:37 Finally! It's working! Thank you for your help. I was scratching my head on this for hours. With this new object I will be able to improve my game significantly. 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 unit ChessPiece; {$mode objfpc}{$H+} interface uses  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ExtCtrls; type  TChessPiece = class(TImage)  private    GetPieceType: string;    GetPieceOwner: string;    GetPieceHasMoved: boolean;    procedure SetPieceType(AValue: string);    procedure SetPieceOwner(AValue: string);    procedure SetPieceHasMoved(AValue: boolean);  public   published    property PieceType: string read GetPieceType write SetPieceType;    property PieceOwner: string read GetPieceOwner write SetPieceOwner;    property PieceHasMoved: boolean read GetPieceHasMoved write SetPieceHasMoved;  end; procedure Register; implementation procedure TChessPiece.SetPieceType(AValue: string);begin  if GetPieceType=AValue then Exit;  GetPieceType:=AValue;end; procedure TChessPiece.SetPieceOwner(AValue: string);begin  if GetPieceOwner=AValue then Exit;  GetPieceOwner:=AValue;end; procedure TChessPiece.SetPieceHasMoved(AValue: boolean);begin  if GetPieceHasMoved=AValue then Exit;  GetPieceHasMoved:=AValue;end; procedure Register;begin  {$I chesspiece_icon.lrs}  RegisterComponents('Additional',[TChessPiece]);end;  end. P.S. The declarations of TImage properties in my previous code were unnecessary as my object already uses TImage as a parent object.