From 98b27da7275ffb92652f493abe68d8b11350f973 Mon Sep 17 00:00:00 2001 From: "rods%netscape.com" Date: Wed, 2 Feb 2000 15:43:54 +0000 Subject: [PATCH] added back in the label and checkbutton classes to support the viewer's testing dialogs b=26195 r=dcone --- widget/src/build/nsWinWidgetFactory.cpp | 40 ++++++++++++++++++------- widget/src/windows/makefile.win | 16 ++++++---- 2 files changed, 39 insertions(+), 17 deletions(-) diff --git a/widget/src/build/nsWinWidgetFactory.cpp b/widget/src/build/nsWinWidgetFactory.cpp index f1ed55b4c287..21bc63b5cb27 100644 --- a/widget/src/build/nsWinWidgetFactory.cpp +++ b/widget/src/build/nsWinWidgetFactory.cpp @@ -25,13 +25,10 @@ #include "nsdefs.h" #include "nsWidgetsCID.h" -#include "nsButton.h" #include "nsFileWidget.h" #include "nsFileSpecWithUIImpl.h" #include "nsLookAndFeel.h" #include "nsScrollbar.h" -#include "nsTextHelper.h" -#include "nsTextWidget.h" #include "nsToolkit.h" #include "nsWindow.h" #include "nsAppShell.h" @@ -39,6 +36,20 @@ #include "nsFontRetrieverService.h" #include "nsSound.h" +//--------------------------- +// needed for viewer only +#include "nsButton.h" +#include "nsTextHelper.h" +#include "nsTextWidget.h" +#include "nsCheckButton.h" +#include "nsLabel.h" + +static NS_DEFINE_IID(kCButton, NS_BUTTON_CID); +static NS_DEFINE_IID(kCTextField, NS_TEXTFIELD_CID); +static NS_DEFINE_IID(kCLabel, NS_LABEL_CID); +static NS_DEFINE_IID(kCCheckButton, NS_CHECKBUTTON_CID); +//--------------------------- + #include "nsWindowsTimer.h" #include "nsTimerManager.h" @@ -50,11 +61,9 @@ static NS_DEFINE_IID(kCWindow, NS_WINDOW_CID); static NS_DEFINE_IID(kCChild, NS_CHILD_CID); -static NS_DEFINE_IID(kCButton, NS_BUTTON_CID); static NS_DEFINE_IID(kCFileOpen, NS_FILEWIDGET_CID); static NS_DEFINE_IID(kCHorzScrollbar, NS_HORZSCROLLBAR_CID); static NS_DEFINE_IID(kCVertScrollbar, NS_VERTSCROLLBAR_CID); -static NS_DEFINE_IID(kCTextField, NS_TEXTFIELD_CID); static NS_DEFINE_IID(kCAppShell, NS_APPSHELL_CID); static NS_DEFINE_IID(kCToolkit, NS_TOOLKIT_CID); static NS_DEFINE_IID(kCLookAndFeel, NS_LOOKANDFEEL_CID); @@ -162,9 +171,6 @@ nsresult nsWidgetFactory::CreateInstance( nsISupports* aOuter, else if (mClassID.Equals(kCChild)) { inst = (nsISupports*)(nsBaseWidget*)new ChildWindow(); } - else if (mClassID.Equals(kCButton)) { - inst = (nsISupports*)(nsBaseWidget*)(nsWindow*)new nsButton(); - } else if (mClassID.Equals(kCFileOpen)) { inst = (nsISupports*)new nsFileWidget(); } @@ -174,9 +180,6 @@ nsresult nsWidgetFactory::CreateInstance( nsISupports* aOuter, else if (mClassID.Equals(kCVertScrollbar)) { inst = (nsISupports*)(nsBaseWidget*)(nsWindow*)new nsScrollbar(PR_TRUE); } - else if (mClassID.Equals(kCTextField)) { - inst = (nsISupports*)(nsBaseWidget*)(nsWindow*)new nsTextWidget(); - } else if (mClassID.Equals(kCAppShell)) { inst = (nsISupports*)new nsAppShell(); } @@ -214,6 +217,21 @@ nsresult nsWidgetFactory::CreateInstance( nsISupports* aOuter, else if (mClassID.Equals(kCTimerManager)) { inst = (nsISupports*)(nsITimerQueue*) new nsTimerManager(); } + /////////////////////////////////////// + // These are needed for Viewer only + /////////////////////////////////////// + else if (mClassID.Equals(kCButton)) { + inst = (nsISupports*)(nsBaseWidget*)(nsWindow*)new nsButton(); + } + else if (mClassID.Equals(kCTextField)) { + inst = (nsISupports*)(nsBaseWidget*)(nsWindow*)new nsTextWidget(); + } + else if (mClassID.Equals(kCLabel)) { + inst = (nsISupports*)(nsBaseWidget*)(nsWindow*)new nsLabel(); + } + else if (mClassID.Equals(kCCheckButton)) { + inst = (nsISupports*)(nsBaseWidget*)(nsWindow*)new nsCheckButton(); + } if (inst == NULL) { return NS_ERROR_OUT_OF_MEMORY; diff --git a/widget/src/windows/makefile.win b/widget/src/windows/makefile.win index ab0e53655c7c..9133ed17e1b8 100644 --- a/widget/src/windows/makefile.win +++ b/widget/src/windows/makefile.win @@ -37,15 +37,17 @@ CPPSRCS = \ nsDataObjCollection.cpp \ nsClipboard.cpp \ nsWindow.cpp \ - nsButton.cpp \ - nsTextWidget.cpp \ - nsTextHelper.cpp \ nsFileWidget.cpp \ nsScrollbar.cpp \ nsAppShell.cpp \ nsLookAndFeel.cpp \ nsToolkit.cpp \ nsSound.cpp \ + nsButton.cpp \ + nsTextWidget.cpp \ + nsTextHelper.cpp \ + nsLabel.cpp \ + nsCheckButton.cpp \ $(NULL) MODULE=raptor @@ -61,15 +63,17 @@ OBJS = \ .\$(OBJDIR)\nsDataObjCollection.obj \ .\$(OBJDIR)\nsClipboard.obj \ .\$(OBJDIR)\nsWindow.obj \ - .\$(OBJDIR)\nsButton.obj \ - .\$(OBJDIR)\nsTextWidget.obj \ - .\$(OBJDIR)\nsTextHelper.obj \ .\$(OBJDIR)\nsFileWidget.obj \ .\$(OBJDIR)\nsScrollbar.obj \ .\$(OBJDIR)\nsAppShell.obj \ .\$(OBJDIR)\nsLookAndFeel.obj \ .\$(OBJDIR)\nsToolkit.obj \ .\$(OBJDIR)\nsSound.obj \ + .\$(OBJDIR)\nsButton.obj \ + .\$(OBJDIR)\nsTextWidget.obj \ + .\$(OBJDIR)\nsTextHelper.obj \ + .\$(OBJDIR)\nsLabel.obj \ + .\$(OBJDIR)\nsCheckButton.obj \ $(NULL) LINCS= \