merge the formfield patch from ooo-build
[ooovba.git] / sw / source / ui / uiview / viewmdi.cxx
blob7fdf5789ad665a9b27d289901b752fa2d5f301da
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: viewmdi.cxx,v $
10 * $Revision: 1.24.140.1 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sw.hxx"
36 #include <string> // HACK: prevent conflict between STLPORT and Workshop headers
38 #include "hintids.hxx"
39 #include <vcl/svapp.hxx>
40 #include <sfx2/dispatch.hxx>
41 #include <svx/ruler.hxx>
42 #include <svx/lrspitem.hxx>
43 #include <svx/srchitem.hxx>
44 #include <sfx2/request.hxx>
45 #include <swmodule.hxx>
46 #ifndef _VIEW_HXX
47 #include <view.hxx>
48 #endif
49 #include <wrtsh.hxx>
50 #ifndef _DOCSH_HXX
51 #include <docsh.hxx>
52 #endif
53 #include <viewopt.hxx>
54 #include <frmatr.hxx>
55 #ifndef _WDOCSH_HXX
56 #include <wdocsh.hxx>
57 #endif
58 #include <uitool.hxx>
59 #include <edtwin.hxx>
60 #include <pagedesc.hxx>
61 #include <IMark.hxx>
62 #include <fldbas.hxx>
63 #include <workctrl.hxx>
64 #include <usrpref.hxx>
65 #include <scroll.hxx>
66 #ifndef _WVIEW_HXX
67 #include <wview.hxx>
68 #endif
70 #ifndef _CMDID_H
71 #include <cmdid.h>
72 #endif
73 #ifndef _VIEW_HRC
74 #include <view.hrc>
75 #endif
76 #ifndef _RIBBAR_HRC
77 #include <ribbar.hrc>
78 #endif
79 #ifndef _HELPID_H
80 #include <helpid.h>
81 #endif
82 #ifndef _GLOBALS_HRC
83 #include <globals.hrc>
84 #endif
86 #include <IDocumentSettingAccess.hxx>
87 #include <PostItMgr.hxx>
88 #include <postit.hxx>
90 USHORT SwView::nMoveType = NID_PGE;
91 sal_Int32 SwView::nActMark = 0;
94 #define VIEW_IMAGECOLOR COL_LIGHTBLUE
96 using namespace ::com::sun::star::uno;
97 using namespace ::com::sun::star::frame;
99 void SwView::SetZoom( SvxZoomType eZoomType, short nFactor, BOOL bViewOnly )
101 _SetZoom( GetEditWin().GetOutputSizePixel(), eZoomType, nFactor, bViewOnly );
104 void SwView::_SetZoom( const Size &rEditSize, SvxZoomType eZoomType,
105 short nFactor, BOOL bViewOnly )
107 BOOL bUnLockView = !pWrtShell->IsViewLocked();
108 pWrtShell->LockView( TRUE );
109 pWrtShell->LockPaint();
112 ACT_KONTEXT(pWrtShell);
114 long nFac = nFactor;
116 BOOL bWeb = 0 != PTR_CAST(SwWebView, this);
117 SwMasterUsrPref *pUsrPref = (SwMasterUsrPref*)SW_MOD()->GetUsrPref(bWeb);
119 const SwPageDesc &rDesc = pWrtShell->GetPageDesc( pWrtShell->GetCurPageDesc() );
120 const SvxLRSpaceItem &rLRSpace = rDesc.GetMaster().GetLRSpace();
121 const SwViewOption *pOpt = pWrtShell->GetViewOptions();
122 long lLeftMargin = 0;
124 if( eZoomType != SVX_ZOOM_PERCENT )
126 const bool bAutomaticViewLayout = 0 == pOpt->GetViewLayoutColumns();
128 const SwRect aPageRect( pWrtShell->GetAnyCurRect( RECT_PAGE_CALC ) );
129 const SwRect aRootRect( pWrtShell->GetAnyCurRect( RECT_PAGES_AREA ) );
130 Size aPageSize( aPageRect.SSize() );
131 Size aRootSize( aRootRect.SSize() );
133 //mod #i6193# added sidebar width
134 SwPostItMgr* pPostItMgr = GetPostItMgr();
135 if (pPostItMgr->HasNotes() && pPostItMgr->ShowNotes())
136 aPageSize.Width() += pPostItMgr->GetSidebarWidth() + pPostItMgr->GetSidebarBorderWidth();
138 const MapMode aTmpMap( MAP_TWIP );
139 const Size aWindowSize( GetEditWin().PixelToLogic( rEditSize, aTmpMap ) );
141 if( nsUseOnPage::PD_MIRROR == rDesc.GetUseOn() ) // gespiegelte Seiten
143 const SvxLRSpaceItem &rLeftLRSpace = rDesc.GetLeft().GetLRSpace();
144 aPageSize.Width() += Abs( long(rLeftLRSpace.GetLeft()) - long(rLRSpace.GetLeft()) );
147 if( SVX_ZOOM_OPTIMAL == eZoomType )
149 if (pPostItMgr->HasNotes() && pPostItMgr->ShowNotes())
151 lLeftMargin = long(rLRSpace.GetLeft()) + aPageRect.Left() + nLeftOfst;
153 else
155 aPageSize.Width() -= ( rLRSpace.GetLeft() + rLRSpace.GetRight() + nLeftOfst * 2 );
156 lLeftMargin = long(rLRSpace.GetLeft()) + aPageRect.Left() + nLeftOfst;
158 nFac = aWindowSize.Width() * 100 / aPageSize.Width();
160 else if(SVX_ZOOM_WHOLEPAGE == eZoomType || SVX_ZOOM_PAGEWIDTH == eZoomType )
162 const long nOf = DOCUMENTBORDER * 2L;
163 long nTmpWidth = bAutomaticViewLayout ? aPageSize.Width() : aRootSize.Width();
164 nTmpWidth += nOf;
165 aPageSize.Height() += nOf;
166 nFac = aWindowSize.Width() * 100 / nTmpWidth;
168 if ( SVX_ZOOM_WHOLEPAGE == eZoomType )
170 long nVisPercent = aWindowSize.Height() * 100 / aPageSize.Height();
171 nFac = Min( nFac, nVisPercent );
174 else /*if( SVX_ZOOM_PAGEWIDTH_NOBORDER == eZoomType )*/
176 const long nTmpWidth = bAutomaticViewLayout ? aPageSize.Width() : aRootSize.Width();
177 nFac = aWindowSize.Width() * 100 / nTmpWidth;
181 nFac = Max( long( MINZOOM ), nFac );
183 SwViewOption aOpt( *pOpt );
184 if ( !GetViewFrame()->GetFrame()->IsInPlace() )
186 //MasterUsrPrefs updaten UND DANACH die ViewOptions der aktuellen
187 //View updaten.
188 if ( !bViewOnly &&
189 (USHORT(nFac) != pUsrPref->GetZoom() ||
190 BYTE (eZoomType) != pUsrPref->GetZoomType()) )
192 pUsrPref->SetZoom ( USHORT(nFac) );
193 pUsrPref->SetZoomType( eZoomType );
194 SW_MOD()->ApplyUsrPref( *pUsrPref,
195 bViewOnly ? this: 0,
196 bViewOnly ? VIEWOPT_DEST_VIEW_ONLY : 0 );
197 pUsrPref->SetModified();
199 if ( pOpt->GetZoom() != (USHORT) nFac )
201 aOpt.SetZoom ( USHORT(nFac) );
202 aOpt.SetReadonly(pOpt->IsReadonly());
203 pWrtShell->ApplyViewOptions( aOpt );
205 if ( eZoomType != SVX_ZOOM_PERCENT )
207 Point aPos;
209 if ( eZoomType == SVX_ZOOM_WHOLEPAGE )
210 aPos.Y() = pWrtShell->GetAnyCurRect(RECT_PAGE).Top() - DOCUMENTBORDER;
211 else
213 //sicherstellen, dass sich der Cursor im sichtbaren
214 //Bereich befindet, damit nur 1x gescrollt wird
215 aPos.X() = lLeftMargin;
216 const SwRect &rCharRect = pWrtShell->GetCharRect();
217 if ( rCharRect.Top() > GetVisArea().Bottom() ||
218 rCharRect.Bottom() < aPos.Y() )
219 aPos.Y() = rCharRect.Top() - rCharRect.Height();
220 else
221 aPos.Y() = GetVisArea().Top();
223 SetVisArea( aPos );
225 // OS: Notloesung - in CalcVisArea wird u.U. wieder SetZoom gerufen und
226 // dann werden falsche Werte eingestellt
227 ((SwViewOption*)pWrtShell->GetViewOptions())->SetZoomType( eZoomType );
228 CalcVisArea( rEditSize ); //fuer das Neuberechnen des sichtbaren Bereiches
230 else if ( USHORT(nFac) != pOpt->GetZoom() )
232 aOpt.SetZoom ( USHORT(nFac) );
233 pWrtShell->ApplyViewOptions( aOpt );
236 const Fraction aFrac( nFac, 100 );
237 pVRuler->SetZoom( aFrac );
238 pVRuler->ForceUpdate();
239 pHRuler->SetZoom( aFrac );
240 pHRuler->ForceUpdate();
241 ((SwViewOption*)pWrtShell->GetViewOptions())->SetZoomType( eZoomType );
243 pWrtShell->UnlockPaint();
244 if( bUnLockView )
245 pWrtShell->LockView( FALSE );
247 if ( mpPostItMgr )
249 mpPostItMgr->Rescale();
250 mpPostItMgr->CalcRects();
251 mpPostItMgr->LayoutPostIts();
254 // eZoom = eZoomType;
257 void SwView::SetViewLayout( USHORT nColumns, bool bBookMode, BOOL bViewOnly )
259 const BOOL bUnLockView = !pWrtShell->IsViewLocked();
260 pWrtShell->LockView( TRUE );
261 pWrtShell->LockPaint();
265 ACT_KONTEXT(pWrtShell);
267 if ( !GetViewFrame()->GetFrame()->IsInPlace() && !bViewOnly )
269 const BOOL bWeb = 0 != PTR_CAST(SwWebView, this);
270 SwMasterUsrPref *pUsrPref = (SwMasterUsrPref*)SW_MOD()->GetUsrPref(bWeb);
272 //MasterUsrPrefs updaten UND DANACH die ViewOptions der aktuellen
273 //View updaten.
274 if ( nColumns != pUsrPref->GetViewLayoutColumns() ||
275 bBookMode != pUsrPref->IsViewLayoutBookMode() )
277 pUsrPref->SetViewLayoutColumns( nColumns );
278 pUsrPref->SetViewLayoutBookMode( bBookMode );
279 SW_MOD()->ApplyUsrPref( *pUsrPref,
280 bViewOnly ? this: 0,
281 bViewOnly ? VIEWOPT_DEST_VIEW_ONLY : 0 );
282 pUsrPref->SetModified();
286 const SwViewOption *pOpt = pWrtShell->GetViewOptions();
288 if ( nColumns != pOpt->GetViewLayoutColumns() ||
289 bBookMode != pOpt->IsViewLayoutBookMode() )
291 SwViewOption aOpt( *pOpt );
292 aOpt.SetViewLayoutColumns( nColumns );
293 aOpt.SetViewLayoutBookMode( bBookMode );
294 pWrtShell->ApplyViewOptions( aOpt );
297 pVRuler->ForceUpdate();
298 pHRuler->ForceUpdate();
302 pWrtShell->UnlockPaint();
303 if( bUnLockView )
304 pWrtShell->LockView( FALSE );
306 SfxBindings& rBnd = GetViewFrame()->GetBindings();
307 rBnd.Invalidate( SID_ATTR_VIEWLAYOUT );
308 rBnd.Invalidate( SID_ATTR_ZOOMSLIDER);
312 * Scrollbar - Handler
315 int SwView::_CreateScrollbar( BOOL bHori )
317 Window *pMDI = &GetViewFrame()->GetWindow();
318 SwScrollbar** ppScrollbar = bHori ? &pHScrollbar : &pVScrollbar;
320 ASSERT( !*ppScrollbar, "vorher abpruefen!" )
322 if( !bHori )
323 CreatePageButtons( !bShowAtResize );
325 *ppScrollbar = new SwScrollbar( pMDI, bHori );
326 UpdateScrollbars();
327 if(bHori)
328 (*ppScrollbar)->SetScrollHdl( LINK( this, SwView, EndScrollHdl ));
329 else
330 (*ppScrollbar)->SetScrollHdl( LINK( this, SwView, ScrollHdl ));
331 (*ppScrollbar)->SetEndScrollHdl( LINK( this, SwView, EndScrollHdl ));
333 (*ppScrollbar)->EnableDrag( TRUE );
335 if(GetWindow())
336 InvalidateBorder();
338 // Scrollbar muss nochmals getestet werden, da im InvalidateBorder u.U. der
339 // Scrollbar wieder geloescht wurde
340 if ( !bShowAtResize && (*ppScrollbar))
341 (*ppScrollbar)->ExtendedShow();
343 return 1;
346 void SwView::CreatePageButtons(BOOL bShow)
348 Window *pMDI = &GetViewFrame()->GetWindow();
349 pPageUpBtn = new SwHlpImageButton(pMDI, SW_RES( BTN_PAGEUP ), TRUE );
350 pPageUpBtn->SetHelpId(HID_SCRL_PAGEUP);
351 pPageDownBtn = new SwHlpImageButton(pMDI, SW_RES( BTN_PAGEDOWN ), FALSE );
352 pPageDownBtn->SetHelpId(HID_SCRL_PAGEDOWN);
353 Reference< XFrame > xFrame = GetViewFrame()->GetFrame()->GetFrameInterface();
354 pNaviBtn = new SwNaviImageButton(pMDI, xFrame );
355 pNaviBtn->SetHelpId(HID_SCRL_NAVI);
356 Link aLk( LINK( this, SwView, BtnPage ) );
357 pPageUpBtn->SetClickHdl( aLk );
358 pPageDownBtn->SetClickHdl( aLk );
359 if(nMoveType != NID_PGE)
361 Color aColor(VIEW_IMAGECOLOR);
362 SetImageButtonColor(aColor);
365 if(bShow)
367 pPageUpBtn->Show();
368 pPageDownBtn->Show();
369 pNaviBtn->Show();
374 * Button-Handler
376 IMPL_LINK( SwView, BtnPage, Button *, pButton )
378 // #i75416# move the execution of the search to an asynchronously called static link
379 bool* pbNext = new bool( (pButton == pPageDownBtn) );
380 Application::PostUserEvent( STATIC_LINK(this, SwView, MoveNavigationHdl), pbNext );
381 return 0;
383 /*-----------------20.06.97 10:46-------------------
385 --------------------------------------------------*/
386 IMPL_STATIC_LINK( SwView, MoveNavigationHdl, bool *, pbNext )
388 if ( !pbNext )
389 return 0;
390 bool bNext = *pbNext;
391 SwWrtShell& rSh = pThis->GetWrtShell();
392 switch( nMoveType )
394 case NID_PGE:
395 bNext ? pThis->PhyPageDown() : pThis->PhyPageUp();
396 break;
397 case NID_TBL :
398 rSh.EnterStdMode();
399 if(bNext)
400 rSh.MoveTable(fnTableNext, fnTableStart);
401 else
402 rSh.MoveTable(fnTablePrev, fnTableStart);
403 break;
404 case NID_FRM :
405 case NID_GRF:
406 case NID_OLE:
408 USHORT eType = GOTOOBJ_FLY_FRM;
409 if(nMoveType == NID_GRF)
410 eType = GOTOOBJ_FLY_GRF;
411 else if(nMoveType == NID_OLE)
412 eType = GOTOOBJ_FLY_OLE;
413 BOOL bSuccess = bNext ?
414 rSh.GotoNextFly(eType) :
415 rSh.GotoPrevFly(eType);
416 if(bSuccess)
418 rSh.HideCrsr();
419 rSh.EnterSelFrmMode();
422 break;
423 case NID_DRW :
424 case NID_CTRL:
425 rSh.GotoObj(bNext,
426 nMoveType == NID_DRW ?
427 GOTOOBJ_DRAW_SIMPLE :
428 GOTOOBJ_DRAW_CONTROL);
429 break;
430 case NID_REG :
431 rSh.EnterStdMode();
432 if(bNext)
433 rSh.MoveRegion(fnRegionNext, fnRegionStart);
434 else
435 rSh.MoveRegion(fnRegionPrev, fnRegionStart);
437 break;
438 case NID_BKM :
439 rSh.EnterStdMode();
440 pThis->GetViewFrame()->GetDispatcher()->Execute(bNext ?
441 FN_NEXT_BOOKMARK :
442 FN_PREV_BOOKMARK);
443 break;
444 case NID_OUTL:
445 rSh.EnterStdMode();
446 bNext ? rSh.GotoNextOutline() : rSh.GotoPrevOutline();
447 break;
448 case NID_SEL :
449 bNext ? rSh.GoNextCrsr() : rSh.GoPrevCrsr();
450 break;
451 case NID_FTN:
452 rSh.EnterStdMode();
453 bNext ?
454 rSh.GotoNextFtnAnchor() :
455 rSh.GotoPrevFtnAnchor();
456 break;
457 case NID_MARK:
459 // unselect
460 rSh.MoveCrsr();
461 rSh.EnterStdMode();
463 // collect navigator reminders
464 IDocumentMarkAccess* const pMarkAccess = rSh.getIDocumentMarkAccess();
465 ::std::vector< const ::sw::mark::IMark* > vNavMarks;
466 for( IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getMarksBegin();
467 ppMark != pMarkAccess->getMarksEnd();
468 ppMark++)
470 if( IDocumentMarkAccess::GetType(**ppMark) == IDocumentMarkAccess::NAVIGATOR_REMINDER )
471 vNavMarks.push_back(ppMark->get());
474 // move
475 if(vNavMarks.size())
477 if(bNext)
479 nActMark++;
480 if (nActMark >= MAX_MARKS || nActMark >= static_cast<sal_Int32>(vNavMarks.size()))
481 nActMark = 0;
483 else
485 nActMark--;
486 if (nActMark < 0 || nActMark >= static_cast<sal_Int32>(vNavMarks.size()))
487 nActMark = vNavMarks.size()-1;
489 rSh.GotoMark(vNavMarks[nActMark]);
492 break;
493 case NID_POSTIT:
495 SwMarginWin* pPostIt = pThis->GetPostItMgr()->GetActivePostIt();
496 if (pPostIt)
497 pThis->GetPostItMgr()->SetActivePostIt(0);
498 SwFieldType* pFldType = rSh.GetFldType(0, RES_POSTITFLD);
499 if (rSh.MoveFldType(pFldType, bNext))
500 pThis->GetViewFrame()->GetDispatcher()->Execute(FN_POSTIT);
501 else
502 //first/last item
503 pThis->GetPostItMgr()->SetActivePostIt(pPostIt);
505 break;
506 case NID_SRCH_REP:
507 if(pSrchItem)
509 BOOL bBackward = pSrchItem->GetBackward();
510 if(rSh.HasSelection() && !bNext == rSh.IsCrsrPtAtEnd())
511 rSh.SwapPam();
512 pSrchItem->SetBackward(!bNext);
513 SfxRequest aReq(FN_REPEAT_SEARCH, SFX_CALLMODE_SLOT, pThis->GetPool());
514 pThis->ExecSearch(aReq);
515 pSrchItem->SetBackward(bBackward);
517 break;
518 case NID_INDEX_ENTRY:
519 rSh.GotoNxtPrvTOXMark(bNext);
520 break;
522 case NID_TABLE_FORMULA:
523 rSh.GotoNxtPrvTblFormula( bNext );
524 break;
526 case NID_TABLE_FORMULA_ERROR:
527 rSh.GotoNxtPrvTblFormula( bNext, TRUE );
528 break;
530 pThis->pEditWin->GrabFocus();
531 delete pbNext;
532 return 0;
535 /*************************************************************************
537 |* SwView::CreateTab()
539 |* Beschreibung
540 |* Ersterstellung VB 29.05.91
541 |* Letzte Aenderung OS 09.05.96
543 *************************************************************************/
545 int SwView::CreateTab()
547 pHRuler->SetActive(GetFrame() && IsActive());
549 pHRuler->Show();
550 InvalidateBorder();
551 return 1;
554 /*************************************************************************
556 |* SwView::KillTab()
558 |* Beschreibung
559 |* Ersterstellung VB 29.05.91
560 |* Letzte Aenderung OS 09.05.96
562 *************************************************************************/
564 int SwView::KillTab()
566 pHRuler->Hide();
567 InvalidateBorder();
568 return 1;
571 void SwView::ChangeTabMetric( FieldUnit eUnit )
573 if(pHRuler->GetUnit() != eUnit )
575 pHRuler->SetUnit( eUnit );
576 pHRuler->Invalidate();
580 void SwView::ChangeVLinealMetric( FieldUnit eUnit )
582 if(pVRuler->GetUnit() != eUnit)
584 pVRuler->SetUnit( eUnit );
585 pVRuler->Invalidate();
588 /* -----------------------------07.04.01 17:09--------------------------------
590 ---------------------------------------------------------------------------*/
591 void SwView::GetVLinealMetric(FieldUnit& eToFill) const
593 eToFill = pVRuler->GetUnit();
595 /* -----------------------------07.04.01 17:09--------------------------------
597 ---------------------------------------------------------------------------*/
598 void SwView::GetHLinealMetric(FieldUnit& eToFill) const
600 eToFill = pHRuler->GetUnit();
602 /*************************************************************************
604 |* SwView::CreateVLineal()
606 |* Beschreibung
607 |* Ersterstellung VB 29.05.91
609 *************************************************************************/
611 int SwView::CreateVLineal()
613 pHRuler->SetBorderPos( pVRuler->GetSizePixel().Width()-1 );
615 pVRuler->SetActive(GetFrame() && IsActive());
616 pVRuler->Show();
617 InvalidateBorder();
618 return 1;
621 /*************************************************************************
623 |* SwView::KillVLineal()
625 |* Beschreibung
626 |* Ersterstellung VB 29.05.91
628 *************************************************************************/
630 int SwView::KillVLineal()
632 pVRuler->Hide();
633 pHRuler->SetBorderPos( 0 );
634 InvalidateBorder();
635 return 1;
637 /*************************************************************************
639 |* SwView::ExecRulerClick()
641 |* Beschreibung
642 |* Ersterstellung OS 15.06.95
643 |* Letzte Aenderung
645 *************************************************************************/
647 IMPL_LINK( SwView, ExecRulerClick, Ruler *, pRuler )
649 USHORT nDefPage = 0;
650 switch( pRuler->GetClickType() )
652 case RULER_TYPE_DONTKNOW:
653 case RULER_TYPE_OUTSIDE:
654 case RULER_TYPE_INDENT:
655 case RULER_TYPE_MARGIN1:
656 case RULER_TYPE_MARGIN2:
657 nDefPage = TP_PARA_STD;
658 break;
659 default:
660 nDefPage = TP_TABULATOR;
664 SfxUInt16Item aDefPage(SID_PARA_DLG, nDefPage);
665 GetViewFrame()->GetDispatcher()->Execute( SID_PARA_DLG,
666 SFX_CALLMODE_SYNCHRON|SFX_CALLMODE_RECORD,
667 &aDefPage, 0L );
668 return 0;
672 /*-----------------20.02.97 09:11-------------------
674 --------------------------------------------------*/
676 USHORT SwView::GetMoveType()
678 return nMoveType;
680 /*-----------------20.02.97 09:11-------------------
682 --------------------------------------------------*/
684 void SwView::SetMoveType(USHORT nSet)
686 BOOL bLastPage = nMoveType == NID_PGE;
687 nMoveType = nSet;
688 BOOL bNewPage = nMoveType == NID_PGE;
689 if(bNewPage != bLastPage)
691 Color aColor(bNewPage ? COL_BLACK : VIEW_IMAGECOLOR);
692 const TypeId aTypeId = TYPE(SwView);
693 SwView* pView = (SwView*)SfxViewShell::GetFirst(&aTypeId);
694 while( pView )
696 pView->SetImageButtonColor(aColor);
697 pView = (SwView*)SfxViewShell::GetNext(*pView, &aTypeId);
702 /*-----------------20.06.97 11:18-------------------
704 --------------------------------------------------*/
705 void SwView::SetActMark(sal_Int32 nSet)
707 nActMark = nSet;
710 /*-----------------15.03.97 10:53-------------------
712 --------------------------------------------------*/
714 void SwView::SetImageButtonColor(Color& rColor)
716 if(pPageUpBtn)
718 pPageUpBtn->SetControlForeground(rColor);
719 pPageDownBtn->SetControlForeground(rColor);
722 /* -----------------------------2002/06/26 13:57------------------------------
724 ---------------------------------------------------------------------------*/
725 void SwView::ShowHScrollbar(sal_Bool bShow)
727 DBG_ASSERT(pHScrollbar, "Scrollbar invalid");
728 pHScrollbar->ExtendedShow(bShow);
730 /* -----------------------------2002/06/26 13:57------------------------------
732 ---------------------------------------------------------------------------*/
733 sal_Bool SwView::IsHScrollbarVisible()const
735 DBG_ASSERT(pHScrollbar, "Scrollbar invalid");
736 return pHScrollbar->IsVisible( FALSE ) || pHScrollbar->IsAuto();
738 /* -----------------------------2002/06/26 13:57------------------------------
740 ---------------------------------------------------------------------------*/
741 void SwView::ShowVScrollbar(sal_Bool bShow)
743 DBG_ASSERT(pVScrollbar, "Scrollbar invalid");
744 pVScrollbar->ExtendedShow(bShow);
745 pPageUpBtn->Show(bShow);
746 pPageDownBtn->Show(bShow);
747 pNaviBtn->Show(bShow);
749 /* -----------------------------2002/06/26 13:57------------------------------
751 ---------------------------------------------------------------------------*/
752 sal_Bool SwView::IsVScrollbarVisible()const
754 DBG_ASSERT(pVScrollbar, "Scrollbar invalid");
755 return pVScrollbar->IsVisible( FALSE );