如何订购自定义组件的属性

问题描述 投票:0回答:1

我正在编写一个自定义组件(一个彩色的 BindNavigator) enter image description here 但对于 Hints 子属性,我被屏蔽了。

   TBtnsHints = class (TPersistent)
  private
    FOwner : TColoredBindNavigator;
    FButtonHints : TButtonHints;
    function GetHint(const index : Integer) : String;
    function HintisStored(const index: Integer) : Boolean;
    procedure SetHint(const index : Integer; const Value : String) ;
   public
    constructor Create(aOwner : TColoredBindNavigator);
    destructor Destroy; override;
  published
    property _1First : String index 0 read GetHint write SetHint stored HintisStored;
    property _2Prior : String index 1 read GetHint write SetHint stored HintisStored;
    property _3Next : String index 2 read GetHint write SetHint stored HintisStored;
    property _4Last : String index 3 read GetHint write SetHint stored HintisStored;
    property _5Insert : String index 4 read GetHint write SetHint stored HintisStored;
    property _6Delete : String index 5 read GetHint write SetHint stored HintisStored;
    property _7Edit : String index 6 read GetHint write SetHint stored HintisStored;
    property _8Post : String index 7 read GetHint write SetHint stored HintisStored;
    property _9Cancel : String index 8 read GetHint write SetHint stored HintisStored;
    property __0Refresh : String index 9 read GetHint write SetHint stored HintisStored;
    property __1ApplyUpdate : String index 10 read GetHint write SetHint stored HintisStored;
    property __2CancelUpdate : String index 11 read GetHint write SetHint stored HintisStored;
  end;

我想要一个逻辑顺序('第一','先前',......,'取消更新') 我发现的唯一方法是使用前缀“_n”,但我发现这并不令人满意。 有没有办法实现这个目标?

firemonkey
1个回答
0
投票

属性按照声明的顺序传入/传出 DFM。但是,对象检查器按字母顺序显示属性,您无法更改它。

© www.soinside.com 2019 - 2024. All rights reserved.