Jump to content


Photo

Display complex types


  • Please log in to reply
5 replies to this topic

#1 DeddyH

DeddyH
  • Members
  • 14 posts

Posted 19 May 2016 - 10:16 AM

Hi Boki,

 

this is my first try using NextInspector and I run into several problems. Most urgent: is it possible to register some kind of property editor to edit complex types such as TStrings e.g.?

 

Thank you in advance.



#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 19 May 2016 - 03:46 PM

Hi,

I suggest using ButtonInspectorNode (4th icon in toolbar inside Nodes Editor).

Then, after you add it There is OnButtonClick where you can open dialog (for example with TMemo to edit string). Then, you simply pass Text property back to :

NextInspector61.EndEditing;
NextInspector61.SelectedNode.AsString := MyDialogForEditingStrings.MyMemoControl.StringsText;
or if Inspector is still in edit mode, you can access to the InplaceEdit property:

  if NextInspector61.EditingNode <> nil then
  begin
    NextInspector61.InplaceEdit.Text := s;
  end;
Hope that this helps.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#3 DeddyH

DeddyH
  • Members
  • 14 posts

Posted 19 May 2016 - 05:56 PM

Thank you for your quick reply. Unfortunately there is no EndEditing in my version (the current one, I guess, downloaded yesterday), but a protected method named EndEdit. I already wrote a small cracker class to avoid changing your original source (for assigning text to value when the return-key is pressed). What I would like to get is displaying a different text than the underlying value in case of comlex types (like Delphi's object inspector does), so that e.g. the text "TStrings" is displayed and value contains the text itself.

Anyway, I will try your suggested way.



#4 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 19 May 2016 - 07:27 PM

Hi,

Your installed version is probably v5. In v6 I have added OnGetValue for this purpose, so other Value than one stored in Value property can be used for display.

If you can use v6 this will help.

In v5 I don't have such property but there is also ButtonItem with similar event (OnButtonClick).
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#5 DeddyH

DeddyH
  • Members
  • 14 posts

Posted 19 May 2016 - 07:39 PM

Ah, I installed v6 but didn' t know what this event is for. I will try tomorrow, thank you.



#6 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 19 May 2016 - 09:22 PM

Hi,

I just updated NextInspector with couple of new features and bug fixes. Please re-download if you have time, there is also improvements on OnGetValue too.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users