Difference between revisions of "IAdeUICallbacks"

m (Lchrisman moved page IAMsgBoxCallback to IAdeUICallbacks: Class name was changed in ADE 4.6)
(rename of interface)
Line 2: Line 2:
 
<< [[Analytica Decision Engine (ADE) API]]
 
<< [[Analytica Decision Engine (ADE) API]]
  
''New to [[What's new in Analytica 4.3?|ADE 4.3]]''
+
''New to [[What's new in Analytica 4.6?|ADE 4.6]]''
  
= interface IAMsgBoxCallback (ADE) =
+
= interface IAdeUICallbacks (ADE) =
  
 
An application can implement this interface (as a COM interface) in order to intercept evaluations of the [[MsgBox]] function in expressions.  This provides an opportunity for a program that uses ADE to display message boxes during evaluation in its interface.   
 
An application can implement this interface (as a COM interface) in order to intercept evaluations of the [[MsgBox]] function in expressions.  This provides an opportunity for a program that uses ADE to display message boxes during evaluation in its interface.   
  
To use this, your program must implement a COM class with the '''ShowMsgBox''' method.  As a COM class, it will implement the '''QueryInterface''' method from ''IUnknown'', and its '''QueryInterface''' method must report that it implements this interface.  You then instantiation an instance of the class and pass a pointer to that object to [[CAEngine::SetCallbackObject]].
+
To use this, your program must implement a COM class with each of the messages, such as the '''MsgBox''' method.  As a COM class, it will implement the '''QueryInterface''' method from ''IUnknown'', and its '''QueryInterface''' method must report that it implements this interface.  You then instantiation an instance of the class and pass a pointer to that object to [[CAEngine::SetCallbackObject]].
 
 
This interface is experimental.  We have not yet successfully figured out how to get C# (or other .NET environment) to create a COM class that implements the interface.  It is included starting with beta build 4.3.0.19 to enable experimentation with this.
 
 
 
Once this is solved, we intend to introduce other callback interfaces.  Your application will then be able to define a single class that implements all the interfaces you are interested in handling, instantiate an instance of it, and pass that to [[CAEngine::SetCallbackObject]] to receive callback messages for all the desired events.
 
  
 
== Methods ==
 
== Methods ==
  
=== LONG ShowMsgBox(string title, string text, long buttons) ===
+
=== LONG MsgBox(string title, string text, long buttons) ===
  
 
Called when the [[MsgBox]] function is evaluated.  You implement this method and can display a message box or other feedback to your end-user.  The return value indicates what button was pressed to terminate the message box, as follows:
 
Called when the [[MsgBox]] function is evaluated.  You implement this method and can display a message box or other feedback to your end-user.  The return value indicates what button was pressed to terminate the message box, as follows:

Revision as of 15:38, 12 May 2015

<< Analytica Decision Engine (ADE) API

New to ADE 4.6

interface IAdeUICallbacks (ADE)

An application can implement this interface (as a COM interface) in order to intercept evaluations of the MsgBox function in expressions. This provides an opportunity for a program that uses ADE to display message boxes during evaluation in its interface.

To use this, your program must implement a COM class with each of the messages, such as the MsgBox method. As a COM class, it will implement the QueryInterface method from IUnknown, and its QueryInterface method must report that it implements this interface. You then instantiation an instance of the class and pass a pointer to that object to CAEngine::SetCallbackObject.

Methods

LONG MsgBox(string title, string text, long buttons)

Called when the MsgBox function is evaluated. You implement this method and can display a message box or other feedback to your end-user. The return value indicates what button was pressed to terminate the message box, as follows:

  • 1 = OK
  • 2 = Cancel
  • 3 = Abort
  • 4 = Retry
  • 5 = Ignore
  • 6 = Yes
  • 7 = No

The «buttons» parameter has the following values:

  • 0 = OK only
  • 1 = OK and Cancel [Default]
  • 2 = Abort, Retry and Ignore
  • 3 = Yes, No and Cancel
  • 4 = Yes and No
  • 5 = Retry and Cancel

which are then added to one of these values:

  • 0 = no icon
  • 16 = Critical
  • 32 = Question
  • 48 = Exclamation
  • 64 = Information
Comments


You are not allowed to post comments.