What does an asterisk in the Object Inspector mean?
Asked Answered
C

1

11

In Delphi's object inspector, I see an asterisk behind a property name (ConnectionName*):

Asterisk in object inspector

How does it get there, and above all: what does it mean?

In the sourcecode for TMySQLConnection I don't see anything special, so I guess it's some design-time thing?

update

It has something to do with the contents of the TSQLConnection.

To reproduce, paste the code below on a form.

After some playing around, I conclude that the asterisk appears when the Params property gets edited so that it doesn't have the default values any longer. It's still a mystery to me how this is achieved though.

object SQLConnection1: TSQLConnection
  ConnectionName = 'MySQLConnection'
  DriverName = 'MySQL'
  LoginPrompt = False
  Params.Strings = (
    'DriverUnit=Data.DBXMySQL'

      'DriverPackageLoader=TDBXDynalinkDriverLoader,DbxCommonDriver190.' +
      'bpl'

      'DriverAssemblyLoader=Borland.Data.TDBXDynalinkDriverLoader,Borla' +
      'nd.Data.DbxCommonDriver,Version=19.0.0.0,Culture=neutral,PublicK' +
      'eyToken=91d62ebb5b0d1b1b'

      'MetaDataPackageLoader=TDBXMySqlMetaDataCommandFactory,DbxMySQLDr' +
      'iver190.bpl'

      'MetaDataAssemblyLoader=Borland.Data.TDBXMySqlMetaDataCommandFact' +
      'ory,Borland.Data.DbxMySQLDriver,Version=19.0.0.0,Culture=neutral' +
      ',PublicKeyToken=91d62ebb5b0d1b1b'
    'GetDriverFunc=getSQLDriverMYSQL'
    'LibraryName=dbxmys.dll'
    'LibraryNameOsx=libsqlmys.dylib'
    'VendorLib=LIBMYSQL.dll'
    'VendorLibWin64=libmysql.dll'
    'VendorLibOsx=libmysqlclient.dylib'
    'MaxBlobSize=-1'
    'DriverName=MySQL'
    'HostName='
    'Database='
    'User_Name=xxx'
    'Password='
    'ServerCharSet='
    'BlobSize=-1'
    'ErrorResourceFile='
    'LocaleCode=0000'
    'Compressed=True'
    'Encrypted=False'
    'ConnectTimeout=60')
  Left = 48
  Top = 24
end
Cleareyed answered 17/4, 2014 at 13:17 Comment(6)
Is it because the property is bound by LiveBindings?Shed
I can't reproduce the issue (I don't have MySQL installed, but I tested with SQLite and IBToGo in a new, clean VCL forms app). I don't see an asterisk on any of the properties.Koehn
Live Bindings would be my guess to, but never used it so wouldn't knowKedgeree
My own conclusion now is that the asterisk shows that the params property was edited.Cleareyed
I can confirm that editing anything in Params does show the asterisk. Nice detective work! You should post a self-answer.Koehn
If somebody can explain how this works then I can award points to somebody else. Maybe it's a special property editor? Maybe it's somehow standard functionality, and this occurs in other components too?Cleareyed
S
6

You have appeared to have reverse engineered the meaning of the asterisk. Since I guess you have no source for the design time component code you'll need to rely on such reverse engineering, or any documentation that you can find.

In the comments you wonder how the component could cause the Object Inspector to display the asterisk. In order to do so the component would register a property editor that overrides TPropertyEditor.GetName. By doing so it can return any name it fancies and the Object Inspector will faithfully display that name.

To illustrate I've taken one of my own property editors, and hacked it around like so:

type
  TMinMaxGridColumnProperty = class(TFloatProperty)
  public
    function GetName: string; override;
    ....
  end;

function TMinMaxGridColumnProperty.GetName: string;
begin
  Result := inherited GetName + '*';
end;

And now the properties that are served by this property editor appear like this in the Object Inspector:

enter image description here

So it seems almost certain to me that this is how the component you are working with is effecting this. The design time code will use the state of the component to determine whether or not to append the asterisk.

Shed answered 17/4, 2014 at 16:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.