18#if !defined(OWL_HLPMANAG_RH)
19# include <owl/hlpmanag.rh>
22#if defined(__BORLANDC__)
30static tchar HtmlHelpDllName[] =
_T(
"HHCTRL.OCX");
34 TModule(HtmlHelpDllName, true, true, false),
47 cbStruct =
sizeof(HH_POPUP);
52 clrForeground =
static_cast<COLORREF
>(-1);
53 clrBackground =
static_cast<COLORREF
>(-1);
54 rcMargins =
TRect(-1,-1,-1,-1);
61 fsValidMembers |= HHWIN_PARAM_STYLES;
68 fsValidMembers |= HHWIN_PARAM_PROPERTIES;
69 fsWinProperties |= prop;
75 fsValidMembers |= HHWIN_PARAM_TB_FLAGS;
76 fsToolBarFlags |= flags;
82 fsValidMembers |= HHWIN_PARAM_TB_FLAGS;
118 if (helpCmd == HELP_INDEX || helpCmd == HELP_CONTENTS)
119 helpCmd = HELP_FINDER;
124 helpCmd, helpFileContextId) !=
nullptr);
127 helpCmd, helpFileContextId) !=
nullptr);
132 helpCmd, helpFileContextId));
135 helpCmd, helpFileContextId));
156 ::WinHelp(
nullptr,
GetHelpFile().c_str(), HELP_QUIT, 0);
171 command = HH_HELP_FINDER;
174 command = HH_HELP_CONTEXT;
177 command = HH_TP_HELP_WM_HELP;
179 case HELP_CONTEXTMENU:
180 command = HH_TP_HELP_CONTEXTMENU;
183 command = HH_CLOSE_ALL;
185 case HELP_CONTEXTPOPUP: {
186 command = HH_DISPLAY_TEXT_POPUP;
193 memset(&hPop, 0,
sizeof(hPop));
194 hPop.cbStruct =
sizeof(hPop);
195 hPop.clrBackground = -1;
196 hPop.clrForeground = -1;
197 hPop.rcMargins.left = -1;
198 hPop.rcMargins.bottom = -1;
199 hPop.rcMargins.right = -1;
201 hPop.idString =
static_cast<UINT
>(data);
202 hPop.pszText =
nullptr;
203 hPop.pszFont =
nullptr;
205 const HWND w = wnd ? wnd->
GetHandle() :
nullptr;
289 Info.cbSize =
sizeof(Info);
297 Info.iContextType = HELPINFO_MENUITEM;
298 Info.iCtrlId = gd->
GetId();
304 Info.iContextType = HELPINFO_WINDOW;
305 Info.dwContextId = 0;
309 Info.iContextType = HELPINFO_MENUITEM;
310 Info.iCtrlId = IDHELP;
314 Info.iCtrlId = ::GetDlgCtrlID(hWnd);
315 Info.hItemHandle = hWnd;
327 bool success =
false;
328 uint hlpCmd = HELP_CONTEXTPOPUP;
330 if (hi.iContextType == HELPINFO_MENUITEM){
332 hlpCmd = HELP_CONTEXT;
334 else if (hi.iContextType == HELPINFO_WINDOW)
338 if (::GetKeyState(VK_F1) < 0 && ::GetKeyState(VK_SHIFT) < 0)
344 else if(::GetKeyState(VK_F1) < 0)
357 if (msg.message == WM_COMMAND) {
362 Info.cbSize =
sizeof(Info);
363 Info.iContextType = HELPINFO_MENUITEM;
364 Info.iCtrlId =
static_cast<int>(msg.wParam);
365 Info.dwContextId = 0;
371 switch (msg.message) {
373 if (msg.wParam == VK_F1) {
392 case WM_NCMOUSEMOVE :
407 if(msg.wParam == MSGF_MENU)
408 if (GetKeyState(VK_F1) < 0) {
429MatchControlId(
const THelpContext& context,
int controlId, HWND hwnd)
443 int controlId, HWND hwnd)
const
448 context = iterator.Current();
455 if (MatchControlId(*indirect, controlId, hwnd)) {
462 else if (MatchControlId(context, controlId, hwnd))
490 context = iterator.Current();
498 if (MatchMenuId(*indirect, menuId)) {
505 else if (MatchMenuId(context, menuId))
550 HelpFileContextId(0),
563 HelpFileContextId(helpId),
564 MenuContextId(menuId),
565 ControlContextId(controlId)
Definition of class TApplication.
#define PRECONDITION(condition)
Derived from TModule and TMsgThread and virtually derived from TEventHandler, TApplication acts as an...
TFrameWindow * GetMainWindow()
Return the current main window.
T * FirstThat(CondFunc cond, void *args) const
bool DetachItem(const T &t)
Base class for an extensible interface for auto enabling/disabling of commands (menu items,...
virtual void Enable(bool enable=true)
Enables or disables the command sender.
TCursor(HCURSOR handle, TAutoDelete autoDelete=NoAutoDelete)
Creates a TCursor object and sets the Handle data member to the given borrowed handle.
TEventHandler is a base class from which you can derive classes that handle messages.
TGadget is the base class for the following derived gadget classes:
int GetId() const
Gets the ID for the gadget.
TGadget * GadgetFromPoint(const TPoint &point) const
Returns the gadget that a given window-relative point is in, or 0 if none is found.
Derived from TWindow, TGadgetWindow maintains a list of tiled gadgets for a window and lets you dynam...
THelpContext is a class that maintains information about a menu item id and a child control id with a...
bool operator==(const THelpContext &) const
Returns true if the context entries match.
bool operator<(const THelpContext &) const
THelpContext()
Default constructor that initializes every data member to zero.
int GetHelpFileContextId() const
Returns the help file context id for the context entry.
int GetControlContextId() const
Returns the child control id for this context entry.
TWindow * GetWindow() const
Returns the window this entry is associated with.
THelpContext & operator=(const THelpContext &)
Makes a copy of the context entry.
int GetMenuContextId() const
Returns the menu id for this context entry.
THelpFileManager, which is designed to be a mix-in for TApplication, uses the global context table.
virtual bool ProcessHelpMsg(MSG &msg)
HWND HtmlHelp(TWindow *, LPCTSTR lpszHelp, uint hlpCmd, DWORD_PTR data)
TBaseList< THelpContext > TContextList
void RemoveContextInfo(TWindow *)
Removes all the entries in the context table for the window.
void EvHelp(const HELPINFO &)
Event handler for the WM_HELP message.
void AddContextInfo(TWindow *, int helpId, int menuId, int controlId)
Adds an entry into the global context table.
virtual ~THelpFileManager()
Deletes the allocated context table.
virtual void SetHelpCursor()
TBaseListIterator< THelpContext > TContextListIterator
THelpFileManager(const tstring &helpFileName)
Constructor.
bool GetHelpContextFromMenu(THelpContext &, int menuId) const
Returns true if a match for the menu item ID was found.
virtual void DeactivateHelp()
Deactivates the help.
tstring GetHelpFile() const
Returns the name of the help file.
virtual void ActivateHelp(TWindow *, int helpFileContextId, uint hlpCmd=HELP_CONTEXT)
Called by EvHelp() to activate the help file with the help context ID.
TContextList * ContextTable
void SetHelpFile(const tstring &helpFileName)
Changes the name of the help file.
void CeContextHelp(TCommandEnabler &ce)
bool GetHelpContextFromControl(THelpContext &, int controlId, HWND ctrl) const
Returns true if a match for the control ID was found.
void SetWindowsPos(const TRect &rect)
void SetToolBarFlags(int flags)
void SetProperties(int prop)
TModuleProc4< HWND, HWND, LPCTSTR, uint, DWORD_PTR > HtmlHelp
TModuleProc0< HRESULT > DllCanUnloadNow
TModuleProc3< HRESULT, REFCLSID, REFIID, void ** > DllGetClassObject
TPoint()
Constructs an uninitialized point.
TRect is a mathematical class derived from tagRect.
TRect()
Default constructor that does nothing.
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
bool SetCursor(TModule *module, TResId resId)
Sets the mouse cursor for the window, loading the given resId from the given module.
HWND ChildWindowFromPoint(const TPoint &point) const
Determines which of the child windows contains the point specified in TPoint.
TWindowAttr & GetWindowAttr()
Returns the TWindowAttr structure, which contains the window's creation attributes.
bool IsChild(HWND hWnd) const
Returns true if the window is a child window or a descendant window of this window.
bool WinHelp(LPCTSTR helpFile, uint command, ULONG_PTR data) const
Invokes a specified help system.
bool PostMessage(TMsgId, TParam1=0, TParam2=0)
Posts a message (msg) to the window in the application's message queue.
void ScreenToClient(TPoint &point) const
Uses the screen coordinates specified in point to calculate the client window's coordinates and then ...
HWND GetHandle() const
Returns the handle of the window.
auto ChildWithId(int id) const -> const TWindow *
#define DEFINE_RESPONSE_TABLE1(cls, base)
Macro to define a response table for a class with one base.
Definition of class TFrameWindow.
Definition of TGadgetList, TGadgetWindow & TGadgetWindowFont A list holding gadgets,...
TModule(const tstring &name, bool shouldLoad=true, bool mustLoad=true, bool addToList=true)
Constructs a TModule object that is used as an alias for a DLL.
static bool IsAvailable()
static THtmlHelpDll * Dll()
Declares THelpContext and THelpFileManager.
Object Windows Library (OWLNext Core).
TWindow * GetWindowPtr(HWND, const TApplication *)
Raw function to retrieve a TWindow pointer given an HWND from the a given app, or any app (app==0).
bool IsLastIndirectContext(const THelpContext &context)
Return true if this entry is the last entry.
bool IsIndirectHelpContext(const THelpContext &context)
Return true if the context entry is a pointer to another table.
EV_COMMAND_ENABLE(CM_FILENEW, CeFileNew)
EV_COMMAND(IDOK, CmOkCancel)
#define TYPESAFE_DOWNCAST(object, toClass)
int X
horizontal position of top left corenr of the window
int Y
vertical position of top left corenr of the window
Definition of container classes used and made available by OWL.
Base window class TWindow definition, including HWND encapsulation.