fix for [beta2] bugs:

37835
39085
32920

-r pinkerton, rods, hyatt


git-svn-id: svn://10.0.0.236/trunk@70910 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
evaughan%netscape.com
2000-05-26 06:42:29 +00:00
parent ce4a10a206
commit e32f5aa5dd
18 changed files with 328 additions and 148 deletions

View File

@@ -33,7 +33,9 @@ class nsIScrollPositionListener;
typedef enum {
nsScrollPreference_kAuto = 0,
nsScrollPreference_kNeverScroll,
nsScrollPreference_kAlwaysScroll
nsScrollPreference_kAlwaysScroll,
nsScrollPreference_kAlwaysScrollHorizontal,
nsScrollPreference_kAlwaysScrollVertical
} nsScrollPreference;
// IID for the nsIScrollableView interface

View File

@@ -986,7 +986,8 @@ NS_IMETHODIMP nsScrollingView::ComputeScrollOffsets(PRBool aAdjustWidgets)
if (NS_OK == win->QueryInterface(NS_GET_IID(nsIScrollbar), (void **)&scrollh)) {
if (((mSizeX > controlRect.width) &&
(mScrollPref != nsScrollPreference_kNeverScroll)) ||
(mScrollPref == nsScrollPreference_kAlwaysScroll))
(mScrollPref == nsScrollPreference_kAlwaysScroll) ||
(mScrollPref == nsScrollPreference_kAlwaysScrollHorizontal))
{
hasHorizontal = PR_TRUE;
}
@@ -1052,7 +1053,7 @@ NS_IMETHODIMP nsScrollingView::ComputeScrollOffsets(PRBool aAdjustWidgets)
scrollv->SetPosition(0); // make sure thumb is at the top
if (mScrollPref == nsScrollPreference_kAlwaysScroll)
if (mScrollPref == nsScrollPreference_kAlwaysScroll || mScrollPref == nsScrollPreference_kAlwaysScrollVertical)
{
((ScrollBarView *)mVScrollBarView)->SetEnabled(PR_TRUE);
win->Enable(PR_FALSE);
@@ -1124,7 +1125,7 @@ NS_IMETHODIMP nsScrollingView::ComputeScrollOffsets(PRBool aAdjustWidgets)
scrollh->SetPosition(0); // make sure thumb is all the way to the left
if (mScrollPref == nsScrollPreference_kAlwaysScroll)
if (mScrollPref == nsScrollPreference_kAlwaysScroll || mScrollPref == nsScrollPreference_kAlwaysScrollHorizontal)
{
((ScrollBarView *)mHScrollBarView)->SetEnabled(PR_TRUE);
win->Enable(PR_FALSE);

View File

@@ -855,10 +855,11 @@ NS_IMETHODIMP nsView :: SynchWidgetSizePosition()
/* You would think that doing a move and resize all in one operation would
* be faster but its not. Something is really broken here. So I'm comenting
* this out for now
* this out for now
// if we moved and resized do it all in one shot
if (mVFlags & NS_VIEW_PUBLIC_FLAG_WIDGET_MOVED && mVFlags & NS_VIEW_PUBLIC_FLAG_WIDGET_RESIZED)
{
nscoord parx = 0, pary = 0;
nsIWidget *pwidget = nsnull;
@@ -877,14 +878,14 @@ NS_IMETHODIMP nsView :: SynchWidgetSizePosition()
else if (bounds.width == width && bounds.height == bounds.height)
mVFlags &= ~NS_VIEW_PUBLIC_FLAG_WIDGET_RESIZED;
else {
printf("%d) SetBounds(%d,%d,%d,%d)\n", this, x, y, width, height);
mWindow->Resize(x,y,width,height, PR_TRUE);
mVFlags &= ~NS_VIEW_PUBLIC_FLAG_WIDGET_RESIZED;
mVFlags &= ~NS_VIEW_PUBLIC_FLAG_WIDGET_MOVED;
return NS_OK;
}
}
*/
*/
// if we just resized do it
if (mVFlags & NS_VIEW_PUBLIC_FLAG_WIDGET_RESIZED)
{
@@ -895,8 +896,10 @@ NS_IMETHODIMP nsView :: SynchWidgetSizePosition()
nsRect bounds;
mWindow->GetBounds(bounds);
if (bounds.width != width || bounds.height != bounds.height)
if (bounds.width != width || bounds.height != bounds.height) {
printf("%d) Resize(%d,%d)\n", this, width, height);
mWindow->Resize(width,height, PR_TRUE);
}
mVFlags &= ~NS_VIEW_PUBLIC_FLAG_WIDGET_RESIZED;
}
@@ -915,8 +918,10 @@ NS_IMETHODIMP nsView :: SynchWidgetSizePosition()
nsRect bounds;
mWindow->GetBounds(bounds);
if (bounds.x != x || bounds.y != y)
if (bounds.x != x || bounds.y != y) {
printf("%d) Move(%d,%d)\n", this, x, y);
mWindow->Move(x,y);
}
mVFlags &= ~NS_VIEW_PUBLIC_FLAG_WIDGET_MOVED;
}

View File

@@ -2814,6 +2814,7 @@ nsViewManager2::CacheWidgetChanges(PRBool aCache)
nsresult
nsViewManager2::ProcessWidgetChanges(nsIView* aView)
{
//printf("---------Begin Sync----------\n");
nsresult rv = aView->SynchWidgetSizePosition();
if (NS_FAILED(rv))
return rv;
@@ -2828,6 +2829,8 @@ nsViewManager2::ProcessWidgetChanges(nsIView* aView)
child->GetNextSibling(child);
}
//printf("---------End Sync----------\n");
return NS_OK;
}