Making the HTML pane work again.

This commit is contained in:
hyatt%netscape.com 1998-09-24 00:06:54 +00:00
parent a742ed0de0
commit 798fa70de8
4 changed files with 76 additions and 9 deletions

View File

@ -1304,7 +1304,6 @@ void CPaneCX::PreNavCenterQueryPosition(PaneMessage *pMessage)
void CPaneCX::PreIdleUpdateCmdUI(PaneMessage *pMsg)
{
/*
// Don't want to update CMD UI unless we have a frame parent.
// This effectively stops CMD UI in the NavCenter HTML pane
// from messing with the UI state when docked.
@ -1313,7 +1312,6 @@ void CPaneCX::PreIdleUpdateCmdUI(PaneMessage *pMsg)
pMsg->lRetval = NULL;
pMsg->bSetRetval = TRUE;
}
*/
}
#ifdef XP_WIN16
@ -1396,11 +1394,10 @@ PaneProc(HWND hPane, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_NAVCENTER_QUERYPOSITION:
pThis->PreNavCenterQueryPosition(&message);
break;
*/
case WM_IDLEUPDATECMDUI:
pThis->PreIdleUpdateCmdUI(&message);
break;
*/
#if defined(XP_WIN32) && _MSC_VER >= 1100
case WM_MOUSEWHEEL:

View File

@ -2327,7 +2327,8 @@ win_click_callback(MWContext * pContext, LO_Element * pEle, int32 event,
}
MapToAnchorAndTarget(pWin->GetContext(), pEle, pClose->x, pClose->y, csAnchor, csTarget);
#ifdef EDITOR
if( EDT_IS_EDITOR(pWin->GetContext()) ){
// Ctrl Click = edit the URL
@ -2337,7 +2338,16 @@ win_click_callback(MWContext * pContext, LO_Element * pEle, int32 event,
#endif // EDITOR
if(status == EVENT_OK) {
CWinCX *pLoader = pWin->DetermineTarget(csTarget);
CWinCX *pLoader = NULL;
if (pWin->IsNavCenterHTMLPane())
{
// We are really an HTML pane.
// Our target should always be the last active context.
pLoader = (CWinCX*)(FEU_GetLastActiveFrameContext());
csTarget = "";
}
else pLoader = pWin->DetermineTarget(csTarget);
pLoader->NormalGetUrl(csAnchor, pClose->szRefer, (csTarget.IsEmpty() ? NULL : (LPCSTR)csTarget));
} else {
if(pClose->bCloseOnFail)

View File

@ -4075,10 +4075,13 @@ int CRDFContentView::OnCreate ( LPCREATESTRUCT lpCreateStruct )
WS_VISIBLE|WS_CHILD|WS_CLIPCHILDREN,
CRect(0,0,100,100), this, 101 );
m_pHTMLView = NULL; //wfe_CreateNavCenterHTMLPain(m_hWnd);
m_pHTMLView = wfe_CreateNavCenterHTMLPain(m_hWnd);
m_pNavBar->Create(NULL, "", WS_CHILD | WS_VISIBLE, CRect(0,0,100,100), this, NC_IDW_NAVMENU);
CRDFOutliner* pOutliner = (CRDFOutliner*)(GetOutlinerParent()->GetOutliner());
HT_View v = pOutliner->GetHTView();
return iRetVal;
}
@ -4094,7 +4097,6 @@ CRDFContentView::~CRDFContentView()
delete m_pNavBar;
delete m_pOutlinerParent;
delete m_pHTMLView;
}
void CRDFContentView::OnSize ( UINT nType, int cx, int cy )
@ -4104,7 +4106,52 @@ void CRDFContentView::OnSize ( UINT nType, int cx, int cy )
{
int titleHeight = m_pNavBar->GetHeightBasedOnProperties();
m_pNavBar->MoveWindow(0,0, cx, titleHeight);
m_pOutlinerParent->MoveWindow ( 0, titleHeight, cx, cy-titleHeight);
int htmlPaneHeight = 0;
CRDFOutliner* pOutliner = (CRDFOutliner*)(m_pOutlinerParent->GetOutliner());
HT_View theView = pOutliner->GetHTView();
BOOL percent = FALSE;
if (theView)
{
HT_Resource topNode = HT_TopNode(theView);
if (HT_HasHTMLPane(theView))
{
htmlPaneHeight = 150;
// Need to get the HTML pane's height.
char* data = HT_HTMLPaneHeight(theView);
int height = 0;
if (data)
{
CString strData(data);
int length = strData.GetLength();
if (strData[length-1] == '%')
{
percent = TRUE;
strData = strData.Left(length-1);
}
else if (strData[0] == '*')
{
percent = TRUE;
strData = "100";
}
else
percent = FALSE;
height = atoi(strData);
if (percent)
htmlPaneHeight = (int)((height/100.0) * (cy - titleHeight));
else htmlPaneHeight = height;
}
}
}
int outlinerHeight = cy-titleHeight-htmlPaneHeight;
m_pOutlinerParent->MoveWindow ( 0, titleHeight, cx, outlinerHeight);
::MoveWindow(m_pHTMLView->GetPane(), 0, titleHeight + outlinerHeight, cx,
htmlPaneHeight, TRUE);
}
}
@ -4164,6 +4211,18 @@ CRDFContentView* CRDFContentView::DisplayRDFTreeFromPane(CWnd* pParent, int xPos
pTitleBar->SetHTView(HT_GetSelectedView(thePane));
pOutliner->SetTitleBar(pTitleBar);
// Register the HTML pane to load the URL
if (HT_HasHTMLPane(HT_GetSelectedView(thePane)))
{
XP_RegisterViewHTMLPane(HT_GetSelectedView(thePane), newView->GetHTMLView()->GetContext());
char* data;
HT_Resource top = HT_TopNode(HT_GetSelectedView(thePane));
HT_GetTemplateData (top, gNavCenter->RDF_HTMLURL, HT_COLUMN_STRING, (void**)&data);
if (data)
{
XP_GetURLForView(HT_GetSelectedView(thePane), data);
}
}
return newView;
}

View File

@ -453,6 +453,7 @@ public:
void SwitchHTViews(HT_View htView);
CNavTitleBar* GetTitleBar() { return m_pNavBar; }
CPaneCX* GetHTMLView() { return m_pHTMLView; }
static 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);