]> git.saurik.com Git - wxWidgets.git/commitdiff
Improved search for about.htm on mac
authorJulian Smart <julian@anthemion.co.uk>
Sat, 7 Aug 2004 21:59:45 +0000 (21:59 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Sat, 7 Aug 2004 21:59:45 +0000 (21:59 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28707 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

demos/forty/forty.cpp
demos/forty/forty.h

index 4d1328172d6413b402b5a973514dd54ed7a2a523..c71d8a241d638c877d8d03dce990300c61a67b74 100644 (file)
@@ -75,7 +75,13 @@ FortyApp::~FortyApp()
 bool FortyApp::OnInit()
 {
     bool largecards = false;
-    m_dir = wxGetCwd();
+#ifndef __WXWINCE__
+    m_helpFile = wxGetCwd() + wxFILE_SEP_PATH + wxT("about.htm");
+    if (!wxFileExists(m_helpFile))
+#endif
+    {
+        m_helpFile = wxPathOnly(argv[0]) + wxFILE_SEP_PATH + wxT("about.htm");
+    }
 
     wxSize size(668,510);
 
@@ -234,8 +240,7 @@ void
 FortyFrame::Help(wxCommandEvent& event)
 {
 #if wxUSE_HTML
-    wxString htmlFile = wxGetApp().GetDir() + wxFILE_SEP_PATH + wxT("about.htm");
-    if (wxFileExists(htmlFile))
+    if (wxFileExists(wxGetApp().GetHelpFile()))
     {
         FortyAboutDialog dialog(this, wxID_ANY, wxT("Forty Thieves Instructions"));
         if (dialog.ShowModal() == wxID_OK)
@@ -326,7 +331,7 @@ bool FortyAboutDialog::AddControls(wxWindow* parent)
 {
 #if wxUSE_HTML
     wxString htmlText;
-    wxString htmlFile = wxGetApp().GetDir() + wxFILE_SEP_PATH + wxT("about.htm");
+    wxString htmlFile = wxGetApp().GetHelpFile();
 
     {
         wxTextFile file(htmlFile);
index d3a24d8cffa8939faeb927cbe312ed94c98209fc..2b8a93005a17c0c843029acd6d736206e6172022 100644 (file)
@@ -23,13 +23,13 @@ public:
     static const wxColour& BackgroundColour();
     static const wxColour& TextColour();
     static const wxBrush&  BackgroundBrush();
-    const wxString& GetDir() const { return m_dir; }
+    const wxString& GetHelpFile() const { return m_helpFile; }
 
 private:
     static wxColour* m_backgroundColour;
     static wxColour* m_textColour;
     static wxBrush*  m_backgroundBrush;
-    wxString m_dir;
+    wxString m_helpFile;
 };
 
 DECLARE_APP(FortyApp)