From d1f792fc7896687a5679c38c999563613df62e8d Mon Sep 17 00:00:00 2001 From: "pinkerton%netscape.com" Date: Tue, 11 Aug 1998 19:17:36 +0000 Subject: [PATCH] Hacks for showing a container docked, popup, or standalone, with a hack for drag and drop. git-svn-id: svn://10.0.0.236/trunk@7760 18797224-902f-48f8-a5cc-f745e15eee43 --- .../cmd/macfe/gui/CPersonalToolbarTable.cp | 53 ++++++++++++++++++- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/mozilla/cmd/macfe/gui/CPersonalToolbarTable.cp b/mozilla/cmd/macfe/gui/CPersonalToolbarTable.cp index d4aee48f201..c7ccd11977a 100644 --- a/mozilla/cmd/macfe/gui/CPersonalToolbarTable.cp +++ b/mozilla/cmd/macfe/gui/CPersonalToolbarTable.cp @@ -24,6 +24,7 @@ #include #include "CPersonalToolbarTable.h" +#include "CBrowserWindow.h" #include "uapp.h" #include "LTableMultiGeometry.h" #include "CURLDragHelper.h" @@ -583,7 +584,31 @@ CPersonalToolbarTable :: ClickCell(const STableCell &inCell, const SMouseDownEve // code for context menu here, if appropriate.... if ( data.IsFolder() ) { - SysBeep(1); + // TEMP CODE (pinkerton) + // Ignores HT's placement hints....just used for testing + + // convert local to port coords for this cell + Rect bounds; + GetLocalCellRect ( inCell, bounds ); + Rect portRect = LocalToPortRect ( this, bounds ); + + // find the Browser window and tell it to show a popdown with + // the give HT_Resource for this cell + LView* top=GetSuperView(); + while ( top->GetSuperView() ) + top = top->GetSuperView(); + + // popdown the tree + CBrowserWindow* browser = dynamic_cast(top); + Assert_(browser != NULL); + if ( browser ) { + if ( inMouseDown.macEvent.modifiers & shiftKey ) + browser->OpenDockedTreeView ( data.GetHTResource() ); + else if ( inMouseDown.macEvent.modifiers & optionKey ) + LCommander::GetTopCommander()->ProcessCommand(cmd_NCOpenNewWindow, data.GetHTResource() ); + else + browser->PopDownTreeView ( portRect.left, portRect.bottom + 5, data.GetHTResource() ); + } } else { if ( !URDFUtilities::LaunchNode(data.GetHTResource()) ) @@ -809,8 +834,32 @@ CPersonalToolbarTable :: InsideDropArea ( DragReference inDragRef ) mDropOn = newDropOn; // hilight new one - if ( newDropOn ) + if ( newDropOn ) { RedrawCellWithHilite ( STableCell(1, newDropCol), true ); + + const CUserButtonInfo & info = GetInfoForPPColumn(newDropCol); + + // TEMP CODE (pinkerton) + // Ignores HT's placement hints....just used for testing + + // convert local to port coords for this cell + Rect bounds; + GetLocalCellRect ( STableCell(1, newDropCol), bounds ); + Rect portRect = LocalToPortRect ( this, bounds ); + + // find the Browser window and tell it to show a popdown with + // the give HT_Resource for this cell + LView* top=GetSuperView(); + while ( top->GetSuperView() ) + top = top->GetSuperView(); + + // popdown the tree + CBrowserWindow* browser = dynamic_cast(top); + Assert_(browser != NULL); + if ( browser ) + browser->PopDownTreeView ( portRect.left, portRect.bottom + 5, info.GetHTResource() ); + + } else DrawDividingLine ( newDropCol );