зеркало из https://github.com/mozilla/gecko-dev.git
Better support for opening a tree popup, docked, or standalone.
This commit is contained in:
Родитель
ccdedc93d0
Коммит
9260381052
|
@ -79,9 +79,11 @@ ViewFEData :: ~ViewFEData ( )
|
||||||
|
|
||||||
CRDFCoordinator::CRDFCoordinator(LStream* inStream)
|
CRDFCoordinator::CRDFCoordinator(LStream* inStream)
|
||||||
: LView(inStream),
|
: LView(inStream),
|
||||||
// LDragAndDrop ( GetMacPort(), this ),
|
|
||||||
mTreePane(NULL),
|
mTreePane(NULL),
|
||||||
mHTPane(NULL)
|
mHTPane(NULL),
|
||||||
|
mColumnHeaders(NULL),
|
||||||
|
mTitleStrip(NULL),
|
||||||
|
mTitleCommandArea(NULL)
|
||||||
{
|
{
|
||||||
*inStream >> mTreePaneID;
|
*inStream >> mTreePaneID;
|
||||||
*inStream >> mColumnHeaderID;
|
*inStream >> mColumnHeaderID;
|
||||||
|
@ -306,7 +308,7 @@ void CRDFCoordinator::HandleNotification(
|
||||||
// needs some work.....
|
// needs some work.....
|
||||||
if ( view == mTreePane->GetHTView() ) {
|
if ( view == mTreePane->GetHTView() ) {
|
||||||
TableIndexT rowToEdit = URDFUtilities::HTRowToPPRow( HT_GetNodeIndex(view, node) );
|
TableIndexT rowToEdit = URDFUtilities::HTRowToPPRow( HT_GetNodeIndex(view, node) );
|
||||||
// mTreePane->DoInlineEditing( rowToEdit );
|
mTreePane->DoInlineEditing( rowToEdit );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -550,9 +552,6 @@ CDockedRDFCoordinator :: CDockedRDFCoordinator(LStream* inStream)
|
||||||
{
|
{
|
||||||
// don't create the HT_pane until we actually need it (someone opens a node
|
// don't create the HT_pane until we actually need it (someone opens a node
|
||||||
// and the want it to be docked).
|
// and the want it to be docked).
|
||||||
//
|
|
||||||
//¥¥¥NOTE: We now need to create it somewhere because it will be null until someone
|
|
||||||
//¥¥¥ puts the code in.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -665,6 +664,40 @@ CDockedRDFCoordinator :: ListenToMessage ( MessageT inMessage, void *ioParam )
|
||||||
} // ListenToMessage
|
} // ListenToMessage
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// BuildHTPane
|
||||||
|
//
|
||||||
|
// Create a new pane with |inNode| as the root. Delete the old pane if it exists
|
||||||
|
//
|
||||||
|
void
|
||||||
|
CDockedRDFCoordinator :: BuildHTPane ( HT_Resource inNode )
|
||||||
|
{
|
||||||
|
// are we already displaying this one? If so, bail.
|
||||||
|
HT_View currView = mTreePane->GetHTView();
|
||||||
|
if ( currView && inNode == HT_TopNode(currView) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// out with the old
|
||||||
|
if ( HTPane() ) {
|
||||||
|
UnregisterNavCenter();
|
||||||
|
HT_DeletePane ( mHTPane );
|
||||||
|
}
|
||||||
|
|
||||||
|
// in with the new
|
||||||
|
mHTPane = CreateHTPane ( inNode );
|
||||||
|
if ( mHTPane ) {
|
||||||
|
ShowOrHideColumnHeaders();
|
||||||
|
|
||||||
|
// we don't get a view selected event like other trees, so setup the tree
|
||||||
|
// view to point to the already selected view in HT and broadcast to tell
|
||||||
|
// the title bar to update the title.
|
||||||
|
SelectView ( HT_GetSelectedView(mHTPane) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} // BuildHTPane
|
||||||
|
|
||||||
|
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
|
|
||||||
|
|
||||||
|
@ -719,29 +752,11 @@ CWindowRDFCoordinator :: FinishCreateSelf ( )
|
||||||
{
|
{
|
||||||
CRDFCoordinator::FinishCreateSelf();
|
CRDFCoordinator::FinishCreateSelf();
|
||||||
|
|
||||||
// just create a default pane. We have to do this _after_ FinishCreateSelf()
|
|
||||||
// because HT can send us notifications that rely on the tree view, etc being
|
|
||||||
// initialized.
|
|
||||||
mHTPane = CreateHTPane();
|
|
||||||
ShowOrHideColumnHeaders();
|
|
||||||
|
|
||||||
} // FinishCreateSelf
|
} // FinishCreateSelf
|
||||||
|
|
||||||
|
|
||||||
#pragma mark -
|
|
||||||
|
|
||||||
|
|
||||||
CPopupRDFCoordinator :: CPopupRDFCoordinator ( LStream* inStream )
|
|
||||||
: CRDFCoordinator ( inStream )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
CPopupRDFCoordinator :: ~CPopupRDFCoordinator ( )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
CPopupRDFCoordinator :: BuildHTPane ( HT_Resource inNode )
|
CWindowRDFCoordinator :: BuildHTPane ( HT_Resource inNode )
|
||||||
{
|
{
|
||||||
mHTPane = CreateHTPane ( inNode );
|
mHTPane = CreateHTPane ( inNode );
|
||||||
if ( mHTPane ) {
|
if ( mHTPane ) {
|
||||||
|
@ -754,3 +769,120 @@ CPopupRDFCoordinator :: BuildHTPane ( HT_Resource inNode )
|
||||||
}
|
}
|
||||||
|
|
||||||
} // BuildHTPane
|
} // BuildHTPane
|
||||||
|
|
||||||
|
void
|
||||||
|
CWindowRDFCoordinator :: BuildHTPane ( RDF_Resource inNode )
|
||||||
|
{
|
||||||
|
mHTPane = CreateHTPane ( inNode );
|
||||||
|
if ( mHTPane ) {
|
||||||
|
ShowOrHideColumnHeaders();
|
||||||
|
|
||||||
|
// we don't get a view selected event like other trees, so setup the tree
|
||||||
|
// view to point to the already selected view in HT and broadcast to tell
|
||||||
|
// the title bar to update the title.
|
||||||
|
SelectView ( HT_GetSelectedView(mHTPane) );
|
||||||
|
}
|
||||||
|
|
||||||
|
} // BuildHTPane
|
||||||
|
|
||||||
|
|
||||||
|
#pragma mark -
|
||||||
|
|
||||||
|
|
||||||
|
CPopdownRDFCoordinator :: CPopdownRDFCoordinator ( LStream* inStream )
|
||||||
|
: CRDFCoordinator ( inStream )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
CPopdownRDFCoordinator :: ~CPopdownRDFCoordinator ( )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// BuildHTPane
|
||||||
|
//
|
||||||
|
// Creates a new HT Pane rooted at the given resource. This can (and should) be called
|
||||||
|
// to switch the HT_Pane of a popdown that has already been created. It will correctly
|
||||||
|
// clean up after itself before making the new pane.
|
||||||
|
//
|
||||||
|
void
|
||||||
|
CPopdownRDFCoordinator :: BuildHTPane ( HT_Resource inNode )
|
||||||
|
{
|
||||||
|
// out with the old
|
||||||
|
if ( mHTPane )
|
||||||
|
HT_DeletePane ( mHTPane );
|
||||||
|
|
||||||
|
// in with the new
|
||||||
|
mHTPane = CreateHTPane ( inNode );
|
||||||
|
if ( mHTPane ) {
|
||||||
|
ShowOrHideColumnHeaders();
|
||||||
|
|
||||||
|
// we don't get a view selected event like other trees, so setup the tree
|
||||||
|
// view to point to the already selected view in HT and broadcast to tell
|
||||||
|
// the title bar to update the title.
|
||||||
|
SelectView ( HT_GetSelectedView(mHTPane) );
|
||||||
|
}
|
||||||
|
|
||||||
|
} // BuildHTPane
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// FinishCreateSelf
|
||||||
|
//
|
||||||
|
// Setup ourselves as a listener for the "close" button so we can pass along the
|
||||||
|
// message to the browser window.
|
||||||
|
//
|
||||||
|
void
|
||||||
|
CPopdownRDFCoordinator :: FinishCreateSelf ( )
|
||||||
|
{
|
||||||
|
CRDFCoordinator::FinishCreateSelf();
|
||||||
|
|
||||||
|
// If the close caption is there, register this class as a listener so we get the
|
||||||
|
// close message
|
||||||
|
LBroadcaster* closeCaption =
|
||||||
|
dynamic_cast<LBroadcaster*>(FindPaneByID(CNavCenterCommandStrip::kClosePaneID));
|
||||||
|
if ( closeCaption )
|
||||||
|
closeCaption->AddListener(this);
|
||||||
|
|
||||||
|
} // FinishCreateSelf
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// FindCommandStatus
|
||||||
|
//
|
||||||
|
// All menu commands, etc should be disabled.
|
||||||
|
//
|
||||||
|
void
|
||||||
|
CPopdownRDFCoordinator :: FindCommandStatus (
|
||||||
|
CommandT inCommand,
|
||||||
|
Boolean &outEnabled,
|
||||||
|
Boolean &outUsesMark,
|
||||||
|
Char16 &outMark,
|
||||||
|
Str255 outName)
|
||||||
|
{
|
||||||
|
outEnabled = false;
|
||||||
|
outUsesMark = false;
|
||||||
|
|
||||||
|
} // FindCommandStatus
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// ListenToMessage
|
||||||
|
//
|
||||||
|
// Handle the message to close up the tree.
|
||||||
|
//
|
||||||
|
void
|
||||||
|
CPopdownRDFCoordinator :: ListenToMessage ( MessageT inMessage, void *ioParam )
|
||||||
|
{
|
||||||
|
// pass through the message up to the browser window that can actually do
|
||||||
|
// something about closing this popdown
|
||||||
|
if ( inMessage == CPopdownFlexTable::msg_ClosePopdownTree ||
|
||||||
|
inMessage == CNavCenterCommandStrip::msg_CloseShelfNow ) {
|
||||||
|
BroadcastMessage ( msg_ClosePopdownTree );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
CRDFCoordinator::ListenToMessage ( inMessage, ioParam );
|
||||||
|
|
||||||
|
} // ListenToMessage
|
||||||
|
|
||||||
|
|
|
@ -76,11 +76,11 @@ struct ViewFEData {
|
||||||
//
|
//
|
||||||
|
|
||||||
class CRDFCoordinator : public LView,
|
class CRDFCoordinator : public LView,
|
||||||
public LListener, public LCommander, LBroadcaster,
|
public LListener, public LCommander, public LBroadcaster,
|
||||||
public CRDFNotificationHandler
|
public CRDFNotificationHandler
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
// protected to prevent anyone from instantiating once of these by itself.
|
// protected to prevent anyone from instantiating one of these by itself.
|
||||||
CRDFCoordinator(LStream* inStream);
|
CRDFCoordinator(LStream* inStream);
|
||||||
virtual ~CRDFCoordinator();
|
virtual ~CRDFCoordinator();
|
||||||
|
|
||||||
|
@ -170,6 +170,9 @@ public:
|
||||||
// allows you to easily slide in/out the shelf or check if it is open.
|
// allows you to easily slide in/out the shelf or check if it is open.
|
||||||
CShelf& NavCenterShelf() const { return *mNavCenter; } ;
|
CShelf& NavCenterShelf() const { return *mNavCenter; } ;
|
||||||
|
|
||||||
|
// create the pane with |inNode| as the root of the view
|
||||||
|
virtual void BuildHTPane ( HT_Resource inNode ) ;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
virtual void FinishCreateSelf ( ) ;
|
virtual void FinishCreateSelf ( ) ;
|
||||||
|
@ -196,6 +199,7 @@ class CShackRDFCoordinator : public CRDFCoordinator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum { class_ID = 'RCoS', pane_ID = 'RCoS' };
|
enum { class_ID = 'RCoS', pane_ID = 'RCoS' };
|
||||||
|
enum { res_ID = 9503 } ;
|
||||||
|
|
||||||
CShackRDFCoordinator(LStream* inStream);
|
CShackRDFCoordinator(LStream* inStream);
|
||||||
virtual ~CShackRDFCoordinator();
|
virtual ~CShackRDFCoordinator();
|
||||||
|
@ -226,6 +230,9 @@ public:
|
||||||
CWindowRDFCoordinator(LStream* inStream);
|
CWindowRDFCoordinator(LStream* inStream);
|
||||||
virtual ~CWindowRDFCoordinator();
|
virtual ~CWindowRDFCoordinator();
|
||||||
|
|
||||||
|
virtual void BuildHTPane ( HT_Resource inNode ) ;
|
||||||
|
virtual void BuildHTPane ( RDF_Resource inNode ) ;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
virtual void FinishCreateSelf ( ) ;
|
virtual void FinishCreateSelf ( ) ;
|
||||||
|
@ -237,20 +244,33 @@ protected:
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// class CPopupRDFCoordinator
|
// class CPopdownRDFCoordinator
|
||||||
//
|
//
|
||||||
// Use this when the tree is popped up from a container on the toolbars. This knows
|
// Use this when the tree is popped down from a container on the toolbars. This knows
|
||||||
// how to create itself from an HT_Resource.
|
// how to create itself from an HT_Resource.
|
||||||
//
|
//
|
||||||
|
|
||||||
class CPopupRDFCoordinator : public CRDFCoordinator
|
class CPopdownRDFCoordinator : public CRDFCoordinator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum { class_ID = 'RCoP', pane_ID = 'RCoP' };
|
enum { class_ID = 'RCoP', pane_ID = 'RCoP' };
|
||||||
|
enum { res_ID = 9504 } ;
|
||||||
|
enum { msg_ClosePopdownTree = 'clos' };
|
||||||
|
|
||||||
CPopupRDFCoordinator(LStream* inStream);
|
CPopdownRDFCoordinator(LStream* inStream);
|
||||||
virtual ~CPopupRDFCoordinator();
|
virtual ~CPopdownRDFCoordinator();
|
||||||
|
|
||||||
virtual void BuildHTPane ( HT_Resource inNode ) ;
|
virtual void BuildHTPane ( HT_Resource inNode ) ;
|
||||||
|
|
||||||
}; // CPopupRDFCoordinator
|
protected:
|
||||||
|
|
||||||
|
virtual void FinishCreateSelf();
|
||||||
|
virtual void ListenToMessage( MessageT inMessage, void *ioParam);
|
||||||
|
virtual void FindCommandStatus(
|
||||||
|
CommandT inCommand,
|
||||||
|
Boolean &outEnabled,
|
||||||
|
Boolean &outUsesMark,
|
||||||
|
Char16 &outMark,
|
||||||
|
Str255 outName);
|
||||||
|
|
||||||
|
}; // CPopdownRDFCoordinator
|
||||||
|
|
Загрузка…
Ссылка в новой задаче