Kaydet (Commit) a7e20d7a authored tarafından Luke Symes's avatar Luke Symes Kaydeden (comit) Tor Lillqvist

Implement GetLastEntryInView for SvTreeListBox.

This function matches up with GetFirstEntryInView, and will be useful
in saving the scroll state of a SvTreeListBox, in particular
the CustomAnimationList.
Signed-off-by: 's avatarTor Lillqvist <tlillqvist@novell.com>
üst 657a01ef
......@@ -369,6 +369,7 @@ public:
SvLBoxEntry* GetFirstEntryInView() const;
SvLBoxEntry* GetNextEntryInView(SvLBoxEntry*) const;
SvLBoxEntry* GetLastEntryInView() const;
void ScrollToAbsPos( long nPos );
void ShowFocusRect( const SvLBoxEntry* pEntry );
......
......@@ -2452,6 +2452,28 @@ SvLBoxEntry* SvTreeListBox::GetNextEntryInView(SvLBoxEntry* pEntry ) const
return pNext;
}
SvLBoxEntry* SvTreeListBox::GetLastEntryInView() const
{
SvLBoxEntry* pEntry = GetFirstEntryInView();
SvLBoxEntry* pNext = 0;
while( pEntry )
{
pNext = (SvLBoxEntry*)NextVisible( pEntry );
if( pNext )
{
Point aPos( GetEntryPosition(pNext) );
const Size& rSize = pImp->GetOutputSize();
if( aPos.Y() < 0 || aPos.Y() >= rSize.Height() )
break;
else
pEntry = pNext;
}
else
break;
}
return pEntry;
}
void SvTreeListBox::ShowFocusRect( const SvLBoxEntry* pEntry )
{
pImp->ShowFocusRect( pEntry );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment