Command Import

Since Data Master 2003 software is, in fact, application development framework, you may extend basic set of its operations. After you create new functions (as a script or action provider), you need to add new items to the DM2003 user interface. Although users can manually reconfigure menu and toolbars by means of special dialog box, there's two cases where it's highly desirable to automate this process:

The feature that implements required functionality is named Command Import.

How to use Command Import feature?

Let's suppose that you have created new script file (named, for example, applets.vbs) that contains code of some actions and you wish to make setup with appropriate user interface. The process involves following steps:

1.   First, you need to copy this file during installation (e.g. into the <INSTALLDIR>\APPLETS subfolder) and create appropriate registry entry for scripter.dll unit:

[HKEY_CURRENT_USER\Software\RRR\DM2003\Scripter]
[HKEY_CURRENT_USER\Software\RRR\DM2003\Scripter\Files]
"My Actions"="C:\\PROGRA~1\\RRR\\DM2003\\APPLETS\\applets.vbs"

2.   Second, you prepare and include in the installation special file (named, for example, applets.ini) that describes required user interface items. This file may contain following records:

;----------------------------------------------
; New actions from applets.vbs

[Actions]
0=Test1UserAction
1=Test2UserAction

[Test1UserAction]
Provider={673A9FB8-9A0B-11D4-B2A4-FD6847C75367}
ID=TEST1
ImageIndex=2
Category=MyCategory

[Test2UserAction]
Provider={673A9FB8-9A0B-11D4-B2A4-FD6847C75367}
ID=TEST2
Category=File

;----------------------------------------------
; New Custom ToolBar

[ToolBar_0]
Name=CustomToolBar
Caption=Custom ToolBar

;----------------------------------------------
; Main Menu items

[ActionBarItem_0]
ActionBar=ActionMainMenuBar
Caption=Test 1
Action=Test1UserAction
Position=13
RootMenu=File

;----------------------------------------------
; Test submenu

[ActionBarItem_1]
ActionBar=ActionMainMenuBar
Caption=Test
Position=2
RootMenu=Options

[ActionBarItem_2]
ActionBar=ActionMainMenuBar
Caption=Test 1
Action=Test1UserAction
Position=0
RootMenu=Test

[ActionBarItem_3]
ActionBar=ActionMainMenuBar
Caption=-
Position=1
RootMenu=Test

[ActionBarItem_4]
ActionBar=ActionMainMenuBar
Caption=Test 2
Action=Test2UserAction
Position=2
RootMenu=Test

;----------------------------------------------
; Custom ToolBar items

[ActionBarItem_5]
ActionBar=CustomToolBar
Caption=Test 1
Action=Test1UserAction
Position=0

[ActionBarItem_6]
ActionBar=CustomToolBar
Caption=Test 2
ImageIndex=2
Action=Test2UserAction
Position=1

3.   Finally, you need to register this INI file for use by DM2003. Install special registry key as shown below:

[HKEY_CURRENT_USER\Software\RRR\DM2003]
[HKEY_CURRENT_USER\Software\RRR\DM2003\Data Master]
[HKEY_CURRENT_USER\Software\RRR\DM2003\Data Master\ImportCommands]
"0"="C:\\PROGRA~1\\RRR\\DM2003\\APPLETS\\applets.ini"

Every time when DM2003 starts, it looks for user interface settings remembered in the %AppData%\RRR\DM2003\config.bin file. If this file not found, DM2003 will add contents of applets.ini to the default user interface elements. Keep in mind that you can also register applets.ini under ImportCommandsOnce key; in this scenario, DM2003 will import commands even if config.bin successfully loaded, but the key will be deleted immediately after import. This feature allows you to add new actions programmatically, for example, by visiting special web site.