Fixes for docking/undocking behavior.

This commit is contained in:
hyatt%netscape.com 1998-09-10 02:35:27 +00:00
parent 92f345c61c
commit 0b497a8ebd
3 changed files with 57 additions and 47 deletions

View File

@ -342,42 +342,12 @@ int CNavTitleBar::OnCreate(LPCREATESTRUCT lpCreateStruct)
void CNavTitleBar::OnLButtonDown (UINT nFlags, CPoint point )
{
// Called when the user clicks on us. Start a drag, switch modes, or close the view.
if (cachedCloseRect.PtInRect(point))
{
// Destroy the window.
CFrameWnd* pFrameWnd = GetParentFrame();
if (pFrameWnd->IsKindOf(RUNTIME_CLASS(CNSNavFrame)))
((CNSNavFrame*)pFrameWnd)->DeleteNavCenter();
}
else if (cachedModeRect.PtInRect(point))
{
CRDFOutliner* pOutliner = (CRDFOutliner*)HT_GetViewFEData(m_View);
//HT_ToggleTreeMode(m_View);
}
else if (cachedAddRect.PtInRect(point))
{
CGenericFrame* pFrame = (CGenericFrame*)FEU_GetLastActiveFrame(MWContextBrowser);
if (pFrame)
{
CAbstractCX* pAbstract = pFrame->GetMainContext();
MWContext* mwContext = pAbstract->GetContext();
History_entry *pHistEnt = SHIST_GetCurrent( &(mwContext->hist) );
if (pHistEnt)
{
HT_AddToContainer( HT_TopNode(m_View), pHistEnt->address, mwContext->title );
}
}
}
else
{
// Called when the user clicks on us.
m_PointHit = point;
CFrameWnd* pFrameWnd = GetParentFrame();
if (pFrameWnd->IsKindOf(RUNTIME_CLASS(CNSNavFrame)))
SetCapture();
}
}
void CNavTitleBar::OnMouseMove(UINT nFlags, CPoint point)
@ -440,6 +410,45 @@ void CNavTitleBar::OnLButtonUp(UINT nFlags, CPoint point)
{
ReleaseCapture();
}
if (cachedCloseRect.PtInRect(point))
{
// Destroy the window.
CFrameWnd* pFrameWnd = GetParentFrame();
if (pFrameWnd->IsKindOf(RUNTIME_CLASS(CNSNavFrame)))
((CNSNavFrame*)pFrameWnd)->DeleteNavCenter();
}
else if (cachedModeRect.PtInRect(point))
{
//CRDFOutliner* pOutliner = (CRDFOutliner*)HT_GetViewFEData(m_View);
//HT_ToggleTreeMode(m_View);
CFrameWnd* pFrameWnd = GetParentFrame();
if (pFrameWnd->IsKindOf(RUNTIME_CLASS(CNSNavFrame)))
{
CNSNavFrame* pNavFrame = (CNSNavFrame*)pFrameWnd;
CRDFOutliner* pOutliner = (CRDFOutliner*)
(pNavFrame->GetContentView()->GetOutlinerParent()->GetOutliner());
pOutliner->SetIsPopup(FALSE);
pNavFrame->UnhookFromButton();
pNavFrame->ForceFloat(TRUE);
}
}
else if (cachedAddRect.PtInRect(point))
{
CGenericFrame* pFrame = (CGenericFrame*)FEU_GetLastActiveFrame(MWContextBrowser);
if (pFrame)
{
CAbstractCX* pAbstract = pFrame->GetMainContext();
MWContext* mwContext = pAbstract->GetContext();
History_entry *pHistEnt = SHIST_GetCurrent( &(mwContext->hist) );
if (pHistEnt)
{
HT_AddToContainer( HT_TopNode(m_View), pHistEnt->address, mwContext->title );
}
}
}
}
void CNavTitleBar::OnSize( UINT nType, int cx, int cy )

View File

@ -512,20 +512,20 @@ void CNSNavFrame::CalcClientArea(RECT* lpRectClient, CNSGenFrame * pParentFrame)
//------------------------------------------------------------------------------
void CNSNavFrame::ForceFloat(BOOL show)
{
// Notify HT of our new state. Reset to the popup state.
HT_SetTreeStateForButton(HT_TopNode(HT_GetSelectedView(GetHTPane())), HT_POPUP_WINDOW);
HT_SetWindowType(GetHTPane(), HT_STANDALONE_WINDOW);
CFrameWnd *pLayout = GetParentFrame();
nsModifyStyle( GetSafeHwnd(), GWL_STYLE, WS_CHILD, WS_OVERLAPPEDWINDOW);
nsModifyStyle( GetSafeHwnd(), GWL_STYLE, WS_POPUP, 0 );
nsModifyStyle( GetSafeHwnd(), GWL_STYLE, WS_CHILD, WS_OVERLAPPEDWINDOW | WS_CAPTION);
nsModifyStyle( GetSafeHwnd(), GWL_EXSTYLE, 0, WS_EX_CLIENTEDGE);
if (show)
{
MoveWindow( m_rectDrag);
}
else ShowWindow(SW_HIDE);
SetWindowPos(&wndNoTopMost, m_rectDrag.left, m_rectDrag.top, m_rectDrag.Width(),
m_rectDrag.Height(), SWP_FRAMECHANGED);
else SetWindowPos(&wndNoTopMost, 0, 0, 0, 0, SWP_FRAMECHANGED
| SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOSIZE | SWP_HIDEWINDOW);
SetParent(NULL);
@ -545,6 +545,7 @@ void CNSNavFrame::ForceFloat(BOOL show)
XP_UndockNavCenter(GetHTPane());
// Tell ParentFrame that we are not docked anymore.
CFrameWnd *pLayout = GetParentFrame();
if (pLayout)
pLayout->RecalcLayout();

View File

@ -905,7 +905,7 @@ void CRDFToolbarButton::FillInMenu(HT_Resource theNode)
if (pOldButton != NULL)
{
pOldButton->GetTreeView()->DeleteNavCenter();
pOldButton->GetTreeView()->DeleteNavCenter(); // Just do a deletion
}
pHolder->SetCurrentButton(NULL, state);
@ -913,7 +913,7 @@ void CRDFToolbarButton::FillInMenu(HT_Resource theNode)
if (!m_bDepressed && pOldButton != this)
{
CPoint point = RequestMenuPlacement();
m_pTreeView = CNSNavFrame::CreateFramedRDFViewFromResource(NULL, point.x, point.y, 300, 500, m_Node);
m_pTreeView = CNSNavFrame::CreateFramedRDFViewFromResource(NULL, point.x, point.y-2, 300, 500, m_Node);
CRDFOutliner* pOutliner = (CRDFOutliner*)(m_pTreeView->GetContentView()->GetOutlinerParent()->GetOutliner());
if (pOutliner->IsPopup() || XP_IsNavCenterDocked(m_pTreeView->GetHTPane()))
{