.. highlightlang:: us .. index:: ADDIN_AddToUI .. _addin_addtoui: ADDIN_AddToUI ============= .. us.tag ADDIN_AddToUI ENGLISH Grid New400 :ref:`ADDIN_AddToUI` adds a function to the UniPlot user interface. .. function:: b = ADDIN_AddToUI(nType, ssText, ssFunction) .. us.return **Return Value** *b* is TRUE (1), when the function was successful and otherwise FALSE (0). .. us.params **Parameters** .. uparam:: nType *nType* specifies to which group of commands the new command is added. The following groups are available: .. list-table:: :header-rows: 1 * - Name - Wert - Bedeutung * - ADDIN_FILE_IMPORT - 1 - Data file import functions * - ADDIN_DATA_MOREXYDATAFUNCTIONS - 2 - More 2D dataset functions * - ADDIN_DATA_MOREXYZDATAFUNCTIONS - 3 - More 3D dataset functions * - ADDIN_FILE_MOREFUNCTIONS - 4 - More file functions * - ADDIN_LAYER_MOREFUNCTIONS - 5 - More diagram functions * - ADDIN_LOAD_FUNCTIONS - 6 - Dataset Load functions .. uparam:: ssText *ssText* is a scalar string which will be displayed in the user interface. .. uparam:: ssFunction *ssFunction* is a function name which will be invoked if the user selects on of the commands. The function name is given without parentheses "()". .. us.example **Example** :: ADDIN_AddToUI(ADDIN_FILE_IMPORT, "Excel - File (*.xls)|*.xls|", "_DoImportExcelFile") .. us.comment **Comment** ADDIN_FILE_IMPORT: The text of the parameter *ssText* will be displayed in the type field in the file-open dialog box. The search filter is added at the end of the text enclosed in OR (|) signs. Example: ``"Excel - File (*.xls)|*.xls|"``. The function name is set without the parentheses. A function for the addin type ADDIN_FILE_IMPORT must return the complete file name of the created NC file. If the function cannot convert the given file it should return an empty string(""). In case of an error the function must return the string ``"#IMPORTERROR#"``. Examples for functions that convert data files to nc files can be found in the directory :file:`\\uniplot\\addin\\rs_fevis` or :file:`\\uniplot\\addin\\rs_combi`. ADDIN_LOAD_FUNCTIONS: For this type only the last part of the name is specified. See :ref:`GridLoadCallback_xxx`. Examples for load functions can be found in the file :file:`\\uniplot\\script\\rs_loaddat.ic`. Your filter should be saved in the autoload directory with the extension :file:`.ic`. ADDIN_DATA_MOREXYDATAFUNCTIONS, ADDIN_DATA_MOREXYZDATAFUNCTIONS, ADDIN_FILE_MOREFUNCTIONS, ADDIN_LAYER_MOREFUNCTIONS: For these types the complete file name must be specified. The functions do not any parameters. Examples can be found in the file :file:`\\uniplot\\script\\rs_xy.ic`. .. seealso:: :ref:`overview-programming`, :ref:`ADDIN_LoadAddIn` :sub:`id-1939877`