From e815a4feaf45a340ca6032ee15924b1df3aac720 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Mon, 16 Dec 2002 10:23:20 +0000 Subject: [PATCH] Backported wxHTML fixes Applied patch [ 654023 ] Enables HtmlHelp (native) Also fixed the bad event table in helpfrm.cpp. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@18253 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- distrib/msw/tmake/filelist.txt | 6 +- include/wx/univ/setup.h | 2 +- include/wx/univ/setup0.h | 2 +- src/html/helpctrl.cpp | 7 +- src/html/helpdata.cpp | 17 +---- src/html/helpfrm.cpp | 6 +- src/wxUniv.dsp | 113 +++++++++++++++++---------------- 7 files changed, 79 insertions(+), 74 deletions(-) diff --git a/distrib/msw/tmake/filelist.txt b/distrib/msw/tmake/filelist.txt index afb753fd9a..b326acaf71 100644 --- a/distrib/msw/tmake/filelist.txt +++ b/distrib/msw/tmake/filelist.txt @@ -292,7 +292,7 @@ dragimag.cpp MSW dropsrc.cpp MSW OLE droptgt.cpp MSW OLE enhmeta.cpp MSW Win32Only -helpbest.cpp MSW Win32Only +helpbest.cpp MSW Win32Only,LowLevel evtloop.cpp MSW LowLevel fdrepdlg.cpp MSW Win32Only # FIXME: the generic implementation doesn't work under MSW, so we must @@ -308,8 +308,8 @@ gaugemsw.cpp MSW NotWin32 gdiimage.cpp MSW LowLevel gdiobj.cpp MSW LowLevel glcanvas.cpp MSW -helpchm.cpp MSW Win32Only -helpwin.cpp MSW +helpchm.cpp MSW Win32Only,LowLevel +helpwin.cpp MSW LowLevel icon.cpp MSW LowLevel imaglist.cpp MSW Win32Only iniconf.cpp MSW diff --git a/include/wx/univ/setup.h b/include/wx/univ/setup.h index ed4f25881e..3e8c9868fe 100644 --- a/include/wx/univ/setup.h +++ b/include/wx/univ/setup.h @@ -888,7 +888,7 @@ #define wxUSE_MS_HTML_HELP 1 // Use wxHTML-based help controller? -#define wxUSE_WXHTML_HELP 0 //? error 'type cast' cannot convert from ... +#define wxUSE_WXHTML_HELP 1 // Use resources #define wxUSE_RESOURCES 1 diff --git a/include/wx/univ/setup0.h b/include/wx/univ/setup0.h index ed4f25881e..3e8c9868fe 100644 --- a/include/wx/univ/setup0.h +++ b/include/wx/univ/setup0.h @@ -888,7 +888,7 @@ #define wxUSE_MS_HTML_HELP 1 // Use wxHTML-based help controller? -#define wxUSE_WXHTML_HELP 0 //? error 'type cast' cannot convert from ... +#define wxUSE_WXHTML_HELP 1 // Use resources #define wxUSE_RESOURCES 1 diff --git a/src/html/helpctrl.cpp b/src/html/helpctrl.cpp index b55d11fcb9..66b763c641 100644 --- a/src/html/helpctrl.cpp +++ b/src/html/helpctrl.cpp @@ -84,6 +84,11 @@ void wxHtmlHelpController::SetTitleFormat(const wxString& title) } +bool wxHtmlHelpController::AddBook(const wxFileName& book_file, bool show_wait_msg) +{ + return AddBook(wxFileSystem::FileNameToURL(book_file), show_wait_msg); +} + bool wxHtmlHelpController::AddBook(const wxString& book, bool show_wait_msg) { wxBusyCursor cur; @@ -186,7 +191,7 @@ bool wxHtmlHelpController::Initialize(const wxString& file) } } - return AddBook(actualFilename); + return AddBook(wxFileName(actualFilename)); } bool wxHtmlHelpController::LoadFile(const wxString& WXUNUSED(file)) diff --git a/src/html/helpdata.cpp b/src/html/helpdata.cpp index 51d0f334d3..1864c907e5 100644 --- a/src/html/helpdata.cpp +++ b/src/html/helpdata.cpp @@ -570,7 +570,6 @@ bool wxHtmlHelpData::AddBook(const wxString& book) { wxFSFile *fi; wxFileSystem fsys; - wxString bookFull; wxString title = _("noname"), safetitle, @@ -579,23 +578,13 @@ bool wxHtmlHelpData::AddBook(const wxString& book) index = wxEmptyString, charset = wxEmptyString; -#if defined(__WXMAC__) && !defined(__DARWIN__) - if (wxIsAbsolutePath(book)) bookFull = book; - else bookFull = wxGetCwd() + book; // no slash or dot - wxFileName fn( bookFull ); - bookFull = fn.GetFullPath( wxPATH_UNIX ); -#else - if (wxIsAbsolutePath(book)) bookFull = book; - else bookFull = wxGetCwd() + wxT("/") + book; -#endif - - fi = fsys.OpenFile(bookFull); + fi = fsys.OpenFile(book); if (fi == NULL) { - wxLogError(_("Cannot open HTML help book: %s"), bookFull.c_str()); + wxLogError(_("Cannot open HTML help book: %s"), book.c_str()); return FALSE; } - fsys.ChangePathTo(bookFull); + fsys.ChangePathTo(book); const wxChar *lineptr; wxChar linebuf[300]; diff --git a/src/html/helpfrm.cpp b/src/html/helpfrm.cpp index 92f11379b1..31eab70e8c 100644 --- a/src/html/helpfrm.cpp +++ b/src/html/helpfrm.cpp @@ -1020,13 +1020,17 @@ Normal face
(and underlined. Italic face. \ { UpdateTestWin(); } + void OnUpdateSpin(wxSpinEvent& WXUNUSED(event)) + { + UpdateTestWin(); + } DECLARE_EVENT_TABLE() }; BEGIN_EVENT_TABLE(wxHtmlHelpFrameOptionsDialog, wxDialog) EVT_COMBOBOX(-1, wxHtmlHelpFrameOptionsDialog::OnUpdate) - EVT_SPINCTRL(-1, wxHtmlHelpFrameOptionsDialog::OnUpdate) + EVT_SPINCTRL(-1, wxHtmlHelpFrameOptionsDialog::OnUpdateSpin) END_EVENT_TABLE() diff --git a/src/wxUniv.dsp b/src/wxUniv.dsp index 3852dba726..721188c706 100644 --- a/src/wxUniv.dsp +++ b/src/wxUniv.dsp @@ -49,7 +49,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\lib\wxuniv.lib" +# ADD LIB32 /nologo !ELSEIF "$(CFG)" == "wxUniv - Win32 Debug" @@ -221,6 +221,11 @@ SOURCE=.\common\event.cpp # End Source File # Begin Source File +SOURCE=.\common\extended.c +# SUBTRACT CPP /YX /Yc /Yu +# End Source File +# Begin Source File + SOURCE=.\common\fddlgcmn.cpp # End Source File # Begin Source File @@ -549,6 +554,11 @@ SOURCE=.\common\txtstrm.cpp # End Source File # Begin Source File +SOURCE=.\common\unzip.c +# SUBTRACT CPP /YX /Yc /Yu +# End Source File +# Begin Source File + SOURCE=.\common\url.cpp # End Source File # Begin Source File @@ -599,18 +609,6 @@ SOURCE=.\common\zipstrm.cpp SOURCE=.\common\zstream.cpp # End Source File - -# Begin Source File - -SOURCE=.\common\extended.c -# SUBTRACT CPP /YX /Yc /Yu -# End Source File -# Begin Source File - -SOURCE=.\common\unzip.c -# SUBTRACT CPP /YX /Yc /Yu -# End Source File - # End Group # Begin Group "Generic Files" @@ -791,7 +789,6 @@ SOURCE=.\generic\treelay.cpp SOURCE=.\generic\wizard.cpp # End Source File - # End Group # Begin Group "wxHTML Files" @@ -876,18 +873,12 @@ SOURCE=.\html\m_tables.cpp SOURCE=.\html\winpars.cpp # End Source File - # End Group # Begin Group "MSW Files" # PROP Default_Filter "" # Begin Source File -SOURCE=.\msw\dummy.cpp -# ADD CPP /Yc"wx/wxprec.h" -# End Source File -# Begin Source File - SOURCE=.\msw\app.cpp # End Source File # Begin Source File @@ -952,6 +943,11 @@ SOURCE=.\msw\dir.cpp # End Source File # Begin Source File +SOURCE=.\msw\dummy.cpp +# ADD CPP /Yc"wx/wxprec.h" +# End Source File +# Begin Source File + SOURCE=.\msw\evtloop.cpp # End Source File # Begin Source File @@ -980,6 +976,28 @@ SOURCE=.\msw\gdiobj.cpp # End Source File # Begin Source File +SOURCE=.\msw\gsocket.c +# SUBTRACT CPP /YX /Yc /Yu +# End Source File +# Begin Source File + +SOURCE=.\msw\gsockmsw.c +# SUBTRACT CPP /YX /Yc /Yu +# End Source File +# Begin Source File + +SOURCE=.\msw\helpbest.cpp +# End Source File +# Begin Source File + +SOURCE=.\msw\helpchm.cpp +# End Source File +# Begin Source File + +SOURCE=.\msw\helpwin.cpp +# End Source File +# Begin Source File + SOURCE=.\msw\icon.cpp # End Source File # Begin Source File @@ -1050,22 +1068,26 @@ SOURCE=.\msw\volume.cpp SOURCE=.\msw\window.cpp # End Source File - -# Begin Source File - -SOURCE=.\msw\gsocket.c -# SUBTRACT CPP /YX /Yc /Yu -# End Source File -# Begin Source File - -SOURCE=.\msw\gsockmsw.c -# SUBTRACT CPP /YX /Yc /Yu -# End Source File - # End Group # Begin Group "Universal Files" # PROP Default_Filter "" +# Begin Group "Theme Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\univ\themes\gtk.cpp +# End Source File +# Begin Source File + +SOURCE=.\univ\themes\metal.cpp +# End Source File +# Begin Source File + +SOURCE=.\univ\themes\win32.cpp +# End Source File +# End Group # Begin Source File SOURCE=.\univ\bmpbuttn.cpp @@ -1202,24 +1224,6 @@ SOURCE=.\univ\topluniv.cpp SOURCE=.\univ\winuniv.cpp # End Source File - -# Begin Group "Theme Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\univ\themes\gtk.cpp -# End Source File -# Begin Source File - -SOURCE=.\univ\themes\metal.cpp -# End Source File -# Begin Source File - -SOURCE=.\univ\themes\win32.cpp -# End Source File - -# End Group # End Group # Begin Group "Headers" @@ -1230,7 +1234,9 @@ SOURCE=.\univ\themes\win32.cpp # Begin Source File SOURCE=..\include\wx\univ\setup.h + !IF "$(CFG)" == "wxUniv - Win32 Release" + # Begin Custom Build - Creating lib\univ\wx\setup.h from $(InputPath) InputPath=..\include\wx\univ\setup.h @@ -1238,7 +1244,9 @@ InputPath=..\include\wx\univ\setup.h copy "$(InputPath)" ..\lib\univ\wx\setup.h # End Custom Build + !ELSEIF "$(CFG)" == "wxUniv - Win32 Debug" + # Begin Custom Build - Creating lib\univd\wx\setup.h from $(InputPath) InputPath=..\include\wx\univ\setup.h @@ -1246,7 +1254,9 @@ InputPath=..\include\wx\univ\setup.h copy "$(InputPath)" ..\lib\univd\wx\setup.h # End Custom Build + !ENDIF + # End Source File # End Group # Begin Group "Common" @@ -2200,7 +2210,6 @@ SOURCE=..\include\wx\zipstrm.h SOURCE=..\include\wx\zstream.h # End Source File - # End Group # Begin Group "MSW" @@ -2369,7 +2378,6 @@ SOURCE=..\include\wx\generic\treectlg.h SOURCE=..\include\wx\generic\wizard.h # End Source File - # End Group # Begin Group "HTML" @@ -2426,7 +2434,6 @@ SOURCE=..\include\wx\html\m_templ.h SOURCE=..\include\wx\html\winpars.h # End Source File - # End Group # Begin Group "Universal"