Message de Fernand Vanrie  date 2010-07-13 12:15 :

Hello,

I tried to change the "multiple pageview" (2 page side by side) and the according zoom factor with the apI.

I tried Thiscomponent.currentController.ViewSettings, I Found a property to change the zoom factor , but nothing to show 2 page side by side on the screen


Hi Fernand,
It seems API was forgotten when designing the new feature :-(
But the dispatcher can do it, I wrote some routines based on the macro recorder.

You have to set the zoom factor to a value suitable to the number of columns to display. There are two examples : reset to one column, and set to 2 columns.

REM  *****  BASIC  *****

Option Explicit

sub View1Column
  setViewColumns(1)
  setZoom(100)
end sub

sub View2Columns
  setViewColumns(2)
  setZoom(50)
end sub

' dispatcher routines ( slightly modified )

sub setViewColumns(colNbr As Long)
dim document   as object
dim dispatcher as object
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dim args1(1) as new com.sun.star.beans.PropertyValue
args1(0).Name = "ViewLayout.Columns"
args1(0).Value = colNbr
args1(1).Name = "ViewLayout.BookMode"
args1(1).Value = false
dispatcher.executeDispatch(document, ".uno:ViewLayout", "", 0, args1())
end sub


sub setZoom(zoomValue As Long)
dim document   as object
dim dispatcher as object
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dim args1(2) as new com.sun.star.beans.PropertyValue
args1(0).Name = "Zoom.Value"
args1(0).Value = zoomValue
args1(1).Name = "Zoom.ValueSet"
' args1(1).Value = 28703
args1(2).Name = "Zoom.Type"
args1(2).Value = 0
dispatcher.executeDispatch(document, ".uno:Zoom", "", 0, args1())
end sub


Regards
  Bernard


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org

Reply via email to