summaryrefslogtreecommitdiff
path: root/vcl/source/window/msgbox.cxx
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2003-04-17 14:19:21 +0000
committerRüdiger Timm <rt@openoffice.org>2003-04-17 14:19:21 +0000
commit81ac314653e75c2afc0556fc3ccb5c1630e8f5b7 (patch)
treede07d7f03c563b15b936634f967d6fc6ab482f9f /vcl/source/window/msgbox.cxx
parente3da9d0ea8985ad562070f0d2f487248ac5750f3 (diff)
INTEGRATION: CWS vcl08 (1.9.124); FILE MERGED
2003/04/09 16:22:44 ssa 1.9.124.1: #104492# include mnemonic when calculating checkbox size
Diffstat (limited to 'vcl/source/window/msgbox.cxx')
-rw-r--r--vcl/source/window/msgbox.cxx27
1 files changed, 24 insertions, 3 deletions
diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx
index d5b91ad895b9..49a314442703 100644
--- a/vcl/source/window/msgbox.cxx
+++ b/vcl/source/window/msgbox.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: msgbox.cxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: dr $ $Date: 2002-11-22 14:54:44 $
+ * last change: $Author: rt $ $Date: 2003-04-17 15:19:21 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -94,6 +94,9 @@
#ifndef _SV_RC_H
#include <rc.h>
#endif
+#ifndef _SV_MNEMONIC_HXX
+#include <mnemonic.hxx>
+#endif
#pragma hdrstop
@@ -410,15 +413,33 @@ void MessBox::ImplPosControls()
aMinCheckboxSize.Width() += 80;
}
+ // #104492# auto mnemonics for CJK strings may increase the length, so measure the
+ // checkbox length including a temporary mnemonic, the correct auto mnemonic will be
+ // generated later in the dialog (see init_show)
+
+ String aMnemonicString( maCheckBoxText );
+ if( GetSettings().GetStyleSettings().GetAutoMnemonic() )
+ {
+ if( aMnemonicString == GetNonMnemonicString( maCheckBoxText ) )
+ {
+ // no mnemonic found -> create one
+ MnemonicGenerator aMnemonicGenerator;
+ aMnemonicGenerator.CreateMnemonic( aMnemonicString );
+ }
+ }
mpCheckBox = new CheckBox( this );
mpCheckBox->Check( mbCheck );
- mpCheckBox->SetText( maCheckBoxText );
+ mpCheckBox->SetText( aMnemonicString );
mpCheckBox->SetStyle( mpCheckBox->GetStyle() | WB_WORDBREAK );
mpCheckBox->SetHelpId( GetHelpId() ); // DR: Check box and dialog have same HID
// align checkbox with message text
Size aSize = mpCheckBox->CalcMinimumSize( aMinCheckboxSize.Width() );
+
+ // now set the original non-mnemonic string
+ mpCheckBox->SetText( maCheckBoxText );
+
Point aPos( aTextPos );
aPos.Y() += aFixedSize.Height() + (IMPL_DIALOG_OFFSET)+(IMPL_MSGBOX_OFFSET_EXTRA_Y*2);