From c6d4031b61b8ecafa3bafae9005160fef6aa9330 Mon Sep 17 00:00:00 2001 From: "kostello%netscape.com" Date: Tue, 18 Aug 1998 22:45:21 +0000 Subject: [PATCH] Add support for nsButton --- widget/src/mac/nsWidgetFactory.cpp | 59 ++++++++++++++---------------- 1 file changed, 28 insertions(+), 31 deletions(-) diff --git a/widget/src/mac/nsWidgetFactory.cpp b/widget/src/mac/nsWidgetFactory.cpp index fc2525735b13..876451959ca4 100644 --- a/widget/src/mac/nsWidgetFactory.cpp +++ b/widget/src/mac/nsWidgetFactory.cpp @@ -25,7 +25,7 @@ #include "nsToolkit.h" #include "nsWindow.h" #include "nsAppShell.h" -//#include "nsButton.h" +#include "nsButton.h" //#include "nsScrollbar.h" //#include "nsCheckButton.h" //#include "nsRadioButton.h" @@ -142,34 +142,37 @@ nsresult nsWidgetFactory::CreateInstance(nsISupports *aOuter, { inst = new nsWindow(aOuter); } - else - if (aIID.Equals(kIWidget)) - { - inst = new nsWindow(aOuter); - } - else - if (mClassID.Equals(kCAppShellCID)) - { - nsAppShell *appInst = new nsAppShell(); - if (appInst == NULL) - { - return NS_ERROR_OUT_OF_MEMORY; - } - nsresult res = appInst->QueryInterface(aIID, aResult); - if (res != NS_OK) - { - delete appInst; - } - return res; - } - + else if (aIID.Equals(kIWidget)) + { + inst = new nsWindow(aOuter); + } + else if (mClassID.Equals(kCAppShellCID)) + { + nsAppShell *appInst = new nsAppShell(); + if (appInst == NULL) + { + return NS_ERROR_OUT_OF_MEMORY; + } + nsresult res = appInst->QueryInterface(aIID, aResult); + if (res != NS_OK) + { + delete appInst; + } + return res; + } + else if ( mClassID.Equals(kCButtonCID)) { + inst = new nsButton(aOuter); + } + else if (aIID.Equals(kIWidget)) { + inst = new nsWindow(aOuter); + } + else if (mClassID.Equals(kCChild)) { + inst = new ChildWindow(aOuter); + } #ifdef NOTNOW else if ( mClassID.Equals(kCCheckButtonCID)) { inst = new nsCheckButton(aOuter); } - else if ( mClassID.Equals(kCButtonCID)) { - inst = new nsButton(aOuter); - } else if (mClassID.Equals(kCVertScrollbarCID)) { inst = new nsScrollbar(aOuter, PR_TRUE); } @@ -198,12 +201,6 @@ nsresult nsWidgetFactory::CreateInstance(nsISupports *aOuter, else if (mClassID.Equals(kCFileWidgetCID)) { inst = new nsFileWidget(aOuter); } - else if (aIID.Equals(kIWidget)) { - inst = new nsWindow(aOuter); - } - else if (mClassID.Equals(kCChild)) { - inst = new ChildWindow(aOuter); - } else if (mClassID.Equals(kCLookAndFeelCID)) { nsLookAndFeel *laf = new nsLookAndFeel(aOuter); if (laf == NULL) {