X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5229b11d2c3163370106668381c2498abe6f792f..5268c5a32bbe68b834abeaa89c8cfb2099d50d2e:/src/html/helpfrm.cpp diff --git a/src/html/helpfrm.cpp b/src/html/helpfrm.cpp index af4af2cc71..a48ad5c3ae 100644 --- a/src/html/helpfrm.cpp +++ b/src/html/helpfrm.cpp @@ -327,11 +327,6 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id, dummy->SetAutoLayout(TRUE); dummy->SetSizer(topsizer); - long treeStyle = wxSUNKEN_BORDER | wxTR_HAS_BUTTONS; - #ifndef __WXMSW__ // FIXME - temporary, till MSW supports wxTR_HIDE_ROOT - treeStyle |= wxTR_HIDE_ROOT; - #endif - if ( style & wxHF_BOOKMARKS ) { m_Bookmarks = new wxComboBox(dummy, wxID_HTML_BOOKMARKSLIST, @@ -366,7 +361,10 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id, m_ContentsBox = new wxTreeCtrl(dummy, wxID_HTML_TREECTRL, wxDefaultPosition, wxDefaultSize, - treeStyle); + wxSUNKEN_BORDER | + wxTR_HAS_BUTTONS | wxTR_HIDE_ROOT | + wxTR_LINES_AT_ROOT); + m_ContentsBox->AssignImageList(ContentsImageList); topsizer->Add(m_ContentsBox, 1, wxEXPAND | wxLEFT | wxBOTTOM | wxRIGHT, 2); @@ -468,11 +466,6 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id, m_Splitter->SetMinimumPaneSize(20); if ( m_Cfg.navig_on ) m_Splitter->SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos); - else - { - m_Splitter->SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos); - m_Splitter->Unsplit(); - } if ( m_Cfg.navig_on ) { @@ -716,7 +709,6 @@ void wxHtmlHelpFrame::CreateContents() int cnt = m_Data->GetContentsCnt(); int i; - size_t booksCnt = m_Data->GetBookRecArray().GetCount(); wxHtmlContentsItem *it; @@ -731,52 +723,31 @@ void wxHtmlHelpFrame::CreateContents() bool imaged[MAX_ROOTS]; m_ContentsBox->DeleteAllItems(); - // FIXME - will go away when wxMSW's wxTreeCtrl supports wxTR_HIDE_ROOT! - bool hasSuperRoot = (booksCnt > 1) || - (m_ContentsBox->GetWindowStyle() & wxTR_HIDE_ROOT); - - // Don't show (Help) root if there's only one boook - if (hasSuperRoot) - { - roots[0] = m_ContentsBox->AddRoot(_("(Help)")); - m_ContentsBox->SetItemImage(roots[0], IMG_RootFolder); - m_ContentsBox->SetItemSelectedImage(roots[0], IMG_RootFolder); - imaged[0] = TRUE; - } + roots[0] = m_ContentsBox->AddRoot(_("(Help)")); + m_ContentsBox->SetItemImage(roots[0], IMG_RootFolder); + m_ContentsBox->SetItemSelectedImage(roots[0], IMG_RootFolder); + imaged[0] = TRUE; for (it = m_Data->GetContents(), i = 0; i < cnt; i++, it++) { // Handle books: if (it->m_Level == 0) { - // special case, only one book, make it tree's root: - if (!hasSuperRoot) + if (m_hfStyle & wxHF_MERGE_BOOKS) + // VS: we don't want book nodes, books' content should + // appear under tree's root. This line will create "fake" + // record about book node so that the rest of this look + // will believe there really _is_ book node and will + // behave correctly. + roots[1] = roots[0]; + else { - roots[0] = roots[1] = m_ContentsBox->AddRoot( + roots[1] = m_ContentsBox->AppendItem(roots[0], it->m_Name, IMG_Book, -1, new wxHtmlHelpTreeItemData(i)); - imaged[0] = imaged[1] = TRUE; m_ContentsBox->SetItemBold(roots[1], TRUE); } - // multiple books: - else - { - if (m_hfStyle & wxHF_MERGE_BOOKS) - // VS: we don't want book nodes, books' content should - // appear under tree's root. This line will create "fake" - // record about book node so that the rest of this look - // will believe there really _is_ book node and will - // behave correctly. - roots[1] = roots[0]; - else - { - roots[1] = m_ContentsBox->AppendItem(roots[0], - it->m_Name, IMG_Book, -1, - new wxHtmlHelpTreeItemData(i)); - m_ContentsBox->SetItemBold(roots[1], TRUE); - } - imaged[1] = TRUE; - } + imaged[1] = TRUE; } // ...and their contents: else @@ -1013,12 +984,14 @@ class wxHtmlHelpFrameOptionsDialog : public wxDialog topsizer->Add(new wxStaticText(this, -1, _("Preview:")), 0, wxLEFT | wxTOP, 10); - topsizer->Add(TestWin = new wxHtmlWindow(this, -1, wxDefaultPosition, wxSize(-1, 150), + topsizer->Add(TestWin = new wxHtmlWindow(this, -1, wxDefaultPosition, wxSize(20, 150), wxHW_SCROLLBAR_AUTO | wxSUNKEN_BORDER), 1, wxEXPAND | wxLEFT|wxTOP|wxRIGHT, 10); sizer = new wxBoxSizer(wxHORIZONTAL); - sizer->Add(new wxButton(this, wxID_OK, _("OK")), 0, wxALL, 10); + wxButton *ok; + sizer->Add(ok = new wxButton(this, wxID_OK, _("OK")), 0, wxALL, 10); + ok->SetDefault(); sizer->Add(new wxButton(this, wxID_CANCEL, _("Cancel")), 0, wxALL, 10); topsizer->Add(sizer, 0, wxALIGN_RIGHT);