0
我正在創建一個覆蓋畫布繪製函數以繪製圖形狀態面板的自定義組件,我已經將其工作,並且作爲嘗試改進我的代碼的一部分希望將我的顏色存儲在數組中,但是我無法正確地定義數組。pascal聲明2d顏色數組 - 錯誤類型定義
有人可以指點我正確的方向嗎?
type
TOC_StepState = (sst_red, sst_yellow, sst_green);
TOC_StepStatus = class(TCustomPanel)
private
{ Private declarations }
fstatus : TOC_StepState;
innerRect : TRect;
const stateColor : array[TOC_StepState,2] // <<<< fails here
of TColor = ((clRed,clRed,clRed), (clYellow,clYellow,clYellow), (clGreen,clGreen,clGreen));
protected
{ Protected declarations }
procedure Paint;
override;
public
{ Public declarations }
published
{ Published declarations }
property status : TOC_StepState read fstatus write fstatus;
end;