summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2003-04-17 14:23:27 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2003-04-17 14:23:27 +0000
commita9e7d0991a8bbab6c33f4b3087dc7edfbb13d10e (patch)
treefb3ef36a21007eb6cfc281092a1a5e4c3b9d6c2e /svtools
parent8098b68e1d7f28b17eaca62286a15af4222dafe3 (diff)
INTEGRATION: CWS vcl08 (1.3.180); FILE MERGED
2003/04/10 13:06:40 pl 1.3.180.1: #108751# better sizing for path dialogue buttons
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/dialogs/filedlg2.cxx36
1 files changed, 29 insertions, 7 deletions
diff --git a/svtools/source/dialogs/filedlg2.cxx b/svtools/source/dialogs/filedlg2.cxx
index 6921c994808c..184b6c536195 100644
--- a/svtools/source/dialogs/filedlg2.cxx
+++ b/svtools/source/dialogs/filedlg2.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: filedlg2.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: pl $ $Date: 2001-09-14 05:14:59 $
+ * last change: $Author: rt $ $Date: 2003-04-17 15:23:27 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -216,7 +216,7 @@ void ImpPathDialog::InitControls()
Size a3Siz = pDlg->LogicToPixel( Size( 3, 3 ), MAP_APPFONT );
Size a6Siz = pDlg->LogicToPixel( Size( 6, 6 ), MAP_APPFONT );
- Size aBtnSiz = pDlg->LogicToPixel( Size( 70, 14 ), MAP_APPFONT );
+ Size aBtnSiz = pDlg->LogicToPixel( Size( 50, 14 ), MAP_APPFONT );
Size aFTSiz = pDlg->LogicToPixel( Size( 142, 10 ), MAP_APPFONT );
Size aEDSiz = pDlg->LogicToPixel( Size( 142, 12 ), MAP_APPFONT );
Point aPnt( a6Siz.Width(), a6Siz.Height() );
@@ -252,20 +252,42 @@ void ImpPathDialog::InitControls()
pDriveList = NULL;
#endif
+ long nExtraWidth = pDlg->GetTextWidth( String( RTL_CONSTASCII_USTRINGPARAM( "(W)" ) ) )+10;
+ String aOkStr = Button::GetStandardText( BUTTON_OK );
+ long nTextWidth = pDlg->GetTextWidth( aOkStr )+nExtraWidth;
+ if( nTextWidth > aBtnSiz.Width() )
+ aBtnSiz.Width() = nTextWidth;
+
+ String aCancelStr = Button::GetStandardText( BUTTON_CANCEL );
+ nTextWidth = pDlg->GetTextWidth( aCancelStr )+nExtraWidth;
+ if( nTextWidth > aBtnSiz.Width() )
+ aBtnSiz.Width() = nTextWidth;
+
+ String aNewDirStr( SvtResId( STR_FILEDLG_NEWDIR ) );
+ nTextWidth = pDlg->GetTextWidth( aNewDirStr )+nExtraWidth;
+ if( nTextWidth > aBtnSiz.Width() )
+ aBtnSiz.Width() = nTextWidth;
+#ifdef UNX
+ String aHomeDirStr( SvtResId( STR_FILEDLG_HOME ) );
+ nTextWidth = pDlg->GetTextWidth( aHomeDirStr )+nExtraWidth;
+ if( nTextWidth > aBtnSiz.Width() )
+ aBtnSiz.Width() = nTextWidth;
+#endif
+
aPnt.X() = 2 * a6Siz.Width() + aEDSiz.Width();
aPnt.Y() = a6Siz.Height();
INITCONTROL( pOkBtn, PushButton, WB_DEFBUTTON,
- aPnt, aBtnSiz, Button::GetStandardText( BUTTON_OK ), 0 );
+ aPnt, aBtnSiz, aOkStr, 0 );
aPnt.Y() += aBtnSiz.Height() + a3Siz.Height();
INITCONTROL( pCancelBtn, CancelButton, 0,
- aPnt, aBtnSiz, Button::GetStandardText( BUTTON_CANCEL ), 0 );
+ aPnt, aBtnSiz, aCancelStr, 0 );
aPnt.Y() += aBtnSiz.Height() + a3Siz.Height();
INITCONTROL( pNewDirBtn, PushButton, WB_DEFBUTTON,
- aPnt, aBtnSiz, UniString( SvtResId( STR_FILEDLG_NEWDIR ) ), HID_FILEDLG_NEWDIR );
+ aPnt, aBtnSiz, aNewDirStr, HID_FILEDLG_NEWDIR );
#ifdef UNX
aPnt.Y() += aBtnSiz.Height() + a3Siz.Height();
INITCONTROL( pHomeBtn, PushButton, WB_DEFBUTTON,
- aPnt, aBtnSiz, UniString( SvtResId( STR_FILEDLG_HOME ) ), HID_FILEDLG_HOME );
+ aPnt, aBtnSiz, aHomeDirStr, HID_FILEDLG_HOME );
#else
pHomeBtn = NULL;
#endif