Commits

Anonymous committed 908d740

kso47:#i115372# Added places window and split window to the file open dialog

Comments (0)

Files changed (9)

fpicker/source/office/iodlg.cxx

     ,_pImp( new SvtExpFileDlg_Impl( nBits ) )
     ,_nExtraBits( nExtraBits )
     ,_bIsInExecute( FALSE )
+    ,m_aSplitWin( this, WB_DIALOGCONTROL | WB_CLIPCHILDREN )
     ,m_bInExecuteAsync( false )
     ,m_bHasFilename( false )
     ,m_bHasPlaces( false )
     ,_pImp( new SvtExpFileDlg_Impl( nBits ) )
     ,_nExtraBits( 0L )
     ,_bIsInExecute( FALSE )
+    ,m_aSplitWin( this, WB_DIALOGCONTROL | WB_CLIPCHILDREN )
     ,m_bHasFilename( false )
     ,m_bHasPlaces( false )
 {
     delete _pPrevBmp;
 
     delete _pUserControls;
-
     delete _pPlacesWin;
 }
 
     _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->SetHelpId( HID_FILEDLG_STANDARD );
     _pFileView->SetStyle( _pFileView->GetStyle() | WB_TABSTOP );
 
 
     if ( m_bHasPlaces )
     {
-        // @@@ KSO: hardcoded sizes etc.!!!
-        _pPlacesWin->SetSizePixel(
-            Size( 120,
-                  _pFileView->GetSizePixel().Height() ) );
-        _pPlacesWin->SetPosPixel(
-            Point( _pFileView->GetPosPixel().X() - 3,
-                   _pFileView->GetPosPixel().Y() - 3 ) );
-        _pPlacesWin->SetClickHdl(
-            LINK( this, SvtFileDialog, PlacesIconClickHdl_Impl ) );
-
-        nXPlacesOffset = _pPlacesWin->GetSizePixel().Width();
+        _pPlacesWin->SetClickHdl( LINK( this, SvtFileDialog, PlacesIconClickHdl_Impl ) );
 
         Size aNewDlgSize( GetOutputSizePixel() );
-        aNewDlgSize.Width() += nXOffset + nXPlacesOffset + 3;
+        aNewDlgSize.Width() += nXOffset + 120 + 3;
         SetOutputSizePixel( aNewDlgSize );
     }
 
     aPos.Y() += aSize.Height();
     aPos.Y() += LogicToPixel( Size( 0, 6 ), MAP_APPFONT ).Height();
     long nYOffset = aPos.Y();
-    aPos = _pFileView->GetPosPixel();
+    aPos = aFileViewPos;
     nYOffset -= aPos.Y();
 
     // Positionen der uebrigen Elemente anpassen.
-    aPos.X() += nXOffset + nXPlacesOffset;
+    aPos.X() += nXOffset;
     aPos.Y() += nYOffset;
-    _pFileView->SetPosPixel( aPos );
+    m_aSplitWin.SetPosPixel( aPos );
+    m_aSplitWin.SetSizePixel( aFileViewSize );
 
     lcl_MoveControl( _pImp->_pFtFileName, nXOffset, nYOffset );
     lcl_MoveControl( _pImp->_pEdFileName, nXOffset, nYOffset );
         if ( _pCbSelection ) _pCbSelection->SetHelpId( HID_FILESAVE_SELECTION );
     }
 
-    if ( m_bHasPlaces )
-    {
-        // move, resize controls wrt places window
-        implChangeControlWidth( nXPlacesOffset );
-
-        lcl_MoveControl( _pImp->_pBtnFileOpen, nXPlacesOffset, 0 );
-        lcl_MoveControl( _pImp->_pBtnCancel, nXPlacesOffset, 0 );
-        lcl_MoveControl( _pImp->_pBtnHelp, nXPlacesOffset, 0 );
-
-        // show places window
-        _pPlacesWin->Show();
-    }
-
     // correct the z-order of the controls
     implArrangeControls();
 
+    m_aSplitWin.SetAlign( WINDOWALIGN_LEFT );
+    if ( m_bHasPlaces )
+        m_aSplitWin.InsertItem( 1, _pPlacesWin, 20, SPLITWINDOW_APPEND, 0, SWIB_PERCENTSIZE );
+	m_aSplitWin.InsertItem( 2, _pFileView, 80, SPLITWINDOW_APPEND, 0, SWIB_PERCENTSIZE );
+	m_aSplitWin.Show();
+    
     // special URLs, such as favourites and "restricted" paths
     implInitializeSpecialURLLists( );
 
     if ( !_pImp->_nFixDeltaHeight )
     {
         // Fixgr"ossen errechnen und merken
-        Point aPnt = _pFileView->GetPosPixel();
-        long nBoxH = _pFileView->GetSizePixel().Height();
+        long nBoxH = m_aSplitWin.GetSizePixel().Height();
         long nH = GetSizePixel().Height();
         _pImp->_nFixDeltaHeight = nH - nBoxH;
     }
     long nWinDeltaW = 0;
 
     if ( _pPrevWin &&
-         _pPrevWin->GetPosPixel().X() > _pFileView->GetPosPixel().X() )
+         _pPrevWin->GetPosPixel().X() > m_aSplitWin.GetPosPixel().X() )
     {
-        nWinDeltaW = _pPrevWin->GetOutputSizePixel().Width() + _pImp->_a6Size.Width();
+        nWinDeltaW = m_aSplitWin.GetOutputSizePixel().Width() + _pImp->_a6Size.Width();
     }
 
-    Size aNewSize = _pFileView->GetSizePixel();
-    Point aBoxPos( _pFileView->GetPosPixel() );
+    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() -= nWinDeltaW;
     nDeltaX -= nWinDeltaW;
 
-    _pFileView->SetSizePixel( aNewSize );
-
-    if ( m_bHasPlaces )
-        _pPlacesWin->SetSizePixel(
-            Size( _pPlacesWin->GetSizePixel().Width(),
-                  _pFileView->GetSizePixel().Height()) );
+    m_aSplitWin.SetSizePixel( aNewSize );
 
     if ( !nDeltaY && !nDeltaX )
         // Dieses Resize wurde nur zum Ein - oder Ausblenden des Indicators aufgerufen

fpicker/source/office/iodlg.hxx

 #ifndef _IODLGIMPL_HXX
 #define _IODLGIMPL_HXX
 
-#ifndef _VCL_DIALOG_HXX
 #include <vcl/dialog.hxx>
-#endif
-#ifndef _SV_BUTTON_HXX
 #include <vcl/button.hxx>
-#endif
 #include <vcl/fixed.hxx>
 #include <vcl/edit.hxx>
 #include <vcl/combobox.hxx>
 #include <vcl/lstbox.hxx>
+#include <vcl/splitwin.hxx>
+
 #include <com/sun/star/beans/StringPair.hpp>
 #include <com/sun/star/uno/Any.hxx>
 #include <com/sun/star/uno/Sequence.hxx>
     ::com::sun::star::uno::Reference<
         ::com::sun::star::ui::dialogs::XDialogClosedListener >
                                 m_xListener;
+
+    SplitWindow                 m_aSplitWin;
     bool                        m_bInExecuteAsync;
     bool                        m_bHasFilename;
     bool                        m_bHasPlaces;
     DECL_LINK( AutoExtensionHdl_Impl, CheckBox* );
     DECL_LINK( ClickHdl_Impl, CheckBox* );
     DECL_LINK( PlayButtonHdl_Impl, PushButton* );
-    DECL_LINK ( PlacesIconClickHdl_Impl, SvtIconChoiceCtrl* );
+    DECL_LINK( PlacesIconClickHdl_Impl, SvtIconChoiceCtrl* );
 
     // entfernt einen Filter mit Wildcards aus dem Path und gibt in zurueck
     BOOL IsolateFilterFromPath_Impl( String& rPath, String& rFilter );
Add a comment to this file

fpicker/source/office/iodlg.src

File contents unchanged.

fpicker/source/office/place.cxx

  *
  ************************************************************************/
 
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_fpicker.hxx"
+
 #include "place.hxx"
 
 #include "rtl/uri.hxx"

fpicker/source/office/placeswin.cxx

  *
  ************************************************************************/
 
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_fpicker.hxx"
+
 #include "placeswin.hxx"
 #include "place.hxx"
 
 #include "comphelper/processfactory.hxx"
 #include "unotools/ucbstreamhelper.hxx"
 #include "svtools/filter.hxx"
+#include "svtools/headbar.hxx"
 #include "vcl/mnemonic.hxx"
 #include "vcl/graph.hxx"
 
 // @@@ KSO! - svtools resources!
-#ifndef _SVTOOLS_HRC
-#include <svtools/svtools.hrc>
-#endif
+#include "svtools/svtools.hrc"
 
 // KSO! - wg. svt resource hack
 #include "rtl/instance.hxx"
 
 using namespace com::sun::star;
 
+#define UNISTRING(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s))
+
 namespace
 {
     struct ResMgrHolder
 
 PlacesWindow::PlacesWindow( Window* pParent ) :
 
-    Window( pParent, WB_DIALOGCONTROL | WB_BORDER | WB_3DLOOK ),
+    Control( pParent, WB_DIALOGCONTROL | WB_BORDER ),
 
     // @@@ KSO: Bug: WB_NODRAGSELECTION sets WB_NOVSCROLL!
-    aIconCtrl( this, WB_ICON | WB_NOCOLUMNHEADER | WB_HIGHLIGHTFRAME | /*!WB_NOSELECTION |*/
-               /*WB_NODRAGSELECTION |*/ WB_TABSTOP | WB_CLIPCHILDREN | WB_NOHSCROLL )
+//    aIconCtrl( this, WB_DETAILS | WB_NOCOLUMNHEADER | WB_HIGHLIGHTFRAME | /*!WB_NOSELECTION |*/
+    aIconCtrl( this, WB_DETAILS | WB_HIGHLIGHTFRAME | /*!WB_NOSELECTION |*/
+               /*WB_NODRAGSELECTION |*/ WB_TABSTOP | WB_NOHSCROLL | WB_NOBORDER ),
+    m_pHeaderBar( NULL )
 {
     aIconCtrl.SetAccessibleName( String( RTL_CONSTASCII_USTRINGPARAM( "Places" ) ) );
     // @@@ KSO: no hid! aIconCtrl.SetHelpId( HID_FILEDLG_PLACESCTRL );
     Image aFolderImage( SvtResId( bHiContrast ? IMG_SVT_FOLDER_HC : IMG_SVT_FOLDER ) );
     Image aDocImage( SvtResId( bHiContrast ? IMG_SVT_NEWDOC_HC : IMG_SVT_NEWDOC ) );
 
-    Size aIconSize( 32, 32 );
+    Size aIconSize( 16, 16 );
+
+    Size aImageSize = aFolderImage.GetSizePixel();
+    if ( ( aImageSize.Width() > aIconSize.Width() ) || (( aImageSize.Height() > aIconSize.Height() )) )
+    {
+        BitmapEx aBitmapEx = aFolderImage.GetBitmapEx();
+        aBitmapEx.Scale( aIconSize, BMP_SCALE_INTERPOLATE );
+        aFolderImage = Image( aBitmapEx );
+    }
+    aImageSize = aDocImage.GetSizePixel();
+    if ( ( aImageSize.Width() > aIconSize.Width() ) || (( aImageSize.Height() > aIconSize.Height() )) )
+    {
+        BitmapEx aBitmapEx = aDocImage.GetBitmapEx();
+        aBitmapEx.Scale( aIconSize, BMP_SCALE_INTERPOLATE );
+        aDocImage = Image( aBitmapEx );
+    }
 
     SvtPathOptions aPathOpts;
 
         it++;
     }
     aIconCtrl.CreateAutoMnemonics();
+    initHeaderbar( pParent );
 }
 
 PlacesWindow::~PlacesWindow()
         SvxIconChoiceCtrlEntry* pEntry = aIconCtrl.GetEntry( i );
         delete (String*)pEntry->GetUserData();
     }
+    delete m_pHeaderBar;
 }
 
 SvxIconChoiceCtrlEntry* PlacesWindow::GetEntry( const String& rURL ) const
 
 void PlacesWindow::Resize()
 {
-    aIconCtrl.SetSizePixel( GetOutputSizePixel() );
+    Size aNewSize = GetOutputSizePixel();
+    Size aHeadSize = m_pHeaderBar->GetSizePixel();
+
+    m_pHeaderBar->SetSizePixel( Size( aNewSize.Width(), aHeadSize.Height() ) );
+    aIconCtrl.SetPosSizePixel( Point( 0, aHeadSize.Height() ),
+                               Size( aNewSize.Width(), aNewSize.Height() - aHeadSize.Height() ) );
     aIconCtrl.ArrangeIcons();
 }
 
     }
 }
 
+// ------------------------------------------------------------------------
+void PlacesWindow::initHeaderbar( Window *pParent )
+{
+    m_pHeaderBar = new HeaderBar( this, WB_BUTTONSTYLE | WB_BOTTOMBORDER );
+
+    m_pHeaderBar->SetPosSizePixel( Point( 0, 0 ), m_pHeaderBar->CalcWindowSizePixel() );
+    m_pHeaderBar->InsertItem( 1, UNISTRING( "Places" ), 600, HIB_LEFT | HIB_VCENTER );
+
+    Size aHeadSize = m_pHeaderBar->GetSizePixel();
+    Size aPlacesSize = aIconCtrl.GetSizePixel();
+    aIconCtrl.SetPosSizePixel( Point( 0, aHeadSize.Height() ),
+                               Size( aPlacesSize.Width(), aPlacesSize.Height() - aHeadSize.Height() ) );
+    m_pHeaderBar->Show();
+}
+
 //=========================================================================
 // static
 bool PlacesWindow::getImageFromURL(

fpicker/source/office/placeswin.hxx

 #include <vcl/window.hxx>
 #include <svtools/ivctrl.hxx>
 
+class HeaderBar;
+
 namespace fpicker { namespace office {
 
-class PlacesWindow : public Window
+class PlacesWindow : public Control
 {
 private:
-    SvtIconChoiceCtrl aIconCtrl;
+    SvtIconChoiceCtrl   aIconCtrl;
+    HeaderBar          *m_pHeaderBar;
 
-    static bool getImageFromURL(
-        const ::rtl::OUString& rImageURL,
-        const Size aSize,
-        Image& rImage );
-
+    static bool   getImageFromURL( const ::rtl::OUString& rImageURL,
+                                   const Size aSize,
+                                   Image& rImage );
     SvxIconChoiceCtrlEntry* GetEntry( const String& rURL ) const;
+    void          initHeaderbar( Window *pParent );
 
 public:
     PlacesWindow( Window* pParent );

svtools/source/contnr/imivctl1.cxx

 	( TEXT_DRAW_CENTER | TEXT_DRAW_TOP | TEXT_DRAW_ENDELLIPSIS | \
 	  TEXT_DRAW_CLIP | TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK | TEXT_DRAW_MNEMONIC )
 
-#define DRAWTEXT_FLAGS_SMALLICON (TEXT_DRAW_LEFT|TEXT_DRAW_ENDELLIPSIS|TEXT_DRAW_CLIP)
+#define DRAWTEXT_FLAGS_SMALLICON (TEXT_DRAW_LEFT | TEXT_DRAW_ENDELLIPSIS | TEXT_DRAW_CLIP | TEXT_DRAW_MNEMONIC)
 
 #define EVENTID_SHOW_CURSOR				((void*)1)
 #define EVENTID_ADJUST_SCROLLBARS		((void*)2)
 	pView = pCurView;
 	pZOrderList = new List; //SvPtrarr;
 	ePositionMode = IcnViewPositionModeFree;
-	SetStyle( nWinStyle );
 	nFlags = 0;
 	nUserEventAdjustScrBars = 0;
 	nUserEventShowCursor = 0;
 	pImpCursor = new IcnCursor_Impl( this );
 	pGridMap = new IcnGridMap_Impl( this );
 
-	aVerSBar.SetScrollHdl( LINK( this, SvxIconChoiceCtrl_Impl, ScrollUpDownHdl ) );
+	SetStyle( nWinStyle );
+
+    aVerSBar.SetScrollHdl( LINK( this, SvxIconChoiceCtrl_Impl, ScrollUpDownHdl ) );
 	aHorSBar.SetScrollHdl( LINK( this, SvxIconChoiceCtrl_Impl, ScrollLeftRightHdl ) );
 	Link aEndScrollHdl( LINK( this, SvxIconChoiceCtrl_Impl, EndScrollHdl ) );
 	aVerSBar.SetEndScrollHdl( aEndScrollHdl );
 
 	Clear( TRUE );
 
-    SetGrid( Size(100, 70) );
+    if ( ( nWinStyle & WB_DETAILS ) ) 
+        SetGrid( Size(200, 20) );
+    else
+        SetGrid( Size(100, 70) );
 }
 
 SvxIconChoiceCtrl_Impl::~SvxIconChoiceCtrl_Impl()
 		eSelectionMode = NO_SELECTION;
 	if( !(nWinStyle & (WB_ALIGN_TOP | WB_ALIGN_LEFT)))
 		nWinBits |= WB_ALIGN_LEFT;
-	if( (nWinStyle & WB_DETAILS))
+	if( (nWinBits & WB_DETAILS) )
 	{
 		if( !pColumns  )
 			SetColumn( 0, SvxIconChoiceCtrlColumnInfo( 0, 100, IcnViewAlignLeft ));
+		aImageSize = Size( 16, 16 );
 	}
 }
 
 	{
 		if( eTextMode != eMode )
 		{
-			if( eTextMode == IcnShowTextDontKnow )
+			if( eMode == IcnShowTextDontKnow )
 				eTextMode = IcnShowTextShort;
-			eTextMode = eMode;
+            else
+                eTextMode = eMode;
 			Arrange( TRUE );
 		}
 	}

svtools/source/contnr/ivctrl.cxx

 
 {
 	SetLineColor();
-	_pImp->SetGrid( Size( 100, 70 ) );
 	_pImp->InitSettings();
 	_pImp->SetPositionMode( IcnViewPositionModeAutoArrange );
 }
 
 {
 	SetLineColor();
-	_pImp->SetGrid( Size( 100, 70 ) );
 	_pImp->InitSettings();
 	_pImp->SetPositionMode( IcnViewPositionModeAutoArrange );
 }

vcl/source/window/window.cxx

     Window*     pRealParent = pParent;
     
     // 3D-Look vererben
+#if 0
     if ( !mpWindowImpl->mbOverlapWin && pParent && (pParent->GetStyle() & WB_3DLOOK) )
         nStyle |= WB_3DLOOK;
-
+#endif
     // create border window if necessary
     if ( !mpWindowImpl->mbFrame && !mpWindowImpl->mbBorderWin && !mpWindowImpl->mpBorderWindow
          && (nStyle & (WB_BORDER | WB_SYSTEMCHILDWINDOW) ) )
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.