From f8f68e16b7bc8988c3d215f0ffc9ea5ecb4e7b59 Mon Sep 17 00:00:00 2001 From: rods Date: Wed, 17 Jun 1998 16:27:05 +0000 Subject: [PATCH] Fixed build problem, removed scrollbar errors --- widget/src/motif/nsScrollbar.cpp | 28 ++++++++++++++------------- widget/src/motif/nsXtEventHandler.cpp | 3 ++- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/widget/src/motif/nsScrollbar.cpp b/widget/src/motif/nsScrollbar.cpp index 9a3e2e46a02..76182356328 100644 --- a/widget/src/motif/nsScrollbar.cpp +++ b/widget/src/motif/nsScrollbar.cpp @@ -24,7 +24,7 @@ #include "nsXtEventHandler.h" -#define DBG 1 +#define DBG 0 //------------------------------------------------------------------------- // @@ -35,10 +35,7 @@ nsScrollbar::nsScrollbar(nsISupports *aOuter, PRBool aIsVertical) : nsWindow(aOu { strcpy(gInstanceClassName, "nsScrollbar"); mOrientation = (aIsVertical) ? XmVERTICAL : XmHORIZONTAL; - //mScaleFactor = 1.0; mLineIncrement = 0; - //mBackground = ::GetSysColor(COLOR_SCROLLBAR); - //mBrush = ::CreateSolidBrush(NSRGB_2_COLOREF(mBackground)); } //------------------------------------------------------------------------- @@ -214,8 +211,10 @@ PRUint32 nsScrollbar::GetPosition() //------------------------------------------------------------------------- void nsScrollbar::SetThumbSize(PRUint32 aSize) { - XtVaSetValues(mWidget, XmNpageIncrement, (int)aSize, nsnull); - XtVaSetValues(mWidget, XmNsliderSize, (int)aSize, nsnull); + if (aSize > 0) { + XtVaSetValues(mWidget, XmNpageIncrement, (int)aSize, nsnull); + XtVaSetValues(mWidget, XmNsliderSize, (int)aSize, nsnull); + } if (DBG) printf("SetThumbSize %d\n", aSize); } @@ -268,13 +267,16 @@ void nsScrollbar::SetParameters(PRUint32 aMaxRange, PRUint32 aThumbSize, PRUint32 aPosition, PRUint32 aLineIncrement) { - XtVaSetValues(mWidget, XmNincrement, aLineIncrement, - XmNmaximum, aMaxRange, - XmNminimum, 0, - XmNsliderSize, aThumbSize, - XmNpageIncrement, aThumbSize, - XmNvalue, aPosition, - nsnull); + int thumbSize = (aThumbSize > 0?aThumbSize:1); + + XtVaSetValues(mWidget, + XmNincrement, (aLineIncrement > 0?aLineIncrement:1), + XmNminimum, 0, + XmNmaximum, (aMaxRange > 0?aMaxRange:10), + XmNsliderSize, thumbSize, + XmNpageIncrement, thumbSize, + XmNvalue, aPosition, + nsnull); mLineIncrement = aLineIncrement; if (DBG) printf("SetParameters %d %d %d %d \n", aMaxRange, aThumbSize, diff --git a/widget/src/motif/nsXtEventHandler.cpp b/widget/src/motif/nsXtEventHandler.cpp index 71f5ca66249..813b47a0ef1 100644 --- a/widget/src/motif/nsXtEventHandler.cpp +++ b/widget/src/motif/nsXtEventHandler.cpp @@ -389,6 +389,7 @@ void nsXtWidget_Expose_Callback(Widget w, XtPointer p, XtPointer call_data) nsXtWidget_InitNSEvent(event, p, pevent, NS_PAINT); pevent.rect = (nsRect *)▭ +#if 0 printf("Count %d\n", event->xexpose.count); if (event->xexpose.count != 0) return ; @@ -426,7 +427,7 @@ printf("Before %d %d %d %d\n", rect.x, rect.y, rect.width, rect.height); } printf("After %d %d %d %d\n", rect.x, rect.y, rect.width, rect.height); } - +#endif widgetWindow->OnPaint(pevent); if (DBG) fprintf(stderr, "Out nsXtWidget_ExposureMask_EventHandler\n");