Commits

Anonymous committed ee4b7cf

#i115372# - Some resource string changes, fixed file dialog resize.

  • Participants
  • Parent commits dac2aed

Comments (0)

Files changed (3)

fpicker/source/office/OfficeFilePicker.src

 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2000, 2010 Oracle and/or its affiliates.
  *
  * OpenOffice.org - a multi-platform office productivity suite
 
 String STR_SVT_FILEPICKER_VERSION
 {
-    Text [ en-US ] = "~Version:";
+    Text [ en-US ] = "~Version";
 };
 
 String STR_SVT_FILEPICKER_TEMPLATES
 {
-    Text [ en-US ] = "S~tyles:" ;
+    Text [ en-US ] = "S~tyles" ;
 };
 
 String STR_SVT_FILEPICKER_IMAGE_TEMPLATE
 {
-	Text [ en-US ] = "Style:";
+    Text [ en-US ] = "Style";
 };
 
 String STR_SVT_FILEPICKER_SELECTION
 
 String STR_SVT_FILEPICKER_FILTER_TITLE
 {
-    Text [ en-US ] = "File ~type:" ;
+    Text [ en-US ] = "File ~type" ;
 };
 
 String STR_SVT_FILEPICKER_PLACES
 {
-	Text [ en-US ] = "Places";
+    Text [ en-US ] = "Places";
 };
 
 String STR_SVT_FOLDERPICKER_DEFAULT_TITLE
 {
-	Text [ en-US ] = "Select Path" ;
+    Text [ en-US ] = "Select Path" ;
 };
 
 String STR_SVT_FOLDERPICKER_DEFAULT_DESCRIPTION
 {
-	Text [ en-US ] = "Please select a folder.";
+    Text [ en-US ] = "Please select a folder.";
 };

fpicker/source/office/iodlg.cxx

     _pFileView = new SvtFileView( this, SvtResId( CTL_EXPLORERFILE_FILELIST ),
                                        FILEDLG_TYPE_PATHDLG == _pImp->_eDlgType,
                                        _pImp->_bMultiSelection );
-    Size aFileViewSize = _pFileView->GetOutputSizePixel();
-    Point aFileViewPos = _pFileView->GetPosPixel();
 
     _pFileView->SetUrlFilter( &m_aURLFilter );
     _pFileView->EnableAutoResize();
     _pFileView->SetStyle( _pFileView->GetStyle() | WB_TABSTOP );
 
     // Positionen und Groessen der Knoepfe bestimmen.
-    Image aNewFolderImg( GetButtonImage( IMG_FILEDLG_CREATEFOLDER ) );
+    const Image aNewFolderImg( GetButtonImage( IMG_FILEDLG_CREATEFOLDER ) );
     _pImp->_pBtnNewFolder->SetModeImage( aNewFolderImg );
 
-    Size aSize( aNewFolderImg.GetSizePixel() );
-    aSize.Width() += FILEDIALOG_DEF_IMAGEBORDER;
-    aSize.Height() += FILEDIALOG_DEF_IMAGEBORDER;
-    _pImp->_pBtnNewFolder->SetSizePixel( aSize );
-    _pImp->_pBtnUp->SetSizePixel( aSize );
-    _pImp->_pBtnBack->SetSizePixel( aSize );
-    _pImp->_pBtnForward->SetSizePixel( aSize );
-
-    Size aDlgSize = GetOutputSizePixel();
+    Size aToolbarButtonSize( aNewFolderImg.GetSizePixel() );
+    aToolbarButtonSize.Width() += FILEDIALOG_DEF_IMAGEBORDER;
+    aToolbarButtonSize.Height() += FILEDIALOG_DEF_IMAGEBORDER;
+
+    _pImp->_pBtnNewFolder->SetSizePixel( aToolbarButtonSize );
+    _pImp->_pBtnUp->SetSizePixel( aToolbarButtonSize );
+    _pImp->_pBtnBack->SetSizePixel( aToolbarButtonSize );
+    _pImp->_pBtnForward->SetSizePixel( aToolbarButtonSize );
+
     long n6AppFontInPixel =
             LogicToPixel( Size( 6, 0 ), MAP_APPFONT ).Width();
     long n3AppFontInPixel =
             LogicToPixel( Size( 3, 0 ), MAP_APPFONT ).Width();
 
     // calculate the length of all buttons
-    const sal_uInt16 nBtnCount = 4; // "previous level", "new folder", "back", "forward"
+    const sal_uInt16 TOOLBAR_BUTTON_COUNT = 4; // "previous level", "new folder", "back", "forward"
     long nDelta = n6AppFontInPixel; // right border
-    nDelta += ( nBtnCount * aSize.Width() ); // button count * button width
-    nDelta += ( nBtnCount * n3AppFontInPixel );
-
-    String aTitle( SvtResId( STR_SVT_FILEPICKER_PLACES ) );
+    nDelta += ( TOOLBAR_BUTTON_COUNT * aToolbarButtonSize.Width() ); // button count * button width
+    nDelta += ( TOOLBAR_BUTTON_COUNT * n3AppFontInPixel );
+
+    Size aDlgSize( GetOutputSizePixel() );
+    Point aPos( aDlgSize.Width() - nDelta, _pImp->_pBtnUp->GetPosPixel().Y() );
+    Size aCurPathSize( aPos.X() - n6AppFontInPixel,
+                       _pImp->_pFtCurrentPath->GetOutputSizePixel().Height() );
+    _pImp->_pFtCurrentPath->SetOutputSizePixel( aCurPathSize );
+
+    Size aFileViewSize( _pFileView->GetOutputSizePixel() );
+    const Point aFileViewPos( _pFileView->GetPosPixel() );
+
+    const String aTitle( SvtResId( STR_SVT_FILEPICKER_PLACES ) );
     _pPlacesWin = new fpicker::office::PlacesWindow( this, aTitle, &m_aURLFilter );
     m_bHasPlaces = _pPlacesWin->GetEntryCount() > 0;
 
-    long nXOffset = 0;
-    long nXPlacesOffset = 0;
+    const long PLACES_DEFAULT_WIDTH = 120;
 
     if ( m_bHasPlaces )
     {
         _pPlacesWin->SetClickHdl( LINK( this, SvtFileDialog, PlacesIconClickHdl_Impl ) );
 
-        Size aNewDlgSize( GetOutputSizePixel() );
-        aNewDlgSize.Width() += nXOffset + 120 + 3;
-        SetOutputSizePixel( aNewDlgSize );
+        aDlgSize.Width() += PLACES_DEFAULT_WIDTH;
+        SetOutputSizePixel( aDlgSize );
+        aFileViewSize.Width() += PLACES_DEFAULT_WIDTH;
+        aPos.X() += PLACES_DEFAULT_WIDTH;
     }
 
-    Point aPos( aDlgSize.Width() - nDelta + nXOffset,
-                _pImp->_pBtnUp->GetPosPixel().Y() );
-    Size aCurPathSize( aPos.X() - n6AppFontInPixel,
-                       _pImp->_pFtCurrentPath->GetOutputSizePixel().Height() );
-    aPos.X() += nXPlacesOffset;
-    _pImp->_pFtCurrentPath->SetOutputSizePixel( aCurPathSize );
     _pImp->_pBtnBack->SetPosPixel( aPos );
-    aPos.X() += aSize.Width();
+    aPos.X() += aToolbarButtonSize.Width();
     aPos.X() += n3AppFontInPixel;
     _pImp->_pBtnForward->SetPosPixel( aPos );
-    aPos.X() += aSize.Width();
+    aPos.X() += aToolbarButtonSize.Width();
     aPos.X() += n3AppFontInPixel;
     _pImp->_pBtnUp->SetPosPixel( aPos );
-    aPos.X() += aSize.Width();
+    aPos.X() += aToolbarButtonSize.Width();
     aPos.X() += n3AppFontInPixel;
     _pImp->_pBtnNewFolder->SetPosPixel( aPos );
 
-    nDelta = aSize.Height();
+    nDelta = aToolbarButtonSize.Height();
     nDelta -= aCurPathSize.Height();
     nDelta /= 2;
-    Point aCurPathPos = _pImp->_pFtCurrentPath->GetPosPixel();
+    Point aCurPathPos( _pImp->_pFtCurrentPath->GetPosPixel() );
     aCurPathPos.Y() += nDelta;
     _pImp->_pFtCurrentPath->SetPosPixel( aCurPathPos );
 
 
     // Zahl der Pixel bestimmen, um die die anderen Elemente in der Position
     // Angepasst werden muessen.
-    aPos.Y() += aSize.Height();
+    aPos.Y() += aToolbarButtonSize.Height();
     aPos.Y() += LogicToPixel( Size( 0, 6 ), MAP_APPFONT ).Height();
     long nYOffset = aPos.Y();
     aPos = aFileViewPos;
     nYOffset -= aPos.Y();
 
     // Positionen der uebrigen Elemente anpassen.
-    aPos.X() += nXOffset;
     aPos.Y() += nYOffset;
     m_aSplitWin.SetPosPixel( aPos );
     m_aSplitWin.SetSizePixel( aFileViewSize );
 
-    lcl_MoveControl( _pImp->_pFtFileName, nXOffset, nYOffset );
-    lcl_MoveControl( _pImp->_pEdFileName, nXOffset, nYOffset );
-
-    lcl_MoveControl( _pImp->_pFtFileVersion, nXOffset, nYOffset );
-    lcl_MoveControl( _pImp->_pLbFileVersion, nXOffset, nYOffset );
-
-    lcl_MoveControl( _pImp->_pFtTemplates, nXOffset, nYOffset );
-    lcl_MoveControl( _pImp->_pLbTemplates, nXOffset, nYOffset );
-
-    lcl_MoveControl( _pImp->_pFtImageTemplates, nXOffset, nYOffset );
-    lcl_MoveControl( _pImp->_pLbImageTemplates, nXOffset, nYOffset );
-
-    lcl_MoveControl( _pImp->_pFtFileType, nXOffset, nYOffset );
-    lcl_MoveControl( _pImp->GetFilterListControl(), nXOffset, nYOffset );
+    lcl_MoveControl( _pImp->_pFtFileName, 0, nYOffset );
+    lcl_MoveControl( _pImp->_pEdFileName, 0, nYOffset );
+
+    lcl_MoveControl( _pImp->_pFtFileVersion, 0, nYOffset );
+    lcl_MoveControl( _pImp->_pLbFileVersion, 0, nYOffset );
+
+    lcl_MoveControl( _pImp->_pFtTemplates, 0, nYOffset );
+    lcl_MoveControl( _pImp->_pLbTemplates, 0, nYOffset );
+
+    lcl_MoveControl( _pImp->_pFtImageTemplates, 0, nYOffset );
+    lcl_MoveControl( _pImp->_pLbImageTemplates, 0, nYOffset );
+
+    lcl_MoveControl( _pImp->_pFtFileType, 0, nYOffset );
+    lcl_MoveControl( _pImp->GetFilterListControl(), 0, nYOffset );
+
+    long nXOffset = 0;
+    if ( m_bHasPlaces )
+        nXOffset += PLACES_DEFAULT_WIDTH;
 
     lcl_MoveControl( _pImp->_pBtnFileOpen, nXOffset, nYOffset );
     lcl_MoveControl( _pImp->_pBtnCancel, nXOffset, nYOffset );
     lcl_MoveControl( _pImp->_pBtnHelp, nXOffset, nYOffset + 3 );
         // a little more spacing between Cancel- and HelpButton
 
+    if ( m_bHasPlaces )
+        implChangeControlWidth( PLACES_DEFAULT_WIDTH );
+
     // Groesse des Dialoges anpassen.
-    aSize = GetSizePixel();
+    Size aSize( GetSizePixel() );
     aSize.Height() += nYOffset;
     SetSizePixel( aSize );
 
     {
         _pImp->_pFtCurrentPath,
         _pImp->_pBtnBack, _pImp->_pBtnForward, _pImp->_pBtnUp, _pImp->_pBtnNewFolder,        // image buttons
-        _pFileView,                                                         // the file view
+        _pPlacesWin, _pFileView,                                                         // the file view
         _pImp->_pFtFileName, _pImp->_pEdFileName,
         _pImp->_pFtFileVersion, _pImp->_pLbFileVersion,
         _pImp->_pFtTemplates, _pImp->_pLbTemplates,
     if ( IsRollUp() )
         return;
 
-    Size aDlgSize = GetResizeOutputSizePixel();
-    Size aOldSize = _pImp->_aDlgSize;
+    Size aDlgSize( GetResizeOutputSizePixel() );
+    Size aOldSize( _pImp->_aDlgSize );
     _pImp->_aDlgSize = aDlgSize;
     long nWinDeltaW = 0;
 
     if ( _pPrevWin &&
          _pPrevWin->GetPosPixel().X() > m_aSplitWin.GetPosPixel().X() )
-    {
-        nWinDeltaW = m_aSplitWin.GetOutputSizePixel().Width() + _pImp->_a6Size.Width();
-    }
-
-    Size aNewSize = m_aSplitWin.GetSizePixel();
-    Point aBoxPos = m_aSplitWin.GetPosPixel();
-    long nDeltaY = aNewSize.Height();
-    long nDeltaX = aNewSize.Width();
+        nWinDeltaW = _pPrevWin->GetOutputSizePixel().Width() + _pImp->_a6Size.Width();
+
+    Size aNewSize( m_aSplitWin.GetSizePixel() );
+    Point aBoxPos( m_aSplitWin.GetPosPixel() );
+    long nDeltaY( aNewSize.Height() );
+    long nDeltaX( aNewSize.Width() );
     aNewSize.Height() = aDlgSize.Height() - _pImp->_nFixDeltaHeight;
     aNewSize.Width() = aDlgSize.Width() - aBoxPos.X() - _pImp->_a6Size.Width() - nWinDeltaW;
+
     if ( aOldSize.Height() )
         nDeltaY = _pImp->_aDlgSize.Height() - aOldSize.Height();
     else
         nDeltaY = aNewSize.Height() - nDeltaY;
+
     nDeltaX = aNewSize.Width() - nDeltaX;
 
     if ( nWinDeltaW )
         nWinDeltaW = nDeltaX * 2 / 3;
+
     aNewSize.Width() -= nWinDeltaW;
     nDeltaX -= nWinDeltaW;
 
 
     // zus"atzliche Controls ausrichten
     if ( _pPrevWin &&
-         _pPrevWin->GetPosPixel().X() > _pFileView->GetPosPixel().X() )
+         _pPrevWin->GetPosPixel().X() > m_aSplitWin.GetPosPixel().X() )
     {
         // Controls vom Typ Window speziell ausrichten
         // auch die Gr"osse anpassen
-        Point aNewPos = _pPrevWin->GetPosPixel();
+        Point aNewPos( _pPrevWin->GetPosPixel() );
         aNewPos.X() += nDeltaX;
         _pPrevWin->SetPosPixel( aNewPos );
         _pPrevBmp->SetPosPixel( aNewPos );

fpicker/source/office/iodlg.src

     {
         Pos = MAP_APPFONT ( 6 , 178 ) ;
         Size = MAP_APPFONT ( 50 , 10 ) ;
-        Text [ en-US ] = "File ~name:" ;
+        Text [ en-US ] = "File ~name" ;
     };
     Edit ED_EXPLORERFILE_FILENAME
     {
     {
         Pos = MAP_APPFONT ( 6 , 208 ) ;
         Size = MAP_APPFONT ( 50 , 10 ) ;
-        Text [ en-US ] = "File ~type:" ;
+        Text [ en-US ] = "File ~type" ;
     };
     ListBox LB_EXPLORERFILE_FILETYPE
     {
     };
     String STR_PATHNAME
     {
-        Text [ en-US ] = "~Path:" ;
+        Text [ en-US ] = "~Path" ;
     };
     String STR_PATHSELECT
     {