Delphi相談室(中級者以上)その12
■ このスレッドは過去ログ倉庫に格納されています
0157156のコードです
NGNGuses DsgnIntf, Graphics;
const clNone = TColor(-1);
type TColorNone =TColor;
TColorNoneProperty = class( TColorProperty)
public
function GetValue: string; override;
procedure SetValue(const Value: string); override;
end;
procedure Register;
implementation
uses Sysutils;
const clNoneStr='clNone';
function TColorNoneProperty.GetValue: string;
begin
if GetOrdValue = clNone then Result :=clNoneStr
else Result := ColorToString(TColor(GetOrdValue));
end;
procedure TColorNoneProperty.SetValue(const Value: string);
begin
if AnsiSameText(Value,clNoneStr) then SetValue('$'+IntToHex(clNone,8))
else inherited SetValue(Value);
end;
procedure Register;
begin RegisterPropertyEditor(TypeInfo(TColorNone), nil, '', TColorNoneProperty);
end;
■ このスレッドは過去ログ倉庫に格納されています