mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-04-02 12:32:55 +00:00
Fixes for docking/undocking behavior.
This commit is contained in:
parent
92f345c61c
commit
0b497a8ebd
@ -342,41 +342,11 @@ 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
|
||||
{
|
||||
m_PointHit = point;
|
||||
CFrameWnd* pFrameWnd = GetParentFrame();
|
||||
if (pFrameWnd->IsKindOf(RUNTIME_CLASS(CNSNavFrame)))
|
||||
SetCapture();
|
||||
}
|
||||
// Called when the user clicks on us.
|
||||
m_PointHit = point;
|
||||
CFrameWnd* pFrameWnd = GetParentFrame();
|
||||
if (pFrameWnd->IsKindOf(RUNTIME_CLASS(CNSNavFrame)))
|
||||
SetCapture();
|
||||
}
|
||||
|
||||
|
||||
@ -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 )
|
||||
|
@ -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);
|
||||
|
||||
@ -541,10 +541,11 @@ void CNSNavFrame::ForceFloat(BOOL show)
|
||||
ShowWindow(SW_SHOW);
|
||||
else ShowWindow(SW_HIDE);
|
||||
|
||||
// Tell XP NavCenter layer that we are no longer docked.
|
||||
// Tell XP NavCenter layer that we are no longer docked.
|
||||
XP_UndockNavCenter(GetHTPane());
|
||||
|
||||
// Tell ParentFrame that we are not docked anymore.
|
||||
|
||||
// Tell ParentFrame that we are not docked anymore.
|
||||
CFrameWnd *pLayout = GetParentFrame();
|
||||
if (pLayout)
|
||||
pLayout->RecalcLayout();
|
||||
|
||||
|
@ -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()))
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user