In this example we describe the procedure of developing a custom procedure in Ted4 in add-ins, and attaching it to the menu.
Let's say you are adding a procedure CustomAssignTo in the CustomTed.vb, and want to have it accessible from the main menu of the Article main tab.
1.Make sure that your GN4 binaries and system add-ins are up-to-same date and version.
2.Open the GN4 solution GN4AddInsExpress.sln in Visual Studio Express, and open the CustomTed.vb file.
3.Locate the CustomTed4MainAddIn class.
4.Write your code for CustomAssignTo there. Note: the procedure name must be unique or it has to contain Overloads statement - otherwise you'll be warned by an error: sub 'xxxxx' shadows an overloadable member declared in the base class 'Ted4MainAddIn'. If you want to overload the base method, this method must be declared 'Overloads'.
5.Make sure no GN4 application is running on your PC and then compile your code and see if there are errors.
6.Open the Ted4_tabitems.xml and locate the appropriate menu section under <GN4ShellMenus> node, e.g. menuset Ted4Main.
7.Locate the drop-down menu where to put your custom call, e.g. to put it under File menu locate below <l:ShellMenuItem Header="_File"> and add a new line such as <l:ShellMenuItem Header="Assign To" CommandParameter="CustomAssignTo"/>. If your procedure has parameter, then use the syntax <l:ShellMenuItem Header="Assign To" CommandParameter="CustomAssignTo" Parameters="edition" />
8.Save and import the Ted4_tabitems.xml file in the database.
9.Run Ted4 and test your procedure by accessing it through menu.
10.Should you apply changes, exit Ted4 and then restart from step 4.
See also
Typically, for all procedures that have to work during text editing in Ted4 and in Fred4 use TxtDesignerBase class. For all procedures to work during page editing use PageDesignerAddIn, or PageTxtDesignerAddIn. |