Added wxCHMHelpController, updated help demo. Added DisplaySection(const wxString&)
to wxHelpControllerBase. Corrected some Dialog Editor bugs. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7205 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
@@ -253,6 +253,7 @@ gaugemsw.cpp M 16
|
|||||||
gdiimage.cpp M
|
gdiimage.cpp M
|
||||||
gdiobj.cpp M
|
gdiobj.cpp M
|
||||||
glcanvas.cpp M
|
glcanvas.cpp M
|
||||||
|
helpchm.cpp M 32
|
||||||
helpwin.cpp M
|
helpwin.cpp M
|
||||||
icon.cpp M
|
icon.cpp M
|
||||||
imaglist.cpp M 32
|
imaglist.cpp M 32
|
||||||
@@ -618,6 +619,7 @@ hash.h W B
|
|||||||
help.h W
|
help.h W
|
||||||
helpbase.h W
|
helpbase.h W
|
||||||
helphtml.h W
|
helphtml.h W
|
||||||
|
helpchm.h W
|
||||||
helpwin.h W
|
helpwin.h W
|
||||||
helpxlp.h W
|
helpxlp.h W
|
||||||
icon.h W
|
icon.h W
|
||||||
@@ -903,6 +905,7 @@ gaugemsw.h 9
|
|||||||
gdiimage.h 9
|
gdiimage.h 9
|
||||||
gdiobj.h 9
|
gdiobj.h 9
|
||||||
glcanvas.h 9
|
glcanvas.h 9
|
||||||
|
helpchm.h 9
|
||||||
helpwin.h 9
|
helpwin.h 9
|
||||||
icon.h 9
|
icon.h 9
|
||||||
imaglist.h 9
|
imaglist.h 9
|
||||||
|
@@ -31,6 +31,8 @@ There are currently the following help controller classes defined:
|
|||||||
|
|
||||||
\begin{itemize}\itemsep=0pt
|
\begin{itemize}\itemsep=0pt
|
||||||
\item wxWinHelpController, for controlling Windows Help.
|
\item wxWinHelpController, for controlling Windows Help.
|
||||||
|
\item wxCHMHelpController, for controlling MS HTML Help. To use this, you need to set wxUSE\_MS\_HTML\_HELP
|
||||||
|
to 0 in setup.h, and link your application with Microsoft's htmlhelp.lib. Currently VC++ only.
|
||||||
\item wxExtHelpController, for controlling external browsers under Unix.
|
\item wxExtHelpController, for controlling external browsers under Unix.
|
||||||
The default browser is Netscape Navigator. The 'help' sample shows its use.
|
The default browser is Netscape Navigator. The 'help' sample shows its use.
|
||||||
\item wxHelpControllerHtml, using \helpref{wxHTML}{wxhtml} to display help. See {\tt wx/helpwxht.h} for
|
\item wxHelpControllerHtml, using \helpref{wxHTML}{wxhtml} to display help. See {\tt wx/helpwxht.h} for
|
||||||
@@ -51,6 +53,7 @@ wxHelpControllerBase\\
|
|||||||
<wx/help.h> (wxWindows chooses the appropriate help controller class)\\
|
<wx/help.h> (wxWindows chooses the appropriate help controller class)\\
|
||||||
<wx/helpbase.h> (wxHelpControllerBase class)\\
|
<wx/helpbase.h> (wxHelpControllerBase class)\\
|
||||||
<wx/helpwin.h> (Windows Help controller)\\
|
<wx/helpwin.h> (Windows Help controller)\\
|
||||||
|
<wx/msw/helpchm.h> (MS HTML Help controller)\\
|
||||||
<wx/generic/helpext.h> (external HTML browser controller)\\
|
<wx/generic/helpext.h> (external HTML browser controller)\\
|
||||||
<wx/generic/helpwxht.h> (simple wxHTML-based help controller)\\
|
<wx/generic/helpwxht.h> (simple wxHTML-based help controller)\\
|
||||||
<wx/html/helpctrl.h> (advanced wxHTML based help controller: wxHtmlHelpController)
|
<wx/html/helpctrl.h> (advanced wxHTML based help controller: wxHtmlHelpController)
|
||||||
@@ -111,11 +114,20 @@ contents.
|
|||||||
|
|
||||||
\membersection{wxHelpController::DisplaySection}\label{wxhelpcontrollerdisplaysection}
|
\membersection{wxHelpController::DisplaySection}\label{wxhelpcontrollerdisplaysection}
|
||||||
|
|
||||||
|
\func{virtual bool}{DisplaySection}{\param{const wxString\&}{ section}}
|
||||||
|
|
||||||
|
If the help viewer is not running, runs it and displays the given section.
|
||||||
|
|
||||||
|
The interpretation of {\it section} differs between help viewers. For most viewers,
|
||||||
|
this call is equivalent to KeywordSearch. For MS HTML Help, if {\it section} has a .htm
|
||||||
|
or .html extension, that HTML file within the .chm file will be displayed; otherwise
|
||||||
|
a keyword search is done.
|
||||||
|
|
||||||
\func{virtual bool}{DisplaySection}{\param{int}{ sectionNo}}
|
\func{virtual bool}{DisplaySection}{\param{int}{ sectionNo}}
|
||||||
|
|
||||||
If the help viewer is not running, runs it and displays the given section.
|
If the help viewer is not running, runs it and displays the given section.
|
||||||
|
|
||||||
{\it WinHelp:} {\it sectionNo} is a context id.
|
{\it WinHelp, MS HTML Help:} {\it sectionNo} is a context id.
|
||||||
|
|
||||||
{\it External HTML help/wxHTML based help:} wxExtHelpController and wxHelpControllerHtml implement {\it sectionNo} as an id in a map file, which is of the form:
|
{\it External HTML help/wxHTML based help:} wxExtHelpController and wxHelpControllerHtml implement {\it sectionNo} as an id in a map file, which is of the form:
|
||||||
|
|
||||||
@@ -127,6 +139,8 @@ If the help viewer is not running, runs it and displays the given section.
|
|||||||
|
|
||||||
{\it wxHtmlHelpController:} {\it sectionNo} is an identifier as specified in the {\tt .hhc} file. See \helpref{Help files format}{helpformat}.
|
{\it wxHtmlHelpController:} {\it sectionNo} is an identifier as specified in the {\tt .hhc} file. See \helpref{Help files format}{helpformat}.
|
||||||
|
|
||||||
|
See also the help sample for notes on how to specify section numbers for various help file formats.
|
||||||
|
|
||||||
\membersection{wxHelpController::GetFrameParameters}\label{wxhelpcontrollergetframeparameters}
|
\membersection{wxHelpController::GetFrameParameters}\label{wxhelpcontrollergetframeparameters}
|
||||||
|
|
||||||
\func{virtual wxFrame *}{GetFrameParameters}{\param{const wxSize * }{size = NULL}, \param{const wxPoint * }{pos = NULL},
|
\func{virtual wxFrame *}{GetFrameParameters}{\param{const wxSize * }{size = NULL}, \param{const wxPoint * }{pos = NULL},
|
||||||
@@ -159,7 +173,7 @@ that the viewer is a variant of Netscape Navigator.}
|
|||||||
If the help viewer is not running, runs it, and searches for sections matching the given keyword. If one
|
If the help viewer is not running, runs it, and searches for sections matching the given keyword. If one
|
||||||
match is found, the file is displayed at this section.
|
match is found, the file is displayed at this section.
|
||||||
|
|
||||||
{\it WinHelp:} If more than one match is found,
|
{\it WinHelp, MS HTML Help:} If more than one match is found,
|
||||||
the first topic is displayed.
|
the first topic is displayed.
|
||||||
|
|
||||||
{\it External HTML help:} If more than one match is found,
|
{\it External HTML help:} If more than one match is found,
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
[OPTIONS]
|
[OPTIONS]
|
||||||
BMROOT=d:\wx2\wxWind~1\docs/latex/wx ; Assume that bitmaps are where the source is
|
BMROOT=d:\wx2\wxWindows\docs\latex\wx ; Assume that bitmaps are where the source is
|
||||||
TITLE=wxWindows Manual
|
TITLE=wxWindows Manual
|
||||||
CONTENTS=Contents
|
CONTENTS=Contents
|
||||||
COMPRESS=HIGH
|
COMPRESS=HIGH
|
||||||
|
@@ -30,48 +30,52 @@
|
|||||||
// Defines the API for help controllers
|
// Defines the API for help controllers
|
||||||
class WXDLLEXPORT wxHelpControllerBase: public wxObject
|
class WXDLLEXPORT wxHelpControllerBase: public wxObject
|
||||||
{
|
{
|
||||||
DECLARE_CLASS(wxHelpControllerBase)
|
DECLARE_CLASS(wxHelpControllerBase)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
inline wxHelpControllerBase() {}
|
inline wxHelpControllerBase() {}
|
||||||
inline ~wxHelpControllerBase() {};
|
inline ~wxHelpControllerBase() {};
|
||||||
|
|
||||||
// Must call this to set the filename and server name.
|
// Must call this to set the filename and server name.
|
||||||
// server is only required when implementing TCP/IP-based
|
// server is only required when implementing TCP/IP-based
|
||||||
// help controllers.
|
// help controllers.
|
||||||
virtual bool Initialize(const wxString& WXUNUSED(file), int WXUNUSED(server) ) { return FALSE; }
|
virtual bool Initialize(const wxString& WXUNUSED(file), int WXUNUSED(server) ) { return FALSE; }
|
||||||
virtual bool Initialize(const wxString& WXUNUSED(file)) { return FALSE; }
|
virtual bool Initialize(const wxString& WXUNUSED(file)) { return FALSE; }
|
||||||
|
|
||||||
// Set viewer: only relevant to some kinds of controller
|
// Set viewer: only relevant to some kinds of controller
|
||||||
virtual void SetViewer(const wxString& WXUNUSED(viewer), long WXUNUSED(flags) = 0) {}
|
virtual void SetViewer(const wxString& WXUNUSED(viewer), long WXUNUSED(flags) = 0) {}
|
||||||
|
|
||||||
// If file is "", reloads file given in Initialize
|
// If file is "", reloads file given in Initialize
|
||||||
virtual bool LoadFile(const wxString& file = "") = 0;
|
virtual bool LoadFile(const wxString& file = "") = 0;
|
||||||
virtual bool DisplayContents(void) = 0;
|
virtual bool DisplayContents(void) = 0;
|
||||||
virtual bool DisplaySection(int sectionNo) = 0;
|
virtual bool DisplaySection(int sectionNo) = 0;
|
||||||
virtual bool DisplayBlock(long blockNo) = 0;
|
|
||||||
virtual bool KeywordSearch(const wxString& k) = 0;
|
|
||||||
/// Allows one to override the default settings for the help frame.
|
|
||||||
virtual void SetFrameParameters(const wxString& WXUNUSED(title),
|
|
||||||
const wxSize& WXUNUSED(size),
|
|
||||||
const wxPoint& WXUNUSED(pos) = wxDefaultPosition,
|
|
||||||
bool WXUNUSED(newFrameEachTime) = FALSE)
|
|
||||||
{
|
|
||||||
// does nothing by default
|
|
||||||
}
|
|
||||||
/// Obtains the latest settings used by the help frame and the help
|
|
||||||
/// frame.
|
|
||||||
virtual wxFrame *GetFrameParameters(wxSize *WXUNUSED(size) = NULL,
|
|
||||||
wxPoint *WXUNUSED(pos) = NULL,
|
|
||||||
bool *WXUNUSED(newFrameEachTime) = NULL)
|
|
||||||
{
|
|
||||||
return (wxFrame*) NULL;// does nothing by default
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual bool Quit(void) = 0;
|
// By default, uses KeywordSection to display a topic. Implementations
|
||||||
virtual void OnQuit(void) {};
|
// may override this for more specific behaviour.
|
||||||
|
virtual bool DisplaySection(const wxString& section) { return KeywordSearch(section); };
|
||||||
|
virtual bool DisplayBlock(long blockNo) = 0;
|
||||||
|
virtual bool KeywordSearch(const wxString& k) = 0;
|
||||||
|
/// Allows one to override the default settings for the help frame.
|
||||||
|
virtual void SetFrameParameters(const wxString& WXUNUSED(title),
|
||||||
|
const wxSize& WXUNUSED(size),
|
||||||
|
const wxPoint& WXUNUSED(pos) = wxDefaultPosition,
|
||||||
|
bool WXUNUSED(newFrameEachTime) = FALSE)
|
||||||
|
{
|
||||||
|
// does nothing by default
|
||||||
|
}
|
||||||
|
/// Obtains the latest settings used by the help frame and the help
|
||||||
|
/// frame.
|
||||||
|
virtual wxFrame *GetFrameParameters(wxSize *WXUNUSED(size) = NULL,
|
||||||
|
wxPoint *WXUNUSED(pos) = NULL,
|
||||||
|
bool *WXUNUSED(newFrameEachTime) = NULL)
|
||||||
|
{
|
||||||
|
return (wxFrame*) NULL;// does nothing by default
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual bool Quit(void) = 0;
|
||||||
|
virtual void OnQuit(void) {};
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // wxUSE_HELP
|
#endif // wxUSE_HELP
|
||||||
#endif
|
#endif
|
||||||
// _WX_HELPBASEH__
|
// _WX_HELPBASEH__
|
||||||
|
@@ -70,6 +70,7 @@ class WXDLLEXPORT wxHtmlHelpController : public wxHelpControllerBase // wxEvtHan
|
|||||||
virtual void SetViewer(const wxString& WXUNUSED(viewer), long WXUNUSED(flags) = 0) {}
|
virtual void SetViewer(const wxString& WXUNUSED(viewer), long WXUNUSED(flags) = 0) {}
|
||||||
virtual bool LoadFile(const wxString& file = "");
|
virtual bool LoadFile(const wxString& file = "");
|
||||||
virtual bool DisplaySection(int sectionNo);
|
virtual bool DisplaySection(int sectionNo);
|
||||||
|
virtual bool DisplaySection(const wxString& section) { return Display(section); }
|
||||||
virtual bool DisplayBlock(long blockNo) { return DisplaySection(blockNo); }
|
virtual bool DisplayBlock(long blockNo) { return DisplaySection(blockNo); }
|
||||||
virtual void SetFrameParameters(const wxString& title,
|
virtual void SetFrameParameters(const wxString& title,
|
||||||
const wxSize& size,
|
const wxSize& size,
|
||||||
|
57
include/wx/msw/helpchm.h
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: helpchm.h
|
||||||
|
// Purpose: Help system: MS HTML Help implementation
|
||||||
|
// Author: Julian Smart
|
||||||
|
// Modified by:
|
||||||
|
// Created: 16/04/2000
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Julian Smart
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_HELPCHM_H_
|
||||||
|
#define _WX_HELPCHM_H_
|
||||||
|
|
||||||
|
#ifdef __GNUG__
|
||||||
|
#pragma interface "helpchm.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "wx/wx.h"
|
||||||
|
|
||||||
|
#if wxUSE_HELP
|
||||||
|
|
||||||
|
#include "wx/helpbase.h"
|
||||||
|
|
||||||
|
class WXDLLEXPORT wxCHMHelpController: public wxHelpControllerBase
|
||||||
|
{
|
||||||
|
DECLARE_CLASS(wxCHMHelpController)
|
||||||
|
|
||||||
|
public:
|
||||||
|
wxCHMHelpController() {}
|
||||||
|
~wxCHMHelpController() {}
|
||||||
|
|
||||||
|
// Must call this to set the filename
|
||||||
|
virtual bool Initialize(const wxString& file);
|
||||||
|
|
||||||
|
// If file is "", reloads file given in Initialize
|
||||||
|
virtual bool LoadFile(const wxString& file = wxEmptyString);
|
||||||
|
virtual bool DisplayContents();
|
||||||
|
virtual bool DisplaySection(int sectionNo);
|
||||||
|
virtual bool DisplaySection(const wxString& section);
|
||||||
|
virtual bool DisplayBlock(long blockNo);
|
||||||
|
virtual bool KeywordSearch(const wxString& k);
|
||||||
|
virtual bool Quit();
|
||||||
|
|
||||||
|
inline wxString GetHelpFile() const { return m_helpFile; }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// Append extension if necessary.
|
||||||
|
wxString GetValidFilename(const wxString& file) const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
wxString m_helpFile;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // wxUSE_HELP
|
||||||
|
#endif
|
||||||
|
// _WX_HELPCHM_H_
|
@@ -24,31 +24,33 @@
|
|||||||
|
|
||||||
class WXDLLEXPORT wxWinHelpController: public wxHelpControllerBase
|
class WXDLLEXPORT wxWinHelpController: public wxHelpControllerBase
|
||||||
{
|
{
|
||||||
DECLARE_CLASS(wxWinHelpController)
|
DECLARE_CLASS(wxWinHelpController)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxWinHelpController(void);
|
wxWinHelpController() {};
|
||||||
~wxWinHelpController(void);
|
~wxWinHelpController() {};
|
||||||
|
|
||||||
// Must call this to set the filename and server name
|
// Must call this to set the filename
|
||||||
virtual bool Initialize(const wxString& file);
|
virtual bool Initialize(const wxString& file);
|
||||||
|
|
||||||
// If file is "", reloads file given in Initialize
|
// If file is "", reloads file given in Initialize
|
||||||
virtual bool LoadFile(const wxString& file = "");
|
virtual bool LoadFile(const wxString& file = wxEmptyString);
|
||||||
virtual bool DisplayContents(void);
|
virtual bool DisplayContents();
|
||||||
virtual bool DisplaySection(int sectionNo);
|
virtual bool DisplaySection(int sectionNo);
|
||||||
virtual bool DisplayBlock(long blockNo);
|
virtual bool DisplayBlock(long blockNo);
|
||||||
virtual bool KeywordSearch(const wxString& k);
|
virtual bool KeywordSearch(const wxString& k);
|
||||||
|
virtual bool Quit();
|
||||||
|
|
||||||
virtual bool Quit(void);
|
inline wxString GetHelpFile() const { return m_helpFile; }
|
||||||
virtual void OnQuit(void);
|
|
||||||
|
|
||||||
inline wxString GetHelpFile(void) const { return m_helpFile; }
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
wxString m_helpFile;
|
// Append extension if necessary.
|
||||||
|
wxString GetValidFilename(const wxString& file) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
wxString m_helpFile;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // wxUSE_HELP
|
#endif // wxUSE_HELP
|
||||||
#endif
|
#endif
|
||||||
// _WX_HELPWIN_H_
|
// _WX_HELPWIN_H_
|
||||||
|
@@ -445,9 +445,10 @@
|
|||||||
|
|
||||||
#define wxUSE_IPC 1
|
#define wxUSE_IPC 1
|
||||||
// 0 for no interprocess comms
|
// 0 for no interprocess comms
|
||||||
// Note: wxHELP uses IPC under X so these are interdependent!
|
|
||||||
#define wxUSE_HELP 1
|
#define wxUSE_HELP 1
|
||||||
// 0 for no help facility
|
// 0 for no help facility
|
||||||
|
#define wxUSE_MS_HTML_HELP 0
|
||||||
|
// 0 for no MS HTML Help
|
||||||
#define wxUSE_RESOURCES 1
|
#define wxUSE_RESOURCES 1
|
||||||
// 0 for no wxGetResource/wxWriteResource
|
// 0 for no wxGetResource/wxWriteResource
|
||||||
#define wxUSE_CONSTRAINTS 1
|
#define wxUSE_CONSTRAINTS 1
|
||||||
@@ -605,8 +606,8 @@
|
|||||||
// disable the settings which don't work for some compilers
|
// disable the settings which don't work for some compilers
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
// These don't work as expected for mingw32 and cygwin32
|
|
||||||
#if defined(__GNUWIN32__)
|
#if defined(__GNUWIN32__)
|
||||||
|
// These don't work as expected for mingw32 and cygwin32
|
||||||
#undef wxUSE_MEMORY_TRACING
|
#undef wxUSE_MEMORY_TRACING
|
||||||
#define wxUSE_MEMORY_TRACING 0
|
#define wxUSE_MEMORY_TRACING 0
|
||||||
|
|
||||||
@@ -615,6 +616,9 @@
|
|||||||
|
|
||||||
#undef wxUSE_DEBUG_NEW_ALWAYS
|
#undef wxUSE_DEBUG_NEW_ALWAYS
|
||||||
#define wxUSE_DEBUG_NEW_ALWAYS 0
|
#define wxUSE_DEBUG_NEW_ALWAYS 0
|
||||||
|
|
||||||
|
#undef wxUSE_MS_HTML_HELP
|
||||||
|
#define wxUSE_MS_HTML_HELP 0
|
||||||
#endif // __GNUWIN32__
|
#endif // __GNUWIN32__
|
||||||
|
|
||||||
// MFC duplicates these operators
|
// MFC duplicates these operators
|
||||||
@@ -691,6 +695,12 @@
|
|||||||
#define wxUSE_LIBJPEG 0
|
#define wxUSE_LIBJPEG 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(__BORLANDC__)
|
||||||
|
// Need a BC++-specific htmlhelp.lib before we can enable this
|
||||||
|
#undef wxUSE_MS_HTML_HELP
|
||||||
|
#define wxUSE_MS_HTML_HELP 0
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(__WXMSW__) && defined(__WATCOMC__)
|
#if defined(__WXMSW__) && defined(__WATCOMC__)
|
||||||
#undef wxUSE_LIBJPEG
|
#undef wxUSE_LIBJPEG
|
||||||
#define wxUSE_LIBJPEG 0
|
#define wxUSE_LIBJPEG 0
|
||||||
@@ -700,6 +710,9 @@
|
|||||||
|
|
||||||
#undef wxUSE_GLCANVAS
|
#undef wxUSE_GLCANVAS
|
||||||
#define wxUSE_GLCANVAS 0
|
#define wxUSE_GLCANVAS 0
|
||||||
|
|
||||||
|
#undef wxUSE_MS_HTML_HELP
|
||||||
|
#define wxUSE_MS_HTML_HELP 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__WXMSW__) && !defined(__WIN32__)
|
#if defined(__WXMSW__) && !defined(__WIN32__)
|
||||||
@@ -740,6 +753,8 @@
|
|||||||
#undef wxUSE_GLCANVAS
|
#undef wxUSE_GLCANVAS
|
||||||
#define wxUSE_GLCANVAS 0
|
#define wxUSE_GLCANVAS 0
|
||||||
|
|
||||||
|
#undef wxUSE_MS_HTML_HELP
|
||||||
|
#define wxUSE_MS_HTML_HELP 0
|
||||||
#endif // Win16
|
#endif // Win16
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@@ -36,9 +36,13 @@
|
|||||||
// Extended styles: for resource usage only
|
// Extended styles: for resource usage only
|
||||||
|
|
||||||
// Use dialog units instead of pixels
|
// Use dialog units instead of pixels
|
||||||
#define wxRESOURCE_DIALOG_UNITS 1
|
#define wxRESOURCE_DIALOG_UNITS 0x0001
|
||||||
// Use default system colour and font
|
// Use default system colour and font
|
||||||
#define wxRESOURCE_USE_DEFAULTS 2
|
#define wxRESOURCE_USE_DEFAULTS 0x0002
|
||||||
|
// Old-style vertical label
|
||||||
|
#define wxRESOURCE_VERTICAL_LABEL 0x0004
|
||||||
|
// Old-style horizontal label
|
||||||
|
#define wxRESOURCE_HORIZONTAL_LABEL 0x0008
|
||||||
|
|
||||||
// Macros to help use dialog units
|
// Macros to help use dialog units
|
||||||
#define wxDLG_POINT(x, y, parent, useDlgUnits) (useDlgUnits ? parent->ConvertDialogToPixel(wxPoint(x, y)) : wxPoint(x, y))
|
#define wxDLG_POINT(x, y, parent, useDlgUnits) (useDlgUnits ? parent->ConvertDialogToPixel(wxPoint(x, y)) : wxPoint(x, y))
|
||||||
|
Before Width: | Height: | Size: 225 B After Width: | Height: | Size: 978 B |
Before Width: | Height: | Size: 231 B After Width: | Height: | Size: 996 B |
@@ -48,7 +48,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if USE_HTML_HELP
|
#if USE_HTML_HELP
|
||||||
|
|
||||||
#include <wx/filesys.h>
|
#include <wx/filesys.h>
|
||||||
#include <wx/fs_zip.h>
|
#include <wx/fs_zip.h>
|
||||||
|
|
||||||
@@ -59,6 +58,10 @@
|
|||||||
#include "wx/html/helpctrl.h"
|
#include "wx/html/helpctrl.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if wxUSE_MS_HTML_HELP
|
||||||
|
#include "wx/msw/helpchm.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// ressources
|
// ressources
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -99,12 +102,16 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
wxHtmlHelpController& GetAdvancedHtmlHelpController() { return m_advancedHtmlHelp; }
|
wxHtmlHelpController& GetAdvancedHtmlHelpController() { return m_advancedHtmlHelp; }
|
||||||
#endif
|
#endif
|
||||||
|
#if wxUSE_MS_HTML_HELP
|
||||||
|
wxCHMHelpController& GetMSHtmlHelpController() { return m_msHtmlHelp; }
|
||||||
|
#endif
|
||||||
|
|
||||||
// event handlers (these functions should _not_ be virtual)
|
// event handlers (these functions should _not_ be virtual)
|
||||||
void OnQuit(wxCommandEvent& event);
|
void OnQuit(wxCommandEvent& event);
|
||||||
void OnHelp(wxCommandEvent& event);
|
void OnHelp(wxCommandEvent& event);
|
||||||
void OnHtmlHelp(wxCommandEvent& event);
|
void OnHtmlHelp(wxCommandEvent& event);
|
||||||
void OnAdvancedHtmlHelp(wxCommandEvent& event);
|
void OnAdvancedHtmlHelp(wxCommandEvent& event);
|
||||||
|
void OnMSHtmlHelp(wxCommandEvent& event);
|
||||||
|
|
||||||
void ShowHelp(int commandId, wxHelpControllerBase& helpController);
|
void ShowHelp(int commandId, wxHelpControllerBase& helpController);
|
||||||
|
|
||||||
@@ -118,6 +125,10 @@ private:
|
|||||||
wxHtmlHelpController m_advancedHtmlHelp;
|
wxHtmlHelpController m_advancedHtmlHelp;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if wxUSE_MS_HTML_HELP
|
||||||
|
wxCHMHelpController m_msHtmlHelp;
|
||||||
|
#endif
|
||||||
|
|
||||||
// any class wishing to process wxWindows events must use this macro
|
// any class wishing to process wxWindows events must use this macro
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
@@ -149,6 +160,12 @@ enum
|
|||||||
HelpDemo_Advanced_Html_Help_Help,
|
HelpDemo_Advanced_Html_Help_Help,
|
||||||
HelpDemo_Advanced_Html_Help_Search,
|
HelpDemo_Advanced_Html_Help_Search,
|
||||||
|
|
||||||
|
HelpDemo_MS_Html_Help_Index,
|
||||||
|
HelpDemo_MS_Html_Help_Classes,
|
||||||
|
HelpDemo_MS_Html_Help_Functions,
|
||||||
|
HelpDemo_MS_Html_Help_Help,
|
||||||
|
HelpDemo_MS_Html_Help_Search,
|
||||||
|
|
||||||
HelpDemo_Help_KDE,
|
HelpDemo_Help_KDE,
|
||||||
HelpDemo_Help_GNOME,
|
HelpDemo_Help_GNOME,
|
||||||
HelpDemo_Help_Netscape,
|
HelpDemo_Help_Netscape,
|
||||||
@@ -183,6 +200,12 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
|||||||
EVT_MENU(HelpDemo_Advanced_Html_Help_Help, MyFrame::OnAdvancedHtmlHelp)
|
EVT_MENU(HelpDemo_Advanced_Html_Help_Help, MyFrame::OnAdvancedHtmlHelp)
|
||||||
EVT_MENU(HelpDemo_Advanced_Html_Help_Search, MyFrame::OnAdvancedHtmlHelp)
|
EVT_MENU(HelpDemo_Advanced_Html_Help_Search, MyFrame::OnAdvancedHtmlHelp)
|
||||||
|
|
||||||
|
EVT_MENU(HelpDemo_MS_Html_Help_Index, MyFrame::OnMSHtmlHelp)
|
||||||
|
EVT_MENU(HelpDemo_MS_Html_Help_Classes, MyFrame::OnMSHtmlHelp)
|
||||||
|
EVT_MENU(HelpDemo_MS_Html_Help_Functions, MyFrame::OnMSHtmlHelp)
|
||||||
|
EVT_MENU(HelpDemo_MS_Html_Help_Help, MyFrame::OnMSHtmlHelp)
|
||||||
|
EVT_MENU(HelpDemo_MS_Html_Help_Search, MyFrame::OnMSHtmlHelp)
|
||||||
|
|
||||||
EVT_MENU(HelpDemo_Help_KDE, MyFrame::OnHelp)
|
EVT_MENU(HelpDemo_Help_KDE, MyFrame::OnHelp)
|
||||||
EVT_MENU(HelpDemo_Help_GNOME, MyFrame::OnHelp)
|
EVT_MENU(HelpDemo_Help_GNOME, MyFrame::OnHelp)
|
||||||
EVT_MENU(HelpDemo_Help_Netscape, MyFrame::OnHelp)
|
EVT_MENU(HelpDemo_Help_Netscape, MyFrame::OnHelp)
|
||||||
@@ -237,9 +260,9 @@ bool MyApp::OnInit()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if USE_HTML_HELP
|
#if USE_HTML_HELP
|
||||||
#if USE_OLD_HTML_HELP
|
|
||||||
// initialise the standard HTML help system: this means that the HTML docs are in the
|
// initialise the standard HTML help system: this means that the HTML docs are in the
|
||||||
// subdirectory doc for platforms using HTML help
|
// subdirectory doc for platforms using HTML help
|
||||||
|
#if USE_OLD_HTML_HELP
|
||||||
if ( !frame->GetHtmlHelpController().Initialize("doc") )
|
if ( !frame->GetHtmlHelpController().Initialize("doc") )
|
||||||
{
|
{
|
||||||
wxLogError("Cannot initialize the HTML help system, aborting.");
|
wxLogError("Cannot initialize the HTML help system, aborting.");
|
||||||
@@ -258,6 +281,15 @@ bool MyApp::OnInit()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if wxUSE_MS_HTML_HELP
|
||||||
|
if ( !frame->GetMSHtmlHelpController().Initialize("doc") )
|
||||||
|
{
|
||||||
|
wxLogError("Cannot initialize the MS HTML help system, aborting.");
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -297,6 +329,15 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
|
|||||||
menuFile->Append(HelpDemo_Advanced_Html_Help_Search, "Advanced HTML &Search help...");
|
menuFile->Append(HelpDemo_Advanced_Html_Help_Search, "Advanced HTML &Search help...");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if wxUSE_MS_HTML_HELP
|
||||||
|
menuFile->AppendSeparator();
|
||||||
|
menuFile->Append(HelpDemo_MS_Html_Help_Index, "MS HTML &Help Index...");
|
||||||
|
menuFile->Append(HelpDemo_MS_Html_Help_Classes, "MS HTML &Help on Classes...");
|
||||||
|
menuFile->Append(HelpDemo_MS_Html_Help_Functions, "MS HTML &Help on Functions...");
|
||||||
|
menuFile->Append(HelpDemo_MS_Html_Help_Help, "MS HTML &About Help Demo...");
|
||||||
|
menuFile->Append(HelpDemo_MS_Html_Help_Search, "MS HTML &Search help...");
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __WXMSW__
|
#ifndef __WXMSW__
|
||||||
#if !wxUSE_HTML
|
#if !wxUSE_HTML
|
||||||
menuFile->AppendSeparator();
|
menuFile->AppendSeparator();
|
||||||
@@ -357,38 +398,111 @@ void MyFrame::OnAdvancedHtmlHelp(wxCommandEvent& event)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MyFrame::OnMSHtmlHelp(wxCommandEvent& event)
|
||||||
|
{
|
||||||
|
#if wxUSE_MS_HTML_HELP
|
||||||
|
ShowHelp(event.GetId(), m_msHtmlHelp);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Notes: ShowHelp uses section ids for displaying particular topics,
|
||||||
|
but you might want to use a unique keyword to display a topic, instead.
|
||||||
|
|
||||||
|
Section ids are specified as follows for the different formats.
|
||||||
|
|
||||||
|
WinHelp
|
||||||
|
|
||||||
|
The [MAP] section specifies the topic to integer id mapping, e.g.
|
||||||
|
|
||||||
|
[MAP]
|
||||||
|
#define intro 100
|
||||||
|
#define functions 1
|
||||||
|
#define classes 2
|
||||||
|
#define about 3
|
||||||
|
|
||||||
|
The identifier name corresponds to the label used for that topic.
|
||||||
|
You could also put these in a .h file and #include it in both the MAP
|
||||||
|
section and your C++ source.
|
||||||
|
|
||||||
|
Note that Tex2RTF doesn't currently generate the MAP section automatically.
|
||||||
|
|
||||||
|
MS HTML Help
|
||||||
|
|
||||||
|
The [MAP] section specifies the HTML filename root to integer id mapping, e.g.
|
||||||
|
|
||||||
|
[MAP]
|
||||||
|
#define doc1 100
|
||||||
|
#define doc3 1
|
||||||
|
#define doc2 2
|
||||||
|
#define doc4 3
|
||||||
|
|
||||||
|
The identifier name corresponds to the HTML filename used for that topic.
|
||||||
|
You could also put these in a .h file and #include it in both the MAP
|
||||||
|
section and your C++ source.
|
||||||
|
|
||||||
|
Note that Tex2RTF doesn't currently generate the MAP section automatically.
|
||||||
|
|
||||||
|
Simple wxHTML Help and External HTML Help
|
||||||
|
|
||||||
|
A wxhelp.map file is used, for example:
|
||||||
|
|
||||||
|
0 wx.htm ; wxWindows: Help index; additional keywords like overview
|
||||||
|
1 wx204.htm ; wxWindows Function Reference
|
||||||
|
2 wx34.htm ; wxWindows Class Reference
|
||||||
|
|
||||||
|
Note that Tex2RTF doesn't currently generate the MAP section automatically.
|
||||||
|
|
||||||
|
Advanced HTML Help
|
||||||
|
|
||||||
|
An extension to the .hhc file format is used, specifying a new parameter
|
||||||
|
with name="ID":
|
||||||
|
|
||||||
|
<OBJECT type="text/sitemap">
|
||||||
|
<param name="Local" value="doc2.htm#classes">
|
||||||
|
<param name="Name" value="Classes">
|
||||||
|
<param name="ID" value=2>
|
||||||
|
</OBJECT>
|
||||||
|
|
||||||
|
Again, this is not generated automatically by Tex2RTF, though it could
|
||||||
|
be added quite easily.
|
||||||
|
|
||||||
|
Unfortunately adding the ID parameters appears to interfere with MS HTML Help,
|
||||||
|
so you should not try to compile a .chm file from a .hhc file with
|
||||||
|
this extension, or the contents will be messed up.
|
||||||
|
*/
|
||||||
|
|
||||||
void MyFrame::ShowHelp(int commandId, wxHelpControllerBase& helpController)
|
void MyFrame::ShowHelp(int commandId, wxHelpControllerBase& helpController)
|
||||||
{
|
{
|
||||||
switch(commandId)
|
switch(commandId)
|
||||||
{
|
{
|
||||||
|
|
||||||
// Note: For WinHelp, these ids are specified in the map session, mapping
|
|
||||||
// topic names to numbers.
|
|
||||||
// For HTML and external help, a wxhelp.map file is used.
|
|
||||||
|
|
||||||
case HelpDemo_Help_Classes:
|
case HelpDemo_Help_Classes:
|
||||||
case HelpDemo_Html_Help_Classes:
|
case HelpDemo_Html_Help_Classes:
|
||||||
case HelpDemo_Advanced_Html_Help_Classes:
|
case HelpDemo_Advanced_Html_Help_Classes:
|
||||||
|
case HelpDemo_MS_Html_Help_Classes:
|
||||||
helpController.DisplaySection(2);
|
helpController.DisplaySection(2);
|
||||||
|
//helpController.DisplaySection("Classes"); // An alternative form for most controllers
|
||||||
// if (helpController.IsKindOf(CLASSINFO(wxHtmlHelpController)))
|
|
||||||
// ((wxHtmlHelpController&)helpController).Display("Classes"); // An alternative form for this controller
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case HelpDemo_Help_Functions:
|
case HelpDemo_Help_Functions:
|
||||||
case HelpDemo_Html_Help_Functions:
|
case HelpDemo_Html_Help_Functions:
|
||||||
case HelpDemo_Advanced_Html_Help_Functions:
|
case HelpDemo_Advanced_Html_Help_Functions:
|
||||||
|
case HelpDemo_MS_Html_Help_Functions:
|
||||||
helpController.DisplaySection(1);
|
helpController.DisplaySection(1);
|
||||||
|
//helpController.DisplaySection("Functions"); // An alternative form for most controllers
|
||||||
break;
|
break;
|
||||||
case HelpDemo_Help_Help:
|
case HelpDemo_Help_Help:
|
||||||
case HelpDemo_Html_Help_Help:
|
case HelpDemo_Html_Help_Help:
|
||||||
case HelpDemo_Advanced_Html_Help_Help:
|
case HelpDemo_Advanced_Html_Help_Help:
|
||||||
|
case HelpDemo_MS_Html_Help_Help:
|
||||||
helpController.DisplaySection(3);
|
helpController.DisplaySection(3);
|
||||||
|
//helpController.DisplaySection("About"); // An alternative form for most controllers
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case HelpDemo_Help_Search:
|
case HelpDemo_Help_Search:
|
||||||
case HelpDemo_Html_Help_Search:
|
case HelpDemo_Html_Help_Search:
|
||||||
case HelpDemo_Advanced_Html_Help_Search:
|
case HelpDemo_Advanced_Html_Help_Search:
|
||||||
|
case HelpDemo_MS_Html_Help_Search:
|
||||||
{
|
{
|
||||||
wxString key = wxGetTextFromUser("Search for?",
|
wxString key = wxGetTextFromUser("Search for?",
|
||||||
"Search help for keyword",
|
"Search help for keyword",
|
||||||
@@ -402,6 +516,7 @@ void MyFrame::ShowHelp(int commandId, wxHelpControllerBase& helpController)
|
|||||||
case HelpDemo_Help_Index:
|
case HelpDemo_Help_Index:
|
||||||
case HelpDemo_Html_Help_Index:
|
case HelpDemo_Html_Help_Index:
|
||||||
case HelpDemo_Advanced_Html_Help_Index:
|
case HelpDemo_Advanced_Html_Help_Index:
|
||||||
|
case HelpDemo_MS_Html_Help_Index:
|
||||||
helpController.DisplayContents();
|
helpController.DisplayContents();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
BIN
samples/help/doc.chm
Normal file
35
samples/help/doc.hhc
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
|
||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<meta name="GENERATOR" content="tex2rtf">
|
||||||
|
<!-- Sitemap 1.0 -->
|
||||||
|
</HEAD><BODY>
|
||||||
|
<OBJECT type="text/site properties">
|
||||||
|
<param name="ImageType" value="Folder">
|
||||||
|
</OBJECT>
|
||||||
|
<UL>
|
||||||
|
<LI> <OBJECT type="text/sitemap">
|
||||||
|
<param name="Local" value="doc.htm">
|
||||||
|
<param name="Name" value="Contents">
|
||||||
|
</OBJECT>
|
||||||
|
<LI> <OBJECT type="text/sitemap">
|
||||||
|
<param name="Local" value="doc1.htm#intro">
|
||||||
|
<param name="Name" value="Introduction">
|
||||||
|
</OBJECT>
|
||||||
|
<UL> <LI> <OBJECT type="text/sitemap">
|
||||||
|
<param name="Local" value="doc2.htm#classes">
|
||||||
|
<param name="Name" value="Classes">
|
||||||
|
</OBJECT>
|
||||||
|
<LI> <OBJECT type="text/sitemap">
|
||||||
|
<param name="Local" value="doc3.htm#functions">
|
||||||
|
<param name="Name" value="Functions">
|
||||||
|
</OBJECT>
|
||||||
|
<LI> <OBJECT type="text/sitemap">
|
||||||
|
<param name="Local" value="doc4.htm#about">
|
||||||
|
<param name="Name" value="About">
|
||||||
|
</OBJECT>
|
||||||
|
</UL> <LI> <OBJECT type="text/sitemap">
|
||||||
|
<param name="Local" value="doc5.htm#chapter2">
|
||||||
|
<param name="Name" value="Chapter 2">
|
||||||
|
</OBJECT>
|
||||||
|
</UL>
|
31
samples/help/doc.hhk
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
|
||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<meta name="GENERATOR" content="tex2rtf">
|
||||||
|
<!-- Sitemap 1.0 -->
|
||||||
|
</HEAD><BODY>
|
||||||
|
<OBJECT type="text/site properties">
|
||||||
|
<param name="ImageType" value="Folder">
|
||||||
|
</OBJECT>
|
||||||
|
<UL>
|
||||||
|
<LI> <OBJECT type="text/sitemap">
|
||||||
|
<param name="Local" value="doc4.htm#about">
|
||||||
|
<param name="Name" value="About">
|
||||||
|
</OBJECT>
|
||||||
|
<LI> <OBJECT type="text/sitemap">
|
||||||
|
<param name="Local" value="doc1.htm#intro">
|
||||||
|
<param name="Name" value="Introduction">
|
||||||
|
</OBJECT>
|
||||||
|
<LI> <OBJECT type="text/sitemap">
|
||||||
|
<param name="Local" value="doc2.htm#classes">
|
||||||
|
<param name="Name" value="Classes">
|
||||||
|
</OBJECT>
|
||||||
|
<LI> <OBJECT type="text/sitemap">
|
||||||
|
<param name="Local" value="doc5.htm#chapter2">
|
||||||
|
<param name="Name" value="Chapter 2">
|
||||||
|
</OBJECT>
|
||||||
|
<LI> <OBJECT type="text/sitemap">
|
||||||
|
<param name="Local" value="doc3.htm#functions">
|
||||||
|
<param name="Name" value="Functions">
|
||||||
|
</OBJECT>
|
||||||
|
</UL>
|
27
samples/help/doc.hhp
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
[OPTIONS]
|
||||||
|
Compatibility=1.1
|
||||||
|
Full-text search=Yes
|
||||||
|
Contents file=doc.hhc
|
||||||
|
Compiled file=doc.chm
|
||||||
|
Default Window=docHelp
|
||||||
|
Default topic=doc.htm
|
||||||
|
Index file=doc.hhk
|
||||||
|
Title=Help Demo
|
||||||
|
|
||||||
|
[WINDOWS]
|
||||||
|
docHelp=,"doc.hhc","doc.hhk","doc.htm",,,,,,0x2420,,0x380e,,,,,0,,,
|
||||||
|
|
||||||
|
[FILES]
|
||||||
|
doc.htm
|
||||||
|
doc1.htm
|
||||||
|
doc2.htm
|
||||||
|
doc3.htm
|
||||||
|
doc4.htm
|
||||||
|
doc5.htm
|
||||||
|
|
||||||
|
[MAP]
|
||||||
|
#define doc1 100
|
||||||
|
#define doc3 1
|
||||||
|
#define doc2 2
|
||||||
|
#define doc4 3
|
||||||
|
|
Before Width: | Height: | Size: 164 B After Width: | Height: | Size: 959 B |
@@ -10,6 +10,7 @@
|
|||||||
WXDIR = $(WXWIN)
|
WXDIR = $(WXWIN)
|
||||||
|
|
||||||
TARGET=demo
|
TARGET=demo
|
||||||
|
#EXTRALIBS=htmlhelp.lib
|
||||||
OBJECTS = $(TARGET).obj
|
OBJECTS = $(TARGET).obj
|
||||||
|
|
||||||
!include $(WXDIR)\src\makeprog.b32
|
!include $(WXDIR)\src\makeprog.b32
|
||||||
|
Before Width: | Height: | Size: 137 B After Width: | Height: | Size: 998 B |
156
src/msw/helpchm.cpp
Normal file
@@ -0,0 +1,156 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: helpchm.cpp
|
||||||
|
// Purpose: Help system: MS HTML Help implementation
|
||||||
|
// Author: Julian Smart
|
||||||
|
// Modified by:
|
||||||
|
// Created: 16/04/2000
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Julian Smart
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifdef __GNUG__
|
||||||
|
#pragma implementation "helpchm.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// For compilers that support precompilation, includes "wx.h".
|
||||||
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
|
#ifdef __BORLANDC__
|
||||||
|
#pragma hdrstop
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WX_PRECOMP
|
||||||
|
#include "wx/defs.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "wx/filefn.h"
|
||||||
|
|
||||||
|
#if wxUSE_HELP && wxUSE_MS_HTML_HELP && defined(__WIN95__)
|
||||||
|
#include "wx/msw/helpchm.h"
|
||||||
|
|
||||||
|
// This is found in the HTML Help Workshop installation,
|
||||||
|
// along with htmlhelp.lib.
|
||||||
|
#include <htmlhelp.h>
|
||||||
|
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
|
#ifdef __WXMSW__
|
||||||
|
#include "wx/msw/private.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
static HWND GetSuitableHWND()
|
||||||
|
{
|
||||||
|
if (wxTheApp->GetTopWindow())
|
||||||
|
return (HWND) wxTheApp->GetTopWindow()->GetHWND();
|
||||||
|
else
|
||||||
|
return GetDesktopWindow();
|
||||||
|
}
|
||||||
|
|
||||||
|
IMPLEMENT_DYNAMIC_CLASS(wxCHMHelpController, wxHelpControllerBase)
|
||||||
|
|
||||||
|
bool wxCHMHelpController::Initialize(const wxString& filename)
|
||||||
|
{
|
||||||
|
m_helpFile = filename;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxCHMHelpController::LoadFile(const wxString& file)
|
||||||
|
{
|
||||||
|
m_helpFile = file;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxCHMHelpController::DisplayContents()
|
||||||
|
{
|
||||||
|
if (m_helpFile.IsEmpty()) return FALSE;
|
||||||
|
|
||||||
|
wxString str = GetValidFilename(m_helpFile);
|
||||||
|
|
||||||
|
HtmlHelp(GetSuitableHWND(), (const wxChar*) str, HH_HELP_FINDER, 0L);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Use topic or HTML filename
|
||||||
|
bool wxCHMHelpController::DisplaySection(const wxString& section)
|
||||||
|
{
|
||||||
|
if (m_helpFile.IsEmpty()) return FALSE;
|
||||||
|
|
||||||
|
wxString str = GetValidFilename(m_helpFile);
|
||||||
|
|
||||||
|
bool isFilename = TRUE;
|
||||||
|
|
||||||
|
// Is this an HTML file or a keyword?
|
||||||
|
wxString path, filename, ext;
|
||||||
|
wxSplitPath(section, & path, & filename, & ext);
|
||||||
|
if (ext != wxT("htm") && ext != wxT("html"))
|
||||||
|
isFilename = FALSE;
|
||||||
|
|
||||||
|
if (isFilename)
|
||||||
|
HtmlHelp(GetSuitableHWND(), (const wxChar*) str, HH_DISPLAY_TOPIC, (DWORD) (const wxChar*) section);
|
||||||
|
else
|
||||||
|
KeywordSearch(section);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Use context number
|
||||||
|
bool wxCHMHelpController::DisplaySection(int section)
|
||||||
|
{
|
||||||
|
if (m_helpFile.IsEmpty()) return FALSE;
|
||||||
|
|
||||||
|
wxString str = GetValidFilename(m_helpFile);
|
||||||
|
|
||||||
|
HtmlHelp(GetSuitableHWND(), (const wxChar*) str, HH_HELP_CONTEXT, (DWORD)section);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxCHMHelpController::DisplayBlock(long block)
|
||||||
|
{
|
||||||
|
return DisplaySection(block);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxCHMHelpController::KeywordSearch(const wxString& k)
|
||||||
|
{
|
||||||
|
if (m_helpFile.IsEmpty()) return FALSE;
|
||||||
|
|
||||||
|
wxString str = GetValidFilename(m_helpFile);
|
||||||
|
|
||||||
|
HH_AKLINK link;
|
||||||
|
link.cbStruct = sizeof(HH_AKLINK) ;
|
||||||
|
link.fReserved = FALSE ;
|
||||||
|
link.pszKeywords = k.c_str() ;
|
||||||
|
link.pszUrl = NULL ;
|
||||||
|
link.pszMsgText = NULL ;
|
||||||
|
link.pszMsgTitle = NULL ;
|
||||||
|
link.pszWindow = NULL ;
|
||||||
|
link.fIndexOnFail = TRUE ;
|
||||||
|
|
||||||
|
HtmlHelp(GetSuitableHWND(), (const wxChar*) str, HH_KEYWORD_LOOKUP, (DWORD)& link);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxCHMHelpController::Quit()
|
||||||
|
{
|
||||||
|
HtmlHelp(GetSuitableHWND(), 0, HH_CLOSE_ALL, 0L);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Append extension if necessary.
|
||||||
|
wxString wxCHMHelpController::GetValidFilename(const wxString& file) const
|
||||||
|
{
|
||||||
|
wxString path, name, ext;
|
||||||
|
wxSplitPath(file, & path, & name, & ext);
|
||||||
|
|
||||||
|
wxString fullName;
|
||||||
|
if (path.IsEmpty())
|
||||||
|
fullName = name + wxT(".chm");
|
||||||
|
else if (path.Last() == wxT('\\'))
|
||||||
|
fullName = path + name + wxT(".chm");
|
||||||
|
else
|
||||||
|
fullName = path + wxT("\\") + name + wxT(".chm");
|
||||||
|
return fullName;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // wxUSE_HELP
|
@@ -24,9 +24,11 @@
|
|||||||
#include "wx/defs.h"
|
#include "wx/defs.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if wxUSE_HELP
|
||||||
|
|
||||||
|
#include "wx/filefn.h"
|
||||||
#include "wx/msw/helpwin.h"
|
#include "wx/msw/helpwin.h"
|
||||||
|
|
||||||
#if wxUSE_HELP
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
@@ -35,124 +37,90 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
// MAX path length
|
static HWND GetSuitableHWND()
|
||||||
#define _MAXPATHLEN 500
|
{
|
||||||
|
if (wxTheApp->GetTopWindow())
|
||||||
// MAX length of Help descriptor
|
return (HWND) wxTheApp->GetTopWindow()->GetHWND();
|
||||||
#define _MAX_HELP_LEN 500
|
else
|
||||||
|
return GetDesktopWindow();
|
||||||
|
}
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxWinHelpController, wxHelpControllerBase)
|
IMPLEMENT_DYNAMIC_CLASS(wxWinHelpController, wxHelpControllerBase)
|
||||||
|
|
||||||
wxWinHelpController::wxWinHelpController(void)
|
|
||||||
{
|
|
||||||
m_helpFile = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
wxWinHelpController::~wxWinHelpController(void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
bool wxWinHelpController::Initialize(const wxString& filename)
|
bool wxWinHelpController::Initialize(const wxString& filename)
|
||||||
{
|
{
|
||||||
m_helpFile = filename;
|
m_helpFile = filename;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxWinHelpController::LoadFile(const wxString& file)
|
bool wxWinHelpController::LoadFile(const wxString& file)
|
||||||
{
|
{
|
||||||
m_helpFile = file;
|
m_helpFile = file;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxWinHelpController::DisplayContents(void)
|
bool wxWinHelpController::DisplayContents(void)
|
||||||
{
|
{
|
||||||
if (m_helpFile == wxT("")) return FALSE;
|
if (m_helpFile.IsEmpty()) return FALSE;
|
||||||
|
|
||||||
wxString str = m_helpFile;
|
wxString str = GetValidFilename(m_helpFile);
|
||||||
size_t len = str.Length();
|
|
||||||
if (!(str[(size_t)(len-1)] == wxT('p') && str[(size_t)(len-2)] == wxT('l') && str[(size_t)(len-3)] == wxT('h') && str[(size_t)(len-4)] == wxT('.')))
|
|
||||||
str += wxT(".hlp");
|
|
||||||
|
|
||||||
if (wxTheApp->GetTopWindow())
|
|
||||||
{
|
|
||||||
#if defined(__WIN95__)
|
#if defined(__WIN95__)
|
||||||
WinHelp((HWND) wxTheApp->GetTopWindow()->GetHWND(), (const wxChar*) str, HELP_FINDER, 0L);
|
WinHelp(GetSuitableHWND(), (const wxChar*) str, HELP_FINDER, 0L);
|
||||||
#else
|
#else
|
||||||
WinHelp((HWND) wxTheApp->GetTopWindow()->GetHWND(), (const wxChar*) str, HELP_CONTENTS, 0L);
|
WinHelp(GetSuitableHWND(), (const wxChar*) str, HELP_CONTENTS, 0L);
|
||||||
#endif
|
#endif
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxWinHelpController::DisplaySection(int section)
|
bool wxWinHelpController::DisplaySection(int section)
|
||||||
{
|
{
|
||||||
// Use context number
|
// Use context number
|
||||||
if (m_helpFile == wxT("")) return FALSE;
|
if (m_helpFile.IsEmpty()) return FALSE;
|
||||||
|
|
||||||
wxString str = m_helpFile;
|
wxString str = GetValidFilename(m_helpFile);
|
||||||
size_t len = str.Length();
|
|
||||||
if (!(str[(size_t)(len-1)] == wxT('p') && str[(size_t)(len-2)] == wxT('l') && str[(size_t)(len-3)] == wxT('h') && str[(size_t)(len-4)] == wxT('.')))
|
|
||||||
str += wxT(".hlp");
|
|
||||||
|
|
||||||
if (wxTheApp->GetTopWindow())
|
WinHelp((HWND) wxTheApp->GetTopWindow()->GetHWND(), (const wxChar*) str, HELP_CONTEXT, (DWORD)section);
|
||||||
{
|
return TRUE;
|
||||||
WinHelp((HWND) wxTheApp->GetTopWindow()->GetHWND(), (const wxChar*) str, HELP_CONTEXT, (DWORD)section);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxWinHelpController::DisplayBlock(long block)
|
bool wxWinHelpController::DisplayBlock(long block)
|
||||||
{
|
{
|
||||||
// Use context number -- a very rough equivalent to block id!
|
DisplaySection(block);
|
||||||
if (m_helpFile == wxT("")) return FALSE;
|
return TRUE;
|
||||||
|
|
||||||
wxString str = m_helpFile;
|
|
||||||
size_t len = str.Length();
|
|
||||||
if (!(str[(size_t)(len-1)] == 'p' && str[(size_t)(len-2)] == 'l' && str[(size_t)(len-3)] == 'h' && str[(size_t)(len-4)] == '.'))
|
|
||||||
str += wxT(".hlp");
|
|
||||||
|
|
||||||
if (wxTheApp->GetTopWindow())
|
|
||||||
{
|
|
||||||
WinHelp((HWND) wxTheApp->GetTopWindow()->GetHWND(), (const wxChar*) str, HELP_CONTEXT, (DWORD)block);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxWinHelpController::KeywordSearch(const wxString& k)
|
bool wxWinHelpController::KeywordSearch(const wxString& k)
|
||||||
{
|
{
|
||||||
if (m_helpFile == wxT("")) return FALSE;
|
if (m_helpFile.IsEmpty()) return FALSE;
|
||||||
|
|
||||||
wxString str = m_helpFile;
|
wxString str = GetValidFilename(m_helpFile);
|
||||||
size_t len = str.Length();
|
|
||||||
if (!(str[(size_t)(len-1)] == wxT('p') && str[(size_t)(len-2)] == wxT('l') && str[(size_t)(len-3)] == wxT('h') && str[(size_t)(len-4)] == wxT('.')))
|
|
||||||
str += wxT(".hlp");
|
|
||||||
|
|
||||||
if (wxTheApp->GetTopWindow())
|
WinHelp(GetSuitableHWND(), (const wxChar*) str, HELP_PARTIALKEY, (DWORD)(const wxChar*) k);
|
||||||
{
|
return TRUE;
|
||||||
WinHelp((HWND) wxTheApp->GetTopWindow()->GetHWND(), (const wxChar*) str, HELP_PARTIALKEY, (DWORD)(const wxChar*) k);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Can't close the help window explicitly in WinHelp
|
// Can't close the help window explicitly in WinHelp
|
||||||
bool wxWinHelpController::Quit(void)
|
bool wxWinHelpController::Quit(void)
|
||||||
{
|
{
|
||||||
if (wxTheApp->GetTopWindow())
|
WinHelp(GetSuitableHWND(), 0, HELP_QUIT, 0L);
|
||||||
{
|
|
||||||
WinHelp((HWND) wxTheApp->GetTopWindow()->GetHWND(), 0, HELP_QUIT, 0L);
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
|
||||||
else
|
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't get notified of WinHelp quitting
|
// Append extension if necessary.
|
||||||
void wxWinHelpController::OnQuit(void)
|
wxString wxWinHelpController::GetValidFilename(const wxString& file) const
|
||||||
{
|
{
|
||||||
|
wxString path, name, ext;
|
||||||
|
wxSplitPath(file, & path, & name, & ext);
|
||||||
|
|
||||||
|
wxString fullName;
|
||||||
|
if (path.IsEmpty())
|
||||||
|
fullName = name + wxT(".hlp");
|
||||||
|
else if (path.Last() == wxT('\\'))
|
||||||
|
fullName = path + name + wxT(".hlp");
|
||||||
|
else
|
||||||
|
fullName = path + wxT("\\") + name + wxT(".hlp");
|
||||||
|
return fullName;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // wxUSE_HELP
|
#endif // wxUSE_HELP
|
||||||
|
@@ -264,6 +264,7 @@ MSWOBJS = $(MSWDIR)\accel.obj \
|
|||||||
$(MSWDIR)\gsocket.obj \
|
$(MSWDIR)\gsocket.obj \
|
||||||
$(MSWDIR)\gsockmsw.obj \
|
$(MSWDIR)\gsockmsw.obj \
|
||||||
$(MSWDIR)\helpwin.obj \
|
$(MSWDIR)\helpwin.obj \
|
||||||
|
$(MSWDIR)\helpchm.obj \
|
||||||
$(MSWDIR)\icon.obj \
|
$(MSWDIR)\icon.obj \
|
||||||
$(MSWDIR)\imaglist.obj \
|
$(MSWDIR)\imaglist.obj \
|
||||||
$(MSWDIR)\joystick.obj \
|
$(MSWDIR)\joystick.obj \
|
||||||
@@ -480,6 +481,8 @@ $(MSWDIR)\gsocket.obj: $(MSWDIR)\gsocket.c
|
|||||||
|
|
||||||
$(MSWDIR)\gsockmsw.obj: $(MSWDIR)\gsockmsw.c
|
$(MSWDIR)\gsockmsw.obj: $(MSWDIR)\gsockmsw.c
|
||||||
|
|
||||||
|
$(MSWDIR)\helpchm.obj: $(MSWDIR)\helpchm.$(SRCSUFF)
|
||||||
|
|
||||||
$(MSWDIR)\helpwin.obj: $(MSWDIR)\helpwin.$(SRCSUFF)
|
$(MSWDIR)\helpwin.obj: $(MSWDIR)\helpwin.$(SRCSUFF)
|
||||||
|
|
||||||
$(MSWDIR)\icon.obj: $(MSWDIR)\icon.$(SRCSUFF)
|
$(MSWDIR)\icon.obj: $(MSWDIR)\icon.$(SRCSUFF)
|
||||||
|
@@ -261,6 +261,7 @@ MSWOBJS = \
|
|||||||
$(MSWDIR)/glcanvas.$(OBJSUFF) \
|
$(MSWDIR)/glcanvas.$(OBJSUFF) \
|
||||||
$(MSWDIR)/gsocket.$(OBJSUFF) \
|
$(MSWDIR)/gsocket.$(OBJSUFF) \
|
||||||
$(MSWDIR)/gsockmsw.$(OBJSUFF) \
|
$(MSWDIR)/gsockmsw.$(OBJSUFF) \
|
||||||
|
$(MSWDIR)/helpchm.$(OBJSUFF) \
|
||||||
$(MSWDIR)/helpwin.$(OBJSUFF) \
|
$(MSWDIR)/helpwin.$(OBJSUFF) \
|
||||||
$(MSWDIR)/icon.$(OBJSUFF) \
|
$(MSWDIR)/icon.$(OBJSUFF) \
|
||||||
$(MSWDIR)/imaglist.$(OBJSUFF) \
|
$(MSWDIR)/imaglist.$(OBJSUFF) \
|
||||||
|
@@ -280,6 +280,7 @@ MSWOBJS = ..\msw\$D\accel.obj \
|
|||||||
..\msw\$D\glcanvas.obj \
|
..\msw\$D\glcanvas.obj \
|
||||||
..\msw\$D\gsocket.obj \
|
..\msw\$D\gsocket.obj \
|
||||||
..\msw\$D\gsockmsw.obj \
|
..\msw\$D\gsockmsw.obj \
|
||||||
|
..\msw\$D\helpchm.obj \
|
||||||
..\msw\$D\helpwin.obj \
|
..\msw\$D\helpwin.obj \
|
||||||
..\msw\$D\icon.obj \
|
..\msw\$D\icon.obj \
|
||||||
..\msw\$D\imaglist.obj \
|
..\msw\$D\imaglist.obj \
|
||||||
|
@@ -236,6 +236,7 @@ MSWOBJS = accel.obj &
|
|||||||
glcanvas.obj &
|
glcanvas.obj &
|
||||||
gsocket.obj &
|
gsocket.obj &
|
||||||
gsockmsw.obj &
|
gsockmsw.obj &
|
||||||
|
helpchm.obj &
|
||||||
helpwin.obj &
|
helpwin.obj &
|
||||||
icon.obj &
|
icon.obj &
|
||||||
imaglist.obj &
|
imaglist.obj &
|
||||||
|
@@ -883,6 +883,10 @@ SOURCE=.\msw\gsockmsw.c
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\msw\helpchm.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\msw\helpwin.cpp
|
SOURCE=.\msw\helpwin.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
@@ -885,6 +885,10 @@ SOURCE=.\msw\gsockmsw.c
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\msw\helpchm.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\msw\helpwin.cpp
|
SOURCE=.\msw\helpwin.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
@@ -1081,6 +1081,9 @@ void wxResourceEditorControlHandler::OnDragEnd(int x, int y, int WXUNUSED(keys),
|
|||||||
int x2 = (int)(x1 + (x - dragOffsetX) - xpos);
|
int x2 = (int)(x1 + (x - dragOffsetX) - xpos);
|
||||||
int y2 = (int)(y1 + (y - dragOffsetY) - ypos);
|
int y2 = (int)(y1 + (y - dragOffsetY) - ypos);
|
||||||
|
|
||||||
|
resourceX = x2;
|
||||||
|
resourceY = y2;
|
||||||
|
|
||||||
// Update the associated resource
|
// Update the associated resource
|
||||||
resource = wxResourceManager::GetCurrentResourceManager()->FindResourceForWindow(item);
|
resource = wxResourceManager::GetCurrentResourceManager()->FindResourceForWindow(item);
|
||||||
if (parentResource->GetResourceStyle() & wxRESOURCE_DIALOG_UNITS)
|
if (parentResource->GetResourceStyle() & wxRESOURCE_DIALOG_UNITS)
|
||||||
|
@@ -420,7 +420,7 @@ bool wxResourceManager::New(bool loadFromFile, const wxString& filename)
|
|||||||
wxString str = filename;
|
wxString str = filename;
|
||||||
if (str == wxString(""))
|
if (str == wxString(""))
|
||||||
{
|
{
|
||||||
wxString f(wxFileSelector("Open resource file", NULL, NULL, "wxr", "*.wxr", 0, wxTheApp->GetTopWindow()));
|
wxString f(wxFileSelector("Open resource file", wxGetCwd(), wxEmptyString, "wxr", "*.wxr", 0, wxTheApp->GetTopWindow()));
|
||||||
if (!f.IsNull() && f != "")
|
if (!f.IsNull() && f != "")
|
||||||
str = f;
|
str = f;
|
||||||
else
|
else
|
||||||
|