From 62877de0ed937926a3e8aaef615380d5c6c2cfbe Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Sun, 31 Oct 1999 22:02:03 +0000 Subject: [PATCH] added html help viewer sample git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4278 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- configure.in | 1 + samples/html/Makefile.in | 2 + samples/html/helpview/Makefile.in | 25 ++++++++ samples/html/helpview/Makefile.vc | 18 ++++++ samples/html/helpview/helpview.cpp | 88 +++++++++++++++++++++++++++++ samples/html/helpview/helpview.rc | 2 + samples/html/helpview/test.zip | Bin 0 -> 3292 bytes 7 files changed, 136 insertions(+) create mode 100644 samples/html/helpview/Makefile.in create mode 100644 samples/html/helpview/Makefile.vc create mode 100644 samples/html/helpview/helpview.cpp create mode 100644 samples/html/helpview/helpview.rc create mode 100644 samples/html/helpview/test.zip diff --git a/configure.in b/configure.in index 762304c6e1..d2903a1ab7 100644 --- a/configure.in +++ b/configure.in @@ -3069,6 +3069,7 @@ AC_OUTPUT([ samples/html/about/Makefile samples/html/help/Makefile samples/html/printing/Makefile + samples/html/helpview/Makefile samples/html/test/Makefile samples/html/zip/Makefile samples/html/virtual/Makefile diff --git a/samples/html/Makefile.in b/samples/html/Makefile.in index 4b163056e2..69d9346911 100644 --- a/samples/html/Makefile.in +++ b/samples/html/Makefile.in @@ -5,6 +5,7 @@ all: cd about && make cd help && make + cd helpview && make cd printing && make cd test && make cd virtual && make @@ -14,6 +15,7 @@ all: clean: cd about && make clean cd help && make clean + cd helpview && make clean cd printing && make clean cd test && make clean cd virtual && make clean diff --git a/samples/html/helpview/Makefile.in b/samples/html/helpview/Makefile.in new file mode 100644 index 0000000000..747c790b19 --- /dev/null +++ b/samples/html/helpview/Makefile.in @@ -0,0 +1,25 @@ +# +# File: Makefile.in +# Author: Julian Smart +# Created: 1998 +# Updated: +# Copyright: (c) 1998 Julian Smart +# +# "%W% %G%" +# +# Makefile for html about example (UNIX). + +top_srcdir = @top_srcdir@ +top_builddir = ../../.. +program_dir = samples/html/helpview + +VPATH = :$(top_srcdir)/samples/html/helpview + +DATAFILES = test.zip + +PROGRAM=helpview + +OBJECTS=$(PROGRAM).o + +include ../../../src/makeprog.env + diff --git a/samples/html/helpview/Makefile.vc b/samples/html/helpview/Makefile.vc new file mode 100644 index 0000000000..ad6597782b --- /dev/null +++ b/samples/html/helpview/Makefile.vc @@ -0,0 +1,18 @@ +# +# File: makefile.vc +# Author: Julian Smart +# Created: 1999 +# Updated: +# Copyright: (c) Julian Smart +# +# Makefile : Builds sample (VC++, WIN32) +# Use FINAL=1 argument to nmake to build final version with no debug info. + +# Set WXDIR for your system +WXDIR = $(WXWIN) + +PROGRAM=helpview +OBJECTS = $(PROGRAM).obj + +!include $(WXDIR)\src\makeprog.vc + diff --git a/samples/html/helpview/helpview.cpp b/samples/html/helpview/helpview.cpp new file mode 100644 index 0000000000..feacd02b99 --- /dev/null +++ b/samples/html/helpview/helpview.cpp @@ -0,0 +1,88 @@ + +///////////////////////////////////////////////////////////////////////////// +// Name: helpview.cpp +// Purpose: wxHtml help browser +///////////////////////////////////////////////////////////////////////////// + +#ifdef __GNUG__ +#pragma implementation "help.cpp" +#pragma interface "help.cpp" +#endif + +// For compilers that support precompilation, includes "wx/wx.h". +#include + +#ifdef __BORLANDC__ +#pragma hdrstop +#endif + +// for all others, include the necessary headers (this file is usually all you +// need because it includes almost all "standard" wxWindows headers +#ifndef WX_PRECOMP +#include +#endif + +#include +#include +#include + +// ---------------------------------------------------------------------------- +// private classes +// ---------------------------------------------------------------------------- + + +// Define a new application type, each program should derive a class from wxApp +class MyApp : public wxApp +{ + public: + // override base class virtuals + // ---------------------------- + + // this one is called on application startup and is a good place for the app + // initialization (doing it here and not in the ctor allows to have an error + // return: if OnInit() returns false, the application terminates) + + virtual bool OnInit(); + virtual int OnExit(); + + private: + wxHtmlHelpController *help; + wxConfig* config; +}; + + +IMPLEMENT_APP(MyApp) + + +bool MyApp::OnInit() +{ + wxInitAllImageHandlers(); + wxFileSystem::AddHandler(new wxZipFSHandler); + + config = new wxConfig("wxHTMLhelp"); + help = new wxHtmlHelpController; + help -> UseConfig(config); + + if (argc < 2) { + wxLogError("Usage : helpview []"); + wxLogError(" helpfile may be .hhp, .zip or .htb"); + return FALSE; + } + + for (int i = 1; i < argc; i++) + help -> AddBook(argv[i]); + + help -> DisplayContents(); + + return TRUE; +} + + +int MyApp::OnExit() +{ + delete help; + delete config; + + return 0; +} + diff --git a/samples/html/helpview/helpview.rc b/samples/html/helpview/helpview.rc new file mode 100644 index 0000000000..7fa90c817b --- /dev/null +++ b/samples/html/helpview/helpview.rc @@ -0,0 +1,2 @@ +#include "wx/msw/wx.rc" +#include "wx/html/msw/wxhtml.rc" diff --git a/samples/html/helpview/test.zip b/samples/html/helpview/test.zip new file mode 100644 index 0000000000000000000000000000000000000000..947cc40d2b444aa6e75e17ec232f07126c298b1f GIT binary patch literal 3292 zcma);c{tQ-AI5)K2ZN%c>|z*X9hqbuCS`PFENKwgw=iNXA+ohNBvMk8Xq2&J86#wi zn6YmWIt7`*%P0_kOl?VcvD0pm7{3?Yi1Xq(7eIx32M8J?JK>6uvdyh zheAv99a4PCn+_6)kV@}Ks~8Lt*4O*BX6T@?oPe@@P)Id?rp8)q_DeDx$;D%#%Ii=P z6qC;0luc-U%1^9a7};ff#;CbsfBQMg(j~lC5!PT&fVyOt_Eg)Yi`QBB?6Tzj4$gR* zzqYBHv?B&3Wl}9&r60d}gPjlL;HC8Oyt5T3Ft@B!XegO)C~a5t3A`b^D$G21sJbP3 zXg6-E*3T4(NJ~VLl%#wQ&Vbmg>1rm5_6F;p=q`;u9+ZyH70s#qKVO z7=)nY)eI6bPgfi*lBYE+OoYRMWj55=3O07g9G3?4YQ&{K zP&oH;TiskAaLui++Letwks^G(K+`j6M+nbCUgVXvsL}v8Q`Sb?V|{{itQn>6S?g+5 z^(%Z`ZwhzZtE?0tX|S(6g$b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