diff options
author | Philipp Lohmann <pl@openoffice.org> | 2002-05-08 15:05:42 +0000 |
---|---|---|
committer | Philipp Lohmann <pl@openoffice.org> | 2002-05-08 15:05:42 +0000 |
commit | faa4d000678c37095f3af5c6908a191913b243fa (patch) | |
tree | 8e7afece40b6494ae23f7448aaf7231842ade12d | |
parent | e6810eded54de5c81a15217560f7e9b0565bdf45 (diff) |
#98573# discard layout information on resize
-rw-r--r-- | vcl/source/control/button.cxx | 7 | ||||
-rw-r--r-- | vcl/source/control/combobox.cxx | 6 | ||||
-rw-r--r-- | vcl/source/control/ctrl.cxx | 12 | ||||
-rw-r--r-- | vcl/source/control/edit.cxx | 5 | ||||
-rw-r--r-- | vcl/source/control/fixed.cxx | 8 | ||||
-rw-r--r-- | vcl/source/control/group.cxx | 71 | ||||
-rw-r--r-- | vcl/source/control/ilstbox.cxx | 9 | ||||
-rw-r--r-- | vcl/source/control/lstbox.cxx | 6 | ||||
-rw-r--r-- | vcl/source/control/scrbar.cxx | 5 | ||||
-rw-r--r-- | vcl/source/control/slider.cxx | 5 | ||||
-rw-r--r-- | vcl/source/control/spinbtn.cxx | 6 | ||||
-rw-r--r-- | vcl/source/control/spinfld.cxx | 5 |
12 files changed, 95 insertions, 50 deletions
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index e94e66370e0f..b84adc779b04 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -2,9 +2,9 @@ * * $RCSfile: button.cxx,v $ * - * $Revision: 1.14 $ + * $Revision: 1.15 $ * - * last change: $Author: pl $ $Date: 2002-04-29 17:46:18 $ + * last change: $Author: pl $ $Date: 2002-05-08 16:01:30 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1066,6 +1066,7 @@ void PushButton::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, void PushButton::Resize() { + Control::Resize(); Invalidate(); } @@ -2211,6 +2212,7 @@ void RadioButton::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize void RadioButton::Resize() { + Control::Resize(); Invalidate(); } @@ -2988,6 +2990,7 @@ void CheckBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, void CheckBox::Resize() { + Control::Resize(); Invalidate(); } diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index a03355ba8300..6ffd1aa435c4 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -2,9 +2,9 @@ * * $RCSfile: combobox.cxx,v $ * - * $Revision: 1.16 $ + * $Revision: 1.17 $ * - * last change: $Author: pl $ $Date: 2002-05-08 13:24:39 $ + * last change: $Author: pl $ $Date: 2002-05-08 16:01:30 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -616,6 +616,8 @@ void ComboBox::SetPosSizePixel( long nX, long nY, long nWidth, long nHeight, void ComboBox::Resize() { + Control::Resize(); + Size aOutSz = GetOutputSizePixel(); if( IsDropDownBox() ) { diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx index 42e146184a37..1462fc68f294 100644 --- a/vcl/source/control/ctrl.cxx +++ b/vcl/source/control/ctrl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ctrl.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: pl $ $Date: 2002-05-03 13:04:12 $ + * last change: $Author: pl $ $Date: 2002-05-08 16:05:42 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -147,6 +147,14 @@ void Control::LoseFocus() // ----------------------------------------------------------------------- +void Control::Resize() +{ + delete mpLayoutData, mpLayoutData = NULL; + Window::Resize(); +} + +// ----------------------------------------------------------------------- + void Control::FillLayoutData() const { } diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index ffe236e6a104..810745664d43 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -2,9 +2,9 @@ * * $RCSfile: edit.cxx,v $ * - * $Revision: 1.36 $ + * $Revision: 1.37 $ * - * last change: $Author: pl $ $Date: 2002-05-03 13:04:12 $ + * last change: $Author: pl $ $Date: 2002-05-08 16:01:30 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1339,6 +1339,7 @@ void Edit::Resize() { if ( !mpSubEdit && IsReallyVisible() ) { + Control::Resize(); // Wegen vertikaler Zentrierung... mnXOffset = 0; ImplAlign(); diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx index f652925d43ec..677eaadfa5fa 100644 --- a/vcl/source/control/fixed.cxx +++ b/vcl/source/control/fixed.cxx @@ -2,9 +2,9 @@ * * $RCSfile: fixed.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: pl $ $Date: 2002-04-29 17:46:18 $ + * last change: $Author: pl $ $Date: 2002-05-08 16:01:30 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -347,6 +347,7 @@ void FixedText::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, void FixedText::Resize() { + Control::Resize(); Invalidate(); } @@ -626,6 +627,7 @@ void FixedLine::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, void FixedLine::Resize() { + Control::Resize(); Invalidate(); } @@ -852,6 +854,7 @@ void FixedBitmap::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize void FixedBitmap::Resize() { + Control::Resize(); Invalidate(); } @@ -1097,6 +1100,7 @@ void FixedImage::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, void FixedImage::Resize() { + Control::Resize(); Invalidate(); } diff --git a/vcl/source/control/group.cxx b/vcl/source/control/group.cxx index 2124a2cf6012..ac2bf81399c0 100644 --- a/vcl/source/control/group.cxx +++ b/vcl/source/control/group.cxx @@ -2,9 +2,9 @@ * * $RCSfile: group.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:05:36 $ + * last change: $Author: pl $ $Date: 2002-05-08 16:01:30 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -67,6 +67,9 @@ #ifndef _SV_GROUP_HXX #include <group.hxx> #endif +#ifndef _VCL_CONTROLLAYOUT_HXX +#include <controllayout.hxx> +#endif #ifndef _SV_RC_H #include <rc.h> @@ -177,7 +180,7 @@ GroupBox::GroupBox( Window* pParent, const ResId& rResId ) : // ----------------------------------------------------------------------- void GroupBox::ImplDraw( OutputDevice* pDev, ULONG nDrawFlags, - const Point& rPos, const Size& rSize ) + const Point& rPos, const Size& rSize, bool bLayout ) { long nTop; long nTextOff; @@ -223,38 +226,51 @@ void GroupBox::ImplDraw( OutputDevice* pDev, ULONG nDrawFlags, nTextOff = GROUP_TEXT_BORDER; } - if ( nDrawFlags & WINDOW_DRAW_MONO ) - pDev->SetLineColor( Color( COL_BLACK ) ); - else - pDev->SetLineColor( rStyleSettings.GetShadowColor() ); - - if ( !aText.Len() ) - pDev->DrawLine( Point( rPos.X(), nTop ), Point( rPos.X()+rSize.Width()-2, nTop ) ); - else + if( ! bLayout ) { - pDev->DrawLine( Point( rPos.X(), nTop ), Point( aRect.Left()-nTextOff, nTop ) ); - pDev->DrawLine( Point( aRect.Right()+nTextOff, nTop ), Point( rPos.X()+rSize.Width()-2, nTop ) ); - } - pDev->DrawLine( Point( rPos.X(), nTop ), Point( rPos.X(), rPos.Y()+rSize.Height()-2 ) ); - pDev->DrawLine( Point( rPos.X(), rPos.Y()+rSize.Height()-2 ), Point( rPos.X()+rSize.Width()-2, rPos.Y()+rSize.Height()-2 ) ); - pDev->DrawLine( Point( rPos.X()+rSize.Width()-2, rPos.Y()+rSize.Height()-2 ), Point( rPos.X()+rSize.Width()-2, nTop ) ); + if ( nDrawFlags & WINDOW_DRAW_MONO ) + pDev->SetLineColor( Color( COL_BLACK ) ); + else + pDev->SetLineColor( rStyleSettings.GetShadowColor() ); - if ( !(nDrawFlags & WINDOW_DRAW_MONO) ) - { - pDev->SetLineColor( rStyleSettings.GetLightColor() ); if ( !aText.Len() ) - pDev->DrawLine( Point( rPos.X()+1, nTop+1 ), Point( rPos.X()+rSize.Width()-3, nTop+1 ) ); + pDev->DrawLine( Point( rPos.X(), nTop ), Point( rPos.X()+rSize.Width()-2, nTop ) ); else { - pDev->DrawLine( Point( rPos.X()+1, nTop+1 ), Point( aRect.Left()-nTextOff, nTop+1 ) ); - pDev->DrawLine( Point( aRect.Right()+nTextOff, nTop+1 ), Point( rPos.X()+rSize.Width()-3, nTop+1 ) ); + pDev->DrawLine( Point( rPos.X(), nTop ), Point( aRect.Left()-nTextOff, nTop ) ); + pDev->DrawLine( Point( aRect.Right()+nTextOff, nTop ), Point( rPos.X()+rSize.Width()-2, nTop ) ); + } + pDev->DrawLine( Point( rPos.X(), nTop ), Point( rPos.X(), rPos.Y()+rSize.Height()-2 ) ); + pDev->DrawLine( Point( rPos.X(), rPos.Y()+rSize.Height()-2 ), Point( rPos.X()+rSize.Width()-2, rPos.Y()+rSize.Height()-2 ) ); + pDev->DrawLine( Point( rPos.X()+rSize.Width()-2, rPos.Y()+rSize.Height()-2 ), Point( rPos.X()+rSize.Width()-2, nTop ) ); + + if ( !(nDrawFlags & WINDOW_DRAW_MONO) ) + { + pDev->SetLineColor( rStyleSettings.GetLightColor() ); + if ( !aText.Len() ) + pDev->DrawLine( Point( rPos.X()+1, nTop+1 ), Point( rPos.X()+rSize.Width()-3, nTop+1 ) ); + else + { + pDev->DrawLine( Point( rPos.X()+1, nTop+1 ), Point( aRect.Left()-nTextOff, nTop+1 ) ); + pDev->DrawLine( Point( aRect.Right()+nTextOff, nTop+1 ), Point( rPos.X()+rSize.Width()-3, nTop+1 ) ); + } + pDev->DrawLine( Point( rPos.X()+1, nTop+1 ), Point( rPos.X()+1, rPos.Y()+rSize.Height()-3 ) ); + pDev->DrawLine( Point( rPos.X(), rPos.Y()+rSize.Height()-1 ), Point( rPos.X()+rSize.Width()-1, rPos.Y()+rSize.Height()-1 ) ); + pDev->DrawLine( Point( rPos.X()+rSize.Width()-1, rPos.Y()+rSize.Height()-1 ), Point( rPos.X()+rSize.Width()-1, nTop ) ); } - pDev->DrawLine( Point( rPos.X()+1, nTop+1 ), Point( rPos.X()+1, rPos.Y()+rSize.Height()-3 ) ); - pDev->DrawLine( Point( rPos.X(), rPos.Y()+rSize.Height()-1 ), Point( rPos.X()+rSize.Width()-1, rPos.Y()+rSize.Height()-1 ) ); - pDev->DrawLine( Point( rPos.X()+rSize.Width()-1, rPos.Y()+rSize.Height()-1 ), Point( rPos.X()+rSize.Width()-1, nTop ) ); } - pDev->DrawText( aRect, aText, nTextStyle ); + MetricVector* pVector = bLayout ? &mpLayoutData->m_aUnicodeBoundRects : NULL; + String* pDisplayText = bLayout ? &mpLayoutData->m_aDisplayText : NULL; + pDev->DrawText( aRect, aText, nTextStyle, pVector, pDisplayText ); +} + +// ----------------------------------------------------------------------- + +void GroupBox::FillLayoutData() const +{ + mpLayoutData = new vcl::ControlLayoutData(); + const_cast<GroupBox*>(this)-> ImplDraw( const_cast<GroupBox*>(this), 0, Point(), GetOutputSizePixel(), true ); } // ----------------------------------------------------------------------- @@ -290,6 +306,7 @@ void GroupBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, void GroupBox::Resize() { + Control::Resize(); Invalidate(); } diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx index 9e04174470db..865465918641 100644 --- a/vcl/source/control/ilstbox.cxx +++ b/vcl/source/control/ilstbox.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ilstbox.cxx,v $ * - * $Revision: 1.33 $ + * $Revision: 1.34 $ * - * last change: $Author: ssa $ $Date: 2002-05-08 12:50:01 $ + * last change: $Author: pl $ $Date: 2002-05-08 16:05:42 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1717,6 +1717,8 @@ USHORT ImplListBoxWindow::GetDisplayLineCount() const void ImplListBoxWindow::Resize() { + Control::Resize(); + BOOL bShowFocusRect = mbHasFocusRect; if ( bShowFocusRect ) ImplHideFocusRect(); @@ -2012,6 +2014,7 @@ void ImplListBox::GetFocus() void ImplListBox::Resize() { + Control::Resize(); ImplResizeControls(); ImplCheckScrollBars(); } @@ -2535,7 +2538,7 @@ void ImplWin::DrawEntry( BOOL bDrawImage, BOOL bDrawText, BOOL bDrawTextAtImageP void ImplWin::Resize() { - delete mpLayoutData, mpLayoutData = NULL; + Control::Resize(); maFocusRect.SetSize( GetOutputSizePixel() ); Invalidate(); } diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx index 36ace507d04a..911402a4bb62 100644 --- a/vcl/source/control/lstbox.cxx +++ b/vcl/source/control/lstbox.cxx @@ -2,9 +2,9 @@ * * $RCSfile: lstbox.cxx,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: pl $ $Date: 2002-05-08 13:24:39 $ + * last change: $Author: pl $ $Date: 2002-05-08 16:01:30 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -604,6 +604,8 @@ void ListBox::Resize() // weil KEY_PGUP/DOWN ausgewertet wird... if ( mpFloatWin ) mpFloatWin->SetSizePixel( mpFloatWin->CalcFloatSize() ); + + Control::Resize(); } // ----------------------------------------------------------------------- diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx index 2c2b8ce5c51c..a4f46b079407 100644 --- a/vcl/source/control/scrbar.cxx +++ b/vcl/source/control/scrbar.cxx @@ -2,9 +2,9 @@ * * $RCSfile: scrbar.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: mt $ $Date: 2001-11-27 09:54:45 $ + * last change: $Author: pl $ $Date: 2002-05-08 16:01:30 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -919,6 +919,7 @@ void ScrollBar::Paint( const Rectangle& rRect ) void ScrollBar::Resize() { + Control::Resize(); mbCalcSize = TRUE; if ( IsReallyVisible() ) ImplCalc( FALSE ); diff --git a/vcl/source/control/slider.cxx b/vcl/source/control/slider.cxx index 3d8fca3c2501..38d834180d97 100644 --- a/vcl/source/control/slider.cxx +++ b/vcl/source/control/slider.cxx @@ -2,9 +2,9 @@ * * $RCSfile: slider.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:05:36 $ + * last change: $Author: pl $ $Date: 2002-05-08 16:01:30 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -858,6 +858,7 @@ void Slider::Paint( const Rectangle& rRect ) void Slider::Resize() { + Control::Resize(); mbCalcSize = TRUE; if ( IsReallyVisible() ) ImplCalc( FALSE ); diff --git a/vcl/source/control/spinbtn.cxx b/vcl/source/control/spinbtn.cxx index 45b3bd98586f..55063e8b2e78 100644 --- a/vcl/source/control/spinbtn.cxx +++ b/vcl/source/control/spinbtn.cxx @@ -2,9 +2,9 @@ * * $RCSfile: spinbtn.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: mt $ $Date: 2001-11-27 09:54:45 $ + * last change: $Author: pl $ $Date: 2002-05-08 16:01:30 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -166,6 +166,8 @@ void SpinButton::Down() void SpinButton::Resize() { + Control::Resize(); + Size aSize( GetOutputSizePixel() ); Point aTmpPoint; Rectangle aRect( aTmpPoint, aSize ); diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx index 39ea3916fc5f..fd2e8f964f70 100644 --- a/vcl/source/control/spinfld.cxx +++ b/vcl/source/control/spinfld.cxx @@ -2,9 +2,9 @@ * * $RCSfile: spinfld.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: pl $ $Date: 2002-05-03 13:04:12 $ + * last change: $Author: pl $ $Date: 2002-05-08 16:01:30 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -587,6 +587,7 @@ void SpinField::Resize() { if ( mbSpin ) { + Control::Resize(); Size aSize = GetOutputSizePixel(); if ( GetStyle() & (WB_SPIN|WB_DROPDOWN) ) |