diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2008-01-14 12:04:59 +0000 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2008-01-14 12:04:59 +0000 |
commit | b2111cded7ea6bd3371a0c72db94d5831d108715 (patch) | |
tree | e7f9e1d226d7fb0737ef18bdc05235d1ae6de8a6 /vcl/source | |
parent | 9da73c7554506a6c5c0a7d11d270c4a850deb146 (diff) |
INTEGRATION: CWS awtfixes1 (1.23.66); FILE MERGED
2007/08/17 13:52:57 mmeeks 1.23.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/ctrl.cxx | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx index 5992de2a1ce4..8429e24320d9 100644 --- a/vcl/source/control/ctrl.cxx +++ b/vcl/source/control/ctrl.cxx @@ -4,9 +4,9 @@ * * $RCSfile: ctrl.cxx,v $ * - * $Revision: 1.23 $ + * $Revision: 1.24 $ * - * last change: $Author: hr $ $Date: 2007-06-27 20:04:56 $ + * last change: $Author: ihi $ $Date: 2008-01-14 13:04:59 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -470,3 +470,19 @@ ControlLayoutData::~ControlLayoutData() if( m_pParent ) m_pParent->ImplClearLayoutData(); } + +// ----------------------------------------------------------------- + +Size Control::GetOptimalSize(WindowSizeType eType) const +{ + switch (eType) { + case WINDOWSIZE_MINIMUM: + return Size( GetTextWidth( GetText() ) + 2 * 12, + GetTextHeight() + 2 * 6 ); + case WINDOWSIZE_PREFERRED: + return GetOptimalSize( WINDOWSIZE_MINIMUM ); + case WINDOWSIZE_MAXIMUM: + default: + return Size( LONG_MAX, LONG_MAX ); + } +} |