From d45bc436954b74745c2f33fdd32b8e813f23431d Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Sat, 25 May 2002 09:40:17 +0000 Subject: [PATCH] Set the focus to the html display window 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 | 1 + src/html/helpfrm.cpp | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/include/wx/html/helpfrm.h b/include/wx/html/helpfrm.h index 33b9ed2598..835a7b9100 100644 --- a/include/wx/html/helpfrm.h +++ b/include/wx/html/helpfrm.h @@ -164,6 +164,7 @@ protected: void OnSearch(wxCommandEvent& event); void OnBookmarksSel(wxCommandEvent& event); void OnCloseWindow(wxCloseEvent& event); + void OnActivate(wxActivateEvent& event); // Images: enum { diff --git a/src/html/helpfrm.cpp b/src/html/helpfrm.cpp index 2e17256a5e..07096d4c71 100644 --- a/src/html/helpfrm.cpp +++ b/src/html/helpfrm.cpp @@ -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) -- 2.45.2