瀏覽代碼

Register property editors

Damian Diaz 6 年之前
父節點
當前提交
773e018c03
共有 1 個文件被更改,包括 7 次插入3 次删除
  1. 7 3
      bccombobox.pas

+ 7 - 3
bccombobox.pas

@@ -56,10 +56,10 @@ type
     constructor Create(AOwner: TComponent); override;
     constructor Create(AOwner: TComponent); override;
     procedure Clear;
     procedure Clear;
     property HoverItem: integer read FHoverItem;
     property HoverItem: integer read FHoverItem;
-    property Button: TBCButton read FButton write FButton;
-    property ListBox: TListBox read FListBox write FListBox;
     property Text: string read GetItemText;
     property Text: string read GetItemText;
   published
   published
+    property Button: TBCButton read FButton write FButton;
+    property ListBox: TListBox read FListBox write FListBox;
     property Canvas: TCanvas read GetComboCanvas;
     property Canvas: TCanvas read GetComboCanvas;
     property Items: TStrings read GetItems write SetItems;
     property Items: TStrings read GetItems write SetItems;
     property ItemIndex: integer read GetItemIndex write SetItemIndex;
     property ItemIndex: integer read GetItemIndex write SetItemIndex;
@@ -80,11 +80,15 @@ procedure Register;
 
 
 implementation
 implementation
 
 
-uses math, LCLType;
+uses math, LCLType, PropEdits;
 
 
 procedure Register;
 procedure Register;
 begin
 begin
   RegisterComponents('BGRA Controls', [TBCComboBox]);
   RegisterComponents('BGRA Controls', [TBCComboBox]);
+  RegisterPropertyEditor(TypeInfo(TListBox),
+    TBCComboBox, 'ListBox', TClassPropertyEditor);
+  RegisterPropertyEditor(TypeInfo(TBCButton),
+    TBCComboBox, 'Button', TClassPropertyEditor);
 end;
 end;
 
 
 { TBCComboBox }
 { TBCComboBox }