Removed commented out CreateWindow code

This commit is contained in:
kmcclusk%netscape.com 1998-07-16 21:43:15 +00:00
parent 3b2507bae4
commit 15d22d92ca

View File

@ -450,135 +450,6 @@ void nsWindow::CreateWindow(nsNativeWidget aNativeParent,
}
#if 0
//-------------------------------------------------------------------------
//
// Create a window.
//
// Note: aNativeParent is always non-null if aWidgetParent is non-null.
// aNativeaParent is set regardless if the parent for the Create() was an
// nsIWidget or a Native widget.
// aNativeParent is equal to aWidgetParent->GetNativeData(NS_NATIVE_WIDGET)
//-------------------------------------------------------------------------
void nsWindow::CreateWindow(nsNativeWidget aNativeParent,
nsIWidget *aWidgetParent,
const nsRect &aRect,
EVENT_CALLBACK aHandleEventFunction,
nsIDeviceContext *aContext,
nsIToolkit *aToolkit,
nsWidgetInitData *aInitData)
{
Widget mainWindow = 0, frame = 0;
Widget parentWidget = 0;
mBounds = aRect;
InitToolkit(aToolkit, aWidgetParent);
// save the event callback function
mEventCallback = aHandleEventFunction;
if (0==aNativeParent) {
parentWidget = (Widget) aInitData ;
}
else
parentWidget = (Widget)aNativeParent;
InitDeviceContext(aContext, parentWidget);
Widget frameParent = 0;
if (!aNativeParent) {
if (gFirstTopLevelWindow == 0) {
mainWindow = ::XtVaCreateManagedWidget("mainWindow",
xmMainWindowWidgetClass,
parentWidget,
nsnull);
gFirstTopLevelWindow = mainWindow;
}
else {
Widget shell = ::XtVaCreatePopupShell(" ",
xmDialogShellWidgetClass,
parentWidget, 0);
XtVaSetValues(shell,
XmNwidth, aRect.width, XmNheight, aRect.height, nsnull);
mainWindow = ::XtVaCreateManagedWidget("mainWindow",
xmMainWindowWidgetClass,
shell,
nsnull);
XtVaSetValues(mainWindow, XmNwidth, aRect.width, XmNheight, aRect.height, nsnull);
}
frameParent = mainWindow;
}
else
frameParent = (Widget)aNativeParent;
frame = ::XtVaCreateManagedWidget("frame",
xmDrawingAreaWidgetClass,
frameParent,
XmNwidth, aRect.width,
XmNheight, aRect.height,
XmNmarginHeight, 0,
XmNmarginWidth, 0,
nsnull);
mWidget = frame ;
if (mainWindow) {
XmMainWindowSetAreas (mainWindow, nsnull, nsnull, nsnull, nsnull, frame);
}
if (aWidgetParent) {
aWidgetParent->AddChild(this);
}
// Force cursor to default setting
mCursor = eCursor_select;
SetCursor(eCursor_standard);
InitCallbacks();
XtAddCallback(mWidget,
XmNresizeCallback,
nsXtWidget_Resize_Callback,
this);
/*XtAddCallback(mWidget,
XmNexposeCallback,
nsXtWidget_Expose_Callback,
this);*/
// Create a Writeable GC for this Widget. Unfortunatley,
// the Window for the Widget is not created properly at this point and
// we Need the GC prior to the Rendering Context getting created, so
// we create a small dummy window of the default depth as our dummy Drawable
// to create a compatible GC
if (nsnull == mGC) {
XGCValues values;
Window w;
Display * d = XtDisplay(mWidget);
w = ::XCreateSimpleWindow(d,
RootWindow(d,DefaultScreen(d)),
0,0,1,1,0,
BlackPixel(d,DefaultScreen(d)),
WhitePixel(d,DefaultScreen(d)));
mGC = ::XCreateGC(d, w, nsnull, &values);
::XDestroyWindow(d,w);
}
}
#endif
//-------------------------------------------------------------------------
//