Book a Demo

Author Topic: How to suppress element properties dialog?  (Read 4758 times)

bachristus

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
How to suppress element properties dialog?
« on: November 19, 2011, 01:12:35 am »
How to suppress element properties dialog when adding new element in project browser using context menu?

I set Repository.SuppressEADialog=true in EA_OnPreNewElement() event handler and it does not suppress ANYTHING!

But when I drag new element from toolbox to a diagram - the properties dialog is suppressed (does not appear).

HE-E-ELP! Please...

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: How to suppress element properties dialog?
« Reply #1 on: November 19, 2011, 01:28:26 am »
I had similar issues with these functions (see here). That was the reason why I did not post anything in a recent thread. Unfortunately one Sparxian put you on that track.

q.
« Last Edit: November 19, 2011, 01:32:11 am by qwerty »

Knut Paulsen

  • EA User
  • **
  • Posts: 82
  • Karma: +1/-0
    • View Profile
Re: How to suppress element properties dialog?
« Reply #2 on: November 22, 2011, 06:34:57 pm »
Hi guys,

I managed to get this to work, but I set the SuppressEADialogs property to true in EA_PostNewElement(), then opened my custom property dialog.

like this:
if (element.Name.StartsWith("Use"))
                    {
                        Repository.SuppressEADialogs = true;
                        KnutForm form = new KnutForm(element);
                        form.Show();
                    }

bachristus

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: How to suppress element properties dialog?
« Reply #3 on: December 07, 2011, 01:00:31 am »
Setting SuppressEADialogs=true in EA_OnPostNewElement() does not suppress default properties dialog when adding new element using Project Browser context menu "Add > Add Element..." item.

Then the 'New Element' form is shown. You can check the 'Open properties dialog on creation' checkbox. Then the new element is created and default properties dialog is shown.

EA_OnPostNewElement() fires AFTER the default properties dialog is shown.

This means that there is no way to suppress default dialog and replace it with a new custom-made one.

Also developer has no access to the 'Open properties dialog on creation' checkbox value. So he cannot decide whether to show his custom dialog or not.

Could anybody suggest any solution to replace the property dialog corectly? :-/
« Last Edit: December 07, 2011, 01:00:50 am by bachristus »