Add support for nsButton

This commit is contained in:
kostello%netscape.com 1998-08-18 22:45:21 +00:00
parent 31d214b475
commit c6d4031b61

View File

@ -25,7 +25,7 @@
#include "nsToolkit.h" #include "nsToolkit.h"
#include "nsWindow.h" #include "nsWindow.h"
#include "nsAppShell.h" #include "nsAppShell.h"
//#include "nsButton.h" #include "nsButton.h"
//#include "nsScrollbar.h" //#include "nsScrollbar.h"
//#include "nsCheckButton.h" //#include "nsCheckButton.h"
//#include "nsRadioButton.h" //#include "nsRadioButton.h"
@ -142,34 +142,37 @@ nsresult nsWidgetFactory::CreateInstance(nsISupports *aOuter,
{ {
inst = new nsWindow(aOuter); inst = new nsWindow(aOuter);
} }
else else if (aIID.Equals(kIWidget))
if (aIID.Equals(kIWidget)) {
{ inst = new nsWindow(aOuter);
inst = new nsWindow(aOuter); }
} else if (mClassID.Equals(kCAppShellCID))
else {
if (mClassID.Equals(kCAppShellCID)) nsAppShell *appInst = new nsAppShell();
{ if (appInst == NULL)
nsAppShell *appInst = new nsAppShell(); {
if (appInst == NULL) return NS_ERROR_OUT_OF_MEMORY;
{ }
return NS_ERROR_OUT_OF_MEMORY; nsresult res = appInst->QueryInterface(aIID, aResult);
} if (res != NS_OK)
nsresult res = appInst->QueryInterface(aIID, aResult); {
if (res != NS_OK) delete appInst;
{ }
delete appInst; return res;
} }
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 #ifdef NOTNOW
else if ( mClassID.Equals(kCCheckButtonCID)) { else if ( mClassID.Equals(kCCheckButtonCID)) {
inst = new nsCheckButton(aOuter); inst = new nsCheckButton(aOuter);
} }
else if ( mClassID.Equals(kCButtonCID)) {
inst = new nsButton(aOuter);
}
else if (mClassID.Equals(kCVertScrollbarCID)) { else if (mClassID.Equals(kCVertScrollbarCID)) {
inst = new nsScrollbar(aOuter, PR_TRUE); inst = new nsScrollbar(aOuter, PR_TRUE);
} }
@ -198,12 +201,6 @@ nsresult nsWidgetFactory::CreateInstance(nsISupports *aOuter,
else if (mClassID.Equals(kCFileWidgetCID)) { else if (mClassID.Equals(kCFileWidgetCID)) {
inst = new nsFileWidget(aOuter); 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)) { else if (mClassID.Equals(kCLookAndFeelCID)) {
nsLookAndFeel *laf = new nsLookAndFeel(aOuter); nsLookAndFeel *laf = new nsLookAndFeel(aOuter);
if (laf == NULL) { if (laf == NULL) {