diff options
author | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2012-07-13 13:12:13 +0200 |
---|---|---|
committer | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2012-07-13 17:38:59 +0200 |
commit | 40e57a316eeaecc9302c05219b8d8da409f2fe3e (patch) | |
tree | ce855e936dbba1179762da9fa3bcb19f7a36d638 /fpicker | |
parent | 897485d81e4637f3cb98dcfa8431f93f186722aa (diff) |
fpicker: added a splitter to resize the places list
Change-Id: I9ae8b7066721c7e5a8ebb75f26949e874d72c982
Diffstat (limited to 'fpicker')
-rw-r--r-- | fpicker/source/office/PlacesListBox.cxx | 6 | ||||
-rw-r--r-- | fpicker/source/office/iodlg.cxx | 40 | ||||
-rw-r--r-- | fpicker/source/office/iodlg.hrc | 1 | ||||
-rw-r--r-- | fpicker/source/office/iodlg.hxx | 3 | ||||
-rw-r--r-- | fpicker/source/office/iodlg.src | 6 |
5 files changed, 53 insertions, 3 deletions
diff --git a/fpicker/source/office/PlacesListBox.cxx b/fpicker/source/office/PlacesListBox.cxx index e16753edb922..b870f7580171 100644 --- a/fpicker/source/office/PlacesListBox.cxx +++ b/fpicker/source/office/PlacesListBox.cxx @@ -45,11 +45,11 @@ PlacesListBox_Impl::PlacesListBox_Impl( PlacesListBox* pParent, const rtl::OUStr { Size aBoxSize = pParent->GetSizePixel( ); mpHeaderBar = new HeaderBar( pParent, WB_BUTTONSTYLE | WB_BOTTOMBORDER ); - mpHeaderBar->SetPosSizePixel( Point( 0, 0 ), Size( aBoxSize.getWidth(), 16 ) ); + mpHeaderBar->SetPosSizePixel( Point( 0, 0 ), Size( 600, 16 ) ); - long pTabs[] = { 2, 20, aBoxSize.getWidth() }; + long pTabs[] = { 2, 20, 600 }; SetTabs( &pTabs[0], MAP_PIXEL ); - mpHeaderBar->InsertItem( COLUMN_NAME, rTitle, aBoxSize.getWidth(), HIB_LEFT | HIB_VCENTER ); + mpHeaderBar->InsertItem( COLUMN_NAME, rTitle, 600, HIB_LEFT | HIB_VCENTER ); Size aHeadSize = mpHeaderBar->GetSizePixel(); SetPosSizePixel( Point( 0, aHeadSize.getHeight() ), diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx index b49bef260dfa..84b46e7d22e5 100644 --- a/fpicker/source/office/iodlg.cxx +++ b/fpicker/source/office/iodlg.cxx @@ -472,6 +472,7 @@ SvtFileDialog::~SvtFileDialog() delete _pImp; delete _pFileView; + delete _pSplitter; delete _pCbReadOnly; delete _pCbLinkBox; @@ -594,6 +595,10 @@ void SvtFileDialog::Init_Impl _pFileView->SetHelpId( HID_FILEDLG_STANDARD ); _pFileView->SetStyle( _pFileView->GetStyle() | WB_TABSTOP ); + _pSplitter = new Splitter( this, SvtResId( EXPLORERFILE_SPLITTER ) ); + _pSplitter->SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor() )); + _pSplitter->SetSplitHdl( LINK( this, SvtFileDialog, Split_Hdl ) ); + // determine the size of the buttons Size aSize = _pImp->_pBtnNewFolder->GetSizePixel(); Image aNewFolderImg( GetButtonImage( IMG_FILEDLG_CREATEFOLDER ) ); @@ -676,6 +681,9 @@ void SvtFileDialog::Init_Impl // Adjust the position of the other elements. _pFileView->SetPosPixel( aPos ); + aPos.X() = _pSplitter->GetPosPixel().X(); + _pSplitter->SetPosPixel( aPos ); + aPos.X() = _pImp->_pPlaces->GetPosPixel().X(); _pImp->_pPlaces->SetPosPixel( aPos ); @@ -2245,6 +2253,7 @@ short SvtFileDialog::PrepareExecute() OpenURL_Impl( aObj.GetMainURL( INetURLObject::NO_DECODE ) ); _pFileView->Show(); + _pSplitter->Show(); SvtDefModalDialogParent_Impl aDefParent( this ); // if applicable read and set size from ini @@ -2670,6 +2679,13 @@ void SvtFileDialog::Resize() _pFileView->SetSizePixel( aNewSize ); + // Resize the Splitter to fit the height + Size splitterNewSize = _pSplitter->GetSizePixel( ); + splitterNewSize.Height() += nDeltaY; + _pSplitter->SetSizePixel( splitterNewSize ); + sal_Int32 nMinX = _pImp->_pPlaces->GetPosPixel( ).X( ); + _pSplitter->SetDragRectPixel( Rectangle( Point( nMinX, 0 ), Size( aDlgSize ) ) ); + // Resize the places list box to fit the height of the FileView Size placesNewSize(_pImp->_pPlaces->GetSizePixel()); placesNewSize.Height() += nDeltaY; @@ -3357,6 +3373,30 @@ void SvtFileDialog::initDefaultPlaces( ) _pImp->_pPlaces->IsUpdated(); } +IMPL_LINK_NOARG( SvtFileDialog, Split_Hdl ) +{ + sal_Int32 nSplitPos = _pSplitter->GetSplitPosPixel(); + + // Resize the places list + sal_Int32 nPlaceX = _pImp->_pPlaces->GetPosPixel( ).X(); + Size placeSize = _pImp->_pPlaces->GetSizePixel( ); + placeSize.Width() = nSplitPos - nPlaceX; + _pImp->_pPlaces->SetSizePixel( placeSize ); + + // Change Pos and size of the fileview + Point fileViewPos = _pFileView->GetPosPixel(); + sal_Int32 nOldX = fileViewPos.X(); + sal_Int32 nNewX = nSplitPos + _pSplitter->GetSizePixel().Width(); + fileViewPos.X() = nNewX; + Size fileViewSize = _pFileView->GetSizePixel(); + fileViewSize.Width() -= ( nNewX - nOldX ); + _pFileView->SetPosSizePixel( fileViewPos, fileViewSize ); + + _pSplitter->SetPosPixel( Point( nSplitPos, _pSplitter->GetPosPixel().Y() ) ); + Resize(); + return 0; +} + // QueryFolderNameDialog ------------------------------------------------------- namespace svtools { diff --git a/fpicker/source/office/iodlg.hrc b/fpicker/source/office/iodlg.hrc index 5e829aa04401..3b2bc8600c17 100644 --- a/fpicker/source/office/iodlg.hrc +++ b/fpicker/source/office/iodlg.hrc @@ -54,6 +54,7 @@ #define BTN_EXPLORERFILE_CONNECT_TO_SERVER 51 #define BTN_EXPLORERFILE_ADD_PLACE 52 #define BTN_EXPLORERFILE_REMOVE_PLACE 53 +#define EXPLORERFILE_SPLITTER 54 // ----------------------------------------------- diff --git a/fpicker/source/office/iodlg.hxx b/fpicker/source/office/iodlg.hxx index 739c95ba43b4..cf5e5029be54 100644 --- a/fpicker/source/office/iodlg.hxx +++ b/fpicker/source/office/iodlg.hxx @@ -25,6 +25,7 @@ #include <vcl/edit.hxx> #include <vcl/combobox.hxx> #include <vcl/lstbox.hxx> +#include <vcl/split.hxx> #include <com/sun/star/beans/StringPair.hpp> #include <com/sun/star/uno/Any.hxx> #include <com/sun/star/uno/Sequence.hxx> @@ -95,6 +96,7 @@ private: Window* _pPrevWin; FixedBitmap* _pPrevBmp; SvtFileView* _pFileView; + Splitter* _pSplitter; ::svt::IFilePickerListener* _pFileNotifier; SvtExpFileDlg_Impl* _pImp; WinBits _nExtraBits; @@ -129,6 +131,7 @@ private: DECL_STATIC_LINK( SvtFileDialog, AddPlacePressed_Hdl, void* ); DECL_STATIC_LINK( SvtFileDialog, RemovePlacePressed_Hdl, void* ); + DECL_LINK ( Split_Hdl, void* ); void Init_Impl( WinBits nBits ); /** find a filter with the given wildcard diff --git a/fpicker/source/office/iodlg.src b/fpicker/source/office/iodlg.src index 5befee56315c..11d01da98f25 100644 --- a/fpicker/source/office/iodlg.src +++ b/fpicker/source/office/iodlg.src @@ -80,6 +80,12 @@ ModalDialog DLG_FPICKER_EXPLORERFILE Size = MAP_APPFONT( 12, 12 ) ; QuickHelpText [ en-US ] = "Up One Level" ; }; + Splitter EXPLORERFILE_SPLITTER + { + Pos = MAP_APPFONT( 56, 26 ); + Size = MAP_APPFONT( 3, 85 ); + HScroll = TRUE; + }; Control LB_EXPLORERFILE_PLACES_LISTBOX { HelpID = "fpicker:ListBox:DLG_SVT_EXPLORERFILE:LB_EXPLORERFILE_PLACES_LISTBOX"; |