Howdy, Stranger!

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

In this Discussion

When to use TLMDClassPropEditor::SetStrValue and when to use SetOrdValue

The example Picture property inspector editor calls SetOrdValue, I'm trying to create a RTFEditor that saves a string to the underlying visual object. Should I use SetStrValue or SetOrdValue?

Using SetStrValue I'm not seeing the result I would expect

Comments

  • 2 Comments sorted by Votes Date Added
  • edited May 28 Posts: 0 Accepted Answer Vote Up0Vote Down
    That's depend of property type your editor is created for. If the property is of string type - then yes, you should call SetStrValue. You can send simple isolated demo project to our support e-mail, I'll look.
  • Thanks. It was actually a TStrings property I'm trying to edit and by looking at the source for your TLMDStringsPropEditor I could see what to do - namely use SetObjectValue:

    procedure TLMDStringsPropEditor.Edit;
    var
      LDlg: TLMDStringsEditorDialog;
    begin
      LDlg := TLMDStringsEditorDialog.Create(Application);
      try
        LDlg.Lines := TStrings(GetObjectValue(0));
        if LDlg.Execute then
          SetObjectValue(LDlg.Lines);
      finally
        LDlg.Free;
      end;
    end;

    Thanks

Sign In or Register to comment.