Question

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
Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top