OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
owl::THelpFileManager Class Reference

THelpFileManager, which is designed to be a mix-in for TApplication, uses the global context table. More...

#include <owl/hlpmanag.h>

Inheritance diagram for owl::THelpFileManager:
owl::TEventHandler

Public Member Functions

 THelpFileManager (const tstring &helpFileName)
 Constructor.
 
virtual ~THelpFileManager ()
 Deletes the allocated context table.
 
virtual void ActivateHelp (TWindow *, int helpFileContextId, uint hlpCmd=HELP_CONTEXT)
 Called by EvHelp() to activate the help file with the help context ID.
 
virtual void DeactivateHelp ()
 Deactivates the help.
 
void SetHelpFile (const tstring &helpFileName)
 Changes the name of the help file.
 
tstring GetHelpFile () const
 Returns the name of the help file.
 
bool GetHelpContextFromControl (THelpContext &, int controlId, HWND ctrl) const
 Returns true if a match for the control ID was found.
 
bool GetHelpContextFromMenu (THelpContext &, int menuId) const
 Returns true if a match for the menu item ID was found.
 
void AddContextInfo (TWindow *, int helpId, int menuId, int controlId)
 Adds an entry into the global context table.
 
void RemoveContextInfo (TWindow *)
 Removes all the entries in the context table for the window.
 
HWND HtmlHelp (TWindow *, LPCTSTR lpszHelp, uint hlpCmd, DWORD_PTR data)
 
HWND HtmlHelp (TWindow *w, const tstring &helpFile, uint hlpCmd, DWORD_PTR data)
 
void TranslateWinToHTML (bool translate)
 
- Public Member Functions inherited from owl::TEventHandler
virtual bool Find (TEventInfo &info, TEqualOperator op=0)
 Searches the list of response table entries looking for a match.
 
TResult Dispatch (TEventInfo &info, TParam1, TParam2=0)
 Takes the message data from TEventInfo's Msg data member and dispatches it to the correct event-handling function.
 
TResult DispatchMsg (TMsgId, uint id, TParam1, TParam2)
 Search for the event given the message and it and dispatch to the event handler if found.
 

Public Attributes

 DECLARE_CASTABLE
 

Protected Types

typedef TBaseList< THelpContextTContextList
 
typedef TBaseListIterator< THelpContextTContextListIterator
 

Protected Member Functions

virtual bool ProcessHelpMsg (MSG &msg)
 
virtual void SetHelpCursor ()
 
void EvHelp (const HELPINFO &)
 Event handler for the WM_HELP message.
 
void EvHelpHit (const THelpHitInfo &)
 
void CmContextHelp ()
 
void CeContextHelp (TCommandEnabler &ce)
 
void CmWhatIsThis ()
 
 DECLARE_RESPONSE_TABLE (THelpFileManager)
 
- Protected Member Functions inherited from owl::TEventHandler
bool SearchEntries (const TGenericTableEntry *entries, TEventInfo &info, TEqualOperator op)
 Low-level response table search function.
 

Protected Attributes

bool UseHTMLHelp
 
bool WinToHTML
 
TContextListContextTable
 
tstring HelpFileName
 
TCursorHelpCursor
 
bool ContextHelp
 
bool HelpState
 
TPoint LastHit
 
TWindowLastParent
 

Additional Inherited Members

- Public Types inherited from owl::TEventHandler
typedef bool(* TEqualOperator) (const TGenericTableEntry &, const TEventInfo &)
 

Detailed Description

THelpFileManager, which is designed to be a mix-in for TApplication, uses the global context table.

THelpFileManager looks for the WM_HELP message and calls the help file with the associated context ID.

Todo
HTMLHelp should be by default, and discourage using old WinHelp files as they are not well supported under Windows Vista and later

Definition at line 154 of file hlpmanag.h.

Member Typedef Documentation

◆ TContextList

◆ TContextListIterator

Constructor & Destructor Documentation

◆ THelpFileManager()

owl::THelpFileManager::THelpFileManager ( const tstring & helpFileName)

Constructor.

Saves the name of the help file and creates the global context table.

Definition at line 90 of file hlpmanag.cpp.

References ContextTable, and SetHelpFile().

◆ ~THelpFileManager()

owl::THelpFileManager::~THelpFileManager ( )
virtual

Deletes the allocated context table.

Definition at line 106 of file hlpmanag.cpp.

References ContextTable, and HelpCursor.

Member Function Documentation

◆ ActivateHelp()

void owl::THelpFileManager::ActivateHelp ( TWindow * ,
int helpFileContextId,
uint hlpCmd = HELP_CONTEXT )
virtual

Called by EvHelp() to activate the help file with the help context ID.

Definition at line 116 of file hlpmanag.cpp.

References GetHelpFile(), HelpState, HtmlHelp(), owl::ToBool(), TYPESAFE_DOWNCAST, and UseHTMLHelp.

◆ AddContextInfo()

void owl::THelpFileManager::AddContextInfo ( TWindow * window,
int helpId,
int menuId,
int controlId )

Adds an entry into the global context table.

Definition at line 524 of file hlpmanag.cpp.

References ContextTable.

◆ CeContextHelp()

void owl::THelpFileManager::CeContextHelp ( TCommandEnabler & ce)
protected

Definition at line 281 of file hlpmanag.cpp.

◆ CmContextHelp()

void owl::THelpFileManager::CmContextHelp ( )
protected

Definition at line 271 of file hlpmanag.cpp.

References ContextHelp, and SetHelpCursor().

◆ CmWhatIsThis()

◆ DeactivateHelp()

void owl::THelpFileManager::DeactivateHelp ( )
virtual

Deactivates the help.

Definition at line 143 of file hlpmanag.cpp.

References GetHelpFile(), HtmlHelp(), TYPESAFE_DOWNCAST, and UseHTMLHelp.

◆ DECLARE_RESPONSE_TABLE()

owl::THelpFileManager::DECLARE_RESPONSE_TABLE ( THelpFileManager )
protected

◆ EvHelp()

void owl::THelpFileManager::EvHelp ( const HELPINFO & hi)
protected

Event handler for the WM_HELP message.

Definition at line 333 of file hlpmanag.cpp.

References ActivateHelp(), GetHelpContextFromControl(), GetHelpContextFromMenu(), and LastHit.

◆ EvHelpHit()

void owl::THelpFileManager::EvHelpHit ( const THelpHitInfo & hit)
inlineprotected

Definition at line 327 of file hlpmanag.h.

References LastHit, and LastParent.

◆ GetHelpContextFromControl()

bool owl::THelpFileManager::GetHelpContextFromControl ( THelpContext & context,
int controlId,
HWND ctrl ) const

Returns true if a match for the control ID was found.

Definition at line 451 of file hlpmanag.cpp.

References ContextTable, owl::IsIndirectHelpContext(), and owl::IsLastIndirectContext().

◆ GetHelpContextFromMenu()

bool owl::THelpFileManager::GetHelpContextFromMenu ( THelpContext & context,
int menuId ) const

Returns true if a match for the menu item ID was found.

Definition at line 494 of file hlpmanag.cpp.

References ContextTable, owl::IsIndirectHelpContext(), and owl::IsLastIndirectContext().

◆ GetHelpFile()

tstring owl::THelpFileManager::GetHelpFile ( ) const
inline

Returns the name of the help file.

Definition at line 318 of file hlpmanag.h.

References HelpFileName.

◆ HtmlHelp() [1/2]

HWND owl::THelpFileManager::HtmlHelp ( TWindow * wnd,
LPCTSTR lpszHelp,
uint hlpCmd,
DWORD_PTR data )

Definition at line 164 of file hlpmanag.cpp.

References owl::GetWindowPtr(), HtmlHelp(), LastHit, and WinToHTML.

◆ HtmlHelp() [2/2]

HWND owl::THelpFileManager::HtmlHelp ( TWindow * w,
const tstring & helpFile,
uint hlpCmd,
DWORD_PTR data )
inline

Definition at line 187 of file hlpmanag.h.

◆ ProcessHelpMsg()

bool owl::THelpFileManager::ProcessHelpMsg ( MSG & msg)
protectedvirtual

Definition at line 364 of file hlpmanag.cpp.

References CmContextHelp(), ContextHelp, EvHelp(), SetHelpCursor(), and TYPESAFE_DOWNCAST.

◆ RemoveContextInfo()

void owl::THelpFileManager::RemoveContextInfo ( TWindow * window)

Removes all the entries in the context table for the window.

Definition at line 542 of file hlpmanag.cpp.

References ContextTable, and DeactivateHelp().

◆ SetHelpCursor()

void owl::THelpFileManager::SetHelpCursor ( )
protectedvirtual

Definition at line 257 of file hlpmanag.cpp.

References TYPESAFE_DOWNCAST.

◆ SetHelpFile()

void owl::THelpFileManager::SetHelpFile ( const tstring & helpFileName)

Changes the name of the help file.

Definition at line 236 of file hlpmanag.cpp.

References _T, _tcsicmp, _tcsrchr, HelpFileName, and UseHTMLHelp.

◆ TranslateWinToHTML()

void owl::THelpFileManager::TranslateWinToHTML ( bool translate)
inline

Definition at line 190 of file hlpmanag.h.

Member Data Documentation

◆ ContextHelp

bool owl::THelpFileManager::ContextHelp
protected

Definition at line 204 of file hlpmanag.h.

◆ ContextTable

TContextList* owl::THelpFileManager::ContextTable
protected

Definition at line 199 of file hlpmanag.h.

◆ DECLARE_CASTABLE

owl::THelpFileManager::DECLARE_CASTABLE

Definition at line 156 of file hlpmanag.h.

◆ HelpCursor

TCursor* owl::THelpFileManager::HelpCursor
protected

Definition at line 202 of file hlpmanag.h.

◆ HelpFileName

tstring owl::THelpFileManager::HelpFileName
protected

Definition at line 201 of file hlpmanag.h.

◆ HelpState

bool owl::THelpFileManager::HelpState
protected

Definition at line 205 of file hlpmanag.h.

◆ LastHit

TPoint owl::THelpFileManager::LastHit
protected

Definition at line 207 of file hlpmanag.h.

◆ LastParent

TWindow* owl::THelpFileManager::LastParent
protected

Definition at line 208 of file hlpmanag.h.

◆ UseHTMLHelp

bool owl::THelpFileManager::UseHTMLHelp
protected

Definition at line 193 of file hlpmanag.h.

◆ WinToHTML

bool owl::THelpFileManager::WinToHTML
protected

Definition at line 194 of file hlpmanag.h.


The documentation for this class was generated from the following files: