Support for templates added to SHACK. More properties added to front end.

This commit is contained in:
hyatt%netscape.com 1998-09-22 00:24:26 +00:00
Родитель 65cab71175
Коммит 9594fd2d58
6 изменённых файлов: 288 добавлений и 267 удалений

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;
}

Просмотреть файл

@ -1,88 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef NAVMENUBAR_H
#define NAVMENUBAR_H
#include "htrdf.h"
#include "usertlbr.h"
#define NAVBAR_CONTROLSTRIP_HEIGHT 18
#define NAVBAR_TITLEBAR_HEIGHT 23
#define NAVBAR_TOTAL_HEIGHT 41
#define NAVBAR_CLOSEBOX 16
class CNavTitleBar : public CWnd, public CCustomImageObject
{
BOOL m_bHasFocus; // Determines what colors to use for the caption (OBSOLETE)
CPoint m_PointHit; // MouseDown tracking
COLORREF m_ControlStripForegroundColor;
COLORREF m_ControlStripBackgroundColor;
CString m_ControlStripBackgroundImageURL;
CRDFImage* m_pControlStripBackgroundImage;
COLORREF m_ForegroundColor;
COLORREF m_BackgroundColor;
CString m_BackgroundImageURL;
CRDFImage* m_pBackgroundImage;
HT_View m_View; // The current HT_View.
BOOL m_bShowTitleText;
CRect cachedCloseRect;
CRect cachedAddRect;
CRect cachedModeRect;
BOOL m_bDrawCloseFrame;
BOOL m_bDrawModeFrame;
BOOL m_bDrawAddFrame;
UINT m_hFocusTimer;
public:
CNavTitleBar();
~CNavTitleBar();
void SetHTView(HT_View theView);
void NotifyFocus(BOOL hasFocus) { m_bHasFocus = hasFocus; Invalidate(); }
void LoadComplete(HT_Resource r) { Invalidate(); }
//{{AFX_MSG(CNavTitleBar)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code!
afx_msg void OnPaint();
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnLButtonDown (UINT nFlags, CPoint point );
afx_msg void OnLButtonUp (UINT nFlags, CPoint point );
afx_msg void OnMouseMove (UINT nFlags, CPoint point );
afx_msg void OnSize( UINT nType, int cx, int cy );
afx_msg void OnTimer(UINT nIDEvent);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#define IDT_STRIPFOCUS 30000
#define STRIPFOCUS_DELAY_MS 10
#endif // NAVBAR_H

Просмотреть файл

@ -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);

Просмотреть файл

@ -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.

Просмотреть файл

@ -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);