Using LinkDialog and AnchorDialog
The two dialogs making up the new link functionality in this stage are made available through new actions in FrmMain.
InsertLinkAction and EditLinkAction both create an instance of class LinkDialog to let the user create or work on a link. When the user has not cancelled upon return of the dialog, method setLink of class SHTMLEditorPane is called to apply the link settings from the LinkDialog object.
EditAnchorsAction is used similar to the above, the only difference is usage of method insertAnchor of class SHTMLEditorPane instead.
Usage of AnchorDialog through LinkDialog
Additional to using AnchorDialog directly on a document currently edited, the dialog can be used from out of class LinkDialog. The idea is that either
To create a link to a newly created anchor link in one step, as in case 2. above, the anchor link needs to be created directly out of class LinkDialog. To do so, LinkDialog has a browse button next to the text field for typing in a link anchor name. When the browse button is pressed class LinkDialog creates an instance of AnchorDialog passing the URL currently entered as the link address.
AnchorDialog opens the document referenced by the URL received from LinkDialog and shows existing anchors of this document. The user now can choose an existing anchor link or create a new one which then is chosen.
Once a link anchor is selected, its name is taken back to the calling LinkDialog and the anchor name is included with the new link currently worked on in the LinkDialog object.