Difference between revisions of "IAdeUICallbacks"

m
m (Inserted a previous page, so changed back link in footer)
 
(16 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
[[Category:ADE Classes]]
 
[[Category:ADE Classes]]
<< [[Analytica Decision Engine (ADE) API]]
+
[[Category:ADE User Guide]]
 +
<languages />
 +
<translate>
 +
<!--T:1-->
 +
[[ADE User Guide]] > [[ADE Server Class Reference]] >
  
''New to [[What's new in Analytica 4.3?|ADE 4.3]]''
+
<!--T:2-->
 +
''New to [[Analytica 4.6|ADE 4.6]]''
  
= interface IAMsgBoxCallback (ADE) =
+
<!--T:3-->
 +
This interface allows you to implement callbacks that are called when Analytica functions requiring user input are evaluated. You can implement these callbacks to support these user interface interactions in your own application. In many cases, the name of each method corresponds fairly directly with the name of the Analytica function that produces the user interaction.
  
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.
+
<!--T:4-->
 +
When your application does not implement this interface, most of the functions requiring user interaction will do nothing when evaluated in ADE.
  
To use this, your program must implement a COM class with the '''ShowMsgBox''' methodAs 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]].
+
<!--T:5-->
 +
The "IAde" prefix stands for "Interface ADE"Your own code can define a class that subclasses this interface and implements its method, and then pass it to [[CAEngine::SetCallbackObject]].
  
This interface is experimentalWe 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.
+
<!--T:6-->
 +
To use this, your program must implement a COM class with each of the messages, such as the '''MsgBox''' methodAs 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]].
  
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 == <!--T:7-->
 +
=== long [[IAdeUICallbacks::MsgBox|MsgBox]]([in] string title, [in] string text, [in] long buttons)===
 +
Called when [[MsgBox]]() is evaluated.
 +
=== bool [[IAdeUICallbacks::ShowProgressBar|ShowProgressBar]]([in] string title, [in] string text, [in] double p)===
 +
Called when [[ShowProgressBar]]() is evaluated.
 +
=== void [[IAdeUICallbacks::HideProgressBar|HideProgressBar]]()===
  
== Methods ==
+
Called when progress bar should be hidden, for example when the computation of the requested result has completed.
 +
=== string [[IAdeUICallbacks::AskMsgText|AskMsgText]]([in] string question, [in] string title, [in] long maxText, [in] string defaultText, [in] bool bPassword, [out] bool *bCancel)=== <!--T:8-->
 +
Called when [[AskMsgText]]() is evaluated.
  
=== LONG ShowMsgBox(string title, string text, long buttons) ===
+
=== double [[IAdeUICallbacks::AskMsgNumber|AskMsgNumber]]([in] string question, [in] BSTR title, [in] bool bShowDefault, [in] double defaultNumber, [out] bool* bCancel)=== <!--T:9-->
 +
Called when [[AskMsgNumber]]() is evaluated.
  
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:
+
=== long [[IAdeUICallbacks::AskMsgChoice|AskMsgChoice]](([in] string question, [in] string title, [in] array<string> optionList, [in] long defaultPosition, [in] bool bShowAll, [out] bool * bCancel)=== <!--T:10-->
  
* 1 = OK
+
<!--T:11-->
* 2 = Cancel
+
Called when [[AskMsgChoice]]() is evaluated, with a [[Choice]]-style control specified.
* 3 = Abort
 
* 4 = Retry
 
* 5 = Ignore
 
* 6 = Yes
 
* 7 = No
 
  
The «buttons» parameter has the following values:
+
=== string [[IAdeUICallbacks::AskMsgComboBox|AskMsgComboBox]]([in] string question, [in] string title, [in] array<string> optionList, [in] string defaultText, [in] bool bShowAll, [out] bool* bCancel, [out] bool* bAllSelected)=== <!--T:12-->
 +
Called when [[AskMsgChoice]]() is evaluated, with a combo-box style control specified.
 +
=== string [[IAdeUICallbacks::GetFilename|GetFilename]]([in] string function, [in] string defaultName, [in] string directory, [in] string extensions, [in] string caption, [in] [[CAObject]]* callingIdent, [in] int flags)===
 +
Called when [[ReadTextFile]](), [[SpreadsheetOpen]](), [[ReadImageFile]]() or [[ReadExportFile]]() is called, and needs to ask for a filename. You would generally display a file-open dialog here, or in a web-app, a file-upload prompt. You should return a full path to the file.
  
* 0 = OK only
+
=== void [[IAdeUICallbacks::FileOpenCompleted|FileOpenCompleted]]([in] string function, [in] string fullFilePath)=== <!--T:13-->
* 1 = OK and Cancel [Default]  
+
Called when the file requested in the call to [[IAdeUICallbacks::GetFilename]] has been fully read. If you created a temporary file for the read (e.g., if the user uploaded a file), you can delete that temporary here.
* 2 = Abort, Retry and Ignore
+
=== void [[IAdeUICallbacks::ShowPdfFile|ShowPdfFile]]([in] string filepath, [in] string bookmark, [in] bool bSearch, [in] bool bBookmarks)===
* 3 = Yes, No and Cancel
+
Called when [[ShowPdfFile]]() is evaluated.
* 4 = Yes and No
+
=== void [[IAdeUICallbacks::OpenURL|OpenURL]]([in] string url, [in] string window, [in] string specs)===
* 5 = Retry and Cancel
+
Called when [[OpenURL]]() is evaluated.
  
which are then added to one of these values:
+
 
* 0 = no icon
+
=See Also= <!--T:14-->
* 16 = Critical
+
{| style="margin: 1em auto 1em auto;width: 100%;border:0;table-layout: fixed;" cellpadding=5
* 32 = Question
+
|- style="text-align: center"
* 48 = Exclamation
+
|  [[CAFiller]]  <-  ||  [[IAdeUICallbacks]] || ->
* 64 = Information
+
|}
 +
</translate>

Latest revision as of 21:21, 28 July 2017

Other languages:
English • ‎中文

ADE User Guide > ADE Server Class Reference >

New to ADE 4.6

This interface allows you to implement callbacks that are called when Analytica functions requiring user input are evaluated. You can implement these callbacks to support these user interface interactions in your own application. In many cases, the name of each method corresponds fairly directly with the name of the Analytica function that produces the user interaction.

When your application does not implement this interface, most of the functions requiring user interaction will do nothing when evaluated in ADE.

The "IAde" prefix stands for "Interface ADE". Your own code can define a class that subclasses this interface and implements its method, and then pass it 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.

Methods

long MsgBox([in] string title, [in] string text, [in] long buttons)

Called when MsgBox() is evaluated.

bool ShowProgressBar([in] string title, [in] string text, [in] double p)

Called when ShowProgressBar() is evaluated.

void HideProgressBar()

Called when progress bar should be hidden, for example when the computation of the requested result has completed.

string AskMsgText([in] string question, [in] string title, [in] long maxText, [in] string defaultText, [in] bool bPassword, [out] bool *bCancel)

Called when AskMsgText() is evaluated.

double AskMsgNumber([in] string question, [in] BSTR title, [in] bool bShowDefault, [in] double defaultNumber, [out] bool* bCancel)

Called when AskMsgNumber() is evaluated.

long AskMsgChoice(([in] string question, [in] string title, [in] array<string> optionList, [in] long defaultPosition, [in] bool bShowAll, [out] bool * bCancel)

Called when AskMsgChoice() is evaluated, with a Choice-style control specified.

string AskMsgComboBox([in] string question, [in] string title, [in] array<string> optionList, [in] string defaultText, [in] bool bShowAll, [out] bool* bCancel, [out] bool* bAllSelected)

Called when AskMsgChoice() is evaluated, with a combo-box style control specified.

string GetFilename([in] string function, [in] string defaultName, [in] string directory, [in] string extensions, [in] string caption, [in] CAObject* callingIdent, [in] int flags)

Called when ReadTextFile(), SpreadsheetOpen(), ReadImageFile() or ReadExportFile() is called, and needs to ask for a filename. You would generally display a file-open dialog here, or in a web-app, a file-upload prompt. You should return a full path to the file.

void FileOpenCompleted([in] string function, [in] string fullFilePath)

Called when the file requested in the call to IAdeUICallbacks::GetFilename has been fully read. If you created a temporary file for the read (e.g., if the user uploaded a file), you can delete that temporary here.

void ShowPdfFile([in] string filepath, [in] string bookmark, [in] bool bSearch, [in] bool bBookmarks)

Called when ShowPdfFile() is evaluated.

void OpenURL([in] string url, [in] string window, [in] string specs)

Called when OpenURL() is evaluated.


See Also

CAFiller <- IAdeUICallbacks ->
Comments


You are not allowed to post comments.