]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/helpwxht.cpp
project files update to use the same compilation options as the new project files...
[wxWidgets.git] / src / generic / helpwxht.cpp
index 1fdb91028cb753d66266cf2f3835b721b035f50f..7b3a9c9d70b7bf154ec27fee2f71ea51b8cc25b3 100644 (file)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        helpext.cpp
-// Purpose:     an external help controller for wxWindows
+// Name:        helpwxht.cpp
+// Purpose:     A help controller using the wxHTML classes
 // Author:      Karsten Ballueder
 // Modified by:
 // Created:     04/01/98
 #   pragma hdrstop
 #endif
 
-#if wxUSE_HTML
+#if wxUSE_WXHTML_HELP
 
 #ifndef WX_PRECOMP
-#   include "wx/string.h"
-#   include "wx/utils.h"
-#   include "wx/list.h"
-#   include "wx/intl.h"
-#   include "wx/layout.h"
-#   include "wx/combobox.h"
+    #include "wx/string.h"
+    #include "wx/utils.h"
+    #include "wx/list.h"
+    #include "wx/intl.h"
+    #include "wx/layout.h"
+    #include "wx/combobox.h"
+    #include "wx/button.h"
 #endif
 
 #include "wx/helpbase.h"
@@ -40,7 +41,7 @@
 #include <sys/stat.h>
 #endif
 
-#ifndef __WINDOWS__
+#if !defined(__WINDOWS__) && !defined(__OS2__)
 #   include   <unistd.h>
 #endif
 
@@ -69,7 +70,7 @@ public:
          delete [] src;
          return doc;
       }
-   
+
     virtual bool CanRead(const wxFSFile& file) const
       {
          wxString filename = file.GetLocation();
@@ -130,7 +131,7 @@ wxHelpFrame::OnButton(wxCommandEvent &ev)
    else if(id == m_IdSearch)
    {
       wxString str = m_combo->GetValue();
-      if(m_combo->FindString(str) == -1 && m_combo->Number() < MAX_COMBO_ENTRIES)
+      if(m_combo->FindString(str) == -1 && m_combo->GetCount() < MAX_COMBO_ENTRIES)
          m_combo->Append(str);
       m_controller->KeywordSearch(str);
    }
@@ -158,7 +159,7 @@ wxHelpFrame::wxHelpFrame(wxWindow *parent, int id,
    wxButton *btn_contents = new wxButton(this, m_IdContents, _("Contents"));
    m_combo = new wxComboBox(this, m_IdCombo);
    wxButton *btn_search = new wxButton(this, m_IdSearch, _("Search"));
-   
+
    m_filter = new wxForceHtmlFilter;
 
    wxLayoutConstraints *c;
@@ -176,7 +177,7 @@ wxHelpFrame::wxHelpFrame(wxWindow *parent, int id,
    c->top.SameAs(this, wxTop, 2*LAYOUT_Y_MARGIN);
    c->height.AsIs();
    btn_fwd->SetConstraints(c);
-   
+
    c = new wxLayoutConstraints;
    c->left.SameAs(btn_fwd, wxRight, 2*LAYOUT_X_MARGIN);
    c->width.Absolute(BUTTON_WIDTH);
@@ -207,11 +208,18 @@ wxHelpFrame::wxHelpFrame(wxWindow *parent, int id,
    m_htmlwin->SetConstraints(c);
    SetAutoLayout(TRUE);
    CreateStatusBar();
+
    m_htmlwin->SetRelatedFrame(this, title);
    m_htmlwin->SetRelatedStatusBar(0);
    m_htmlwin->AddFilter(m_filter);
 
+#ifdef __WXMOTIF__
+   // Motif needs a nudge to get it to resize properly
+   // when shown
+   wxSizeEvent event(size, GetId());
+   GetEventHandler()->ProcessEvent(event);
+#endif
+
    Show(TRUE);
 }
 
@@ -220,7 +228,7 @@ wxHelpFrame::~wxHelpFrame()
 }
 
 void
-wxHelpFrame::OnClose(wxCloseEvent &ev)
+wxHelpFrame::OnClose(wxCloseEvent &WXUNUSED(ev))
 {
    wxASSERT(m_controller);
    m_controller->m_Frame = NULL;
@@ -259,7 +267,7 @@ wxHelpControllerHtml::~wxHelpControllerHtml(void)
 #endif
 
 bool
-wxHelpControllerHtml::DisplayHelp(wxString const &relativeURL)
+wxHelpControllerHtml::DisplayHelp(const wxString &relativeURL)
 {
    wxBusyCursor b; // display a busy cursor
 
@@ -307,4 +315,5 @@ wxHelpControllerHtml::GetFrameParameters(wxSize *size,
    return m_Frame;
 }
 
-#endif // wxUSE_HTML
+#endif // wxUSE_WXHTML_HELP
+