diff --git a/ctl/ctlTreeJSON.cpp b/ctl/ctlTreeJSON.cpp index 900f234..7dfb264 100644 --- a/ctl/ctlTreeJSON.cpp +++ b/ctl/ctlTreeJSON.cpp @@ -71,7 +71,7 @@ void ctlTreeJSON::OnChar(wxKeyEvent& event) {

Ctrl-Z - Return source context node.

)"; - showHelpHtml(this,helpstr,screenPos, wxSize(450,300)); + showHelpHtml((wxWindow *)winMain,helpstr,screenPos, wxSize(450,300)); return; } if (event.GetKeyCode() == WXK_CONTROL_F) { diff --git a/include/utils/misc.h b/include/utils/misc.h index 0630bc8..7b93cac 100644 --- a/include/utils/misc.h +++ b/include/utils/misc.h @@ -280,6 +280,7 @@ wxString qtIdent(const wxString &value); // add " if necessary wxString qtTypeIdent(const wxString &value); // add " if necessary bool make_identifier(const wxString &strname, wxString &s, wxString &n, bool islower); +wxSize getScreenSizeForPoint(const wxPoint screenPos); void showHelpHtml(wxWindow *parent, const wxString &htmlHelp,wxPoint screenPos, wxSize size); #endif diff --git a/utils/misc.cpp b/utils/misc.cpp index 1c51506..f842c8f 100644 --- a/utils/misc.cpp +++ b/utils/misc.cpp @@ -1484,10 +1484,8 @@ bool make_identifier(const wxString &strname, wxString &s, wxString &n, bool isl return true; } -//show help window -void showHelpHtml(wxWindow *parent, const wxString &htmlHelp,wxPoint screenPos, wxSize size) { - FunctionPGHelper fh(htmlHelp); - wxString key = "content"; +// Get display for ScreenPoint +wxSize getScreenSizeForPoint(const wxPoint screenPos) { // screen size wxPoint posScreen; wxSize sizeScreen; @@ -1504,7 +1502,14 @@ void showHelpHtml(wxWindow *parent, const wxString &htmlHelp,wxPoint screenPos, posScreen = wxPoint(0, 0); sizeScreen = wxGetDisplaySize(); } + return sizeScreen; +} +//show help window +void showHelpHtml(wxWindow *parent, const wxString &htmlHelp,wxPoint screenPos, wxSize size) { + FunctionPGHelper fh(htmlHelp); + wxString key = "content"; + wxSize sizeScreen=getScreenSizeForPoint(screenPos); wxSize rr(350, 70); if (size.x!=-1) rr=size; popuphelp *m_Popup = new popuphelp(parent, key, &fh, screenPos, rr); @@ -1526,7 +1531,7 @@ void showHelpHtml(wxWindow *parent, const wxString &htmlHelp,wxPoint screenPos, wxRect r = m_Popup->GetScreenRect(); m_Popup->Popup(); } - + //m_Popup->SetFocus(); }