Difference between revisions of "IAdeUICallbacks::GetFilename"
(Marked this version for translation) |
|||
Line 3: | Line 3: | ||
<languages /> | <languages /> | ||
<translate> | <translate> | ||
− | = string GetFilename([in] string function, [in] string defaultName, [in] string directory, [in] string extensions, [in] string caption, [in] [[CAObject]]* callingIdent) = | + | = string GetFilename([in] string function, [in] string defaultName, [in] string directory, [in] string extensions, [in] string caption, [in] [[CAObject]]* callingIdent) = <!--T:1--> |
+ | <!--T:2--> | ||
Called when any of several functions are evaluated, when the user needs to be asked to select a filename. These include [[SpreadsheetOpen]](), [[ReadTextFile]](), [[ReadImageFile]](), and [[ReadExportFile]]. | Called when any of several functions are evaluated, when the user needs to be asked to select a filename. These include [[SpreadsheetOpen]](), [[ReadTextFile]](), [[ReadImageFile]](), and [[ReadExportFile]]. | ||
+ | <!--T:3--> | ||
Your implementation should allow the user to select a file, or if your are implementing a web-based application, you may allow him to upload a file. | Your implementation should allow the user to select a file, or if your are implementing a web-based application, you may allow him to upload a file. | ||
+ | <!--T:4--> | ||
After the file is read, the [[IAdeUICallbacks::FileOpenCompleted]]() is called. If your application has uploaded a file to a temporary location, you can safely delete the temporary file here. | After the file is read, the [[IAdeUICallbacks::FileOpenCompleted]]() is called. If your application has uploaded a file to a temporary location, you can safely delete the temporary file here. | ||
+ | <!--T:5--> | ||
The method is not called if the dialog is unnecessary. | The method is not called if the dialog is unnecessary. | ||
− | == Parameters == | + | == Parameters == <!--T:6--> |
+ | <!--T:7--> | ||
* «function»: the identifier of the built-in function that is requesting the filename. E.g., "[[SpreadsheetOpen]]", "[[ReadTextFile]]", "[[ReadImageFile]]", or "[[ReadExportFile]]". | * «function»: the identifier of the built-in function that is requesting the filename. E.g., "[[SpreadsheetOpen]]", "[[ReadTextFile]]", "[[ReadImageFile]]", or "[[ReadExportFile]]". | ||
* «directory»: The [[CurrentDataDirectory|current directory]]. | * «directory»: The [[CurrentDataDirectory|current directory]]. | ||
Line 21: | Line 26: | ||
* «callingIdent»: A [[CAObject]] pointer to the user-object in the model that is calling the build-in function. | * «callingIdent»: A [[CAObject]] pointer to the user-object in the model that is calling the build-in function. | ||
− | == Return value == | + | == Return value == <!--T:8--> |
+ | <!--T:9--> | ||
The full file path to the file selected or uploaded. | The full file path to the file selected or uploaded. | ||
− | = See Also = | + | = See Also = <!--T:10--> |
+ | <!--T:11--> | ||
* [[IAdeUICallbacks::FileOpenCompleted]] method | * [[IAdeUICallbacks::FileOpenCompleted]] method | ||
* [[SpreadsheetOpen]], [[ReadTextFile]], [[ReadExportFile]], [[ReadImageFile]] functions | * [[SpreadsheetOpen]], [[ReadTextFile]], [[ReadExportFile]], [[ReadImageFile]] functions | ||
</translate> | </translate> |
Revision as of 01:41, 16 June 2015
ADE User Guide > ADE Server Class Reference > IAdeUICallbacks
string GetFilename([in] string function, [in] string defaultName, [in] string directory, [in] string extensions, [in] string caption, [in] CAObject* callingIdent)
Called when any of several functions are evaluated, when the user needs to be asked to select a filename. These include SpreadsheetOpen(), ReadTextFile(), ReadImageFile(), and ReadExportFile.
Your implementation should allow the user to select a file, or if your are implementing a web-based application, you may allow him to upload a file.
After the file is read, the IAdeUICallbacks::FileOpenCompleted() is called. If your application has uploaded a file to a temporary location, you can safely delete the temporary file here.
The method is not called if the dialog is unnecessary.
Parameters
- «function»: the identifier of the built-in function that is requesting the filename. E.g., "SpreadsheetOpen", "ReadTextFile", "ReadImageFile", or "ReadExportFile".
- «directory»: The current directory.
- «extensions»: A list of file extensions to filter for. When there is more that one possible extension, they are separated by a double bar, "||". Each extension has two parts, separated by a single bar, "|". The first part is a list of wild cards such as "*.txt;*.dat", each wildcard separated by semi-colons. The second part is a user-friendly description of the extension. For example, SpreadsheetOpen may provide the following filter:
"*.xl*;*.csv|Excel Files (*.xl*;*.csv)||*.*|All Files (*.*)"
- «caption»: The recommended title or caption text for a file open dialog.
- «callingIdent»: A CAObject pointer to the user-object in the model that is calling the build-in function.
Return value
The full file path to the file selected or uploaded.
See Also
- IAdeUICallbacks::FileOpenCompleted method
- SpreadsheetOpen, ReadTextFile, ReadExportFile, ReadImageFile functions
Comments
Enable comment auto-refresher