]> git.saurik.com Git - wxWidgets.git/commitdiff
Added showing the default URL in DisplayContents and DisplayIndex
authorJulian Smart <julian@anthemion.co.uk>
Fri, 27 Apr 2001 15:04:57 +0000 (15:04 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Fri, 27 Apr 2001 15:04:57 +0000 (15:04 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9903 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/html/helpdata.h
src/html/helpdata.cpp
src/html/helpfrm.cpp
src/msw/mdi.cpp

index 2f6b2b534e3913ec766ddaba2574b937d28646db..be84c07264c54f422ae6c48143ae0e4e9360d422 100644 (file)
@@ -198,6 +198,9 @@ class WXDLLEXPORT wxHtmlHelpData : public wxObject
         // Writes binary book
 };
 
+// Utility function
+wxString wxAddBasePath(const wxString& basePath, const wxString& path) ;
+
 #endif
 
 #endif
index 5e35fe729e43481a5b045e6e75d3700592915917..2afd0e5416a6196435f4b3ea8a699edb4fe1f332 100644 (file)
@@ -766,10 +766,10 @@ wxString wxHtmlHelpData::FindPageByName(const wxString& x)
     cnt = m_BookRecords.GetCount();
     for (i = 0; i < cnt; i++) 
     {
-        f = fsys.OpenFile(m_BookRecords[i].GetBasePath() + x);
+        f = fsys.OpenFile(wxAddBasePath(m_BookRecords[i].GetBasePath(), x));
         if (f) 
            {
-            url = m_BookRecords[i].GetBasePath() + x;
+            url = wxAddBasePath(m_BookRecords[i].GetBasePath(), x);
             delete f;
             return url;
         }
@@ -782,7 +782,7 @@ wxString wxHtmlHelpData::FindPageByName(const wxString& x)
     {
         if (m_BookRecords[i].GetTitle() == x) 
            {
-            url = m_BookRecords[i].GetBasePath() + m_BookRecords[i].GetStart();
+            url = wxAddBasePath(m_BookRecords[i].GetBasePath(), m_BookRecords[i].GetStart());
             return url;
         }
     }
@@ -794,7 +794,7 @@ wxString wxHtmlHelpData::FindPageByName(const wxString& x)
     {
         if (wxStrcmp(m_Contents[i].m_Name, x) == 0) 
            {
-            url = m_Contents[i].m_Book->GetBasePath() + m_Contents[i].m_Page;
+            url = wxAddBasePath(m_Contents[i].m_Book->GetBasePath(), m_Contents[i].m_Page);
             return url;
         }
     }
@@ -807,7 +807,7 @@ wxString wxHtmlHelpData::FindPageByName(const wxString& x)
     {
         if (wxStrcmp(m_Index[i].m_Name, x) == 0) 
            {
-            url = m_Index[i].m_Book->GetBasePath() + m_Index[i].m_Page;
+            url = wxAddBasePath(m_Index[i].m_Book->GetBasePath(), m_Index[i].m_Page);
             return url;
         }
     }
@@ -824,7 +824,7 @@ wxString wxHtmlHelpData::FindPageById(int id)
     {
         if (m_Contents[i].m_ID == id) 
            {
-            url = m_Contents[i].m_Book->GetBasePath() + m_Contents[i].m_Page;
+            url = wxAddBasePath(m_Contents[i].m_Book->GetBasePath(), m_Contents[i].m_Page);
             return url;
         }
     }
@@ -903,7 +903,7 @@ bool wxHtmlSearchStatus::Search()
     else m_LastPage = thepage;
     
     wxFileSystem fsys;
-    file = fsys.OpenFile(m_Data->m_Contents[i].m_Book->GetBasePath() + thepage);
+    file = fsys.OpenFile(wxAddBasePath(m_Data->m_Contents[i].m_Book->GetBasePath(), thepage));
     if (file) 
     {
         if (m_Engine.Scan(file->GetStream())) {
@@ -990,6 +990,14 @@ bool wxSearchEngine::Scan(wxInputStream *stream)
     return found;
 }
 
+// Utility function
+wxString wxAddBasePath(const wxString& basePath, const wxString& path)
+{
+    if (wxIsAbsolutePath(path))
+        return path;
+    else
+        return basePath + path;
+}
 
 
 
index d4bdeeeaf1f70e8af33c1740a6329f8f3876659b..c10b8254c5ab0c63351732783d293c596e2d7f5d 100644 (file)
@@ -601,6 +601,12 @@ bool wxHtmlHelpFrame::DisplayContents()
         m_Cfg.navig_on = TRUE;
     }
     m_NavigPan->SetSelection(0);
+    if (m_Data->GetBookRecArray().GetCount() > 0)
+    {
+        wxHtmlBookRecord& book = m_Data->GetBookRecArray()[0];
+        if (!book.GetStart().IsEmpty())
+            m_HtmlWin->LoadPage(wxAddBasePath(book.GetBasePath(), book.GetStart()));
+    }
     return TRUE;
 }
 
@@ -617,6 +623,12 @@ bool wxHtmlHelpFrame::DisplayIndex()
         m_Splitter->SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos);
     }
     m_NavigPan->SetSelection(1);
+    if (m_Data->GetBookRecArray().GetCount() > 0)
+    {
+        wxHtmlBookRecord& book = m_Data->GetBookRecArray()[0];
+        if (!book.GetStart().IsEmpty())
+            m_HtmlWin->LoadPage(wxAddBasePath(book.GetBasePath(), book.GetStart()));
+    }
     return TRUE;
 }
 
@@ -674,7 +686,7 @@ bool wxHtmlHelpFrame::KeywordSearch(const wxString& keyword)
         wxHtmlContentsItem *it = (wxHtmlContentsItem*) m_SearchList->GetClientData(0);
         if (it)
         {
-            m_HtmlWin->LoadPage(it->m_Book->GetBasePath() + it->m_Page);
+            m_HtmlWin->LoadPage(wxAddBasePath(it->m_Book->GetBasePath(), it->m_Page));
             NotifyPageChanged();
         }
     }
@@ -713,7 +725,7 @@ void wxHtmlHelpFrame::CreateContents()
         roots[it->m_Level + 1] =  m_ContentsBox->AppendItem(
                                        roots[it->m_Level], it->m_Name, IMG_Page, -1,
                                        new wxHtmlHelpTreeItemData(i));
-        m_PagesHash->Put(it->m_Book->GetBasePath() + it->m_Page,
+        m_PagesHash->Put(wxAddBasePath(it->m_Book->GetBasePath(), it->m_Page),
                            new wxHtmlHelpHashData(i, roots[it->m_Level + 1]));
 
         if (it->m_Level == 0)
@@ -1102,7 +1114,7 @@ void wxHtmlHelpFrame::OnToolbar(wxCommandEvent& event)
                     wxHtmlContentsItem *it = m_Data->GetContents() + (ha->m_Index - 1);
                     if (it->m_Page[0] != 0)
                     {
-                        m_HtmlWin->LoadPage(it->m_Book->GetBasePath() + it->m_Page);
+                        m_HtmlWin->LoadPage(wxAddBasePath(it->m_Book->GetBasePath(), it->m_Page));
                         NotifyPageChanged();
                     }
                 }
@@ -1130,7 +1142,7 @@ void wxHtmlHelpFrame::OnToolbar(wxCommandEvent& event)
                     {
                         if (it->m_Page[0] != 0)
                         {
-                            m_HtmlWin->LoadPage(it->m_Book->GetBasePath() + it->m_Page);
+                            m_HtmlWin->LoadPage(wxAddBasePath(it->m_Book->GetBasePath(), it->m_Page));
                             NotifyPageChanged();
                         }
                     }
@@ -1154,11 +1166,11 @@ void wxHtmlHelpFrame::OnToolbar(wxCommandEvent& event)
                 {
                     wxHtmlContentsItem *it = m_Data->GetContents() + (ha->m_Index + 1);
 
-                    while (it->m_Book->GetBasePath() + it->m_Page == adr) it++;
+                    while (wxAddBasePath(it->m_Book->GetBasePath(), it->m_Page) == adr) it++;
 
                     if (it->m_Page[0] != 0)
                     {
-                        m_HtmlWin->LoadPage(it->m_Book->GetBasePath() + it->m_Page);
+                        m_HtmlWin->LoadPage(wxAddBasePath(it->m_Book->GetBasePath(), it->m_Page));
                         NotifyPageChanged();
                     }
                 }
@@ -1281,7 +1293,7 @@ void wxHtmlHelpFrame::OnContentsSel(wxTreeEvent& event)
         it = m_Data->GetContents() + (pg->m_Id);
         m_UpdateContents = FALSE;
         if (it->m_Page[0] != 0)
-            m_HtmlWin->LoadPage(it->m_Book->GetBasePath() + it->m_Page);
+            m_HtmlWin->LoadPage(wxAddBasePath(it->m_Book->GetBasePath(), it->m_Page));
         m_UpdateContents = TRUE;
     }
 }
@@ -1292,7 +1304,7 @@ void wxHtmlHelpFrame::OnIndexSel(wxCommandEvent& WXUNUSED(event))
 {
     wxHtmlContentsItem *it = (wxHtmlContentsItem*) m_IndexList->GetClientData(m_IndexList->GetSelection());
     if (it->m_Page[0] != 0)
-        m_HtmlWin->LoadPage(it->m_Book->GetBasePath() + it->m_Page);
+        m_HtmlWin->LoadPage(wxAddBasePath(it->m_Book->GetBasePath(), it->m_Page));
     NotifyPageChanged();
 }
 
@@ -1331,7 +1343,7 @@ void wxHtmlHelpFrame::OnIndexFind(wxCommandEvent& event)
                 if (first)
                        {
                     if (index[i].m_Page[0] != 0)
-                        m_HtmlWin->LoadPage(index[i].m_Book->GetBasePath() + index[i].m_Page);
+                        m_HtmlWin->LoadPage(wxAddBasePath(index[i].m_Book->GetBasePath(), index[i].m_Page));
                     NotifyPageChanged();
                     first = FALSE;
                 }
@@ -1362,7 +1374,7 @@ void wxHtmlHelpFrame::OnIndexAll(wxCommandEvent& WXUNUSED(event))
         if (first)
            {
             if (index[i].m_Page[0] != 0)
-                m_HtmlWin->LoadPage(index[i].m_Book->GetBasePath() + index[i].m_Page);
+                m_HtmlWin->LoadPage(wxAddBasePath(index[i].m_Book->GetBasePath(), index[i].m_Page));
             NotifyPageChanged();
             first = FALSE;
         }
@@ -1380,7 +1392,7 @@ void wxHtmlHelpFrame::OnSearchSel(wxCommandEvent& WXUNUSED(event))
     if (it)
     {
         if (it->m_Page[0] != 0)
-            m_HtmlWin->LoadPage(it->m_Book->GetBasePath() + it->m_Page);
+            m_HtmlWin->LoadPage(wxAddBasePath(it->m_Book->GetBasePath(), it->m_Page));
         NotifyPageChanged();
     }
 }
index 155e3537da1c7050a8bb76f5ee6a1622fe1436a2..4eaf3c777902851631519414d7c2b823f1d5677f 100644 (file)
@@ -695,7 +695,7 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
   else
       mcs.cy = CW_USEDEFAULT;
 
-  DWORD msflags = WS_OVERLAPPED | WS_CLIPCHILDREN;
+  DWORD msflags = WS_OVERLAPPED | WS_CLIPCHILDREN | WS_THICKFRAME;
   if (style & wxMINIMIZE_BOX)
     msflags |= WS_MINIMIZEBOX;
   if (style & wxMAXIMIZE_BOX)