From f7091ec3313a6d9c19de9db78cb8f9f5e042077b Mon Sep 17 00:00:00 2001 From: "hyatt%netscape.com" Date: Tue, 22 Sep 1998 00:24:26 +0000 Subject: [PATCH] Support for templates added to SHACK. More properties added to front end. git-svn-id: svn://10.0.0.236/trunk@10644 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/cmd/winfe/cxpane.cpp | 6 +- mozilla/cmd/winfe/navbar.cpp | 391 ++++++++++++++++++++------------- mozilla/cmd/winfe/navbar.h | 1 + mozilla/cmd/winfe/rdfliner.cpp | 61 +++-- mozilla/cmd/winfe/rdfliner.h | 2 +- mozilla/cmd/winfe/usertlbr.cpp | 7 +- 6 files changed, 289 insertions(+), 179 deletions(-) diff --git a/mozilla/cmd/winfe/cxpane.cpp b/mozilla/cmd/winfe/cxpane.cpp index 9821d6baf5a..3cd7cef3aed 100644 --- a/mozilla/cmd/winfe/cxpane.cpp +++ b/mozilla/cmd/winfe/cxpane.cpp @@ -1572,10 +1572,12 @@ void CPaneCX::DisplayBuiltin(MWContext *pContext, int iLocation, LO_BuiltinStruc char* url = LO_GetBuiltInAttribute(pBuiltin_struct, "data"); char* target = LO_GetBuiltInAttribute(pBuiltin_struct, "target"); if (pBuiltin_struct->FE_Data == NULL ){ + char* templateType = LO_GetBuiltInAttribute(pBuiltin_struct, "template"); + #ifdef OJI - CRDFContentView* pWnd = CRDFContentView::DisplayRDFTreeFromSHACK(pContext, cWnd, xPos, yPos, width, height, url == NULL ? "" :url , pBuiltin_struct->attributes.n, pBuiltin_struct->attributes.names, pBuiltin_struct->attributes.values); + CRDFContentView* pWnd = CRDFContentView::DisplayRDFTreeFromSHACK(pContext, cWnd, xPos, yPos, width, height, url == NULL ? "" :url , templateType, pBuiltin_struct->attributes.n, pBuiltin_struct->attributes.names, pBuiltin_struct->attributes.values); #else - CRDFContentView* pWnd = CRDFContentView::DisplayRDFTreeFromSHACK(pContext, cWnd, xPos, yPos, width, height, url == NULL ? "" :url , pBuiltin_struct->attribute_cnt, pBuiltin_struct->attribute_list, pBuiltin_struct->value_list); + CRDFContentView* pWnd = CRDFContentView::DisplayRDFTreeFromSHACK(pContext, cWnd, xPos, yPos, width, height, url == NULL ? "" :url , templateType, pBuiltin_struct->attribute_cnt, pBuiltin_struct->attribute_list, pBuiltin_struct->value_list); #endif ((CRDFOutliner*)pWnd->GetOutlinerParent()->GetOutliner())->SetWindowTarget(target); pBuiltin_struct->FE_Data = pWnd; diff --git a/mozilla/cmd/winfe/navbar.cpp b/mozilla/cmd/winfe/navbar.cpp index eef4f8ebea6..e539f32d6d6 100644 --- a/mozilla/cmd/winfe/navbar.cpp +++ b/mozilla/cmd/winfe/navbar.cpp @@ -131,8 +131,36 @@ void CNavTitleBar::OnPaint( ) CRect controlStripRect(rect); CRect titleBarRect(rect); - controlStripRect.top = NAVBAR_TOTAL_HEIGHT - NAVBAR_CONTROLSTRIP_HEIGHT; - controlStripRect.bottom = NAVBAR_TOTAL_HEIGHT; + + int navBarTotalHeight = 0; + int navBarControlStripHeight = 0; + int navBarTitleBarHeight = 0; + + HT_GetTemplateData(topNode, gNavCenter->showTitleBar, HT_COLUMN_STRING, &data); + if (data) + { + CString answer((char*)data); + if (answer.GetLength() > 0 && (answer.GetAt(0) == 'Y' || answer.GetAt(0) == 'y')) + { + navBarTotalHeight += NAVBAR_TITLEBAR_HEIGHT; + navBarTitleBarHeight += NAVBAR_TITLEBAR_HEIGHT; + } + } + + // Whether or not to show the control strip. + HT_GetTemplateData(topNode, gNavCenter->showControlStrip, HT_COLUMN_STRING, &data); + if (data) + { + CString answer((char*)data); + if (answer.GetLength() > 0 && (answer.GetAt(0) == 'Y' || answer.GetAt(0) == 'y')) + { + navBarTotalHeight += NAVBAR_CONTROLSTRIP_HEIGHT; + navBarControlStripHeight = NAVBAR_CONTROLSTRIP_HEIGHT; + } + } + + controlStripRect.top = navBarTitleBarHeight; + controlStripRect.bottom = navBarTotalHeight; titleBarRect.top = 0; titleBarRect.bottom = controlStripRect.top; @@ -172,167 +200,193 @@ void CNavTitleBar::OnPaint( ) dc.FillRect(&controlStripRect, &controlStripFaceBrush); } - - // Draw the title strip text. - CString titleText(HT_GetNodeName(HT_TopNode(m_View))); - - CFont arialFont; - LOGFONT lf; - XP_MEMSET(&lf,0,sizeof(LOGFONT)); - lf.lfHeight = 120; - lf.lfWeight = 700; - strcpy(lf.lfFaceName, "Arial"); - arialFont.CreatePointFontIndirect(&lf, &dc); - HFONT font = (HFONT)arialFont.GetSafeHandle(); - - HFONT hOldFont = (HFONT)::SelectObject(dc.m_hDC, font); - CRect sizeRect(titleBarRect); - int height = CIntlWin::DrawText(CS_UTF8, dc.m_hDC, titleText.GetBuffer(0), titleText.GetLength(), &sizeRect, DT_CALCRECT | DT_WORDBREAK); - - if (sizeRect.Width() > rect.Width() - 9) + if (navBarTitleBarHeight > 0) { - // Don't write into the close box area! - sizeRect.right = sizeRect.left + (rect.Width() - 9); - } - sizeRect.left += 4; // indent slightly horizontally - sizeRect.right += 4; + // Draw the title strip text. + CString titleText(HT_GetNodeName(HT_TopNode(m_View))); - // Center the text vertically. - sizeRect.top = (titleBarRect.Height() - height) / 2; - sizeRect.bottom = sizeRect.top + height; + CFont arialFont; + LOGFONT lf; + XP_MEMSET(&lf,0,sizeof(LOGFONT)); + lf.lfHeight = 120; + lf.lfWeight = 700; + strcpy(lf.lfFaceName, "Arial"); + arialFont.CreatePointFontIndirect(&lf, &dc); + HFONT font = (HFONT)arialFont.GetSafeHandle(); - // Draw the text - int nOldBkMode = dc.SetBkMode(TRANSPARENT); + HFONT hOldFont = (HFONT)::SelectObject(dc.m_hDC, font); + CRect sizeRect(titleBarRect); + int height = CIntlWin::DrawText(CS_UTF8, dc.m_hDC, titleText.GetBuffer(0), titleText.GetLength(), &sizeRect, DT_CALCRECT | DT_WORDBREAK); + + if (sizeRect.Width() > rect.Width() - 9) + { + // Don't write into the close box area! + sizeRect.right = sizeRect.left + (rect.Width() - 9); + } + sizeRect.left += 4; // indent slightly horizontally + sizeRect.right += 4; - UINT nFormat = DT_SINGLELINE | DT_VCENTER | DT_EXTERNALLEADING; - COLORREF oldColor; + // Center the text vertically. + sizeRect.top = (titleBarRect.Height() - height) / 2; + sizeRect.bottom = sizeRect.top + height; - oldColor = dc.SetTextColor(m_ForegroundColor); - CIntlWin::DrawText(CS_UTF8, dc.m_hDC, titleText.GetBuffer(0), -1, &sizeRect, nFormat); + // Draw the text + int nOldBkMode = dc.SetBkMode(TRANSPARENT); - // Draw the control strip text. - CFont smallArialFont; - LOGFONT lf2; - XP_MEMSET(&lf2,0,sizeof(LOGFONT)); - lf2.lfHeight = 90; - lf2.lfWeight = 400; - strcpy(lf2.lfFaceName, "Arial"); - smallArialFont.CreatePointFontIndirect(&lf2, &dc); - HFONT smallFont = (HFONT)smallArialFont.GetSafeHandle(); - ::SelectObject(dc.m_hDC, smallFont); + UINT nFormat = DT_SINGLELINE | DT_VCENTER | DT_EXTERNALLEADING; + COLORREF oldColor; - // The ADD button - CString addText("Add Page"); // Will use an extensible HT mechanism eventually. Hardcode for now. - //HT_GetTemplateData(topNode, gNavCenter->controlStripModeText, HT_COLUMN_STRING, &data); - //if (data) - // modeText = (char*)data; - - CRect addRect(controlStripRect); - int smallHeight = CIntlWin::DrawText(CS_UTF8, dc.m_hDC, addText.GetBuffer(0), addText.GetLength(), &addRect, DT_CALCRECT | DT_WORDBREAK); - - if (addRect.Width() > rect.Width() - 9) - { - // Don't write into the close box area! - addRect.right = addRect.left + (rect.Width() - 9); - } - addRect.left += 4; // indent slightly horizontally - addRect.right += 4; + oldColor = dc.SetTextColor(m_ForegroundColor); + CIntlWin::DrawText(CS_UTF8, dc.m_hDC, titleText.GetBuffer(0), -1, &sizeRect, nFormat); - // Center the text vertically. - addRect.top = controlStripRect.top + (controlStripRect.Height() - smallHeight) / 2; - addRect.bottom = addRect.top + smallHeight; - - // Cache the rect - cachedAddRect.top = controlStripRect.top; - cachedAddRect.left = 0; - cachedAddRect.bottom = controlStripRect.bottom; - cachedAddRect.right = addRect.right + 3; - - // The MANAGE button - CString modeText("Edit Bookmarks"); // Will use an extensible HT mechanism eventually. Hardcode for now. - //HT_GetTemplateData(topNode, gNavCenter->controlStripModeText, HT_COLUMN_STRING, &data); - //if (data) - // modeText = (char*)data; - - CRect modeRect(controlStripRect); - smallHeight = CIntlWin::DrawText(CS_UTF8,dc.m_hDC, modeText.GetBuffer(0), modeText.GetLength(), &modeRect, DT_CALCRECT | DT_WORDBREAK); - - if (modeRect.Width() > rect.Width() - 9) - { - // Don't write into the close box area! - modeRect.right = modeRect.left + (rect.Width() - 9); - } - modeRect.left += cachedAddRect.right + 10; // account for add rect and indent slightly horizontally - modeRect.right += cachedAddRect.right + 10; - - // Center the text vertically. - modeRect.top = addRect.top; - modeRect.bottom = addRect.bottom; - modeRect.right += 4; - - // Cache the rect - cachedModeRect.top = controlStripRect.top; - cachedModeRect.left = cachedAddRect.right + 6; - cachedModeRect.bottom = controlStripRect.bottom; - cachedModeRect.right = cachedModeRect.left + modeRect.Width() + 3; - - // Now compute the close box rect. - CString closeText("Close"); - HT_GetTemplateData(topNode, gNavCenter->controlStripCloseText, HT_COLUMN_STRING, &data); - if (data) - closeText = (char*)data; - - CRect closeRect(controlStripRect); - CIntlWin::DrawText(CS_UTF8, dc.m_hDC, closeText.GetBuffer(0), closeText.GetLength(), &closeRect, DT_CALCRECT | DT_WORDBREAK); - - int closeWidth = closeRect.Width(); - - closeRect.right = rect.right - 4; - closeRect.left = closeRect.right - closeWidth; - - // Center the text vertically. - closeRect.top = modeRect.top; - closeRect.bottom = modeRect.bottom; - - CRect arrowRect; - arrowRect.top = controlStripRect.top; - arrowRect.left = closeRect.left - 12; - arrowRect.right = arrowRect.left + 12; - arrowRect.bottom = controlStripRect.bottom; - - DrawArrow(dc.m_hDC, m_ControlStripForegroundColor, LEFT_ARROW, arrowRect, TRUE); - - // Cache the rect - cachedCloseRect.top = controlStripRect.top; - cachedCloseRect.left = arrowRect.left; - cachedCloseRect.bottom = controlStripRect.bottom; - cachedCloseRect.right = closeRect.right + 3; - - // Draw the text - dc.SetTextColor(m_ControlStripForegroundColor); - CIntlWin::DrawText(CS_UTF8, dc.m_hDC, closeText.GetBuffer(0), -1, &closeRect, nFormat); - CIntlWin::DrawText(CS_UTF8, dc.m_hDC, modeText.GetBuffer(0), -1, &modeRect, nFormat); - CIntlWin::DrawText(CS_UTF8, dc.m_hDC, addText.GetBuffer(0), -1, &addRect, nFormat); - - // See if we're supposed to draw a framing rect. - - CBrush controlBrush(m_ControlStripForegroundColor); - if (m_bDrawCloseFrame) - { - dc.FrameRect(cachedCloseRect, &controlBrush); - } - if (m_bDrawModeFrame) - { - dc.FrameRect(cachedModeRect, &controlBrush); - } - if (m_bDrawAddFrame) - { - dc.FrameRect(cachedAddRect, &controlBrush); + dc.SetTextColor(oldColor); + dc.SetBkMode(nOldBkMode); + ::SelectObject(dc.m_hDC, hOldFont); } - dc.SetTextColor(oldColor); - dc.SetBkMode(nOldBkMode); - ::SelectObject(dc.m_hDC, hOldFont); + if (navBarControlStripHeight > 0) + { + // Draw the control strip text. + CFont smallArialFont; + LOGFONT lf2; + XP_MEMSET(&lf2,0,sizeof(LOGFONT)); + lf2.lfHeight = 90; + lf2.lfWeight = 400; + strcpy(lf2.lfFaceName, "Arial"); + smallArialFont.CreatePointFontIndirect(&lf2, &dc); + HFONT smallFont = (HFONT)smallArialFont.GetSafeHandle(); + HFONT hOldFont = (HFONT)::SelectObject(dc.m_hDC, smallFont); + + // The ADD button + CString addText("Add Page"); // Will use an extensible HT mechanism eventually. Hardcode for now. + //HT_GetTemplateData(topNode, gNavCenter->controlStripModeText, HT_COLUMN_STRING, &data); + //if (data) + // modeText = (char*)data; + + CRect addRect(controlStripRect); + int smallHeight = CIntlWin::DrawText(CS_UTF8, dc.m_hDC, addText.GetBuffer(0), addText.GetLength(), &addRect, DT_CALCRECT | DT_WORDBREAK); + + if (addRect.Width() > rect.Width() - 9) + { + // Don't write into the close box area! + addRect.right = addRect.left + (rect.Width() - 9); + } + addRect.left += 4; // indent slightly horizontally + addRect.right += 4; + + // Center the text vertically. + addRect.top = controlStripRect.top + (controlStripRect.Height() - smallHeight) / 2; + addRect.bottom = addRect.top + smallHeight; + + // Cache the rect + cachedAddRect.top = controlStripRect.top; + cachedAddRect.left = 0; + cachedAddRect.bottom = controlStripRect.bottom; + cachedAddRect.right = addRect.right + 3; + + // The MANAGE button + CString modeText("Edit Bookmarks"); // Will use an extensible HT mechanism eventually. Hardcode for now. + //HT_GetTemplateData(topNode, gNavCenter->controlStripModeText, HT_COLUMN_STRING, &data); + //if (data) + // modeText = (char*)data; + + CRect modeRect(controlStripRect); + smallHeight = CIntlWin::DrawText(CS_UTF8,dc.m_hDC, modeText.GetBuffer(0), modeText.GetLength(), &modeRect, DT_CALCRECT | DT_WORDBREAK); + + if (modeRect.Width() > rect.Width() - 9) + { + // Don't write into the close box area! + modeRect.right = modeRect.left + (rect.Width() - 9); + } + modeRect.left += cachedAddRect.right + 10; // account for add rect and indent slightly horizontally + modeRect.right += cachedAddRect.right + 10; + + // Center the text vertically. + modeRect.top = addRect.top; + modeRect.bottom = addRect.bottom; + modeRect.right += 4; + + // Cache the rect + cachedModeRect.top = controlStripRect.top; + cachedModeRect.left = cachedAddRect.right + 6; + cachedModeRect.bottom = controlStripRect.bottom; + cachedModeRect.right = cachedModeRect.left + modeRect.Width() + 3; + + CString closeText("Close"); + HT_GetTemplateData(topNode, gNavCenter->controlStripCloseText, HT_COLUMN_STRING, &data); + if (data) + closeText = (char*)data; + + CRect closeRect(controlStripRect); + CIntlWin::DrawText(CS_UTF8, dc.m_hDC, closeText.GetBuffer(0), closeText.GetLength(), &closeRect, DT_CALCRECT | DT_WORDBREAK); + + int closeWidth = closeRect.Width(); + + closeRect.right = rect.right - 4; + closeRect.left = closeRect.right - closeWidth; + + // Center the text vertically. + closeRect.top = modeRect.top; + closeRect.bottom = modeRect.bottom; + + CRect arrowRect; + arrowRect.top = controlStripRect.top; + arrowRect.left = closeRect.left - 12; + arrowRect.right = arrowRect.left + 12; + arrowRect.bottom = controlStripRect.bottom; + + // Cache the rect + cachedCloseRect.top = controlStripRect.top; + cachedCloseRect.left = arrowRect.left; + cachedCloseRect.bottom = controlStripRect.bottom; + cachedCloseRect.right = closeRect.right + 3; + + // Now compute the close box rect. + HT_Pane pane = HT_GetPane(HT_GetView(topNode)); + if (HT_GetWindowType(pane) == HT_STANDALONE_WINDOW || + HT_GetWindowType(pane) == HT_EMBEDDED_WINDOW) + { + // Don't allow the close box to exist. + cachedCloseRect.SetRect(0,0,0,0); + closeRect.SetRect(0,0,0,0); + arrowRect.SetRect(0,0,0,0); + } + + if (HT_GetWindowType(pane) != HT_STANDALONE_WINDOW && + HT_GetWindowType(pane) != HT_EMBEDDED_WINDOW) + DrawArrow(dc.m_hDC, m_ControlStripForegroundColor, LEFT_ARROW, arrowRect, TRUE); + + // Draw the text + int nOldBkMode = dc.SetBkMode(TRANSPARENT); + int oldColor = dc.SetTextColor(m_ControlStripForegroundColor); + UINT nFormat = DT_SINGLELINE | DT_VCENTER | DT_EXTERNALLEADING; + + if (HT_GetWindowType(pane) != HT_STANDALONE_WINDOW && + HT_GetWindowType(pane) != HT_EMBEDDED_WINDOW) + CIntlWin::DrawText(CS_UTF8, dc.m_hDC, closeText.GetBuffer(0), -1, &closeRect, nFormat); + CIntlWin::DrawText(CS_UTF8, dc.m_hDC, modeText.GetBuffer(0), -1, &modeRect, nFormat); + CIntlWin::DrawText(CS_UTF8, dc.m_hDC, addText.GetBuffer(0), -1, &addRect, nFormat); + + // See if we're supposed to draw a framing rect. + + CBrush controlBrush(m_ControlStripForegroundColor); + if (m_bDrawCloseFrame) + { + dc.FrameRect(cachedCloseRect, &controlBrush); + } + if (m_bDrawModeFrame) + { + dc.FrameRect(cachedModeRect, &controlBrush); + } + if (m_bDrawAddFrame) + { + dc.FrameRect(cachedAddRect, &controlBrush); + } + + dc.SetTextColor(oldColor); + dc.SetBkMode(nOldBkMode); + ::SelectObject(dc.m_hDC, hOldFont); + } } int CNavTitleBar::OnCreate(LPCREATESTRUCT lpCreateStruct) @@ -491,3 +545,34 @@ void CNavTitleBar::OnTimer(UINT nIDEvent) CWnd::OnTimer(nIDEvent); } + +int CNavTitleBar::GetHeightBasedOnProperties() +{ + if (!m_View) + return 0; + + HT_Resource topNode = HT_TopNode(m_View); + void* data; + PRBool foundData = FALSE; + + // Whether or not to show the title bar. + int height = 0; + HT_GetTemplateData(topNode, gNavCenter->showTitleBar, HT_COLUMN_STRING, &data); + if (data) + { + CString answer((char*)data); + if (answer.GetLength() > 0 && (answer.GetAt(0) == 'Y' || answer.GetAt(0) == 'y')) + height += NAVBAR_TITLEBAR_HEIGHT; + } + + // Whether or not to show the control strip. + HT_GetTemplateData(topNode, gNavCenter->showControlStrip, HT_COLUMN_STRING, &data); + if (data) + { + CString answer((char*)data); + if (answer.GetLength() > 0 && (answer.GetAt(0) == 'Y' || answer.GetAt(0) == 'y')) + height += NAVBAR_CONTROLSTRIP_HEIGHT; + } + + return height; +} diff --git a/mozilla/cmd/winfe/navbar.h b/mozilla/cmd/winfe/navbar.h index 1ae5e7a607e..2e4ad9a13fb 100644 --- a/mozilla/cmd/winfe/navbar.h +++ b/mozilla/cmd/winfe/navbar.h @@ -64,6 +64,7 @@ public: void NotifyFocus(BOOL hasFocus) { m_bHasFocus = hasFocus; Invalidate(); } void LoadComplete(HT_Resource r) { Invalidate(); } + int GetHeightBasedOnProperties(); //{{AFX_MSG(CNavTitleBar) diff --git a/mozilla/cmd/winfe/rdfliner.cpp b/mozilla/cmd/winfe/rdfliner.cpp index ac9c05c48e5..ab7d5477a72 100644 --- a/mozilla/cmd/winfe/rdfliner.cpp +++ b/mozilla/cmd/winfe/rdfliner.cpp @@ -1052,13 +1052,18 @@ void CRDFOutliner::ToggleModes() show = stricmp(answer, "No"); } - ((CRDFOutlinerParent*)GetParent())->EnableHeaders(show); + CRDFOutlinerParent* pParent = (CRDFOutlinerParent*)GetParent(); + pParent->EnableHeaders(show); - // Need to invalidate the title strip. + // Need to invalidate the title strip and figure out exactly how tall it is. CRDFContentView* pView = (CRDFContentView*)(GetParent()->GetParent()); - pView->GetTitleBar()->Invalidate(); - - Invalidate(); + + CRect parentRect; + pParent->GetClientRect(&parentRect); + + int titleHeight = pView->GetTitleBar()->GetHeightBasedOnProperties(); + pView->GetTitleBar()->MoveWindow(CRect(0, 0, parentRect.Width(), titleHeight)); + pParent->MoveWindow(CRect(0, titleHeight, parentRect.Width(), parentRect.Height() - titleHeight)); } void CRDFOutliner::OnSelDblClk(int iLine) @@ -1845,8 +1850,7 @@ void CRDFOutliner::OnPaint() m_bDrawDividers = TRUE; m_bUseSingleClick = FALSE; m_bUseInlineEditing = TRUE; - m_bUseSelection = TRUE; - + // Foreground color HT_GetTemplateData(top, gNavCenter->viewFGColor, HT_COLUMN_STRING, &data); if (data) @@ -1912,14 +1916,6 @@ void CRDFOutliner::OnPaint() m_bDrawDividers = FALSE; } - HT_GetTemplateData(top, gNavCenter->useSelection, HT_COLUMN_STRING, &data); - if (data) - { - CString answer((char*)data); - if (answer.GetLength() > 0 && (answer.GetAt(0) == 'n' || answer.GetAt(0) == 'N')) - m_bUseSelection = FALSE; - } - HT_GetTemplateData(top, gNavCenter->useInlineEditing, HT_COLUMN_STRING, &data); if (data) { @@ -3862,15 +3858,37 @@ void CRDFOutlinerParent::CreateColumns ( void ) uint32 tokenType; UINT index = 0; + int visibleCount = 0; while (HT_GetNextColumn(columnCursor, &columnName, &columnWidth, &token, &tokenType)) { // We have retrieved a new column. Contruct a front end column object CRDFColumn* newColumn = new CRDFColumn(columnName, columnWidth, token, tokenType); index = (UINT)columnMap.AddCommand(newColumn); m_pOutliner->AddColumn(columnName, index, 50, 10000, ColumnVariable, 100); + PRBool visible = HT_GetColumnVisibility(theView, token, tokenType); + if (visible) + visibleCount++; } + if (visibleCount == 0) + visibleCount++; + HT_DeleteColumnCursor(columnCursor); - m_pOutliner->SetVisibleColumns(1); // For now... TODO: Get visible/invisible info! + + // If column headers aren't shown, assume only one visible column. + // Whether or not to show column headers + void* data; + HT_GetTemplateData(HT_TopNode(theView), gNavCenter->showColumnHeaders, HT_COLUMN_STRING, &data); + BOOL show = TRUE; + if (data) + { + char* answer = (char*)data; + show = stricmp(answer, "No"); + } + + if (!show) + visibleCount = 1; + + m_pOutliner->SetVisibleColumns(visibleCount); m_pOutliner->SetImageColumn(m_pOutliner->m_pColumn[0]->iCommand); // Make it so @@ -4084,8 +4102,9 @@ void CRDFContentView::OnSize ( UINT nType, int cx, int cy ) CView::OnSize ( nType, cx, cy ); if (IsWindow(m_pOutlinerParent->m_hWnd)) { - m_pNavBar->MoveWindow(0,0, cx, NAVBAR_TOTAL_HEIGHT); - m_pOutlinerParent->MoveWindow ( 0, NAVBAR_TOTAL_HEIGHT, cx, cy-NAVBAR_TOTAL_HEIGHT); + int titleHeight = m_pNavBar->GetHeightBasedOnProperties(); + m_pNavBar->MoveWindow(0,0, cx, titleHeight); + m_pOutlinerParent->MoveWindow ( 0, titleHeight, cx, cy-titleHeight); } } @@ -4163,7 +4182,9 @@ CRDFContentView* CRDFContentView::DisplayRDFTreeFromResource(CWnd* pParent, return DisplayRDFTreeFromPane(pParent, xPos, yPos, width, height, thePane, pContext); } -CRDFContentView* CRDFContentView::DisplayRDFTreeFromSHACK(MWContext *pContext, CWnd* pParent, int xPos, int yPos, int width, int height, char* url, int32 param_count, char** param_names, char** param_values) +CRDFContentView* CRDFContentView::DisplayRDFTreeFromSHACK(MWContext *pContext, CWnd* pParent, + int xPos, int yPos, int width, int height, char* url, char* templateType, + int32 param_count, char** param_names, char** param_values) { HT_Notification ns = new HT_NotificationStruct; XP_BZERO(ns, sizeof(HT_NotificationStruct)); @@ -4172,7 +4193,7 @@ CRDFContentView* CRDFContentView::DisplayRDFTreeFromSHACK(MWContext *pContext, C theApp.m_pRDFCX->TrackRDFWindow(pParent); // Construct the pane and give it our notification struct - HT_Pane thePane = HT_PaneFromURL(pContext, url, ns, 0, param_count, param_names, param_values); + HT_Pane thePane = HT_PaneFromURL(pContext, url, templateType, ns, 0, param_count, param_names, param_values); // Now call our helper function return DisplayRDFTreeFromPane(pParent, xPos, yPos, width, height, thePane); diff --git a/mozilla/cmd/winfe/rdfliner.h b/mozilla/cmd/winfe/rdfliner.h index e410a645e38..dd8ac911df7 100644 --- a/mozilla/cmd/winfe/rdfliner.h +++ b/mozilla/cmd/winfe/rdfliner.h @@ -455,7 +455,7 @@ public: CNavTitleBar* GetTitleBar() { return m_pNavBar; } static CRDFContentView* DisplayRDFTreeFromSHACK(MWContext *pContext, CWnd* pParent, int xPos, int yPos, int width, - int height, char* url, int32 param_count, char** param_names, char** param_values); + int height, char* url, char* templateType, int32 param_count, char** param_names, char** param_values); // This function can be called to create an embedded RDF tree view using an // external URL and specified targeting. diff --git a/mozilla/cmd/winfe/usertlbr.cpp b/mozilla/cmd/winfe/usertlbr.cpp index 8c618b468f1..9f167d4add4 100644 --- a/mozilla/cmd/winfe/usertlbr.cpp +++ b/mozilla/cmd/winfe/usertlbr.cpp @@ -1516,9 +1516,10 @@ CRDFToolbar* CRDFToolbar::CreateUserToolbar(HT_View theView, CWnd* pParent) char *data; HT_GetTemplateData(HT_TopNode(theView), gNavCenter->toolbarDisplayMode, HT_COLUMN_STRING, (void **)&data); - int style = StyleFromHTDescriptor(data); - if (style < 0) - style = theApp.m_pToolbarStyle; + int style = theApp.m_pToolbarStyle; + + if (data) + style = StyleFromHTDescriptor(data); CRDFToolbar* pToolbar = new CRDFToolbar(theView, MAX_TOOLBAR_BUTTONS, style, 43, 27, 27);