make the toolbar inherit from the dataModelWidget class like the trees.

This commit is contained in:
pinkerton%netscape.com 1998-12-03 01:26:39 +00:00
parent 4ad7e18ed5
commit cbea612556
2 changed files with 13 additions and 3 deletions

View File

@ -88,7 +88,7 @@ static CNavTokenDeallocator gItemInfoKiller;*/
//--------------------------------------------------------------------
//-- nsToolbar Constructor
//--------------------------------------------------------------------
nsToolbar::nsToolbar() : ChildWindow(), nsIToolbar()
nsToolbar::nsToolbar() : nsDataModelWidget(), nsIToolbar()
{
NS_INIT_REFCNT();
@ -820,6 +820,14 @@ nsEventStatus nsToolbar::HandleEvent(nsGUIEvent *aEvent)
}
//-------------------------------------------------------------------
void nsToolbar::HandleDataModelEvent(int anEvent, nsHierarchicalDataItem* pItem)
{
Invalidate(PR_FALSE);
}
//-------------------------------------------------------------------
NS_METHOD nsToolbar::SetWrapping(PRBool aDoWrap)
{

View File

@ -23,11 +23,13 @@
#include "nsWindow.h"
#include "nsIImageButton.h"
#include "nsIToolbarItem.h"
#include "nsDataModelWidget.h"
class ToolbarLayoutInfo;
//------------------------------------------------------------
class nsToolbar : public ChildWindow,
class nsToolbar : public nsDataModelWidget,
public nsIToolbar,
public nsIToolbarItem
@ -62,7 +64,7 @@ public:
NS_IMETHOD_(nsEventStatus) HandleEvent(nsGUIEvent *aEvent);
NS_IMETHOD_(nsEventStatus) OnPaint(nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect);
NS_IMETHOD_(void) HandleDataModelEvent(int event, nsHierarchicalDataItem* pItem) ;
// nsIToolbarItem
NS_IMETHOD Repaint(PRBool aIsSynchronous);