From cbea612556d16a5a02673cc7a350011dc7006437 Mon Sep 17 00:00:00 2001 From: "pinkerton%netscape.com" Date: Thu, 3 Dec 1998 01:26:39 +0000 Subject: [PATCH] make the toolbar inherit from the dataModelWidget class like the trees. --- widget/src/xpwidgets/nsToolbar.cpp | 10 +++++++++- widget/src/xpwidgets/nsToolbar.h | 6 ++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/widget/src/xpwidgets/nsToolbar.cpp b/widget/src/xpwidgets/nsToolbar.cpp index 48b8f8f8d9bc..135c9d785a3a 100644 --- a/widget/src/xpwidgets/nsToolbar.cpp +++ b/widget/src/xpwidgets/nsToolbar.cpp @@ -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) { diff --git a/widget/src/xpwidgets/nsToolbar.h b/widget/src/xpwidgets/nsToolbar.h index b6f4828a82e6..6948b37e4095 100644 --- a/widget/src/xpwidgets/nsToolbar.h +++ b/widget/src/xpwidgets/nsToolbar.h @@ -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);