fix broken debugging messages and fix bounds condition where a window

should be mapped.
This commit is contained in:
blizzard%redhat.com 1999-07-28 04:53:49 +00:00
Родитель b0abbaff39
Коммит c7eb463783
3 изменённых файлов: 17 добавлений и 10 удалений

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

@ -256,6 +256,8 @@ void nsScrollbar::CreateNative(Window aParent, nsRect aRect)
attr_mask,
&attr);
AddWindowCallback(mBar, this);
PR_LOG(XlibScrollbarLM, PR_LOG_DEBUG, ("nsScrollbar::CreateNative created window 0x%lx with bar 0x%lx\n",
mBaseWindow, mBar));
}
NS_IMETHODIMP nsScrollbar::Show(PRBool bState)
@ -409,3 +411,8 @@ void nsScrollbar::LayoutBar(void)
mBarBounds.x, mBarBounds.y,
mBarBounds.width, mBarBounds.height);
}
NS_IMETHODIMP nsScrollbar::Move(PRInt32 aX, PRInt32 aY)
{
return nsWidget::Move(aX, aY);
}

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

@ -39,6 +39,7 @@ public:
PRBool OnResize (nsSizeEvent &event);
PRBool DispatchMouseEvent (nsMouseEvent &aEvent);
NS_IMETHOD Show (PRBool bState);
NS_IMETHOD Move (PRInt32 aX, PRInt32 aY);
NS_IMETHOD Resize (PRInt32 aWidth,
PRInt32 aHeight,
PRBool aRepaint);

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

@ -872,13 +872,13 @@ void nsWidget::WidgetMove(nsWidget *aWidget)
aWidget->mBounds.x,
aWidget->mBounds.y);
if (aWidget->mIsShown == PR_TRUE) {
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("Mapping window 0x%lx...\n", mBaseWindow));
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("Mapping window 0x%lx...\n", aWidget->mBaseWindow));
aWidget->Map();
}
}
else {
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("Widget is not visible...\n"));
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("Unmapping window 0x%lx...\n", mBaseWindow));
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("Unmapping window 0x%lx...\n", aWidget->mBaseWindow));
aWidget->Unmap();
}
}
@ -893,13 +893,13 @@ void nsWidget::WidgetResize(nsWidget *aWidget)
aWidget->mBounds.width,
aWidget->mBounds.height);
if (aWidget->mIsShown == PR_TRUE) {
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("Mapping window 0x%lx...\n", mBaseWindow));
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("Mapping window 0x%lx...\n", aWidget->mBaseWindow));
aWidget->Map();
}
}
else {
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("Widget is not visible...\n"));
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("Unmapping window 0x%lx...\n", mBaseWindow));
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("Unmapping window 0x%lx...\n", aWidget->mBaseWindow));
aWidget->Unmap();
}
}
@ -916,13 +916,13 @@ void nsWidget::WidgetMoveResize(nsWidget *aWidget)
aWidget->mBounds.x,
aWidget->mBounds.y);
if (aWidget->mIsShown == PR_TRUE) {
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("Mapping window 0x%lx...\n", mBaseWindow));
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("Mapping window 0x%lx...\n", aWidget->mBaseWindow));
aWidget->Map();
}
}
else {
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("Widget is not visible...\n"));
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("Unmapping window 0x%lx...\n", mBaseWindow));
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("Unmapping window 0x%lx...\n", aWidget->mBaseWindow));
aWidget->Unmap();
}
}
@ -930,8 +930,7 @@ void nsWidget::WidgetMoveResize(nsWidget *aWidget)
void nsWidget::WidgetShow(nsWidget *aWidget)
{
if (PR_TRUE == WidgetVisible(aWidget->mBounds)) {
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("Mapping window...\n"));
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("Mapping window 0x%lx...\n", mBaseWindow));
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("Mapping window 0x%lx...\n", aWidget->mBaseWindow));
aWidget->Map();
}
else {
@ -944,8 +943,8 @@ PRBool nsWidget::WidgetVisible(nsRect &aBounds)
nsRect scrollArea;
scrollArea.x = 0;
scrollArea.y = 0;
scrollArea.width = mBounds.width;
scrollArea.height = mBounds.height;
scrollArea.width = mBounds.width + 1;
scrollArea.height = mBounds.height + 1;
if (scrollArea.Intersects(aBounds)) {
PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("nsWidget::WidgetVisible(): widget is visible\n"));
return PR_TRUE;