зеркало из https://github.com/mozilla/pjs.git
Added implementation for nsScrollbar::Create passing a nsNativeWidget.
Also check for nsnull cliprect in ScrollTo
This commit is contained in:
Родитель
503c6f8761
Коммит
7980847773
|
@ -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);
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче