Added implementation for nsScrollbar::Create passing a nsNativeWidget.

Also check for nsnull cliprect in ScrollTo
This commit is contained in:
kmcclusk%netscape.com 1998-07-27 22:25:43 +00:00
Родитель 503c6f8761
Коммит 7980847773
2 изменённых файлов: 16 добавлений и 17 удалений

Просмотреть файл

@ -43,22 +43,16 @@ nsScrollbar::nsScrollbar(nsISupports *aOuter, PRBool aIsVertical) : nsWindow(aOu
// Create
//
//-------------------------------------------------------------------------
void nsScrollbar::Create(nsIWidget *aParent,
void nsScrollbar::Create(nsNativeWidget aParent,
const nsRect &aRect,
EVENT_CALLBACK aHandleEventFunction,
nsIDeviceContext *aContext,
nsIToolkit *aToolkit,
nsWidgetInitData *aInitData)
{
Widget parentWidget = nsnull;
Widget parentWidget = (Widget)aParent;
strcpy(gInstanceClassName, "nsScrollbar");
if (aParent) {
parentWidget = (Widget) aParent->GetNativeData(NS_NATIVE_WIDGET);
} else {
parentWidget = (Widget) aInitData ;
}
int procDir = mOrientation == XmVERTICAL? XmMAX_ON_BOTTOM:XmMAX_ON_RIGHT;
mWidget = ::XtVaCreateManagedWidget("scrollbar",
@ -107,18 +101,23 @@ void nsScrollbar::Create(nsIWidget *aParent,
}
//-------------------------------------------------------------------------
//
// Create
//
//-------------------------------------------------------------------------
void nsScrollbar::Create(nsNativeWidget aParent,
void nsScrollbar::Create(nsIWidget *aParent,
const nsRect &aRect,
EVENT_CALLBACK aHandleEventFunction,
nsIDeviceContext *aContext,
nsIToolkit *aToolkit,
nsWidgetInitData *aInitData)
{
Widget parentWidget;
if (aParent) {
parentWidget = (Widget) aParent->GetNativeData(NS_NATIVE_WIDGET);
} else {
parentWidget = (Widget) aInitData ;
}
Create((nsNativeWidget)parentWidget, aRect, aHandleEventFunction, aContext, aToolkit, aInitData);
}
//-------------------------------------------------------------------------

Просмотреть файл

@ -1002,11 +1002,12 @@ void nsWindow::Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect)
Window win = XtWindow(mWidget);
Display *display = XtDisplay(mWidget);
XCopyArea(display, win, win, XDefaultGC(display, 0),
if (nsnull != aClipRect) {
XCopyArea(display, win, win, XDefaultGC(display, 0),
aClipRect->x, aClipRect->y,
aClipRect->XMost(), aClipRect->YMost(), aDx, aDy);
}
#if 1
XEvent evt;
evt.xgraphicsexpose.type = GraphicsExpose;
evt.xgraphicsexpose.send_event = False;
@ -1031,7 +1032,6 @@ void nsWindow::Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect)
XSendEvent(display, win, False, ExposureMask, &evt);
XFlush(display);
#endif
}