Tree :



 Faceted index, by topics :
Menu

 
Category
V5 (46)
V5.01 (21)
V5.10 (15)
V5.20 (32)
V5.30 (16)
V5.31 (1)
V5.32 (4)
V5.33 (16)
V5.34 (7)
V5.35 (2)
V5.40 (27)
V5.41 (7)
V5.42 (4)
V5.43 (6)
V5.50 (1)
V5.60 (1)
V5.61 (2)
V5.70 (9)
V5.71 (4)
 
 How to insert these widgets?

      7. FAQ
          7.8. Advanced features
 7.8.1. FAQ : Building a contextual help system 

For programmers, WIT helps to easily make contextual help system for software in development phase : here are the main steps (illustrated with Microsoft Visual C++, some minor changes should be made for other programming languages).

 In WIT, activate expert mode and choice of generated HTML pages names ("File/Options" menu).

 Create the structure of the user manual of your software. This structure should match the main functions of the software to document, and the main dialog boxes. Give an explicit name to the files associated with each idea.

 Write the user manual using WIT (define keywords, choose structure and style templates ; check that the structure template generates ideas in separated pages (tree : one idea - one page, see the "page" tab of the structure template dialog).

 Define where the web site will be generated, for example "c:\MyInstallDir\Help", and generate the site there.

 In Visual C++, overload the OnHelpInfo() method, in all your derived dialog classes (dialog boxes (derived from CDialog), views (derived from CView), tabs (derived from CPropertyPage) of property sheets (CPropertySheet)).

 In the registry (for example), create a key (for example MyHelpValues), where you will store values (strings) like : "valueName" = "helpPagePath". For example, for a CMyDialog dialog box to which the "My dialog" idea has been created with an associated file name "my-dialog", create the key : "CMyDialog" = "text/my-dialog" Help specific pages are generated in the "text" sub directory of site root : "c:\MyInstallDir\Help" (no need to append a suffix to the page names).

 In the CxxxxApp class (where xxxx is the name of your being documented software), create a method such as :

void CxxxxApp::ShowHelp(CString helpId) 
{
// retrieve the registry key (example : MyHelpValues) where
// the values such as "CMyDialog"="text/my-dialog" were
// stored.
CString regKey = ... ; // Retrieve the value associated to the value name "helpid".
CString helpFile = ...; // Retrieve the help web site root path
CString helpPath = "C:\MyInstallDir\Help"; // for example, or use the registry
if (helpFile == _T(""))
{
CString msg;
msg.Format("Soon help on \"%s\", file %s ...", helpId, helpFile);
AfxMessageBox(msg);
} else {
// Build the path to help file
CString helpFile = helpPath + "\\" + helpFile + ".html";
// Launch the browser on the help file (example MSIE)
CString iePath = "C:\Program Files\Internet Explorer\iexplore.exe"; // (or ask the registry for MSIE path)
_spawnlp(_P_NOWAIT , iePath, "ie", helpFile, NULL );
}
}

 In the CMyDialog::OnHelpInfo() method, call the help display method, passing class name as parameter (context) :

BOOL DDispBookPage::OnHelpInfo(HELPINFO* pHelpInfo) 
{
theApp.ShowHelp("CMyDialog");
return TRUE;
}

 Compile and launch the xxxx program. Display the dialog handled by CMyDialog and press F1 key : the web navigator is launched and displays the correct page (here "C:\MyInstallDir\Help\my-dialog.html").

 User manual can then be modified, and again automatically generated in the same place : there's no need to recompile the software.

Keywords :  Contextual help creation ; FAQ ; Help