]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't send dummy wxCommandEvent.
authorWłodzimierz Skiba <abx@abx.art.pl>
Tue, 7 Mar 2006 18:41:27 +0000 (18:41 +0000)
committerWłodzimierz Skiba <abx@abx.art.pl>
Tue, 7 Mar 2006 18:41:27 +0000 (18:41 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37863 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/html/helpwnd.h
src/html/helpwnd.cpp

index 5d299a7159887372a8e561a34757e41f07b84d5a..be0bc67cd5305a7be5d391d11d65012a05bfa7a8 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        helpwnd.h
+// Name:        wx/html/helpwnd.h
 // Purpose:     wxHtmlHelpWindow
 // Notes:       Based on htmlhelp.cpp, implementing a monolithic
 //              HTML Help controller class,  by Vaclav Slavik
@@ -252,6 +252,8 @@ protected:
     int m_hfStyle;
 
 private:
+    void DoIndexFind();
+    void DoIndexAll();
     void DisplayIndexItem(const wxHtmlHelpMergedIndexItem *it);
     wxHtmlHelpMergedIndex *m_mergedIndex;
 
@@ -327,4 +329,3 @@ END_DECLARE_EVENT_TYPES()
 #endif // wxUSE_WXHTML_HELP
 
 #endif
-
index 5686f0bab5e39701d9babb5e69d1a382304f0dbd..83c06c71c6c592f4b0cddfe6614ead29f25ad2dd 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        helpwnd.cpp
+// Name:        src/html/helpwnd.cpp
 // Purpose:     wxHtmlHelpWindow
 // Notes:       Based on htmlhelp.cpp, implementing a monolithic
 //              HTML Help controller class,  by Vaclav Slavik
@@ -342,13 +342,13 @@ bool wxHtmlHelpWindow::Create(wxWindow* parent, wxWindowID id,
     // The sizer for the whole top-level window.
     wxSizer *topWindowSizer = new wxBoxSizer(wxVERTICAL);
     SetSizer(topWindowSizer);
-    SetAutoLayout(TRUE);
+    SetAutoLayout(true);
 
 #if wxUSE_TOOLBAR
     // toolbar?
     if (helpStyle & (wxHF_TOOLBAR | wxHF_FLAT_TOOLBAR))
     {
-        wxToolBar *toolBar = new wxToolBar(this, -1, wxDefaultPosition, wxDefaultSize,
+        wxToolBar *toolBar = new wxToolBar(this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
                                            wxNO_BORDER | wxTB_HORIZONTAL |
                                            wxTB_DOCKABLE | wxTB_NODIVIDER |
                                            (helpStyle & wxHF_FLAT_TOOLBAR ? wxTB_FLAT : 0));
@@ -874,7 +874,7 @@ bool wxHtmlHelpWindow::KeywordSearch(const wxString& keyword,
         }
 
         m_SearchButton->Enable();
-        m_SearchText->SetSelection(0, keyword.Length());
+        m_SearchText->SetSelection(0, keyword.length());
         m_SearchText->SetFocus();
     }
     else if (mode == wxHELP_SEARCH_INDEX)
@@ -885,8 +885,7 @@ bool wxHtmlHelpWindow::KeywordSearch(const wxString& keyword,
         m_IndexButtonAll->Disable();
         m_IndexText->SetValue(keyword);
 
-        wxCommandEvent dummy;
-        OnIndexFind(dummy); // what a hack...
+        DoIndexFind();
         m_IndexButton->Enable();
         m_IndexButtonAll->Enable();
         foundcnt = m_IndexList->GetCount();
@@ -1584,13 +1583,18 @@ void wxHtmlHelpWindow::OnIndexSel(wxCommandEvent& WXUNUSED(event))
         DisplayIndexItem(it);
 }
 
-void wxHtmlHelpWindow::OnIndexFind(wxCommandEvent& event)
+void wxHtmlHelpWindow::OnIndexFind(wxCommandEvent& WXUNUSED(event))
+{
+    DoIndexFind();
+}
+
+void wxHtmlHelpWindow::DoIndexFind()
 {
     wxString sr = m_IndexText->GetLineText(0);
     sr.MakeLower();
     if (sr == wxEmptyString)
     {
-        OnIndexAll(event);
+        DoIndexAll();
     }
     else
     {
@@ -1654,12 +1658,17 @@ void wxHtmlHelpWindow::OnIndexFind(wxCommandEvent& event)
         cnttext.Printf(_("%i of %i"), displ, cnt);
         m_IndexCountInfo->SetLabel(cnttext);
 
-        m_IndexText->SetSelection(0, sr.Length());
+        m_IndexText->SetSelection(0, sr.length());
         m_IndexText->SetFocus();
     }
 }
 
 void wxHtmlHelpWindow::OnIndexAll(wxCommandEvent& WXUNUSED(event))
+{
+    DoIndexAll();
+}
+
+void wxHtmlHelpWindow::DoIndexAll()
 {
     wxBusyCursor bcur;