summaryrefslogtreecommitdiff
path: root/lib/help_provider.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:23:19 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:23:19 +0200
commit0887aee8c54d0ed51bb2031431e2bcdafebb4c6e (patch)
tree69537ceb9787bb25ac363cc4e6cdaf0804d78363 /lib/help_provider.h
parent5.12 (diff)
downloadFreeFileSync-0887aee8c54d0ed51bb2031431e2bcdafebb4c6e.tar.gz
FreeFileSync-0887aee8c54d0ed51bb2031431e2bcdafebb4c6e.tar.bz2
FreeFileSync-0887aee8c54d0ed51bb2031431e2bcdafebb4c6e.zip
5.13
Diffstat (limited to 'lib/help_provider.h')
-rw-r--r--lib/help_provider.h28
1 files changed, 19 insertions, 9 deletions
diff --git a/lib/help_provider.h b/lib/help_provider.h
index 15ae4f60..215b7dac 100644
--- a/lib/help_provider.h
+++ b/lib/help_provider.h
@@ -8,12 +8,14 @@
#define HELPPROVIDER_H_INCLUDED
#include <wx/help.h>
-#include "ffs_paths.h"
#include <zen/zstring.h>
+#include "ffs_paths.h"
namespace zen
{
-void displayHelpEntry(const wxString& section = wxEmptyString); //use '/' as path separator!
+//use '/' as path separator!
+void displayHelpEntry(wxWindow* parent);
+void displayHelpEntry(const wxString& section, wxWindow* parent);
@@ -36,10 +38,10 @@ wxHelpController& getHelpCtrl()
if (!initialized)
{
initialized = true;
- controller.Initialize(toWx(zen::getResourceDir()) +
+ controller.Initialize(utfCvrtTo<wxString>(zen::getResourceDir()) +
#ifdef FFS_WIN
L"FreeFileSync.chm");
-#elif defined FFS_LINUX
+#elif defined FFS_LINUX || defined FFS_MAC
L"Help/FreeFileSync.hhp");
#endif
}
@@ -48,12 +50,20 @@ wxHelpController& getHelpCtrl()
inline
-void displayHelpEntry(const wxString& section)
+void displayHelpEntry(const wxString& section, wxWindow* parent)
+{
+ getHelpCtrl().SetParentWindow(parent); //this nicely solves modal issues on OSX with help file going to the background
+ getHelpCtrl().DisplaySection(replaceCpy(section, L'/', utfCvrtTo<wxString>(FILE_NAME_SEPARATOR)));
+ getHelpCtrl().SetParentWindow(nullptr);
+}
+
+
+inline
+void displayHelpEntry(wxWindow* parent)
{
- if (section.empty())
- getHelpCtrl().DisplayContents();
- else
- getHelpCtrl().DisplaySection(replaceCpy(section, L'/', utfCvrtTo<std::wstring>(FILE_NAME_SEPARATOR)));
+ getHelpCtrl().SetParentWindow(parent);
+ getHelpCtrl().DisplayContents();
+ getHelpCtrl().SetParentWindow(nullptr);
}
}
bgstack15