1{ 2 ***************************************************************************** 3 See the file COPYING.modifiedLGPL.txt, included in this distribution, 4 for details about the license. 5 ***************************************************************************** 6 7 Property editor for THeaderControl objects 8 9} 10unit HeaderControlPropEdit; 11 12{$MODE OBJFPC}{$H+} 13 14interface 15 16uses 17 Classes, 18 // LCL 19 ComCtrls, 20 // IdeIntf 21 PropEdits, ComponentEditors, ObjInspStrConsts; 22 23type 24 { THeaderControlComponentEditor } 25 26 THeaderControlComponentEditor = class(TComponentEditor) 27 public 28 procedure ExecuteVerb(Index: Integer); override; 29 function GetVerb(Index: Integer): string; override; 30 function GetVerbCount: Integer; override; 31 end; 32 33implementation 34 35 36{ THeaderControlComponentEditor } 37 38procedure THeaderControlComponentEditor.ExecuteVerb(Index: Integer); 39var 40 Hook: TPropertyEditorHook; 41 AHeaderControl: THeaderControl; 42begin 43 if Index = 0 then 44 begin 45 GetHook(Hook); 46 AHeaderControl := GetComponent as THeaderControl; 47 EditCollection(AHeaderControl, AHeaderControl.Sections, 'Sections'); 48 if Assigned(Hook) then Hook.Modified(Self); 49 end; 50end; 51 52function THeaderControlComponentEditor.GetVerb(Index: Integer): string; 53begin 54 Result := ''; 55 if Index = 0 then Result := sccsHCEditSections; 56end; 57 58function THeaderControlComponentEditor.GetVerbCount: Integer; 59begin 60 Result := 1; 61end; 62 63initialization 64 //Register a component editor for THeaderControl 65 RegisterComponentEditor(THeaderControl, THeaderControlComponentEditor); 66 67end. 68