Bernard ,

Anoying because this new feature has his influence on the Viewcursor position , two page gives a X an Y who are different depending on the used ViewLayout. I normaly calculate the cursor postition by using the page number and the "vieuwcursor.position. X" and Y Now it becomes more complicated and i need to know the actual Viewlayout. or to force a "known" ViewLayout using your routines. I supose i have to look a bit closer to the ViewData property who is probably :-) a array of with the positions depending on the actual ViewLayout ?
I comback with  the hard figures.

Thanks for the routines

Fernand


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


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

Reply via email to