diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2008-01-14 12:05:27 +0000 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2008-01-14 12:05:27 +0000 |
commit | 613df5c833bedd16bc4e7053050f49155e4c2cc5 (patch) | |
tree | 5193baea4f6aa7cf375f4296253e95f8a92d05e3 /vcl/source | |
parent | 26b331e95e6dc8aec2f657cc311b1bfb4c146d6c (diff) |
INTEGRATION: CWS awtfixes1 (1.21.66); FILE MERGED
2007/10/31 18:02:00 mmeeks 1.21.66.2: Submitted by: jcn
Reviewed by: mmeeks
More sizing fixes for vcl.
2007/08/17 13:52:57 mmeeks 1.21.66.1: Issue number: i#80754#
Submitted by: mmeeks
Start of virtual method for sizing ...
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/control/fixed.cxx | 48 |
1 files changed, 38 insertions, 10 deletions
diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx index f1a439c4eb08..f14f64bd791d 100644 --- a/vcl/source/control/fixed.cxx +++ b/vcl/source/control/fixed.cxx @@ -4,9 +4,9 @@ * * $RCSfile: fixed.cxx,v $ * - * $Revision: 1.21 $ + * $Revision: 1.22 $ * - * last change: $Author: hr $ $Date: 2007-06-27 20:06:03 $ + * last change: $Author: ihi $ $Date: 2008-01-14 13:05:27 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -400,25 +400,41 @@ void FixedText::DataChanged( const DataChangedEvent& rDCEvt ) // ----------------------------------------------------------------------- -Size FixedText::CalcMinimumSize( long nMaxWidth ) const +Size FixedText::CalcMinimumTextSize( Control const *pControl, long nMaxWidth ) { - USHORT nStyle = ImplGetTextStyle( GetStyle() ); - if ( !( GetStyle() & WB_NOLABEL ) ) + USHORT nStyle = ImplGetTextStyle( pControl->GetStyle() ); + if ( !( pControl->GetStyle() & WB_NOLABEL ) ) nStyle |= TEXT_DRAW_MNEMONIC; - Size aSize = GetTextRect( Rectangle( Point(), Size( (nMaxWidth ? nMaxWidth : 0x7fffffff), 0x7fffffff ) ), - GetText(), nStyle ).GetSize(); + Size aSize = pControl->GetTextRect( Rectangle( Point(), Size( (nMaxWidth ? nMaxWidth : 0x7fffffff), 0x7fffffff ) ), + pControl->GetText(), nStyle ).GetSize(); - if ( GetStyle() & WB_EXTRAOFFSET ) + if ( pControl->GetStyle() & WB_EXTRAOFFSET ) aSize.Width() += 2; // GetTextRect verkraftet keinen leeren String: if ( aSize.Width() < 0 ) aSize.Width() = 0; if ( aSize.Height() <= 0 ) - aSize.Height() = GetTextHeight(); + aSize.Height() = pControl->GetTextHeight(); + + return aSize; +} + +Size FixedText::CalcMinimumSize( long nMaxWidth ) const +{ + return CalcWindowSize( CalcMinimumTextSize ( this, nMaxWidth ) ); +} +// ----------------------------------------------------------------------- - return CalcWindowSize( aSize ); +Size FixedText::GetOptimalSize(WindowSizeType eType) const +{ + switch (eType) { + case WINDOWSIZE_MINIMUM: + return CalcMinimumSize(); + default: + return Control::GetOptimalSize( eType ); + } } // ----------------------------------------------------------------------- @@ -678,6 +694,18 @@ void FixedLine::DataChanged( const DataChangedEvent& rDCEvt ) } } +// ----------------------------------------------------------------------- + +Size FixedLine::GetOptimalSize(WindowSizeType eType) const +{ + switch (eType) { + case WINDOWSIZE_MINIMUM: + return CalcWindowSize( FixedText::CalcMinimumTextSize ( this ) ); + default: + return Control::GetOptimalSize( eType ); + } +} + // ======================================================================= void FixedBitmap::ImplInit( Window* pParent, WinBits nStyle ) |