Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

TLMDPropertyInspector hides properties if more than one component is added

If I add more than one component to a TLMDPropertyInspector then properties derived from type string are hidden.
Is there a possibility to avoid this?

Happy New Year
Johannes

Comments

  • 8 Comments sorted by Votes Date Added
  • I cannot reproduce this issue. Everything works fine:

    type
      TFoo = class(TPersistent)
      private
        FS: string;
      published
        property S: string read FS write SetS;
      end;

    procedure TForm1.Button1Click(Sender: TObject);
    begin
      LMDSimplePropInspector1.Objects.Add(TFoo.Create);
      LMDSimplePropInspector1.Objects.Add(TFoo.Create);
    end;
  • Generally, this is controlled by the praMultiSelect attribute of the property editor. So, some specific properties, which have specialized property editors can be hidden when several objects are added. One example of such kind of properties is TComponent.Name.
  • edited January 2021 Posts: 23Vote Up0Vote Down
    I have a property of a self defined type of string:

    TMyString = type string;

    Type
      TMyObject = class (TPersistent)
        private
          FS: TMyString;
        published
          property S: TMyString read FS write FS;
      end;
  • Strange. It should work. I've checked this case (TMyString = type string) also before answering you last time.
    Can you then create a small demo project and send it to our support email?
  • Okay, trying to build a demo project I recognized that I registered an own property editor for "TMyString". It seems that this is the reason why TMyString property is not shown if I select more than one objects.
  • I sent a demo project to your support email.
  • The solution is to use praMultiSelect attribute:

    function TMyStringPropEditor.GetAttrs: TLMDPropAttrs;
    begin
      Result := [praDialog, praMultiSelect];
    end;
  • This works!
    Thank you for helping me!


Sign In or Register to comment.