diff options
author | Philipp Lohmann [pl] <Philipp.Lohmann@Sun.COM> | 2010-01-18 15:54:29 +0100 |
---|---|---|
committer | Philipp Lohmann [pl] <Philipp.Lohmann@Sun.COM> | 2010-01-18 15:54:29 +0100 |
commit | 4debc1f9a1306f3c644fc047e1de8456939d6cc5 (patch) | |
tree | 75c1ef7bc9a47cc994fab15d3659932ab83c470d /vcl/source/window/status.cxx | |
parent | b333a8e8f186d884d24d1955a7fd6c8a493d3c86 (diff) |
vcl109: #i108321# change status bar to optionally use separators instead of item boxes
Diffstat (limited to 'vcl/source/window/status.cxx')
-rw-r--r-- | vcl/source/window/status.cxx | 67 |
1 files changed, 52 insertions, 15 deletions
diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx index 274092db3d77..29ad0f0812cb 100644 --- a/vcl/source/window/status.cxx +++ b/vcl/source/window/status.cxx @@ -65,13 +65,15 @@ public: VirtualDevice* mpVirDev; long mnItemBorderWidth; - BOOL mbTopBorder:1; + bool mbTopBorder:1; + bool mbDrawItemFrames:1; }; StatusBar::ImplData::ImplData() { mpVirDev = NULL; - mbTopBorder = FALSE; + mbTopBorder = false; + mbDrawItemFrames = false; mnItemBorderWidth = 0; } @@ -355,9 +357,7 @@ Rectangle StatusBar::ImplGetItemRectPos( USHORT nPos ) const { Rectangle aRect; ImplStatusItem* pItem; - pItem = mpItemList->GetObject( nPos ); - if ( pItem ) { if ( pItem->mbVisible ) @@ -376,6 +376,25 @@ Rectangle StatusBar::ImplGetItemRectPos( USHORT nPos ) const // ----------------------------------------------------------------------- +USHORT StatusBar::ImplGetFirstVisiblePos() const +{ + ImplStatusItem* pItem; + + for( USHORT nPos = 0; nPos < mpItemList->Count(); nPos++ ) + { + pItem = mpItemList->GetObject( nPos ); + if ( pItem ) + { + if ( pItem->mbVisible ) + return nPos; + } + } + + return ~0; +} + +// ----------------------------------------------------------------------- + void StatusBar::ImplDrawText( BOOL bOffScreen, long nOldTextWidth ) { // Das ueberschreiben der Item-Box verhindern @@ -475,17 +494,36 @@ void StatusBar::ImplDrawItem( BOOL bOffScreen, USHORT nPos, BOOL bDrawText, BOOL SetClipRegion(); // Frame ausgeben - if ( bDrawFrame && !(pItem->mnBits & SIB_FLAT) ) + if ( bDrawFrame ) { - USHORT nStyle; + if( mpImplData->mbDrawItemFrames ) + { + if( !(pItem->mnBits & SIB_FLAT) ) + { + USHORT nStyle; - if ( pItem->mnBits & SIB_IN ) - nStyle = FRAME_DRAW_IN; - else - nStyle = FRAME_DRAW_OUT; + if ( pItem->mnBits & SIB_IN ) + nStyle = FRAME_DRAW_IN; + else + nStyle = FRAME_DRAW_OUT; + + DecorationView aDecoView( this ); + aDecoView.DrawFrame( aRect, nStyle ); + } + } + else if( nPos != ImplGetFirstVisiblePos() ) + { + // draw separator + Point aFrom( aRect.TopLeft() ); + aFrom.X()--; + aFrom.Y()++; + Point aTo( aRect.BottomLeft() ); + aTo.X()--; + aTo.Y()--; - DecorationView aDecoView( this ); - aDecoView.DrawFrame( aRect, nStyle ); + DecorationView aDecoView( this ); + aDecoView.DrawSeparator( aFrom, aTo ); + } } if ( !ImplIsRecordLayout() ) @@ -693,8 +731,6 @@ void StatusBar::ImplCalcProgressRect() } if( ! bNativeOK ) maPrgsTxtPos.Y() = mnTextY; - - } // ----------------------------------------------------------------------- @@ -1699,7 +1735,8 @@ Size StatusBar::CalcWindowSizePixel() const } } - if( pThis->IsNativeControlSupported( CTRL_FRAME, PART_BORDER ) ) + if( mpImplData->mbDrawItemFrames && + pThis->IsNativeControlSupported( CTRL_FRAME, PART_BORDER ) ) { ImplControlValue aControlValue( FRAME_DRAW_NODRAW ); Region aBound, aContent; |