зеркало из https://github.com/mozilla/gecko-dev.git
Remove dependance on CNavCenterSelector's constants and make the title strips LCommanders so they can have context menus.
This commit is contained in:
Родитель
3adf766ed6
Коммит
d4152a19bd
|
@ -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<HT_View>(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<void*>(const_cast<EventRecord*>(&inEvent)));
|
||||
|
||||
} // AdjustCursorSelf
|
||||
|
||||
|
||||
//
|
||||
// DrawBeveledFill
|
||||
//
|
||||
|
|
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче