From d4152a19bd6e278e77c3280477f3841e651ef506 Mon Sep 17 00:00:00 2001 From: "pinkerton%netscape.com" Date: Fri, 7 Aug 1998 00:14:26 +0000 Subject: [PATCH] Remove dependance on CNavCenterSelector's constants and make the title strips LCommanders so they can have context menus. --- cmd/macfe/rdfui/CNavCenterTitle.cp | 50 ++++++++++++++++++++++++++++-- cmd/macfe/rdfui/CNavCenterTitle.h | 12 +++---- 2 files changed, 54 insertions(+), 8 deletions(-) diff --git a/cmd/macfe/rdfui/CNavCenterTitle.cp b/cmd/macfe/rdfui/CNavCenterTitle.cp index 70b86c3b61c4..36376838f313 100644 --- a/cmd/macfe/rdfui/CNavCenterTitle.cp +++ b/cmd/macfe/rdfui/CNavCenterTitle.cp @@ -25,8 +25,9 @@ // #include "CNavCenterTitle.h" -#include "CNavCenterSelectorPane.h" // for message id's #include "URDFUtilities.h" +#include "CContextMenuAttachment.h" +#include "CRDFCoordinator.h" CNavCenterStrip :: CNavCenterStrip ( LStream *inStream ) @@ -43,6 +44,37 @@ CNavCenterStrip :: ~CNavCenterStrip() } +// +// FindCommandStatus +// +// Respond to commands from the context menu for Aurora popup-location. +// +void +CNavCenterStrip :: FindCommandStatus ( CommandT inCommand, Boolean &outEnabled, + Boolean &outUsesMark, Char16 &outMark, Str255 outName) +{ + outEnabled = true; + outUsesMark = false; //еее expand later to mark the current state + +} // FindCommandStatus + + +// +// ClickSelf +// +// Handle context-clicks by passing them off to the attachement (if present) +// +void +CNavCenterStrip :: ClickSelf ( const SMouseDownEvent & inMouseDown ) +{ + CContextMenuAttachment::SExecuteParams params; + params.inMouseDown = &inMouseDown; + + ExecuteAttachments ( CContextMenuAttachment::msg_ContextMenu, (void*)¶ms ); + +} // ClickSelf + + // // ListenToMessage // @@ -55,7 +87,7 @@ CNavCenterStrip :: ListenToMessage ( MessageT inMessage, void* ioParam ) { switch ( inMessage ) { - case msg_ActiveSelectorChanged: + case CRDFCoordinator::msg_ActiveSelectorChanged: { mView = reinterpret_cast(ioParam); if ( mView ) @@ -77,6 +109,20 @@ CNavCenterStrip :: ListenToMessage ( MessageT inMessage, void* ioParam ) } // ListenToMessage +// +// AdjustCursorSelf +// +// Handle changing cursor to contextual menu cursor if cmd key is down +// +void +CNavCenterStrip :: AdjustCursorSelf( Point /*inPoint*/, const EventRecord& inEvent ) +{ + ExecuteAttachments(CContextMenuAttachment::msg_ContextMenuCursor, + static_cast(const_cast(&inEvent))); + +} // AdjustCursorSelf + + // // DrawBeveledFill // diff --git a/cmd/macfe/rdfui/CNavCenterTitle.h b/cmd/macfe/rdfui/CNavCenterTitle.h index 4fd33ab80fe5..59b6340dac1d 100644 --- a/cmd/macfe/rdfui/CNavCenterTitle.h +++ b/cmd/macfe/rdfui/CNavCenterTitle.h @@ -33,12 +33,8 @@ extern RDF_NCVocab gNavCenter; // RDF vocab struct for NavCenter class CNavCenterStrip - : public CGrayBevelView, public CTiledImageMixin + : public CGrayBevelView, public CTiledImageMixin, public LCommander { - enum { - msg_ActiveSelectorChanged = 'selc' // broadcast when view changes - }; - // Construction, Destruction CNavCenterStrip(LStream *inStream); ~CNavCenterStrip(); @@ -56,7 +52,11 @@ protected: // PowerPlant overrides virtual void ListenToMessage ( MessageT inMessage, void* ioParam ) ; - + virtual void AdjustCursorSelf( Point inPoint, const EventRecord& inEvent ) ; + virtual void FindCommandStatus ( CommandT inCommand, Boolean &outEnabled, + Boolean &outUsesMark, Char16 &outMark, Str255 outName) ; + virtual void ClickSelf ( const SMouseDownEvent & inMouseDown ) ; + virtual void DrawBeveledFill ( ) ; virtual void DrawStandby ( const Point & inTopLeft, const IconTransformType inTransform ) const;