問題解決請版主刪除. (20分)

  • 主题发起人 主题发起人 leway
  • 开始时间 开始时间
L

leway

Unregistered / Unconfirmed
GUEST, unregistred user!
題目;在自己設計的控件的Color屬性,使用自訂的ColorList? Callback function Proc('clGreen')?哪裡可以看到他裡面的代碼?

TCM = class(TWinControl)
prvate
fcolor : TColor;
publisded
property color: TColor read fColor write fColor;
end;

在Object Inspector的COlOR屬性編輯時,會出現ColorList.
如果想不使用Default的ColorList,使用我自訂的ColorList,該如何實現?
 
听课,我也想知道
 
等待高手解决
 
你应该继承自TList
 
const
Colors: array[0..51] of TIdentMapEntry = (
(Value: clBlack; Name: 'clBlack'),
(Value: clMaroon; Name: 'clMaroon'),
(Value: clGreen; Name: 'clGreen'),
(Value: clOlive; Name: 'clOlive'),
(Value: clNavy; Name: 'clNavy'),
(Value: clPurple; Name: 'clPurple'),
(Value: clTeal; Name: 'clTeal'),
(Value: clGray; Name: 'clGray'),
(Value: clSilver; Name: 'clSilver'),
(Value: clRed; Name: 'clRed'),
(Value: clLime; Name: 'clLime'),
(Value: clYellow; Name: 'clYellow'),
(Value: clBlue; Name: 'clBlue'),
(Value: clFuchsia; Name: 'clFuchsia'),
(Value: clAqua; Name: 'clAqua'),
(Value: clWhite; Name: 'clWhite'),

(Value: clMoneyGreen; Name: 'clMoneyGreen'),
(Value: clSkyBlue; Name: 'clSkyBlue'),
(Value: clCream; Name: 'clCream'),
(Value: clMedGray; Name: 'clMedGray'),

(Value: clActiveBorder; Name: 'clActiveBorder'),
(Value: clActiveCaption; Name: 'clActiveCaption'),
(Value: clAppWorkSpace; Name: 'clAppWorkSpace'),
(Value: clBackground; Name: 'clBackground'),
(Value: clBtnFace; Name: 'clBtnFace'),
(Value: clBtnHighlight; Name: 'clBtnHighlight'),
(Value: clBtnShadow; Name: 'clBtnShadow'),
(Value: clBtnText; Name: 'clBtnText'),
(Value: clCaptionText; Name: 'clCaptionText'),
(Value: clDefault; Name: 'clDefault'),
(Value: clGradientActiveCaption; Name: 'clGradientActiveCaption'),
(Value: clGradientInactiveCaption; Name: 'clGradientInactiveCaption'),
(Value: clGrayText; Name: 'clGrayText'),
(Value: clHighlight; Name: 'clHighlight'),
(Value: clHighlightText; Name: 'clHighlightText'),
(Value: clHotLight; Name: 'clHotLight'),
(Value: clInactiveBorder; Name: 'clInactiveBorder'),
(Value: clInactiveCaption; Name: 'clInactiveCaption'),
(Value: clInactiveCaptionText; Name: 'clInactiveCaptionText'),
(Value: clInfoBk; Name: 'clInfoBk'),
(Value: clInfoText; Name: 'clInfoText'),
(Value: clMenu; Name: 'clMenu'),
(Value: clMenuBar; Name: 'clMenuBar'),
(Value: clMenuHighlight; Name: 'clMenuHighlight'),
(Value: clMenuText; Name: 'clMenuText'),
(Value: clNone; Name: 'clNone'),
(Value: clScrollBar; Name: 'clScrollBar'),
(Value: cl3DDkShadow; Name: 'cl3DDkShadow'),
(Value: cl3DLight; Name: 'cl3DLight'),
(Value: clWindow; Name: 'clWindow'),
(Value: clWindowFrame; Name: 'clWindowFrame'),
(Value: clWindowText; Name: 'clWindowText'));


procedure GetColorValues(Proc: TGetStrProc);
var
I: Integer;
begin
for I := Low(Colors) to High(Colors) do Proc(Colors.Name);
end;


我想看看 Proc('clGreen') 裡面執行的代碼,請問
哪裡可以看到Callback funtion Proc(Colors.Name)裡面的代碼,謝謝!
 
問題解決,請版主刪除此問題.
答案告訴大家,提供大家參考.
Key:仿照TColorProperty重写一个属性编辑器,注册到新元件的Color属性上。
 
好,同意了[:D]
 
楼主真是小气,才20分都不想散
呵呵
 
后退
顶部