]> git.saurik.com Git - wxWidgets.git/commitdiff
Set the focus to the html display window
authorRobert Roebling <robert@roebling.de>
Sat, 25 May 2002 09:40:17 +0000 (09:40 +0000)
committerRobert Roebling <robert@roebling.de>
Sat, 25 May 2002 09:40:17 +0000 (09:40 +0000)
    if the help frame comes to the front.
    With this, you can use context sensitive
    help systems without the mouse.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15661 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

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

index 33b9ed2598baf685bb7d1860886127e6319a6942..835a7b91006bf27726b0897cb692f59e238aed31 100644 (file)
@@ -164,6 +164,7 @@ protected:
     void OnSearch(wxCommandEvent& event);
     void OnBookmarksSel(wxCommandEvent& event);
     void OnCloseWindow(wxCloseEvent& event);
+    void OnActivate(wxActivateEvent& event);
 
     // Images:
     enum {
index 2e17256a5eccf47d0cdff79c9d08b694accdc408..07096d4c71357173b7b4478f2b4e93850de98469 100644 (file)
@@ -1099,6 +1099,14 @@ EVENT HANDLING :
 */
 
 
+void wxHtmlHelpFrame::OnActivate(wxActivateEvent& event)
+{
+    // This saves one mouse click when using the
+    // wxHTML for context sensitive help systems
+    if (event.GetActive() && m_HtmlWin)
+        m_HtmlWin->SetFocus();
+}
+
 void wxHtmlHelpFrame::OnToolbar(wxCommandEvent& event)
 {
     switch (event.GetId())
@@ -1448,6 +1456,7 @@ void wxHtmlHelpFrame::OnCloseWindow(wxCloseEvent& evt)
 }
 
 BEGIN_EVENT_TABLE(wxHtmlHelpFrame, wxFrame)
+    EVT_ACTIVATE(wxHtmlHelpFrame::OnActivate)
     EVT_TOOL_RANGE(wxID_HTML_PANEL, wxID_HTML_OPTIONS, wxHtmlHelpFrame::OnToolbar)
     EVT_BUTTON(wxID_HTML_BOOKMARKSREMOVE, wxHtmlHelpFrame::OnToolbar)
     EVT_BUTTON(wxID_HTML_BOOKMARKSADD, wxHtmlHelpFrame::OnToolbar)