Understanding TADXOlForm events

Add-in Express™ Support Service
That's what is more important than anything else

Understanding TADXOlForm events
 
Andrew Lockwood




Posts: 50
Joined: 2014-12-29
I am struggling to understand TADXOlForm events.

For example, if I create an advanced region on an inspector, then when I open an inspector, the FormCreate event, followed by the OnADXAfterFormShow event is triggered. That makes sense.

When I then close the inspector, the OnADXAfterFormHide event is called, which also makes sense, but then the OnADXAfterFormShow event is called as well! Also, the OnClose event is NOT triggered. Why?

But then it gets even more puzzling. When I open a new inspector, the OnADXAfterFormHide event is triggered before the OnADXAfterFormShow event!

Is there an explanation somewhere about which events are triggered when?

What I am actually trying to do at the moment is to stop the inspector closing until certain conditions have been met. But I cannot seem to work out how to do this from the TADXOlForm. Does the Advanced Region have any means of accessing the properties of the inspector?

Any help would be greatly appreciated!


Andrew
Posted 29 Jan, 2015 14:36:17 Top
Andrei Smolin


Add-in Express team


Posts: 14140
Joined: 2006-05-11
Hello Andrew,

Andrew Lockwood writes:
When I open a new inspector, the OnADXAfterFormHide event is triggered before the OnADXAfterFormShow event!


We cannot confirm this.

Nevertheless, our tests show that for some reason the ADXBeforeInspectorSubpaneClose and FormClose events occur when the new inspector is opened. We've created a case (#6310) in our bug-tracking database. When we fix this, you'll find that case ID in whatsnew.txt. Meanwhile you can use OnADXAfterFormHide instead of FormClose. What do you think?

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 30 Jan, 2015 06:04:29 Top
Andrew Lockwood




Posts: 50
Joined: 2014-12-29
Are you saying that you could not replicate the problem I described?

I have done some more experimentation, using the Layouts D7 sample project. I have deleted the formsmanager entry for Explorers so that the advanced region only shows in Inspectors.

I have then added a ShowMessage command in the OnADXAfterFormShow and OnADXAfterFormHide events.

If I actually compose and send an email, it seems to work OK. However, if I open an Inspector and then close it again without doing anything, then the behaviour I described above occurs.

But on a more general note, is there any documentation about when the various events should occur, and also, is there any way to access the properties of the Inspector in my example from the events of the TADXOlForm?


Andrew
Posted 30 Jan, 2015 09:00:41 Top
Andrei Smolin


Add-in Express team


Posts: 14140
Joined: 2006-05-11
Hello Andrew,

You need to use OutputDebugString instead of ShowMessage because closing a message box produces an extra InspectorActivate event.

Andrew Lockwood writes:
is there any documentation about when the various events should occur


The Outlook reference doesn't provide such a documentation. The Add-in Express manual describes the sequence of events in section Region States and UI-Related Properties and Events, see the PDF file in the folder {Add-in Express}\Docs on your development PC.

Andrew Lockwood writes:
is there any way to access the properties of the Inspector in my example from the events of the TADXOlForm?


Please see the property TADXOlForm.InspectorObj. Note that it is set to nil if the form is shown in an explorer window.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 03 Feb, 2015 07:04:45 Top