helpuser.h File Reference

(r1785/r1729)

Go to the source code of this file.

Functions

BOOL HelpUser (const DialogOp &dlgop)
 Public function that finds the help topic associated with the given dialog operation and runs the system help engine to display the topic.
BOOL HelpUser (const wxDialog &dlg)
 Public function that finds the help topic associated with the given MFC dialog and runs the system help engine to display the topic.
BOOL HelpUser (const OpDescriptor &opdesc)
 Public function that finds the help topic associated with the given OpDescriptor and runs the system help engine to display the topic.
BOOL HelpUser (UINT32 nMessageID)
 Public function that finds the help topic associated with the given message and runs the system help engine to display the topic.
BOOL HelpUserPropertyPage (UINT32 PageID)
 Public function that finds the help topic associated with the given property page. This is required due to the new way the tabbed dialogs work (via MFC).
BOOL HelpUserTopic (DWORD dwHelpIndex)
 Public function that finds the help topic associated with the given message and runs the system help engine to display the topic.
BOOL _HelpUser (LPCTSTR lpcszClassName, UINT32 nSubTopic=0)
 Public function that finds the help topic associated with the given object and runs the system help engine to display it. This is a "bodgey" direct-access function for invoking help in those tricky cases, such as the print-setup dialog, that do not have any Camelot object directly associated with them.
BOOL HelpContents ()
 Runs the system help engine, displaying the "Contents" page.
BOOL HelpUsingHelp ()
 Runs the system help engine, displaying the system's instructions for using it.
BOOL HelpUsingTools ()
 Runs the system help engine, displaying the help on tools.
BOOL HelpUsingGalleries ()
 Runs the system help engine, displaying the help on galleries.
BOOL HelpOnlineDemos ()
 Runs the system help engine, displaying the on-line demos help page.
BOOL HelpTechnicalSupport ()
 Runs the system help engine, displaying the tech support help page.
BOOL CanHelpUser (UINT32 nMessageID)
 Public function to query whether a help topic exists for a given message. Depending on this the caller may display a help button in a message box, or may not etc.
void SetNextMsgHelpContext (UINT32 nMessageID)
 Remembers the last format string passed to MakeMsg. If a call is made to InformWarning, InformError etc and no string resource ID is passed then we have a problem using the string resource as an index into the help file. This remembers that last one, which we use if the "error ID" is zero.
UINT32 GetNextMsgHelpContext ()
 Gets the last help context set by SetNextMsgHelpContext.
BOOL InitUserHelp ()
BOOL DeInitUserHelp ()
 Shuts down the help system. This should be called as late as possible, so help is available for app shut-down problems. Note that MFC will call WinHelp(HELP_QUIT) for us when the main frame window is destroyed.


Function Documentation

BOOL _HelpUser LPCTSTR  lpcszClassName,
UINT32  nSubTopic
 

Public function that finds the help topic associated with the given object and runs the system help engine to display it. This is a "bodgey" direct-access function for invoking help in those tricky cases, such as the print-setup dialog, that do not have any Camelot object directly associated with them.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/5/95
Parameters:
lpcszClassName the class name of the object to run help for [INPUTS] nSubTopic which sub-topic for the object to display (by default, no sub-topic)
Returns:
TRUE if the help system is started successfully.
See also:
HelpUser; LookupDialogTopic; RunOilHelp

Definition at line 799 of file helpuser.cpp.

00800 {
00801     DWORD dwHelpIndex = LookupDialogTopic(lpcszClassName, nSubTopic);
00802     if (dwHelpIndex == 0)
00803     {
00804         TRACEUSER( "Ollie", _T("Can't find raw help topic for %s (sub %lu)\n"),
00805                                     lpcszClassName, nSubTopic);
00806         return FALSE;
00807     }
00808 
00809     return ShowHelp(HELP_CONTEXT, dwHelpIndex);
00810 }

BOOL CanHelpUser UINT32  nMessageID  ) 
 

Public function to query whether a help topic exists for a given message. Depending on this the caller may display a help button in a message box, or may not etc.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/5/95
Parameters:
nMessageID the resource identifier of the message that is being [INPUTS] enquired about
Returns:
TRUE if a help topic descrbing this message exists, FALSE otherwise.
See also:
LookupMessageTopic; InformGeneral

Definition at line 962 of file helpuser.cpp.

00963 {
00964     // Just return TRUE if a help topic for the message exists.
00965     return LookupMessageTopic(nMessageID) != 0;
00966 }

BOOL DeInitUserHelp  ) 
 

Shuts down the help system. This should be called as late as possible, so help is available for app shut-down problems. Note that MFC will call WinHelp(HELP_QUIT) for us when the main frame window is destroyed.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/5/95
Returns:
TRUE if successful.
See also:
InitUserHelp

Definition at line 1108 of file helpuser.cpp.

01109 {
01110 PORTNOTETRACE("help", "Help function unimplemented!");
01111 #if !defined(EXCLUDE_FROM_XARALX)
01112     // Tell the help engine we've finished using the help file(s).
01113     // NB. KNWON BUG: this doesn't do the job on Windows NT, leaving the helpfiles open.
01114     // As yet I have no idea why - it is as per the docs and works on Win32s & Chicago.
01115     if (fHaveUsedHelp)
01116     {
01117         TRACEUSER( "Ollie", _T("Closing general helpfile\n"));
01118         ShowHelp(HELP_QUIT, 0);
01119     }
01120 
01121 #ifdef STANDALONE
01122     // Same if we ran the special helpfile.
01123     if (fHaveUsedSpecHelp)
01124     {
01125         TRACEUSER( "Ollie", _T("Closing special helpfile\n"));
01126         RunOilHelp(achzSpecPath, HELP_QUIT, 0);
01127     }
01128 #endif
01129 
01130     // Remove our F1 message hook.
01131     return hF1Hook == NULL || ::UnhookWindowsHookEx(hF1Hook);
01132 #else
01133     return TRUE;
01134 #endif
01135 }

UINT32 GetNextMsgHelpContext  ) 
 

Gets the last help context set by SetNextMsgHelpContext.

Author:
Andy_Hills (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/11/00
Parameters:
none [INPUTS]
Returns:
help context
See also:
used by ScreenView::OnActivateView

Definition at line 1002 of file helpuser.cpp.

01003 {
01004     return nNextMessageHelpContext;
01005 }

BOOL HelpContents  ) 
 

Runs the system help engine, displaying the "Contents" page.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/5/95
Returns:
TRUE if successful.

Errors: -

See also:
HelpUser; HelpSearch; HelpUsingHelp

Definition at line 825 of file helpuser.cpp.

00826 {
00827 #ifndef STANDALONE
00828 
00829     // If F1 was pressed, popup help in the context of the current tool. Use the tool's OpToken (of 
00830     // the form "TOOL<ToolId>") to look-up its help page. Fixes #10489
00831     if (KeyPress::IsKeyPressed(CAMKEY(F1)))
00832     {
00833         String OpToken;
00834         OpToken._MakeMsg( _T("TOOL%u"), Tool::GetCurrentID() );
00835         DWORD dwHelpIndex = LookupOperationTopic(OpToken);
00836         return ShowHelp(HELP_CONTEXT, dwHelpIndex);
00837     }
00838 
00839     return ShowHelp(HELP_FINDER, 0);
00840 
00841 #else // STANDALONE
00842     // On the viewer go directly to the contents page on all OS's
00843     #ifdef WEBSTER
00844         return ShowHelp(HELP_CONTEXT, _R(IDH_Contents));
00845     #else //WEBSTER
00846         return ShowHelp(HELP_CONTEXT, _R(IDH_Misc_Contents));
00847     #endif // WEBSTER
00848 #endif // STANDALONE
00849 }

BOOL HelpOnlineDemos  ) 
 

Runs the system help engine, displaying the on-line demos help page.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/5/95
Returns:
TRUE if successful.
See also:
HelpUser; HelpContents; HelpSearch

Definition at line 915 of file helpuser.cpp.

00916 {
00917 PORTNOTETRACE("help", "Help function unimplemented!");
00918 #if !defined(EXCLUDE_FROM_XARALX)
00919     return RunOilHelp(achzMoviesHelpPath, 0, 0);
00920 #else
00921     return FALSE;
00922 #endif
00923 }

BOOL HelpTechnicalSupport  ) 
 

Runs the system help engine, displaying the tech support help page.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
1/11/95
Returns:
TRUE if successful.
See also:
HelpUser; HelpContents; HelpSearch

Definition at line 937 of file helpuser.cpp.

00938 {
00939 #ifdef WEBSTER
00940     return FALSE;
00941 #else
00942     return ShowHelp(HELP_CONTEXT, _R(IDH_Misc_Tech_Support));
00943 #endif
00944 }

BOOL HelpUser UINT32  nMessageID  ) 
 

Public function that finds the help topic associated with the given message and runs the system help engine to display the topic.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/5/95
Parameters:
nMessageID the resource identifier of the message to display [INPUTS] help about
Returns:
TRUE if help was successfully provided, FALSE otherwise
See also:
RunOilHelp; LookupMessageTopic

Definition at line 722 of file helpuser.cpp.

00723 {
00724     // Look-up the message ID in our list of help topics.  If we can't find it
00725     // then return a failure code.
00726     DWORD dwHelpIndex = LookupMessageTopic(nMessageID);
00727     if (dwHelpIndex == 0)
00728     {
00729         TRACEUSER( "Ollie", _T("Can't find help topic for message 0x%lX\n"),
00730                                 (UINT32) nMessageID);
00731         return FALSE;
00732     }
00733 
00734     // Show this topic in the help system and return a success code.
00735     return ShowHelp(HELP_CONTEXT, dwHelpIndex);
00736 }

BOOL HelpUser const OpDescriptor opdesc  ) 
 

Public function that finds the help topic associated with the given OpDescriptor and runs the system help engine to display the topic.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/5/95
Parameters:
opdesc the OpDescriptor of the Operation to provide help for [INPUTS]
Returns:
TRUE if help was successfully provided, FALSE if not.
See also:
RunOilHelp; LookupOperationTopic

Definition at line 686 of file helpuser.cpp.

00687 {
00688     // Check if a help topic is already recorded within the OpDescriptor.  If it isn't
00689     // then we will have to look it up instead.
00690 /*
00691     //  NB. all the help topic ID's within the OpDescriptors are wrong, so ignore them!
00692     DWORD dwHelpIndex = ((OpDescriptor&) opdesc).GetHelpId();
00693     if (dwHelpIndex == 0) dwHelpIndex = LookupOperationTopic(opdesc.Token);
00694 */
00695     DWORD dwHelpIndex = LookupOperationTopic(opdesc.Token);
00696     if (dwHelpIndex == 0)
00697     {
00698         TRACEUSER( "Ollie", _T("Can't find help topic for the %s OpDescriptor\n"),
00699                                 (LPCTSTR) opdesc.Token);
00700         return FALSE;
00701     }
00702 
00703     // Show the topic we have found.
00704     return ShowHelp(HELP_CONTEXT, dwHelpIndex);
00705 }

BOOL HelpUser const wxDialog &  dlg  ) 
 

Public function that finds the help topic associated with the given MFC dialog and runs the system help engine to display the topic.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/5/95
Parameters:
dlg the MFC dialog that requires help [INPUTS]
Returns:
TRUE if help was successfully provided, FALSE if not.
See also:
RunOilHelp; LookupDialogTopic

Definition at line 656 of file helpuser.cpp.

00657 {
00658     // Look-up the class name/page ID in our list of help topics.  If we can't find it
00659     // then we return a failure code.
00660     DWORD dwHelpIndex = LookupDialogTopic(dlg.GetClassInfo()->GetClassName(), 0);
00661     if (dwHelpIndex == 0)
00662     {
00663         TRACEUSER( "Ollie", _T("Can't find help topic for the %s MFC dialog\n"),
00664                                 (LPCTSTR) dlg.GetClassInfo()->GetClassName());
00665         return FALSE;
00666     }
00667 
00668     // Show this topic in the help system and return a success code.
00669     return ShowHelp(HELP_CONTEXT, dwHelpIndex);
00670 }

BOOL HelpUser const DialogOp DlgOp  ) 
 

Public function that finds the help topic associated with the given dialog operation and runs the system help engine to display the topic.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/5/95
Parameters:
DlgOp reference to a (constant) dialog operation to display [INPUTS] help about
Returns:
TRUE if help was successfully provided, FALSE if not.
See also:
RunOilHelp; LookupDialogTopic

Definition at line 592 of file helpuser.cpp.

00593 {
00594     // Work out which page within the dialog is visible, if appropriate.  We begin by
00595     // assuming this isn't relevant.
00596     UINT32 nPageResID = 0;
00597     if (DlgOp.IsKindOf(TABBED_DIALOG_CLASS))
00598     {
00599         // Work out which is the active (top-most) page within the tabbed dialog.
00600         wxWindow* pWnd = (wxWindow*) DlgOp.WindowID;
00601         if (pWnd != NULL)
00602         {
00603             // We got the window handle, get its MFC CWnd analogue.
00604             wxBookCtrlBase* pSheet = DialogManager::GetBookControl( pWnd );
00605             if (pSheet != NULL)
00606             {
00607                 // Ask it for the resource ID of its currently active page.
00608                 nPageResID = (UINT32) pSheet->GetCurrentPage()->GetId();
00609             }
00610 #ifdef _DEBUG
00611             else
00612             {
00613                 TRACEUSER( "Ollie", _T("Null OurPropSheet pointer in HelpUser\n"));
00614             }
00615 #endif
00616         }
00617 #ifdef _DEBUG
00618         else
00619         {
00620             TRACEUSER( "Ollie", _T("Null DialogOp window handle in HelpUser\n"));
00621         }
00622 #endif
00623     }
00624 
00625     // Get the run-time class name etc of the dialog.
00626     LPCTSTR lpcszDialogClass = DlgOp.GetRuntimeClass()->m_lpszClassName;
00627 
00628     // Look-up the class name/page ID in our list of help topics.  If we can't find it
00629     // then we return a failure code.
00630     DWORD dwHelpIndex = LookupDialogTopic(lpcszDialogClass, nPageResID);
00631     if (dwHelpIndex == 0)
00632     {
00633         TRACEUSER( "Ollie", _T("Can't find help topic for %s dialog (page ID %lu)\n"),
00634                                 (LPTSTR) lpcszDialogClass, (UINT32) nPageResID);
00635         return FALSE;
00636     }
00637 
00638     // Show this topic in the help system and return a success code.
00639     return ShowHelp(HELP_CONTEXT, dwHelpIndex);
00640 }

BOOL HelpUserPropertyPage UINT32  PageID  ) 
 

Public function that finds the help topic associated with the given property page. This is required due to the new way the tabbed dialogs work (via MFC).

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/5/97
Parameters:
PageID ResourceID of the currently active page [INPUTS]
Returns:
TRUE if help was successfully provided, FALSE otherwise

Definition at line 752 of file helpuser.cpp.

00753 {
00754     DWORD dwHelpIndex = LookupDialogTopic(NULL, PageID);
00755     return (HelpUserTopic(dwHelpIndex));
00756 }

BOOL HelpUserTopic DWORD  dwHelpIndex  ) 
 

Public function that finds the help topic associated with the given message and runs the system help engine to display the topic.

> BOOL HelpUserTopic(DWORD dwHelpIndex)

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/7/96
Parameters:
nMessageID the resource identifier of the message to display [INPUTS] help about
Returns:
TRUE if help was successfully provided, FALSE otherwise

Definition at line 772 of file helpuser.cpp.

00773 {
00774     if (dwHelpIndex == 0)
00775         return FALSE;
00776     
00777     // Show this topic in the help system and return a success code.
00778     return ShowHelp(HELP_CONTEXT, dwHelpIndex);
00779 }

BOOL HelpUsingGalleries  ) 
 

Runs the system help engine, displaying the help on galleries.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/5/95
Returns:
TRUE if successful.
See also:
HelpUser; HelpContents; HelpSearch

Definition at line 898 of file helpuser.cpp.

00899 {
00900     return ShowHelp(HELP_CONTEXT, _R(IDH_Overview_Galleries));
00901 }

BOOL HelpUsingHelp  ) 
 

Runs the system help engine, displaying the system's instructions for using it.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/5/95
Returns:
TRUE if successful.
See also:
HelpUser; HelpContents; HelpSearch

Definition at line 864 of file helpuser.cpp.

00865 {
00866     return RunOilHelp(NULL, HELP_HELPONHELP, 0);
00867 }

BOOL HelpUsingTools  ) 
 

Runs the system help engine, displaying the help on tools.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/5/95
Returns:
TRUE if successful.
See also:
HelpUser; HelpContents; HelpSearch

Definition at line 881 of file helpuser.cpp.

00882 {
00883     return ShowHelp(HELP_CONTEXT, _R(IDH_Misc_Tools));
00884 }

BOOL InitUserHelp  ) 
 

Definition at line 1024 of file helpuser.cpp.

01025 {
01026 #if !defined(EXCLUDE_FROM_XARALX)
01027     // If we have any deferred file copies, deal with them now...
01028     HelpDownloadOp::DoDeferredFileCopy();
01029 #endif
01030 
01031     // init main help file:
01032     BOOL bOK = InitHelpPath(TRUE);
01033 
01034     // init movies help file
01035     bOK = bOK && InitHelpPath(FALSE);
01036 
01037 #if !defined(EXCLUDE_FROM_XARALX)
01038     // Install a message filter hook to trap F1 being pressed in dialogs etc.  We don't need
01039     // one for menus as our "custom menu code" (ha ha ha) does this already.
01040     hF1Hook = ::SetWindowsHookEx(WH_MSGFILTER, F1HookProc, NULL, ::GetCurrentThreadId());
01041     ERROR3IF(hF1Hook == NULL, "Couldn't set F1 key hook in InitUserHelp");
01042 
01043     // Success!?!
01044     return hF1Hook != NULL;
01045 #else
01046     return bOK;
01047 #endif
01048 }

void SetNextMsgHelpContext UINT32  nMessageID  ) 
 

Remembers the last format string passed to MakeMsg. If a call is made to InformWarning, InformError etc and no string resource ID is passed then we have a problem using the string resource as an index into the help file. This remembers that last one, which we use if the "error ID" is zero.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/5/95
Parameters:
nMessageID the last message format string passed to MakeMsg [INPUTS]
See also:
StringBase::MakeMsg

Definition at line 983 of file helpuser.cpp.

00984 {
00985     nNextMessageHelpContext = nMessageID;
00986     //TRACEUSER( "Andy", _T("\tSetNextMsgHelpContext(%d)\n"), nMessageID);
00987 }


Generated on Sat Nov 10 03:49:11 2007 for Camelot by  doxygen 1.4.4