}
} else if (mClassID.Equals(kCTreeView)) { inst = (nsISupports*)(nsWindow*)new nsTreeView(); }
nsresult nsWidgetFactory::CreateInstance( nsISupports* aOuter,                                          const nsIID &aIID,                                            void **aResult)  {      if (aResult == NULL) {          return NS_ERROR_NULL_POINTER;      }      *aResult = NULL;      if (nsnull != aOuter) {        return NS_ERROR_NO_AGGREGATION;    }    nsISupports *inst = nsnull;    if (mClassID.Equals(kCWindow)) {        inst = (nsISupports*)new nsWindow();    }    else if (mClassID.Equals(kCChild)) {        inst = (nsISupports*)new ChildWindow();    }    else if (mClassID.Equals(kCButton)) {        inst = (nsISupports*)(nsWindow*)new nsButton();    }    else if (mClassID.Equals(kCCheckButton)) {        inst = (nsISupports*)(nsWindow*)new nsCheckButton();    }    else if (mClassID.Equals(kCCombobox)) {        inst = (nsISupports*)(nsWindow*)new nsComboBox();    }    else if (mClassID.Equals(kCRadioButton)) {        inst = (nsISupports*)(nsWindow*)new nsRadioButton();    }    //else if (mClassID.Equals(kCRadioGroup)) {    //    inst = (nsISupports*)(nsObject*)new nsRadioGroup();    //}    else if (mClassID.Equals(kCFileOpen)) {        inst = (nsISupports*)new nsFileWidget();    }    else if (mClassID.Equals(kCListbox)) {        inst = (nsISupports*)(nsWindow*)new nsListBox();    }    else if (mClassID.Equals(kCHorzScrollbar)) {        inst = (nsISupports*)(nsWindow*)new nsScrollbar(PR_FALSE);    }    else if (mClassID.Equals(kCVertScrollbar)) {        inst = (nsISupports*)(nsWindow*)new nsScrollbar(PR_TRUE);    }    else if (mClassID.Equals(kCTextArea)) {        inst = (nsISupports*)(nsWindow*)new nsTextAreaWidget();    }    else if (mClassID.Equals(kCTextField)) {        inst = (nsISupports*)(nsWindow*)new nsTextWidget();    }    else if (mClassID.Equals(kCTabWidget)) {        inst = (nsISupports*)(nsWindow*)new nsTabWidget();    }    else if (mClassID.Equals(kCTooltipWidget)) {        inst = (nsISupports*)(nsWindow*)new nsTooltipWidget();    }    else if (mClassID.Equals(kCAppShell)) {        inst = (nsISupports*)new nsAppShell();    }    else if (mClassID.Equals(kCToolkit)) {        inst = (nsISupports*)new nsToolkit();    }    else if (mClassID.Equals(kCLookAndFeel)) {        inst = (nsISupports*)new nsLookAndFeel();    }    else if (mClassID.Equals(kCDialog)) {        inst = (nsISupports*)(nsWindow*)new nsDialog();    }    else if (mClassID.Equals(kCLabel)) {        inst = (nsISupports*)(nsWindow*)new nsLabel();    }    else if (mClassID.Equals(kCMenuBar)) {        inst = (nsISupports*)new nsMenuBar();    }    else if (mClassID.Equals(kCMenu)) {        inst = (nsISupports*)new nsMenu();    }    else if (mClassID.Equals(kCMenuItem)) {        inst = (nsISupports*)new nsMenuItem();    }    else if (mClassID.Equals(kCImageButton)) {        inst = (nsISupports*)(nsWindow*)new nsImageButton();    }    else if (mClassID.Equals(kCMenuButton)) {        inst = (nsISupports*)(nsWindow*)new nsMenuButton();    }    else if (mClassID.Equals(kCToolBar)) {        inst = (nsISupports*)(nsWindow*)new nsToolbar();    }    else if (mClassID.Equals(kCToolBarManager)) {        inst = (nsISupports*)(nsWindow*)new nsToolbarManager();    }    else if (mClassID.Equals(kCToolBarItemHolder)) {        inst = (nsISupports*)(nsIToolbarItemHolder *) new nsToolbarItemHolder();    }    else if (mClassID.Equals(kCPopUpMenu)) {        inst = (nsISupports*)new nsPopUpMenu();    }/* */      if (inst == NULL) {          return NS_ERROR_OUT_OF_MEMORY;      }      nsresult res = inst->QueryInterface(aIID, aResult);    if (res != NS_OK) {          // We didn't get the right interface, so clean up          delete inst;      }    return res;  }  