From 81ac314653e75c2afc0556fc3ccb5c1630e8f5b7 Mon Sep 17 00:00:00 2001 From: RĂ¼diger Timm Date: Thu, 17 Apr 2003 14:19:21 +0000 Subject: 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 --- vcl/source/window/msgbox.cxx | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'vcl/source/window/msgbox.cxx') 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 #endif +#ifndef _SV_MNEMONIC_HXX +#include +#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); -- cgit