Recently I found that Delphi object inspector displays some properties in grey. Here is an example:
I wonder what does it mean? How such properties are defined? I did not find any differences in definition of let's say DSHostname and ProxyHost. But as you can see DSHostname is displayed normally and ProxyHost in grey.
Here is a relevant declaration of properties in question:
/// <summary>The host to proxy requests through, or empty string to not use a proxy.</summary>
property ProxyHost: string read FProxyHost write FProxyHost;
/// <summary>The port on the proxy host to proxy requests through. Ignored if DSProxyHost isn't set.
/// </summary>
[Default(8888)]
property ProxyPort: Integer read FProxyPort write FProxyPort default 8888;
/// <summary>The user name for authentication with the specified proxy.</summary>
property ProxyUsername: string read FProxyUsername write FProxyUsername;
/// <summary>The password for authentication with the specified proxy.</summary>
property ProxyPassword: string read FProxyPassword write FProxyPassword;
Finally I got a proof that Remy Lebeau was right in his guess. I made a descendant of TDSClientCallbackChannelManager which has published property TestProxyHost. This property does nothing but mirroring ProxyHost in Get and Set. Here is the full code for the component:
unit uTestCallbackChannelManager;
interface
uses
System.SysUtils, System.Classes, Datasnap.DSCommon;
type
TTestCallbackChannelManager = class(TDSClientCallbackChannelManager)
private
function GetTestProxyHost: string;
procedure SetTestProxyHost(const Value: string);
published
property TestProxyHost: string read GetTestProxyHost write SetTestProxyHost;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('Samples', [TTestCallbackChannelManager]);
end;
{ TTestCallbackChannelManager }
function TTestCallbackChannelManager.GetTestProxyHost: string;
begin
Result := ProxyHost;
end;
procedure TTestCallbackChannelManager.SetTestProxyHost(const Value: string);
begin
ProxyHost := Value;
end;
end.
After I installed TTestCallbackChannelManager into component palette I dropped in on a form in a test project.
In Object Inspector the ProxyHost property is displayed in grey and TestProxyHost as normal. Now if I change TestProxyHost then ProxyHost is changed as well. Here is a screenshot:
This means:
The only problem is what logic behind the Property Editor? When the properties become available and how to use them? It looks like the properties are introduced very recently in xe10 or a bit earlier. And Embarcadero provides no documentation about these properties (at least for now I could not find any). But this is a subject of separate question. I suspect that support for these properties has not been tested (or may be not implemented) yet and so they are intended for use in future releases.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With