diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2008-01-14 12:04:30 +0000 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2008-01-14 12:04:30 +0000 |
commit | 4ba173a28086e6dd4c603e50e014ffcb055c20a0 (patch) | |
tree | 8ded78a0d1f8d5031e000e704c4aafb6a9b88eea /vcl/source | |
parent | 937af7e57a9e715955c0b9f2d3074ccf3d9ed30e (diff) |
INTEGRATION: CWS awtfixes1 (1.52.18); FILE MERGED
2007/11/01 20:06:12 jcn 1.52.18.4: Issue number: i#80754#
Submitted by: jcn
Reviewed by: mmeeks
Put PushButton::CalcMinimumSize back. Fixes build.
2007/10/31 18:02:00 mmeeks 1.52.18.3: Submitted by: jcn
Reviewed by: mmeeks
More sizing fixes for vcl.
2007/08/17 14:46:07 mmeeks 1.52.18.2: RESYNC: (1.52-1.54); FILE MERGED
2007/08/17 13:52:57 mmeeks 1.52.18.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/button.cxx | 47 |
1 files changed, 42 insertions, 5 deletions
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 96cc679fc05c..fb3def9d7274 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -4,9 +4,9 @@ * * $RCSfile: button.cxx,v $ * - * $Revision: 1.55 $ + * $Revision: 1.56 $ * - * last change: $Author: kz $ $Date: 2007-12-12 13:19:36 $ + * last change: $Author: ihi $ $Date: 2008-01-14 13:04:30 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -1981,11 +1981,13 @@ Size PushButton::CalcMinimumSize( long nMaxWidth ) const aSize = Size( 12, 12 ); else if ( IsImage() && ! (ImplGetButtonState() & BUTTON_DRAW_NOIMAGE) ) aSize = GetModeImage().GetSizePixel(); - else if ( PushButton::GetText().Len() && ! (ImplGetButtonState() & BUTTON_DRAW_NOTEXT) ) + if ( PushButton::GetText().Len() && ! (ImplGetButtonState() & BUTTON_DRAW_NOTEXT) ) { ULONG nDrawFlags = 0; - aSize = GetTextRect( Rectangle( Point(), Size( nMaxWidth ? nMaxWidth : 0x7fffffff, 0x7fffffff ) ), - PushButton::GetText(), ImplGetTextStyle( nDrawFlags ) ).GetSize(); + Size textSize = GetTextRect( Rectangle( Point(), Size( nMaxWidth ? nMaxWidth : 0x7fffffff, 0x7fffffff ) ), + PushButton::GetText(), ImplGetTextStyle( nDrawFlags ) ).GetSize(); + aSize.Width() += int( textSize.Width () * 1.15 ); + aSize.Height() = std::max( aSize.Height(), long( textSize.Height() * 1.15 ) ); } // cf. ImplDrawPushButton ... @@ -1995,6 +1997,17 @@ Size PushButton::CalcMinimumSize( long nMaxWidth ) const return CalcWindowSize( aSize ); } +Size PushButton::GetOptimalSize(WindowSizeType eType) const +{ + switch (eType) { + case WINDOWSIZE_MINIMUM: { + return CalcMinimumSize(); + } + default: + return Button::GetOptimalSize( eType ); + } +} + // ======================================================================= void OKButton::ImplInit( Window* pParent, WinBits nStyle ) @@ -3255,6 +3268,18 @@ Size RadioButton::CalcMinimumSize( long nMaxWidth ) const return CalcWindowSize( aSize ); } +// ----------------------------------------------------------------------- + +Size RadioButton::GetOptimalSize(WindowSizeType eType) const +{ + switch (eType) { + case WINDOWSIZE_MINIMUM: + return CalcMinimumSize(); + default: + return Button::GetOptimalSize( eType ); + } +} + // ======================================================================= void CheckBox::ImplInitCheckBoxData() @@ -4085,6 +4110,18 @@ Size CheckBox::CalcMinimumSize( long nMaxWidth ) const return CalcWindowSize( aSize ); } +// ----------------------------------------------------------------------- + +Size CheckBox::GetOptimalSize(WindowSizeType eType) const +{ + switch (eType) { + case WINDOWSIZE_MINIMUM: + return CalcMinimumSize(); + default: + return Button::GetOptimalSize( eType ); + } +} + // ======================================================================= ImageButton::ImageButton( WindowType nType ) : |