TNamedIntegerPropEdit: Property Editor for ordinal (Integer, Longint etc.) properties.

Download

Adds an additional feature to standard TIntegerProperty Property Editor. It permits user to select value from a drop-down list of predefined named values (retaining an opportunity to type a value directly into the property edit box); each line in the drop-down list has a form of Name=Value:

Named values for this drop-down list must be supplied by creating your own Property Editor inherited from TNamedIntegerPropEdit and overriding its GetNamedValues method. For example:

    TMyNamedIntegerPropertyEditor = class(TNamedIntegerPropertyEditor)
      function GetNamedValues: string; override;
      end;

GetNamedValues function must return string, containing a list of named values separated by semicolons. For example:

    function TMyNamedIntegerPropertyEditor.GetNamedValues: string;
    begin
    Result:='First=11;Second=22;Third=33'.
    end;

Caution: when registering this Property Editor for some property of a component, you shoud use exact type of the property in RegisterPropertyEditor procedure (for example, don't attempt to use TypeInfo(Integer) for Longint property in Delphi 1 -- it will not work, because in 16-bit Delphi Integer is interpreted as Shortint, not Longint).

If you don't know how to register Property Editors then see:
1) demo supplied (testpe.pas, procedure Register)
2) Delpi Help (Component Writer's Help) -- RegisterPropertyEditor
3) excellent book written by Ray Lischner "Secrets of Delphi 2", Chapter 10.

This Property Editor is freeware. It was tried with Delphi 1 and Delphi 3 but I specifically disclaim any warranties of any kind. You may use this Property Editor for any purpose (commercial or non-commercial), modify it etc. - at your own risk.

Author: Alexander Kopilovitch