handle context menu commands and updates from the toolbars that their sizes have changed.
git-svn-id: svn://10.0.0.236/trunk@12324 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -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<CRDFToolbar*>(HT_GetViewFEData(ht_view)) )
|
||||
if( CRDFToolbar* toolbar = reinterpret_cast<CRDFToolbar*>(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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user