diff --git a/samples/help/Makefile b/samples/help/Makefile new file mode 100644 index 0000000000..bccce53f76 --- /dev/null +++ b/samples/help/Makefile @@ -0,0 +1 @@ +include ../../setup/general/makeapp diff --git a/samples/help/Makefile.in b/samples/help/Makefile.in new file mode 100644 index 0000000000..76cebe4c89 --- /dev/null +++ b/samples/help/Makefile.in @@ -0,0 +1,26 @@ +# WXXT base directory +WXBASEDIR=@WXBASEDIR@ + +# set the OS type for compilation +OS=@OS@ +# compile a library only +RULE=bin + +# define library name +BIN_TARGET=demo +# define library sources +BIN_SRC=\ +demo.cpp kbList.cpp wxexthlp.cpp + +#define library objects +BIN_OBJ=\ +demo.o + +# additional things needed to link +BIN_LINK= + +# additional things needed to compile +ADD_COMPILE= + +# include the definitions now +include ../../../template.mak diff --git a/samples/help/demo.cpp b/samples/help/demo.cpp new file mode 100644 index 0000000000..f7118b22d2 --- /dev/null +++ b/samples/help/demo.cpp @@ -0,0 +1,259 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: minimal.cpp +// Purpose: Minimal wxWindows sample +// Author: Julian Smart +// Modified by: +// Created: 04/01/98 +// RCS-ID: $Id$ +// Copyright: (c) Julian Smart and Markus Holzem +// Licence: wxWindows license +///////////////////////////////////////////////////////////////////////////// + +// ============================================================================ +// declarations +// ============================================================================ + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- +#ifdef __GNUG__ + #pragma implementation "minimal.cpp" + #pragma interface "minimal.cpp" +#endif + +// For compilers that support precompilation, includes "wx/wx.h". +#include "wx/wxprec.h" + +#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 "wx/wx.h" +#endif + +#include "wx/helpbase.h" +#include "wx/help.h" + +// ---------------------------------------------------------------------------- +// ressources +// ---------------------------------------------------------------------------- +// the application icon +#ifdef __WXGTK__ + #include "mondrian.xpm" +#endif + +// ---------------------------------------------------------------------------- +// 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(); +}; + +// Define a new frame type: this is going to be our main frame +class MyFrame : public wxFrame +{ +public: + // ctor(s) + MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size); + + // event handlers (these functions should _not_ be virtual) + void OnQuit(wxCommandEvent& event); + void OnHelp(wxCommandEvent& event); + +private: + wxHelpController help; + // any class wishing to process wxWindows events must use this macro + DECLARE_EVENT_TABLE() +}; + +// ---------------------------------------------------------------------------- +// constants +// ---------------------------------------------------------------------------- + +// IDs for the controls and the menu commands +enum +{ + // menu items + Minimal_Quit = 1, + Minimal_Help_Index, + Minimal_Help_Classes, + Minimal_Help_Functions, + Minimal_Help_Help, + Minimal_Help_KDE, + Minimal_Help_GNOME, + Minimal_Help_Netscape, + Minimal_Help_Search, + // controls start here (the numbers are, of course, arbitrary) + Minimal_Text = 1000, +}; + +// ---------------------------------------------------------------------------- +// event tables and other macros for wxWindows +// ---------------------------------------------------------------------------- + +// the event tables connect the wxWindows events with the functions (event +// handlers) which process them. It can be also done at run-time, but for the +// simple menu events like this the static method is much simpler. +BEGIN_EVENT_TABLE(MyFrame, wxFrame) + EVT_MENU(Minimal_Quit, MyFrame::OnQuit) + EVT_MENU(Minimal_Help_Index, MyFrame::OnHelp) + EVT_MENU(Minimal_Help_Classes, MyFrame::OnHelp) + EVT_MENU(Minimal_Help_Functions, MyFrame::OnHelp) + EVT_MENU(Minimal_Help_Help, MyFrame::OnHelp) + EVT_MENU(Minimal_Help_KDE, MyFrame::OnHelp) + EVT_MENU(Minimal_Help_GNOME, MyFrame::OnHelp) + EVT_MENU(Minimal_Help_Netscape, MyFrame::OnHelp) + EVT_MENU(Minimal_Help_Search, MyFrame::OnHelp) +END_EVENT_TABLE() + +// Create a new application object: this macro will allow wxWindows to create +// the application object during program execution (it's better than using a +// static object for many reasons) and also declares the accessor function +// wxGetApp() which will return the reference of the right type (i.e. MyApp and +// not wxApp) +IMPLEMENT_APP(MyApp) + +// ============================================================================ +// implementation +// ============================================================================ + +// ---------------------------------------------------------------------------- +// the application class +// ---------------------------------------------------------------------------- + +// `Main program' equivalent: the program execution "starts" here +bool MyApp::OnInit() +{ + // Create the main application window + MyFrame *frame = new MyFrame("Minimal wxWindows App", + wxPoint(50, 50), wxSize(450, 340)); + + // Show it and tell the application that it's our main window + // @@@ what does it do exactly, in fact? is it necessary here? + frame->Show(TRUE); + SetTopWindow(frame); + + // success: wxApp::OnRun() will be called which will enter the main message + // loop and the application will run. If we returned FALSE here, the + // application would exit immediately. + return TRUE; +} + +// ---------------------------------------------------------------------------- +// main frame +// ---------------------------------------------------------------------------- + +// frame constructor +MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) + : wxFrame((wxFrame *)NULL, -1, title, pos, size) +{ + // set the frame icon + SetIcon(wxICON(mondrian)); + + // create a menu bar + wxMenu *menuFile = new wxMenu; + + menuFile->Append(Minimal_Help_Index, "&Help Index..."); + menuFile->Append(Minimal_Help_Classes, "&Help on Classes..."); + menuFile->Append(Minimal_Help_Functions, "&Help on Functions..."); + menuFile->Append(Minimal_Help_Help, "&About wxExtHelpController..."); + menuFile->AppendSeparator(); + menuFile->Append(Minimal_Help_Search, "&Search help..."); + if(help.IsKindOf(CLASSINFO(wxExtHelpController))) + { + menuFile->AppendSeparator(); + menuFile->Append(Minimal_Help_KDE, "Use &KDE"); + menuFile->Append(Minimal_Help_GNOME, "Use &GNOME"); + menuFile->Append(Minimal_Help_Netscape, "Use &Netscape"); + } + menuFile->AppendSeparator(); + menuFile->Append(Minimal_Quit, "E&xit"); + + // now append the freshly created menu to the menu bar... + wxMenuBar *menuBar = new wxMenuBar; + menuBar->Append(menuFile, "&File"); + + // ... and attach this menu bar to the frame + SetMenuBar(menuBar); + + // create a status bar just for fun (by default with 1 pane only) + CreateStatusBar(); + SetStatusText("Welcome to wxWindows!"); + + // now create some controls + + // a panel first - if there were several controls, it would allow us to + // navigate between them from the keyboard + wxPanel *panel = new wxPanel(this, -1, wxPoint(0, 0), wxSize(400, 200)); + + // and a static control whose parent is the panel + (void)new wxStaticText(panel, -1, "Hello, world!", wxPoint(10, 10)); + + // initialise the help system + help.Initialize("doc"); + +} + + +// event handlers + +void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) +{ + // TRUE is to force the frame to close + Close(TRUE); +} + +void MyFrame::OnHelp(wxCommandEvent& event) +{ + switch(event.GetId()) + { + case Minimal_Help_Classes: + help.DisplaySection(1); + break; + case Minimal_Help_Functions: + help.DisplaySection(2); + break; + case Minimal_Help_Help: + help.DisplaySection(5); + break; + case Minimal_Help_KDE: + if(help.IsKindOf(CLASSINFO(wxExtHelpController))) + ((wxExtHelpController *)&help)->SetBrowser("kdehelp"); + break; + case Minimal_Help_GNOME: + if(help.IsKindOf(CLASSINFO(wxExtHelpController))) + ((wxExtHelpController *)&help)->SetBrowser("gnome-help-browser"); + break; + case Minimal_Help_Netscape: + if(help.IsKindOf(CLASSINFO(wxExtHelpController))) + ((wxExtHelpController *)&help)->SetBrowser("netscape",TRUE); + break; + case Minimal_Help_Search: + { + wxString key = wxGetTextFromUser("Search for?", + "Search help for keyword", + "", + this); + if(! key.IsEmpty()) + help.KeywordSearch(key); + } + break; + case Minimal_Help_Index: + default: + help.DisplayContents(); + break; + } +} diff --git a/samples/help/demo.def b/samples/help/demo.def new file mode 100644 index 0000000000..060bfe3fce --- /dev/null +++ b/samples/help/demo.def @@ -0,0 +1,8 @@ +NAME Minimal +DESCRIPTION 'Minimal wxWindows application' +EXETYPE WINDOWS +STUB 'WINSTUB.EXE' +CODE PRELOAD MOVEABLE DISCARDABLE +DATA PRELOAD MOVEABLE MULTIPLE +HEAPSIZE 4048 +STACKSIZE 16000 diff --git a/samples/help/demo.rc b/samples/help/demo.rc new file mode 100644 index 0000000000..3bf71d6da0 --- /dev/null +++ b/samples/help/demo.rc @@ -0,0 +1,6 @@ +mondrian ICON "mondrian.ico" +#include "wx/msw/wx.rc" + +#define MINIMAL_QUIT 1 +#define MINIMAL_ABOUT 102 + diff --git a/samples/help/doc/ClassGraph.class b/samples/help/doc/ClassGraph.class new file mode 100644 index 0000000000..3c6afea844 Binary files /dev/null and b/samples/help/doc/ClassGraph.class differ diff --git a/samples/help/doc/ClassGraphPanel.class b/samples/help/doc/ClassGraphPanel.class new file mode 100644 index 0000000000..4e3b5162cb Binary files /dev/null and b/samples/help/doc/ClassGraphPanel.class differ diff --git a/samples/help/doc/ClassLayout.class b/samples/help/doc/ClassLayout.class new file mode 100644 index 0000000000..40eb67e0e9 Binary files /dev/null and b/samples/help/doc/ClassLayout.class differ diff --git a/samples/help/doc/HIER.html b/samples/help/doc/HIER.html new file mode 100644 index 0000000000..8f43b7e822 --- /dev/null +++ b/samples/help/doc/HIER.html @@ -0,0 +1,9 @@ +
this page has been generated automatically by doc++ +
(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de
\ No newline at end of file
diff --git a/samples/help/doc/HIERjava.html b/samples/help/doc/HIERjava.html
new file mode 100644
index 0000000000..ae1ed66918
--- /dev/null
+++ b/samples/help/doc/HIERjava.html
@@ -0,0 +1,15 @@
+
this page has been generated automatically by doc++ +
(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de
\ No newline at end of file
diff --git a/samples/help/doc/NavigatorButton.class b/samples/help/doc/NavigatorButton.class
new file mode 100644
index 0000000000..9f447021d0
Binary files /dev/null and b/samples/help/doc/NavigatorButton.class differ
diff --git a/samples/help/doc/USE_HELP.html b/samples/help/doc/USE_HELP.html
new file mode 100644
index 0000000000..ec4dc5bc07
--- /dev/null
+++ b/samples/help/doc/USE_HELP.html
@@ -0,0 +1,38 @@
+
+ +This class implements help via an external browser ++
+ +This class implements help via an external browser. +It requires the name of a directory containing the documentation +and a file mapping numerical Section numbers to relative URLS.+The map file contains two or three fields per line: +numeric_id relative_URL [; comment/documentation]
The numeric_id is the id used to look up the entry in +DisplaySection()/DisplayBlock(). The relative_URL is a filename of +an html file, relative to the help directory. The optional +comment/documentation field (after a ';') is used for keyword +searches, so some meaningful text here does not hurt. + +
alphabetic index hierarchy of classes
this page has been generated automatically by doc++ +
(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de
\ No newline at end of file
diff --git a/samples/help/doc/aindex.html b/samples/help/doc/aindex.html
new file mode 100644
index 0000000000..7f7746ce2e
--- /dev/null
+++ b/samples/help/doc/aindex.html
@@ -0,0 +1,21 @@
+
this page has been generated automatically by doc++ +
(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de
\ No newline at end of file
diff --git a/samples/help/doc/down.gif b/samples/help/doc/down.gif
new file mode 100644
index 0000000000..fdf028aff3
Binary files /dev/null and b/samples/help/doc/down.gif differ
diff --git a/samples/help/doc/dxxgifs.tex b/samples/help/doc/dxxgifs.tex
new file mode 100644
index 0000000000..eb32b296ef
--- /dev/null
+++ b/samples/help/doc/dxxgifs.tex
@@ -0,0 +1,4 @@
+\documentclass{article}
+\pagestyle{empty}
+\begin{document}
+\end{document}
diff --git a/samples/help/doc/gifs.db b/samples/help/doc/gifs.db
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/samples/help/doc/icon1.gif b/samples/help/doc/icon1.gif
new file mode 100644
index 0000000000..f78f30eb98
Binary files /dev/null and b/samples/help/doc/icon1.gif differ
diff --git a/samples/help/doc/icon2.gif b/samples/help/doc/icon2.gif
new file mode 100644
index 0000000000..6cbe01a831
Binary files /dev/null and b/samples/help/doc/icon2.gif differ
diff --git a/samples/help/doc/index.html b/samples/help/doc/index.html
new file mode 100644
index 0000000000..7f7746ce2e
--- /dev/null
+++ b/samples/help/doc/index.html
@@ -0,0 +1,21 @@
+
this page has been generated automatically by doc++ +
(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de
\ No newline at end of file
diff --git a/samples/help/doc/logo.gif b/samples/help/doc/logo.gif
new file mode 100644
index 0000000000..d92bbc60a1
Binary files /dev/null and b/samples/help/doc/logo.gif differ
diff --git a/samples/help/doc/wx204.htm b/samples/help/doc/wx204.htm
new file mode 100644
index 0000000000..47887ec214
--- /dev/null
+++ b/samples/help/doc/wx204.htm
@@ -0,0 +1,33 @@
+
+
+The functions defined in wxWindows are described here.
+
+File functions
+
+String functions
+
+Dialog functions
+
+GDI functions
+
+System event functions
+
+Printer settings
+
+Clipboard functions
+
+Miscellaneous functions
+
+Macros
+
+wxWindows resource functions
+
+
diff --git a/samples/help/doc/wx34.htm b/samples/help/doc/wx34.htm
new file mode 100644
index 0000000000..9c1fa6acde
--- /dev/null
+++ b/samples/help/doc/wx34.htm
@@ -0,0 +1,349 @@
+
+
+ +This class implements help via an external browser ++
+ +This class implements help via an external browser. +It requires the name of a directory containing the documentation +and a file mapping numerical Section numbers to relative URLS.+The map file contains two or three fields per line: +numeric_id relative_URL [; comment/documentation]
The numeric_id is the id used to look up the entry in +DisplaySection()/DisplayBlock(). The relative_URL is a filename of +an html file, relative to the help directory. The optional +comment/documentation field (after a ';') is used for keyword +searches, so some meaningful text here does not hurt. +If the documentation itself contains a ';', only the part before +that will be displayed in the listbox, but all of it used for search.
Lines starting with ';' will be ignored.
This confuses DOC++, so I leave it out for now: +ifdef USE_HELP: public wxHelpControllerBase +{ +DECLARE_CLASS(wxExtHelpController) +else{ +endif + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ virtual bool Initialize(const wxString& file)
+
virtual bool LoadFile(const wxString& file = "")
+
virtual bool DisplayContents(void)
+
virtual bool DisplaySection(int sectionNo)
+
virtual bool DisplayBlock(long blockNo)
+
virtual bool KeywordSearch(const wxString& k)
+
virtual bool Quit(void)
+
virtual void OnQuit(void)
+
void SetBrowser(wxString const & browsername = WXEXTHELP_DEFAULTBROWSER, bool isNetscape = WXEXTHELP_DEFAULTBROWSER_IS_NETSCAPE)
+
isNetscape - Set this to TRUE if the browser is some variant of Netscape. wxString m_MapFile
+
int m_NumOfEntries
+
wxExtHelpMapList* m_MapList
+
wxString m_BrowserName
+
bool m_BrowserIsNetscape
+
bool CallBrowser(wxString const &)
+
alphabetic index hierarchy of classes
this page has been generated automatically by doc++ +
(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de
\ No newline at end of file
diff --git a/samples/help/doc/wxhelp.map b/samples/help/doc/wxhelp.map
new file mode 100644
index 0000000000..3fdaa8f48d
--- /dev/null
+++ b/samples/help/doc/wxhelp.map
@@ -0,0 +1,15 @@
+;
+; This is a sample wxhelp.map file for a small help application.
+;
+;
+; First, some wxWindows documentation files:
+;
+0 wx.html ;wxWindows: Help index; additional keywords like overview
+1 wx34.htm#classref ; wxWindows Class References
+2 wx204.htm#functions ; wxWindows Function References; methods
+;
+; Some doc++ generated files:
+;
+4 aindex.html ;wxExtHelpController: Table of contents
+3 HIER.html ; Class hierarchy (very small)
+5 wxExtHelpController.html ; The class documentation of wxExtHelpController.;brower viewer
diff --git a/samples/help/mondrian.ico b/samples/help/mondrian.ico
new file mode 100644
index 0000000000..2310c5d275
Binary files /dev/null and b/samples/help/mondrian.ico differ
diff --git a/samples/help/mondrian.xpm b/samples/help/mondrian.xpm
new file mode 100644
index 0000000000..409f27a843
--- /dev/null
+++ b/samples/help/mondrian.xpm
@@ -0,0 +1,44 @@
+/* XPM */
+static char *mondrian_xpm[] = {
+/* columns rows colors chars-per-pixel */
+"32 32 6 1",
+" c Black",
+". c Blue",
+"X c #00bf00",
+"o c Red",
+"O c Yellow",
+"+ c Gray100",
+/* pixels */
+" ",
+" oooooo +++++++++++++++++++++++ ",
+" oooooo +++++++++++++++++++++++ ",
+" oooooo +++++++++++++++++++++++ ",
+" oooooo +++++++++++++++++++++++ ",
+" oooooo +++++++++++++++++++++++ ",
+" oooooo +++++++++++++++++++++++ ",
+" oooooo +++++++++++++++++++++++ ",
+" ",
+" ++++++ ++++++++++++++++++ .... ",
+" ++++++ ++++++++++++++++++ .... ",
+" ++++++ ++++++++++++++++++ .... ",
+" ++++++ ++++++++++++++++++ .... ",
+" ++++++ ++++++++++++++++++ .... ",
+" ++++++ ++++++++++++++++++ ",
+" ++++++ ++++++++++++++++++ ++++ ",
+" ++++++ ++++++++++++++++++ ++++ ",
+" ++++++ ++++++++++++++++++ ++++ ",
+" ++++++ ++++++++++++++++++ ++++ ",
+" ++++++ ++++++++++++++++++ ++++ ",
+" ++++++ ++++++++++++++++++ ++++ ",
+" ++++++ ++++++++++++++++++ ++++ ",
+" ++++++ ++++++++++++++++++ ++++ ",
+" ++++++ ++++++++++++++++++ ++++ ",
+" ++++++ ++++ ",
+" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
+" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
+" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
+" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
+" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
+" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
+" "
+};