1*9e0e4191SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*9e0e4191SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*9e0e4191SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*9e0e4191SAndrew Rist * distributed with this work for additional information 6*9e0e4191SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*9e0e4191SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*9e0e4191SAndrew Rist * "License"); you may not use this file except in compliance 9*9e0e4191SAndrew Rist * with the License. You may obtain a copy of the License at 10*9e0e4191SAndrew Rist * 11*9e0e4191SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*9e0e4191SAndrew Rist * 13*9e0e4191SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*9e0e4191SAndrew Rist * software distributed under the License is distributed on an 15*9e0e4191SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*9e0e4191SAndrew Rist * KIND, either express or implied. See the License for the 17*9e0e4191SAndrew Rist * specific language governing permissions and limitations 18*9e0e4191SAndrew Rist * under the License. 19*9e0e4191SAndrew Rist * 20*9e0e4191SAndrew Rist *************************************************************/ 21*9e0e4191SAndrew Rist 22*9e0e4191SAndrew Rist 23cdf0e10cSrcweir #include "precompiled_reportdesign.hxx" 24cdf0e10cSrcweir #include "ScrollHelper.hxx" 25cdf0e10cSrcweir #include "DesignView.hxx" 26cdf0e10cSrcweir #include "ReportController.hxx" 27cdf0e10cSrcweir #include "ReportWindow.hxx" 28cdf0e10cSrcweir #include "UITools.hxx" 29cdf0e10cSrcweir #include <tools/debug.hxx> 30cdf0e10cSrcweir #include <com/sun/star/accessibility/AccessibleRole.hpp> 31cdf0e10cSrcweir #include <toolkit/helper/convert.hxx> 32cdf0e10cSrcweir #include <vcl/svapp.hxx> 33cdf0e10cSrcweir 34cdf0e10cSrcweir namespace rptui 35cdf0e10cSrcweir { 36cdf0e10cSrcweir #define LINE_SIZE 50 37cdf0e10cSrcweir #define SECTION_OFFSET 3 38cdf0e10cSrcweir #define SCR_LINE_SIZE 10 39cdf0e10cSrcweir using namespace ::com::sun::star; 40cdf0e10cSrcweir 41cdf0e10cSrcweir // ----------------------------------------------------------------------------- 42cdf0e10cSrcweir void lcl_setScrollBar(sal_Int32 _nNewValue,const Point& _aPos,const Size& _aSize,ScrollBar& _rScrollBar) 43cdf0e10cSrcweir { 44cdf0e10cSrcweir _rScrollBar.SetPosSizePixel(_aPos,_aSize); 45cdf0e10cSrcweir _rScrollBar.SetPageSize( _nNewValue ); 46cdf0e10cSrcweir _rScrollBar.SetVisibleSize( _nNewValue ); 47cdf0e10cSrcweir } 48cdf0e10cSrcweir 49cdf0e10cSrcweir // ----------------------------------------------------------------------------- 50cdf0e10cSrcweir DBG_NAME( rpt_OScrollWindowHelper ); 51cdf0e10cSrcweir OScrollWindowHelper::OScrollWindowHelper( ODesignView* _pDesignView) 52cdf0e10cSrcweir : OScrollWindowHelper_BASE( _pDesignView,WB_DIALOGCONTROL) 53cdf0e10cSrcweir ,OPropertyChangeListener(m_aMutex) 54cdf0e10cSrcweir ,m_aHScroll( this, WB_HSCROLL|WB_REPEAT|WB_DRAG ) 55cdf0e10cSrcweir ,m_aVScroll( this, WB_VSCROLL|WB_REPEAT|WB_DRAG ) 56cdf0e10cSrcweir ,m_aCornerWin( this ) 57cdf0e10cSrcweir ,m_pParent(_pDesignView) 58cdf0e10cSrcweir ,m_aReportWindow(this,m_pParent) 59cdf0e10cSrcweir ,m_pReportDefintionMultiPlexer(NULL) 60cdf0e10cSrcweir { 61cdf0e10cSrcweir DBG_CTOR( rpt_OScrollWindowHelper,NULL); 62cdf0e10cSrcweir SetMapMode( MapMode( MAP_100TH_MM ) ); 63cdf0e10cSrcweir 64cdf0e10cSrcweir impl_initScrollBar( m_aHScroll ); 65cdf0e10cSrcweir impl_initScrollBar( m_aVScroll ); 66cdf0e10cSrcweir 67cdf0e10cSrcweir m_aReportWindow.SetMapMode( MapMode( MAP_100TH_MM ) ); 68cdf0e10cSrcweir m_aReportWindow.Show(); 69cdf0e10cSrcweir 70cdf0e10cSrcweir // normally we should be SCROLL_PANE 71cdf0e10cSrcweir SetAccessibleRole(accessibility::AccessibleRole::SCROLL_PANE); 72cdf0e10cSrcweir ImplInitSettings(); 73cdf0e10cSrcweir } 74cdf0e10cSrcweir 75cdf0e10cSrcweir // ----------------------------------------------------------------------------- 76cdf0e10cSrcweir OScrollWindowHelper::~OScrollWindowHelper() 77cdf0e10cSrcweir { 78cdf0e10cSrcweir DBG_DTOR( rpt_OScrollWindowHelper,NULL); 79cdf0e10cSrcweir if ( m_pReportDefintionMultiPlexer.is() ) 80cdf0e10cSrcweir m_pReportDefintionMultiPlexer->dispose(); 81cdf0e10cSrcweir } 82cdf0e10cSrcweir 83cdf0e10cSrcweir // ----------------------------------------------------------------------------- 84cdf0e10cSrcweir void OScrollWindowHelper::impl_initScrollBar( ScrollBar& _rScrollBar ) const 85cdf0e10cSrcweir { 86cdf0e10cSrcweir AllSettings aSettings( _rScrollBar.GetSettings() ); 87cdf0e10cSrcweir StyleSettings aStyle( aSettings.GetStyleSettings() ); 88cdf0e10cSrcweir aStyle.SetDragFullOptions( aStyle.GetDragFullOptions() | DRAGFULL_OPTION_SCROLL ); // live scrolling 89cdf0e10cSrcweir aSettings.SetStyleSettings( aStyle ); 90cdf0e10cSrcweir _rScrollBar.SetSettings( aSettings ); 91cdf0e10cSrcweir //_rScrollBar.SetMapMode( MapMode( MAP_100TH_MM ) ); 92cdf0e10cSrcweir 93cdf0e10cSrcweir _rScrollBar.SetScrollHdl( LINK( this, OScrollWindowHelper, ScrollHdl ) ); 94cdf0e10cSrcweir _rScrollBar.SetLineSize( SCR_LINE_SIZE ); 95cdf0e10cSrcweir } 96cdf0e10cSrcweir 97cdf0e10cSrcweir // ----------------------------------------------------------------------------- 98cdf0e10cSrcweir void OScrollWindowHelper::initialize() 99cdf0e10cSrcweir { 100cdf0e10cSrcweir uno::Reference<report::XReportDefinition> xReportDefinition = m_pParent->getController().getReportDefinition(); 101cdf0e10cSrcweir m_pReportDefintionMultiPlexer = addStyleListener(xReportDefinition,this); 102cdf0e10cSrcweir 103cdf0e10cSrcweir m_aReportWindow.initialize(); 104cdf0e10cSrcweir } 105cdf0e10cSrcweir //------------------------------------------------------------------------------ 106cdf0e10cSrcweir void OScrollWindowHelper::setTotalSize(sal_Int32 _nWidth ,sal_Int32 _nHeight) 107cdf0e10cSrcweir { 108cdf0e10cSrcweir m_aTotalPixelSize.Width() = _nWidth; 109cdf0e10cSrcweir m_aTotalPixelSize.Height() = _nHeight; 110cdf0e10cSrcweir 111cdf0e10cSrcweir // now set the ranges without start marker 112cdf0e10cSrcweir Fraction aStartWidth(REPORT_STARTMARKER_WIDTH * m_pParent->getController().getZoomValue(),100); 113cdf0e10cSrcweir long nWidth = long(_nWidth - (double)aStartWidth); 114cdf0e10cSrcweir m_aHScroll.SetRangeMax( nWidth ); 115cdf0e10cSrcweir m_aVScroll.SetRangeMax( m_aTotalPixelSize.Height() ); 116cdf0e10cSrcweir 117cdf0e10cSrcweir Resize(); 118cdf0e10cSrcweir } 119cdf0e10cSrcweir //------------------------------------------------------------------------------ 120cdf0e10cSrcweir Size OScrollWindowHelper::ResizeScrollBars() 121cdf0e10cSrcweir { 122cdf0e10cSrcweir // get the new output-size in pixel 123cdf0e10cSrcweir Size aOutPixSz = GetOutputSizePixel(); 124cdf0e10cSrcweir if ( aOutPixSz.Width() == 0 || aOutPixSz.Height() == 0 ) 125cdf0e10cSrcweir return aOutPixSz; 126cdf0e10cSrcweir 127cdf0e10cSrcweir aOutPixSz.Height() -= m_aReportWindow.getRulerHeight(); 128cdf0e10cSrcweir // determine the size of the output-area and if we need scrollbars 129cdf0e10cSrcweir const long nScrSize = GetSettings().GetStyleSettings().GetScrollBarSize(); 130cdf0e10cSrcweir bool bVVisible = false; // by default no vertical-ScrollBar 131cdf0e10cSrcweir bool bHVisible = false; // by default no horizontal-ScrollBar 132cdf0e10cSrcweir bool bChanged; // determines if a visiblility was changed 133cdf0e10cSrcweir do 134cdf0e10cSrcweir { 135cdf0e10cSrcweir bChanged = false; 136cdf0e10cSrcweir 137cdf0e10cSrcweir // does we need a vertical ScrollBar 138cdf0e10cSrcweir if ( aOutPixSz.Width() < m_aTotalPixelSize.Width() && !bHVisible ) 139cdf0e10cSrcweir { 140cdf0e10cSrcweir bHVisible = true; 141cdf0e10cSrcweir aOutPixSz.Height() -= nScrSize; 142cdf0e10cSrcweir bChanged = true; 143cdf0e10cSrcweir } 144cdf0e10cSrcweir 145cdf0e10cSrcweir // does we need a horizontal ScrollBar 146cdf0e10cSrcweir if ( aOutPixSz.Height() < m_aTotalPixelSize.Height() && !bVVisible ) 147cdf0e10cSrcweir { 148cdf0e10cSrcweir bVVisible = true; 149cdf0e10cSrcweir aOutPixSz.Width() -= nScrSize; 150cdf0e10cSrcweir bChanged = true; 151cdf0e10cSrcweir } 152cdf0e10cSrcweir 153cdf0e10cSrcweir } 154cdf0e10cSrcweir while ( bChanged ); // until no visibility has changed 155cdf0e10cSrcweir 156cdf0e10cSrcweir aOutPixSz.Height() += m_aReportWindow.getRulerHeight(); 157cdf0e10cSrcweir 158cdf0e10cSrcweir // show or hide scrollbars 159cdf0e10cSrcweir m_aVScroll.Show( bVVisible ); 160cdf0e10cSrcweir m_aHScroll.Show( bHVisible ); 161cdf0e10cSrcweir 162cdf0e10cSrcweir // disable painting in the corner between the scrollbars 163cdf0e10cSrcweir if ( bVVisible && bHVisible ) 164cdf0e10cSrcweir { 165cdf0e10cSrcweir m_aCornerWin.SetPosSizePixel(Point(aOutPixSz.Width(), aOutPixSz.Height()), Size(nScrSize, nScrSize) ); 166cdf0e10cSrcweir m_aCornerWin.Show(); 167cdf0e10cSrcweir } 168cdf0e10cSrcweir else 169cdf0e10cSrcweir m_aCornerWin.Hide(); 170cdf0e10cSrcweir 171cdf0e10cSrcweir const Point aOffset = LogicToPixel( Point( SECTION_OFFSET, SECTION_OFFSET ), MAP_APPFONT ); 172cdf0e10cSrcweir // resize scrollbars and set their ranges 173cdf0e10cSrcweir { 174cdf0e10cSrcweir Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH*m_pParent->getController().getZoomValue()),100); 175cdf0e10cSrcweir const sal_Int32 nNewWidth = aOutPixSz.Width() - aOffset.X() - (long)aStartWidth; 176cdf0e10cSrcweir lcl_setScrollBar(nNewWidth,Point( (long)aStartWidth + aOffset.X(), aOutPixSz.Height() ),Size( nNewWidth, nScrSize ),m_aHScroll); 177cdf0e10cSrcweir } 178cdf0e10cSrcweir { 179cdf0e10cSrcweir const sal_Int32 nNewHeight = aOutPixSz.Height() - m_aReportWindow.getRulerHeight(); 180cdf0e10cSrcweir lcl_setScrollBar(nNewHeight,Point( aOutPixSz.Width(), m_aReportWindow.getRulerHeight() ),Size( nScrSize,nNewHeight),m_aVScroll); 181cdf0e10cSrcweir } 182cdf0e10cSrcweir 183cdf0e10cSrcweir return aOutPixSz; 184cdf0e10cSrcweir } 185cdf0e10cSrcweir //------------------------------------------------------------------------------ 186cdf0e10cSrcweir void OScrollWindowHelper::Resize() 187cdf0e10cSrcweir { 188cdf0e10cSrcweir OScrollWindowHelper_BASE::Resize(); 189cdf0e10cSrcweir const Size aTotalOutputSize = ResizeScrollBars(); 190cdf0e10cSrcweir 191cdf0e10cSrcweir m_aReportWindow.SetPosSizePixel(Point( 0, 0 ),aTotalOutputSize); 192cdf0e10cSrcweir } 193cdf0e10cSrcweir //------------------------------------------------------------------------------ 194cdf0e10cSrcweir IMPL_LINK( OScrollWindowHelper, ScrollHdl, ScrollBar*, /*pScroll*/ ) 195cdf0e10cSrcweir { 196cdf0e10cSrcweir m_aReportWindow.ScrollChildren( getThumbPos() ); 197cdf0e10cSrcweir return 0; 198cdf0e10cSrcweir } 199cdf0e10cSrcweir //------------------------------------------------------------------------------ 200cdf0e10cSrcweir void OScrollWindowHelper::addSection(const uno::Reference< report::XSection >& _xSection 201cdf0e10cSrcweir ,const ::rtl::OUString& _sColorEntry 202cdf0e10cSrcweir ,sal_uInt16 _nPosition) 203cdf0e10cSrcweir { 204cdf0e10cSrcweir m_aReportWindow.addSection(_xSection,_sColorEntry,_nPosition); 205cdf0e10cSrcweir } 206cdf0e10cSrcweir //------------------------------------------------------------------------------ 207cdf0e10cSrcweir void OScrollWindowHelper::removeSection(sal_uInt16 _nPosition) 208cdf0e10cSrcweir { 209cdf0e10cSrcweir m_aReportWindow.removeSection(_nPosition); 210cdf0e10cSrcweir } 211cdf0e10cSrcweir //------------------------------------------------------------------------------ 212cdf0e10cSrcweir void OScrollWindowHelper::toggleGrid(sal_Bool _bVisible) 213cdf0e10cSrcweir { 214cdf0e10cSrcweir m_aReportWindow.toggleGrid(_bVisible); 215cdf0e10cSrcweir } 216cdf0e10cSrcweir //------------------------------------------------------------------------------ 217cdf0e10cSrcweir sal_uInt16 OScrollWindowHelper::getSectionCount() const 218cdf0e10cSrcweir { 219cdf0e10cSrcweir return m_aReportWindow.getSectionCount(); 220cdf0e10cSrcweir } 221cdf0e10cSrcweir //------------------------------------------------------------------------------ 222cdf0e10cSrcweir void OScrollWindowHelper::SetInsertObj( sal_uInt16 eObj,const ::rtl::OUString& _sShapeType ) 223cdf0e10cSrcweir { 224cdf0e10cSrcweir m_aReportWindow.SetInsertObj(eObj,_sShapeType); 225cdf0e10cSrcweir } 226cdf0e10cSrcweir //---------------------------------------------------------------------------- 227cdf0e10cSrcweir rtl::OUString OScrollWindowHelper::GetInsertObjString() const 228cdf0e10cSrcweir { 229cdf0e10cSrcweir return m_aReportWindow.GetInsertObjString(); 230cdf0e10cSrcweir } 231cdf0e10cSrcweir //------------------------------------------------------------------------------ 232cdf0e10cSrcweir void OScrollWindowHelper::SetMode( DlgEdMode _eNewMode ) 233cdf0e10cSrcweir { 234cdf0e10cSrcweir m_aReportWindow.SetMode(_eNewMode); 235cdf0e10cSrcweir } 236cdf0e10cSrcweir //------------------------------------------------------------------------------ 237cdf0e10cSrcweir sal_Bool OScrollWindowHelper::HasSelection() const 238cdf0e10cSrcweir { 239cdf0e10cSrcweir return m_aReportWindow.HasSelection(); 240cdf0e10cSrcweir } 241cdf0e10cSrcweir //---------------------------------------------------------------------------- 242cdf0e10cSrcweir void OScrollWindowHelper::Delete() 243cdf0e10cSrcweir { 244cdf0e10cSrcweir m_aReportWindow.Delete(); 245cdf0e10cSrcweir } 246cdf0e10cSrcweir //---------------------------------------------------------------------------- 247cdf0e10cSrcweir void OScrollWindowHelper::Copy() 248cdf0e10cSrcweir { 249cdf0e10cSrcweir m_aReportWindow.Copy(); 250cdf0e10cSrcweir } 251cdf0e10cSrcweir //---------------------------------------------------------------------------- 252cdf0e10cSrcweir void OScrollWindowHelper::Paste() 253cdf0e10cSrcweir { 254cdf0e10cSrcweir m_aReportWindow.Paste(); 255cdf0e10cSrcweir } 256cdf0e10cSrcweir //---------------------------------------------------------------------------- 257cdf0e10cSrcweir sal_Bool OScrollWindowHelper::IsPasteAllowed() const 258cdf0e10cSrcweir { 259cdf0e10cSrcweir return m_aReportWindow.IsPasteAllowed(); 260cdf0e10cSrcweir } 261cdf0e10cSrcweir //----------------------------------------------------------------------------- 262cdf0e10cSrcweir void OScrollWindowHelper::SelectAll(const sal_uInt16 _nObjectType) 263cdf0e10cSrcweir { 264cdf0e10cSrcweir m_aReportWindow.SelectAll(_nObjectType); 265cdf0e10cSrcweir } 266cdf0e10cSrcweir //---------------------------------------------------------------------------- 267cdf0e10cSrcweir void OScrollWindowHelper::unmarkAllObjects(OSectionView* _pSectionView) 268cdf0e10cSrcweir { 269cdf0e10cSrcweir m_aReportWindow.unmarkAllObjects(_pSectionView); 270cdf0e10cSrcweir } 271cdf0e10cSrcweir //------------------------------------------------------------------------------ 272cdf0e10cSrcweir sal_Int32 OScrollWindowHelper::getMaxMarkerWidth(sal_Bool _bWithEnd) const 273cdf0e10cSrcweir { 274cdf0e10cSrcweir return m_aReportWindow.getMaxMarkerWidth(_bWithEnd); 275cdf0e10cSrcweir } 276cdf0e10cSrcweir //---------------------------------------------------------------------------- 277cdf0e10cSrcweir void OScrollWindowHelper::showRuler(sal_Bool _bShow) 278cdf0e10cSrcweir { 279cdf0e10cSrcweir m_aReportWindow.showRuler(_bShow); 280cdf0e10cSrcweir } 281cdf0e10cSrcweir //------------------------------------------------------------------------------ 282cdf0e10cSrcweir sal_Bool OScrollWindowHelper::handleKeyEvent(const KeyEvent& _rEvent) 283cdf0e10cSrcweir { 284cdf0e10cSrcweir return m_aReportWindow.handleKeyEvent(_rEvent); 285cdf0e10cSrcweir } 286cdf0e10cSrcweir //------------------------------------------------------------------------ 287cdf0e10cSrcweir void OScrollWindowHelper::setMarked(OSectionView* _pSectionView,sal_Bool _bMark) 288cdf0e10cSrcweir { 289cdf0e10cSrcweir m_aReportWindow.setMarked(_pSectionView,_bMark); 290cdf0e10cSrcweir } 291cdf0e10cSrcweir //------------------------------------------------------------------------ 292cdf0e10cSrcweir void OScrollWindowHelper::setMarked(const uno::Reference< report::XSection>& _xSection,sal_Bool _bMark) 293cdf0e10cSrcweir { 294cdf0e10cSrcweir m_aReportWindow.setMarked(_xSection,_bMark); 295cdf0e10cSrcweir } 296cdf0e10cSrcweir //------------------------------------------------------------------------ 297cdf0e10cSrcweir void OScrollWindowHelper::setMarked(const uno::Sequence< uno::Reference< report::XReportComponent> >& _xShape,sal_Bool _bMark) 298cdf0e10cSrcweir { 299cdf0e10cSrcweir m_aReportWindow.setMarked(_xShape,_bMark); 300cdf0e10cSrcweir } 301cdf0e10cSrcweir // ------------------------------------------------------------------------- 302cdf0e10cSrcweir ::boost::shared_ptr<OSectionWindow> OScrollWindowHelper::getMarkedSection(NearSectionAccess nsa) const 303cdf0e10cSrcweir { 304cdf0e10cSrcweir return m_aReportWindow.getMarkedSection(nsa); 305cdf0e10cSrcweir } 306cdf0e10cSrcweir // ------------------------------------------------------------------------- 307cdf0e10cSrcweir ::boost::shared_ptr<OSectionWindow> OScrollWindowHelper::getSectionWindow(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) const 308cdf0e10cSrcweir { 309cdf0e10cSrcweir return m_aReportWindow.getSectionWindow(_xSection); 310cdf0e10cSrcweir } 311cdf0e10cSrcweir // ------------------------------------------------------------------------- 312cdf0e10cSrcweir void OScrollWindowHelper::markSection(const sal_uInt16 _nPos) 313cdf0e10cSrcweir { 314cdf0e10cSrcweir m_aReportWindow.markSection(_nPos); 315cdf0e10cSrcweir } 316cdf0e10cSrcweir // ----------------------------------------------------------------------------- 317cdf0e10cSrcweir void OScrollWindowHelper::fillCollapsedSections(::std::vector<sal_uInt16>& _rCollapsedPositions) const 318cdf0e10cSrcweir { 319cdf0e10cSrcweir m_aReportWindow.fillCollapsedSections(_rCollapsedPositions); 320cdf0e10cSrcweir } 321cdf0e10cSrcweir // ----------------------------------------------------------------------------- 322cdf0e10cSrcweir void OScrollWindowHelper::collapseSections(const uno::Sequence< ::com::sun::star::beans::PropertyValue>& _aCollpasedSections) 323cdf0e10cSrcweir { 324cdf0e10cSrcweir m_aReportWindow.collapseSections(_aCollpasedSections); 325cdf0e10cSrcweir } 326cdf0e10cSrcweir //------------------------------------------------------------------------------ 327cdf0e10cSrcweir long OScrollWindowHelper::Notify( NotifyEvent& rNEvt ) 328cdf0e10cSrcweir { 329cdf0e10cSrcweir const CommandEvent* pCommandEvent = rNEvt.GetCommandEvent(); 330cdf0e10cSrcweir if ( pCommandEvent && 331cdf0e10cSrcweir ( ((pCommandEvent->GetCommand() == COMMAND_WHEEL) || 332cdf0e10cSrcweir (pCommandEvent->GetCommand() == COMMAND_STARTAUTOSCROLL) || 333cdf0e10cSrcweir (pCommandEvent->GetCommand() == COMMAND_AUTOSCROLL))) ) 334cdf0e10cSrcweir { 335cdf0e10cSrcweir ScrollBar* pHScrBar = NULL; 336cdf0e10cSrcweir ScrollBar* pVScrBar = NULL; 337cdf0e10cSrcweir if ( m_aHScroll.IsVisible() ) 338cdf0e10cSrcweir pHScrBar = &m_aHScroll; 339cdf0e10cSrcweir 340cdf0e10cSrcweir if ( m_aVScroll.IsVisible() ) 341cdf0e10cSrcweir pVScrBar = &m_aVScroll; 342cdf0e10cSrcweir 343cdf0e10cSrcweir if ( HandleScrollCommand( *pCommandEvent, pHScrBar, pVScrBar ) ) 344cdf0e10cSrcweir return 1L; 345cdf0e10cSrcweir } 346cdf0e10cSrcweir return OScrollWindowHelper_BASE::Notify(rNEvt); 347cdf0e10cSrcweir } 348cdf0e10cSrcweir // ----------------------------------------------------------------------------- 349cdf0e10cSrcweir void OScrollWindowHelper::alignMarkedObjects(sal_Int32 _nControlModification,bool _bAlignAtSection, bool bBoundRects) 350cdf0e10cSrcweir { 351cdf0e10cSrcweir m_aReportWindow.alignMarkedObjects(_nControlModification, _bAlignAtSection, bBoundRects); 352cdf0e10cSrcweir } 353cdf0e10cSrcweir //------------------------------------------------------------------------------ 354cdf0e10cSrcweir void OScrollWindowHelper::ImplInitSettings() 355cdf0e10cSrcweir { 356cdf0e10cSrcweir SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor() )); 357cdf0e10cSrcweir // SetBackground( Wallpaper( COL_LIGHTRED )); 358cdf0e10cSrcweir SetFillColor( Application::GetSettings().GetStyleSettings().GetFaceColor() ); 359cdf0e10cSrcweir SetTextFillColor( Application::GetSettings().GetStyleSettings().GetFaceColor() ); 360cdf0e10cSrcweir } 361cdf0e10cSrcweir //----------------------------------------------------------------------------- 362cdf0e10cSrcweir void OScrollWindowHelper::DataChanged( const DataChangedEvent& rDCEvt ) 363cdf0e10cSrcweir { 364cdf0e10cSrcweir Window::DataChanged( rDCEvt ); 365cdf0e10cSrcweir 366cdf0e10cSrcweir if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && 367cdf0e10cSrcweir (rDCEvt.GetFlags() & SETTINGS_STYLE) ) 368cdf0e10cSrcweir { 369cdf0e10cSrcweir ImplInitSettings(); 370cdf0e10cSrcweir Invalidate(); 371cdf0e10cSrcweir } 372cdf0e10cSrcweir } 373cdf0e10cSrcweir // ----------------------------------------------------------------------------- 374cdf0e10cSrcweir void OScrollWindowHelper::_propertyChanged(const beans::PropertyChangeEvent& /*_rEvent*/) throw( uno::RuntimeException) 375cdf0e10cSrcweir { 376cdf0e10cSrcweir m_aReportWindow.notifySizeChanged(); 377cdf0e10cSrcweir } 378cdf0e10cSrcweir // ----------------------------------------------------------------------------- 379cdf0e10cSrcweir void OScrollWindowHelper::setGridSnap(sal_Bool bOn) 380cdf0e10cSrcweir { 381cdf0e10cSrcweir m_aReportWindow.setGridSnap(bOn); 382cdf0e10cSrcweir } 383cdf0e10cSrcweir // ----------------------------------------------------------------------------- 384cdf0e10cSrcweir void OScrollWindowHelper::setDragStripes(sal_Bool bOn) 385cdf0e10cSrcweir { 386cdf0e10cSrcweir m_aReportWindow.setDragStripes(bOn); 387cdf0e10cSrcweir } 388cdf0e10cSrcweir // ----------------------------------------------------------------------------- 389cdf0e10cSrcweir sal_uInt32 OScrollWindowHelper::getMarkedObjectCount() const 390cdf0e10cSrcweir { 391cdf0e10cSrcweir return m_aReportWindow.getMarkedObjectCount(); 392cdf0e10cSrcweir } 393cdf0e10cSrcweir // ----------------------------------------------------------------------------- 394cdf0e10cSrcweir void OScrollWindowHelper::zoom(const Fraction& _aZoom) 395cdf0e10cSrcweir { 396cdf0e10cSrcweir m_aReportWindow.zoom(_aZoom); 397cdf0e10cSrcweir Resize(); 398cdf0e10cSrcweir Invalidate(INVALIDATE_NOCHILDREN|INVALIDATE_TRANSPARENT); 399cdf0e10cSrcweir } 400cdf0e10cSrcweir // ----------------------------------------------------------------------------- 401cdf0e10cSrcweir void OScrollWindowHelper::fillControlModelSelection(::std::vector< uno::Reference< uno::XInterface > >& _rSelection) const 402cdf0e10cSrcweir { 403cdf0e10cSrcweir m_aReportWindow.fillControlModelSelection(_rSelection); 404cdf0e10cSrcweir } 405cdf0e10cSrcweir // ----------------------------------------------------------------------------- 406cdf0e10cSrcweir sal_uInt16 OScrollWindowHelper::getZoomFactor(SvxZoomType _eType) const 407cdf0e10cSrcweir { 408cdf0e10cSrcweir return m_aReportWindow.getZoomFactor(_eType); 409cdf0e10cSrcweir } 410cdf0e10cSrcweir //============================================================================== 411cdf0e10cSrcweir } // rptui 412cdf0e10cSrcweir //============================================================================== 413