1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: datwin.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_svtools.hxx"
39 #ifndef _APP_HXX //autogen
40 #include <vcl/svapp.hxx>
44 #include <vcl/help.hxx>
47 #include <vcl/image.hxx>
50 #include <tools/debug.hxx>
52 DECLARE_LIST( BrowserColumns
, BrowserColumn
* )
54 //===================================================================
55 void ButtonFrame::Draw( OutputDevice
& rDev
)
57 Color aOldFillColor
= rDev
.GetFillColor();
58 Color aOldLineColor
= rDev
.GetLineColor();
60 const StyleSettings
&rSettings
= rDev
.GetSettings().GetStyleSettings();
61 Color
aColLight( rSettings
.GetLightColor() );
62 Color
aColShadow( rSettings
.GetShadowColor() );
63 Color
aColFace( rSettings
.GetFaceColor() );
65 rDev
.SetLineColor( aColFace
);
66 rDev
.SetFillColor( aColFace
);
67 rDev
.DrawRect( aRect
);
69 if( rDev
.GetOutDevType() == OUTDEV_WINDOW
)
71 Window
*pWin
= (Window
*) &rDev
;
73 pWin
->DrawSelectionBackground( aRect
, 0, TRUE
, FALSE
, FALSE
);
77 rDev
.SetLineColor( bPressed
? aColShadow
: aColLight
);
78 rDev
.DrawLine( aRect
.TopLeft(), Point( aRect
.Right(), aRect
.Top() ) );
79 rDev
.DrawLine( aRect
.TopLeft(), Point( aRect
.Left(), aRect
.Bottom() - 1 ) );
80 rDev
.SetLineColor( bPressed
? aColLight
: aColShadow
);
81 rDev
.DrawLine( aRect
.BottomRight(), Point( aRect
.Right(), aRect
.Top() ) );
82 rDev
.DrawLine( aRect
.BottomRight(), Point( aRect
.Left(), aRect
.Bottom() ) );
87 String aVal
= rDev
.GetEllipsisString(aText
,aInnerRect
.GetWidth() - 2*MIN_COLUMNWIDTH
);
89 Font
aFont( rDev
.GetFont() );
90 BOOL bOldTransp
= aFont
.IsTransparent();
93 aFont
.SetTransparent( TRUE
);
94 rDev
.SetFont( aFont
);
97 Color aOldColor
= rDev
.GetTextColor();
99 rDev
.SetTextColor(rSettings
.GetDisableColor());
101 rDev
.DrawText( Point(
102 ( aInnerRect
.Left() + aInnerRect
.Right() ) / 2 - ( rDev
.GetTextWidth(aVal
) / 2 ),
103 aInnerRect
.Top() ), aVal
);
108 aFont
.SetTransparent(FALSE
);
109 rDev
.SetFont( aFont
);
112 rDev
.SetTextColor(aOldColor
);
117 rDev
.SetLineColor( Color( COL_BLACK
) );
119 rDev
.DrawRect( Rectangle(
120 Point( aRect
.Left(), aRect
.Top() ), Point( aRect
.Right(), aRect
.Bottom() ) ) );
123 rDev
.SetLineColor( aOldLineColor
);
124 rDev
.SetFillColor( aOldFillColor
);
127 //-------------------------------------------------------------------
129 BrowserColumn::BrowserColumn( USHORT nItemId
, const class Image
&rImage
,
130 const String
& rTitle
, ULONG nWidthPixel
, const Fraction
& rCurrentZoom
,
131 HeaderBarItemBits nFlags
)
133 _nWidth( nWidthPixel
),
139 double n
= (double)_nWidth
;
140 n
*= (double)rCurrentZoom
.GetDenominator();
141 n
/= (double)rCurrentZoom
.GetNumerator();
142 _nOriginalWidth
= n
>0 ? (long)(n
+0.5) : -(long)(-n
+0.5);
145 BrowserColumn::~BrowserColumn()
149 //-------------------------------------------------------------------
151 void BrowserColumn::SetWidth(ULONG nNewWidthPixel
, const Fraction
& rCurrentZoom
)
153 _nWidth
= nNewWidthPixel
;
154 double n
= (double)_nWidth
;
155 n
*= (double)rCurrentZoom
.GetDenominator();
156 n
/= (double)rCurrentZoom
.GetNumerator();
157 _nOriginalWidth
= n
>0 ? (long)(n
+0.5) : -(long)(-n
+0.5);
160 //-------------------------------------------------------------------
162 void BrowserColumn::Draw( BrowseBox
& rBox
, OutputDevice
& rDev
, const Point
& rPos
, BOOL bCurs
)
166 // paint handle column
167 ButtonFrame( rPos
, Size( Width()-1, rBox
.GetDataRowHeight()-1 ),
168 String(), FALSE
, bCurs
,
169 0 != (BROWSER_COLUMN_TITLEABBREVATION
&_nFlags
) ).Draw( rDev
);
170 Color aOldLineColor
= rDev
.GetLineColor();
171 rDev
.SetLineColor( Color( COL_BLACK
) );
173 Point( rPos
.X(), rPos
.Y()+rBox
.GetDataRowHeight()-1 ),
174 Point( rPos
.X() + Width() - 1, rPos
.Y()+rBox
.GetDataRowHeight()-1 ) );
176 Point( rPos
.X() + Width() - 1, rPos
.Y() ),
177 Point( rPos
.X() + Width() - 1, rPos
.Y()+rBox
.GetDataRowHeight()-1 ) );
178 rDev
.SetLineColor( aOldLineColor
);
180 rBox
.DoPaintField( rDev
,
182 Point( rPos
.X() + 2, rPos
.Y() + 2 ),
183 Size( Width()-1, rBox
.GetDataRowHeight()-1 ) ),
185 BrowseBox::BrowserColumnAccess() );
190 long nWidth
= Width() == LONG_MAX
? rBox
.GetDataWindow().GetSizePixel().Width() : Width();
192 rBox
.DoPaintField( rDev
,
194 Point( rPos
.X() + MIN_COLUMNWIDTH
, rPos
.Y() ),
195 Size( nWidth
-2*MIN_COLUMNWIDTH
, rBox
.GetDataRowHeight()-1 ) ),
197 BrowseBox::BrowserColumnAccess() );
201 //-------------------------------------------------------------------
203 void BrowserColumn::ZoomChanged(const Fraction
& rNewZoom
)
205 double n
= (double)_nOriginalWidth
;
206 n
*= (double)rNewZoom
.GetNumerator();
207 n
/= (double)rNewZoom
.GetDenominator();
209 _nWidth
= n
>0 ? (long)(n
+0.5) : -(long)(-n
+0.5);
212 //-------------------------------------------------------------------
214 BrowserDataWin::BrowserDataWin( BrowseBox
* pParent
)
215 :Control( pParent
, WinBits(WB_CLIPCHILDREN
) )
216 ,DragSourceHelper( this )
217 ,DropTargetHelper( this )
219 ,pEventWin( pParent
)
224 ,bNoScrollBack( FALSE
)
228 ,bResizeOnPaint( FALSE
)
229 ,bUpdateOnUnlock( FALSE
)
230 ,bInUpdateScrollbars( FALSE
)
231 ,bHadRecursion( FALSE
)
232 ,bOwnDataChangedHdl( FALSE
)
233 ,bCallingDropCallback( FALSE
)
236 ,m_nDragRowDividerLimit( 0 )
237 ,m_nDragRowDividerOffset( 0 )
239 aMouseTimer
.SetTimeoutHdl( LINK( this, BrowserDataWin
, RepeatedMouseMove
) );
240 aMouseTimer
.SetTimeout( 100 );
243 //-------------------------------------------------------------------
244 BrowserDataWin::~BrowserDataWin()
250 //-------------------------------------------------------------------
251 void BrowserDataWin::LeaveUpdateLock()
253 if ( !--nUpdateLock
)
255 DoOutstandingInvalidations();
256 if (bUpdateOnUnlock
)
259 bUpdateOnUnlock
= FALSE
;
264 //-------------------------------------------------------------------
265 void InitSettings_Impl( Window
*pWin
,
266 BOOL bFont
, BOOL bForeground
, BOOL bBackground
)
268 const StyleSettings
& rStyleSettings
=
269 pWin
->GetSettings().GetStyleSettings();
273 Font aFont
= rStyleSettings
.GetFieldFont();
274 if ( pWin
->IsControlFont() )
275 aFont
.Merge( pWin
->GetControlFont() );
276 pWin
->SetZoomedPointFont( aFont
);
279 if ( bFont
|| bForeground
)
281 Color aTextColor
= rStyleSettings
.GetWindowTextColor();
282 if ( pWin
->IsControlForeground() )
283 aTextColor
= pWin
->GetControlForeground();
284 pWin
->SetTextColor( aTextColor
);
289 if( pWin
->IsControlBackground() )
290 pWin
->SetBackground( pWin
->GetControlBackground() );
292 pWin
->SetBackground( rStyleSettings
.GetWindowColor() );
296 //-------------------------------------------------------------------
297 void BrowserDataWin::Update()
302 bUpdateOnUnlock
= TRUE
;
305 //-------------------------------------------------------------------
306 void BrowserDataWin::DataChanged( const DataChangedEvent
& rDCEvt
)
308 if ( (rDCEvt
.GetType() == DATACHANGED_SETTINGS
) &&
309 (rDCEvt
.GetFlags() & SETTINGS_STYLE
) )
311 if( !bOwnDataChangedHdl
)
313 InitSettings_Impl( this, TRUE
, TRUE
, TRUE
);
315 InitSettings_Impl( GetParent(), TRUE
, TRUE
, TRUE
);
316 GetParent()->Invalidate();
317 GetParent()->Resize();
321 Control::DataChanged( rDCEvt
);
324 //-------------------------------------------------------------------
325 void BrowserDataWin::Paint( const Rectangle
& rRect
)
327 if ( !nUpdateLock
&& GetUpdateMode() )
331 aInvalidRegion
.Insert( new Rectangle( rRect
) );
335 ( (BrowseBox
*) GetParent() )->PaintData( *this, rRect
);
337 DoOutstandingInvalidations();
340 aInvalidRegion
.Insert( new Rectangle( rRect
) );
343 //-------------------------------------------------------------------
345 BrowseEvent
BrowserDataWin::CreateBrowseEvent( const Point
& rPosPixel
)
347 BrowseBox
*pBox
= GetParent();
349 // seek to row under mouse
350 long nRelRow
= rPosPixel
.Y() < 0
352 : rPosPixel
.Y() / pBox
->GetDataRowHeight();
353 long nRow
= nRelRow
< 0 ? -1 : nRelRow
+ pBox
->nTopRow
;
355 // find column under mouse
356 long nMouseX
= rPosPixel
.X();
360 nCol
< pBox
->pCols
->Count() && nColX
< GetSizePixel().Width();
362 if ( pBox
->pCols
->GetObject(nCol
)->IsFrozen() || nCol
>= pBox
->nFirstCol
)
364 nColX
+= pBox
->pCols
->GetObject(nCol
)->Width();
365 if ( nMouseX
< nColX
)
368 USHORT nColId
= BROWSER_INVALIDID
;
369 if ( nCol
< pBox
->pCols
->Count() )
370 nColId
= pBox
->pCols
->GetObject(nCol
)->GetId();
372 // compute the field rectangle and field relative MouseEvent
373 Rectangle aFieldRect
;
374 if ( nCol
< pBox
->pCols
->Count() )
376 nColX
-= pBox
->pCols
->GetObject(nCol
)->Width();
377 aFieldRect
= Rectangle(
378 Point( nColX
, nRelRow
* pBox
->GetDataRowHeight() ),
379 Size( pBox
->pCols
->GetObject(nCol
)->Width(),
380 pBox
->GetDataRowHeight() ) );
383 // assemble and return the BrowseEvent
384 return BrowseEvent( this, nRow
, nCol
, nColId
, aFieldRect
);
387 //-------------------------------------------------------------------
388 sal_Int8
BrowserDataWin::AcceptDrop( const AcceptDropEvent
& _rEvt
)
390 bCallingDropCallback
= sal_True
;
391 sal_Int8 nReturn
= DND_ACTION_NONE
;
392 nReturn
= GetParent()->AcceptDrop( BrowserAcceptDropEvent( this, _rEvt
) );
393 bCallingDropCallback
= sal_False
;
397 //-------------------------------------------------------------------
398 sal_Int8
BrowserDataWin::ExecuteDrop( const ExecuteDropEvent
& _rEvt
)
400 bCallingDropCallback
= sal_True
;
401 sal_Int8 nReturn
= DND_ACTION_NONE
;
402 nReturn
= GetParent()->ExecuteDrop( BrowserExecuteDropEvent( this, _rEvt
) );
403 bCallingDropCallback
= sal_False
;
407 //-------------------------------------------------------------------
408 void BrowserDataWin::StartDrag( sal_Int8 _nAction
, const Point
& _rPosPixel
)
410 if ( !GetParent()->bRowDividerDrag
)
412 Point
aEventPos( _rPosPixel
);
413 aEventPos
.Y() += GetParent()->GetTitleHeight();
414 GetParent()->StartDrag( _nAction
, aEventPos
);
418 //-------------------------------------------------------------------
419 void BrowserDataWin::Command( const CommandEvent
& rEvt
)
422 BrowseBox
*pBox
= GetParent();
423 if ( ( (rEvt
.GetCommand() == COMMAND_WHEEL
) ||
424 (rEvt
.GetCommand() == COMMAND_STARTAUTOSCROLL
) ||
425 (rEvt
.GetCommand() == COMMAND_AUTOSCROLL
) ) &&
426 ( HandleScrollCommand( rEvt
, &pBox
->aHScroll
, pBox
->pVScroll
) ) )
429 Point
aEventPos( rEvt
.GetMousePosPixel() );
430 long nRow
= pBox
->GetRowAtYPosPixel( aEventPos
.Y(), FALSE
);
431 MouseEvent
aMouseEvt( aEventPos
, 1, MOUSE_SELECT
, MOUSE_LEFT
);
432 if ( COMMAND_CONTEXTMENU
== rEvt
.GetCommand() && rEvt
.IsMouseEvent() &&
433 nRow
< pBox
->GetRowCount() && !pBox
->IsRowSelected(nRow
) )
435 BOOL bDeleted
= FALSE
;
436 pDtorNotify
= &bDeleted
;
438 MouseButtonDown( aMouseEvt
);
441 MouseButtonUp( aMouseEvt
);
448 aEventPos
.Y() += GetParent()->GetTitleHeight();
449 CommandEvent
aEvt( aEventPos
, rEvt
.GetCommand(),
450 rEvt
.IsMouseEvent(), rEvt
.GetData() );
452 BOOL bDeleted
= FALSE
;
453 pDtorNotify
= &bDeleted
;
454 GetParent()->Command( aEvt
);
460 if ( COMMAND_STARTDRAG
== rEvt
.GetCommand() )
461 MouseButtonUp( aMouseEvt
);
463 Control::Command( rEvt
);
466 //-------------------------------------------------------------------
468 BOOL
BrowserDataWin::ImplRowDividerHitTest( const BrowserMouseEvent
& _rEvent
)
470 if ( ! ( GetParent()->IsInteractiveRowHeightEnabled()
471 && ( _rEvent
.GetRow() >= 0 )
472 && ( _rEvent
.GetRow() < GetParent()->GetRowCount() )
473 && ( _rEvent
.GetColumnId() == 0 )
478 long nDividerDistance
= GetParent()->GetDataRowHeight() - ( _rEvent
.GetPosPixel().Y() % GetParent()->GetDataRowHeight() );
479 return ( nDividerDistance
<= 4 );
482 //-------------------------------------------------------------------
484 void BrowserDataWin::MouseButtonDown( const MouseEvent
& rEvt
)
486 aLastMousePos
= OutputToScreenPixel( rEvt
.GetPosPixel() );
488 BrowserMouseEvent
aBrowserEvent( this, rEvt
);
489 if ( ( aBrowserEvent
.GetClicks() == 1 ) && ImplRowDividerHitTest( aBrowserEvent
) )
491 StartRowDividerDrag( aBrowserEvent
.GetPosPixel() );
495 GetParent()->MouseButtonDown( BrowserMouseEvent( this, rEvt
) );
498 //-------------------------------------------------------------------
500 void BrowserDataWin::MouseMove( const MouseEvent
& rEvt
)
502 // Pseudo MouseMoves verhindern
503 Point aNewPos
= OutputToScreenPixel( rEvt
.GetPosPixel() );
504 if ( ( aNewPos
== aLastMousePos
) )
506 aLastMousePos
= aNewPos
;
508 // transform to a BrowseEvent
509 BrowserMouseEvent
aBrowserEvent( this, rEvt
);
510 GetParent()->MouseMove( aBrowserEvent
);
513 PointerStyle ePointerStyle
= POINTER_ARROW
;
514 if ( ImplRowDividerHitTest( aBrowserEvent
) )
515 ePointerStyle
= POINTER_VSIZEBAR
;
516 SetPointer( Pointer( ePointerStyle
) );
518 // dragging out of the visible area?
519 if ( rEvt
.IsLeft() &&
520 ( rEvt
.GetPosPixel().Y() > GetSizePixel().Height() ||
521 rEvt
.GetPosPixel().Y() < 0 ) )
528 // killing old repeat-event
529 if ( aMouseTimer
.IsActive() )
533 //-------------------------------------------------------------------
535 IMPL_LINK_INLINE_START( BrowserDataWin
, RepeatedMouseMove
, void *, EMPTYARG
)
537 GetParent()->MouseMove( BrowserMouseEvent( this, aRepeatEvt
) );
540 IMPL_LINK_INLINE_END( BrowserDataWin
, RepeatedMouseMove
, void *, EMPTYARG
)
542 //-------------------------------------------------------------------
544 void BrowserDataWin::MouseButtonUp( const MouseEvent
& rEvt
)
546 // Pseudo MouseMoves verhindern
547 Point aNewPos
= OutputToScreenPixel( rEvt
.GetPosPixel() );
548 aLastMousePos
= aNewPos
;
550 // Move an die aktuelle Position simulieren
553 // eigentliches Up-Handling
555 if ( aMouseTimer
.IsActive() )
557 GetParent()->MouseButtonUp( BrowserMouseEvent( this, rEvt
) );
560 //-------------------------------------------------------------------
562 void BrowserDataWin::StartRowDividerDrag( const Point
& _rStartPos
)
564 long nDataRowHeight
= GetParent()->GetDataRowHeight();
565 // the exact separation pos of the two rows
566 long nDragRowDividerCurrentPos
= _rStartPos
.Y();
567 if ( ( nDragRowDividerCurrentPos
% nDataRowHeight
) > nDataRowHeight
/ 2 )
568 nDragRowDividerCurrentPos
+= nDataRowHeight
;
569 nDragRowDividerCurrentPos
/= nDataRowHeight
;
570 nDragRowDividerCurrentPos
*= nDataRowHeight
;
572 m_nDragRowDividerOffset
= nDragRowDividerCurrentPos
- _rStartPos
.Y();
574 m_nDragRowDividerLimit
= nDragRowDividerCurrentPos
- nDataRowHeight
;
576 GetParent()->bRowDividerDrag
= TRUE
;
577 GetParent()->ImplStartTracking();
579 Rectangle
aDragSplitRect( 0, m_nDragRowDividerLimit
, GetOutputSizePixel().Width(), nDragRowDividerCurrentPos
);
580 ShowTracking( aDragSplitRect
, SHOWTRACK_SMALL
);
585 //-------------------------------------------------------------------
587 void BrowserDataWin::Tracking( const TrackingEvent
& rTEvt
)
589 if ( !GetParent()->bRowDividerDrag
)
592 Point aMousePos
= rTEvt
.GetMouseEvent().GetPosPixel();
593 // stop resizing at our bottom line
594 if ( aMousePos
.Y() > GetOutputSizePixel().Height() )
595 aMousePos
.Y() = GetOutputSizePixel().Height();
597 if ( rTEvt
.IsTrackingEnded() )
600 GetParent()->bRowDividerDrag
= FALSE
;
601 GetParent()->ImplEndTracking();
603 if ( !rTEvt
.IsTrackingCanceled() )
605 long nNewRowHeight
= aMousePos
.Y() + m_nDragRowDividerOffset
- m_nDragRowDividerLimit
;
607 // care for minimum row height
608 if ( nNewRowHeight
< GetParent()->QueryMinimumRowHeight() )
609 nNewRowHeight
= GetParent()->QueryMinimumRowHeight();
611 GetParent()->SetDataRowHeight( nNewRowHeight
);
612 GetParent()->RowHeightChanged();
617 GetParent()->ImplTracking();
619 long nDragRowDividerCurrentPos
= aMousePos
.Y() + m_nDragRowDividerOffset
;
621 // care for minimum row height
622 if ( nDragRowDividerCurrentPos
< m_nDragRowDividerLimit
+ GetParent()->QueryMinimumRowHeight() )
623 nDragRowDividerCurrentPos
= m_nDragRowDividerLimit
+ GetParent()->QueryMinimumRowHeight();
625 Rectangle
aDragSplitRect( 0, m_nDragRowDividerLimit
, GetOutputSizePixel().Width(), nDragRowDividerCurrentPos
);
626 ShowTracking( aDragSplitRect
, SHOWTRACK_SMALL
);
630 //-------------------------------------------------------------------
632 void BrowserDataWin::KeyInput( const KeyEvent
& rEvt
)
634 // pass to parent window
635 if ( !GetParent()->ProcessKey( rEvt
) )
636 Control::KeyInput( rEvt
);
639 //-------------------------------------------------------------------
641 void BrowserDataWin::RequestHelp( const HelpEvent
& rHEvt
)
644 GetParent()->RequestHelp( rHEvt
);
645 pEventWin
= GetParent();
648 //===================================================================
650 BrowseEvent::BrowseEvent( Window
* pWindow
,
651 long nAbsRow
, USHORT nColumn
, USHORT nColumnId
,
652 const Rectangle
& rRect
):
661 //===================================================================
662 BrowserMouseEvent::BrowserMouseEvent( BrowserDataWin
*pWindow
,
663 const MouseEvent
& rEvt
):
665 BrowseEvent( pWindow
->CreateBrowseEvent( rEvt
.GetPosPixel() ) )
669 //-------------------------------------------------------------------
671 BrowserMouseEvent::BrowserMouseEvent( Window
*pWindow
, const MouseEvent
& rEvt
,
672 long nAbsRow
, USHORT nColumn
, USHORT nColumnId
,
673 const Rectangle
& rRect
):
675 BrowseEvent( pWindow
, nAbsRow
, nColumn
, nColumnId
, rRect
)
679 //===================================================================
681 BrowserAcceptDropEvent::BrowserAcceptDropEvent( BrowserDataWin
*pWindow
, const AcceptDropEvent
& rEvt
)
682 :AcceptDropEvent(rEvt
)
683 ,BrowseEvent( pWindow
->CreateBrowseEvent( rEvt
.maPosPixel
) )
687 //===================================================================
689 BrowserExecuteDropEvent::BrowserExecuteDropEvent( BrowserDataWin
*pWindow
, const ExecuteDropEvent
& rEvt
)
690 :ExecuteDropEvent(rEvt
)
691 ,BrowseEvent( pWindow
->CreateBrowseEvent( rEvt
.maPosPixel
) )
695 //===================================================================
697 //-------------------------------------------------------------------
699 void BrowserDataWin::SetUpdateMode( BOOL bMode
)
701 DBG_ASSERT( !bUpdateMode
|| aInvalidRegion
.Count() == 0,
702 "invalid region not empty" );
703 if ( bMode
== bUpdateMode
)
708 DoOutstandingInvalidations();
711 //-------------------------------------------------------------------
712 void BrowserDataWin::DoOutstandingInvalidations()
714 for ( Rectangle
* pRect
= aInvalidRegion
.First();
716 pRect
= aInvalidRegion
.Next() )
718 Control::Invalidate( *pRect
);
721 aInvalidRegion
.Clear();
724 //-------------------------------------------------------------------
726 void BrowserDataWin::Invalidate( USHORT nFlags
)
728 if ( !GetUpdateMode() )
730 for ( Rectangle
* pRect
= aInvalidRegion
.First();
732 pRect
= aInvalidRegion
.Next() )
734 aInvalidRegion
.Clear();
735 aInvalidRegion
.Insert( new Rectangle( Point( 0, 0 ), GetOutputSizePixel() ) );
738 Window::Invalidate( nFlags
);
741 //-------------------------------------------------------------------
743 void BrowserDataWin::Invalidate( const Rectangle
& rRect
, USHORT nFlags
)
745 if ( !GetUpdateMode() )
746 aInvalidRegion
.Insert( new Rectangle( rRect
) );
748 Window::Invalidate( rRect
, nFlags
);
751 //===================================================================
753 void BrowserScrollBar::Tracking( const TrackingEvent
& rTEvt
)
755 ULONG nPos
= GetThumbPos();
756 if ( nPos
!= _nLastPos
)
759 Help::HideTip( _nTip
);
761 String
aTip( String::CreateFromInt32(nPos
) );
763 if ( _pDataWin
->GetRealRowCount().Len() )
764 aTip
+= _pDataWin
->GetRealRowCount();
766 aTip
+= String::CreateFromInt32(GetRangeMax());
767 Rectangle
aRect( GetPointerPosPixel(), Size( GetTextHeight(), GetTextWidth( aTip
) ) );
768 _nTip
= Help::ShowTip( this, aRect
, aTip
);
772 ScrollBar::Tracking( rTEvt
);
775 //-------------------------------------------------------------------
777 void BrowserScrollBar::EndScroll()
780 Help::HideTip( _nTip
);
782 ScrollBar::EndScroll();