diff --git a/mozilla/cmd/macfe/gui/CRDFToolbarContainer.cp b/mozilla/cmd/macfe/gui/CRDFToolbarContainer.cp index 02ad8339432..9efa309c142 100644 --- a/mozilla/cmd/macfe/gui/CRDFToolbarContainer.cp +++ b/mozilla/cmd/macfe/gui/CRDFToolbarContainer.cp @@ -57,6 +57,15 @@ CRDFToolbarContainer::RestorePlace( LStream *inPlace ) } +void +CRDFToolbarContainer :: HandleHTCommand ( CommandT inPPCommand ) +{ + HT_Error err = HT_DoMenuCmd ( _ht_root.get(), (HT_MenuCmd)(inPPCommand - cmd_NavCenterBase) ); + Assert_( err == HT_NoErr ); + +} // HandleHTCommand + + void CRDFToolbarContainer::HandleNotification( HT_Notification notification, HT_Resource node, HT_Event event, void* token, uint32 tokenType ) { @@ -69,8 +78,11 @@ CRDFToolbarContainer::HandleNotification( HT_Notification notification, HT_Resou break; case HT_EVENT_VIEW_DELETED: // i.e., destroy a toolbar - if( CRDFToolbar* toolbar = reinterpret_cast(HT_GetViewFEData(ht_view)) ) + if( CRDFToolbar* toolbar = reinterpret_cast(HT_GetViewFEData(ht_view)) ) { + mBars.Remove(&toolbar); delete toolbar; + } + ToolbarChanged(); break; #if 0 @@ -105,3 +117,20 @@ CRDFToolbarContainer::HandleNotification( HT_Notification notification, HT_Resou toolbar->HandleNotification(notification, node, event, token, tokenType); } } + + +// +// ToolbarChanged +// +// One of the toolbars w/in us has changed in such a way that it's height is +// different than before. Readjust our size as well as all the other toolbars +// to accomodate. +// +void +CRDFToolbarContainer :: ToolbarChanged ( ) +{ + AdjustDock(); + RepositionBars(); + AdjustContainer(); + +} // ResizeFrameBy diff --git a/mozilla/cmd/macfe/gui/CRDFToolbarContainer.h b/mozilla/cmd/macfe/gui/CRDFToolbarContainer.h index 3efa076f491..8ec0aaad822 100644 --- a/mozilla/cmd/macfe/gui/CRDFToolbarContainer.h +++ b/mozilla/cmd/macfe/gui/CRDFToolbarContainer.h @@ -46,6 +46,14 @@ class CRDFToolbarContainer CRDFToolbarContainer( LStream* ); // virtual ~CRDFToolbarContainer(); -- already virtual from bases, |auto_ptr| member means no destructor needed + // call when a toolbar has changed in some way to readjust the container + // and all the bars w/in it. + virtual void ToolbarChanged ( ) ; + + // execute a command we know to be an HT command. |inPPCommand| should be what + // we get from PowerPlant, not adjusted to HT's version. + virtual void HandleHTCommand ( CommandT inPPCommand ) ; + private: // Pass-by-value is not allowed. A single |CRDFToolbarContainer| corresponds to a single on-screen object; copying doesn't make sense. CRDFToolbarContainer( const CRDFToolbarContainer& ); // DON'T IMPLEMENT CRDFToolbarContainer& operator=( const CRDFToolbarContainer& ); // DON'T IMPLEMENT