Add new scroll method to allow scrolling to top or bottom of doc.
This commit is contained in:
Родитель
940f9ecaa3
Коммит
f3b8c1d1a2
|
@ -204,6 +204,14 @@ public:
|
|||
*/
|
||||
NS_IMETHOD ScrollByPages(PRInt32 aNumPages) = 0;
|
||||
|
||||
/**
|
||||
* Scroll the view to the top or bottom of the document depending
|
||||
* on the value of aTop.
|
||||
* @param aForward indicates whether to scroll to top or bottom
|
||||
* @return error status
|
||||
*/
|
||||
NS_IMETHOD ScrollByWhole(PRBool aTop) = 0;
|
||||
|
||||
/**
|
||||
* Returns the clip view
|
||||
*/
|
||||
|
|
|
@ -1578,6 +1578,24 @@ NS_IMETHODIMP nsScrollingView::ScrollByPages(PRInt32 aNumPages)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsScrollingView::ScrollByWhole(PRBool aTop)
|
||||
{
|
||||
nscoord newPos = 0;
|
||||
|
||||
if (aTop) {
|
||||
newPos = 0;
|
||||
}
|
||||
else {
|
||||
nsSize clipSize;
|
||||
mClipView->GetDimensions(&clipSize.width, &clipSize.height);
|
||||
newPos = mSizeY - clipSize.height;
|
||||
}
|
||||
|
||||
ScrollTo(0, newPos, 0);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRBool nsScrollingView::CannotBitBlt(nsIView* aScrolledView)
|
||||
{
|
||||
PRBool trans;
|
||||
|
|
|
@ -75,6 +75,7 @@ public:
|
|||
NS_IMETHOD GetLineHeight(nscoord *aHeight);
|
||||
NS_IMETHOD ScrollByLines(PRInt32 aNumLines);
|
||||
NS_IMETHOD ScrollByPages(PRInt32 aNumPages);
|
||||
NS_IMETHOD ScrollByWhole(PRBool aTop);
|
||||
|
||||
NS_IMETHOD GetClipView(const nsIView** aClipView) const;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче