In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

Changing Preview Zoom

Xailer professional forum in English
Responder
Timm
Mensajes: 151
Registrado: Lun Jun 21, 2010 11:01 am

Changing Preview Zoom

Mensaje por Timm »

Hi!

I tried to preset a new zoom value by overloading it:

Código: Seleccionar todo

CLASS TPreviewControl FROM XPreviewControl
   PROPERTY nZoomIndex INIT 10
END CLASS
It didn't work.
This allows me to adjust the zoom factor, but the combobox in the preview window doesn't show the correct value.

Código: Seleccionar todo

CLASS TPreviewPage FROM XPreviewPage
   PROPERTY nFitInPage INIT pfALL
END CLASS

Best regards, Timm
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9580
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Re: Changing Preview Zoom

Mensaje por ignacio »

Try this:

Código: Seleccionar todo

CLASS TPreviewPage FROM XPreviewPage
   PROPERTY nZoomFactor INIT 10   WRITE INLINE ( ::FnFitInPage := pfNONE, ::FnZoomFactor := Value, ::SetEmfCoors(), ::Refresh() )
END CLASS
BTW, This is the complete fix:

Código: Seleccionar todo

CLASS TOzsPreviewControl FROM TOzsBevel

   PROPERTY nZoomIndex  READ  INLINE IIF( !Empty(::oCombo:nIndex), ::oCombo:nIndex, ::FnZommIndex ) ;
                        WRITE INLINE ( ::oCombo:nIndex := Value, ::SetZoom() ) 
END CLASS
On method Create() (about line 143 )

Código: Seleccionar todo

IF !Empty( ::FnZoomIndex ) .AND. ::FnZoomIndex <= Len( :aItems )
  ::oCombo:nIndex := ::FnZoomIndex
  ::oPreviewPage:nZoomFactor := Val( :aItems[ :nIndex ] )
ELSE
  :SelectString( ToString( ::oPreviewPage:nZoomFactor ) ) // Old code
ENDIF
It will be available on next Xailer release.

Regards,
Ignacio Ortiz de Zúñiga
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
Responder