Centering a ScaleRichView document...

General TRichView support forum. Please post your questions here
Post Reply
DXS
Posts: 44
Joined: Fri Sep 16, 2005 10:31 am
Location: Cape Town, South Africa

Centering a ScaleRichView document...

Post by DXS »

Hello again :)

Is it possible to keep a drawing centered (either vertically or both vertical and horizontally), though zooming/scaling? currently it seems to stay left.

If not an automatic method, I do assume that I can code an event to center on zoom?

Thanks,
Andy
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Do you mean drawing or scrolling?

As for scrolling, TSRichViewEdit tries to keep unmoved:
- the mouse pointer position (if it is inside its window)
- document at the window center (if the mouse pointer is outside the window)
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

As for drawing, pages are drawn in an imaginary grid. The maximum count of columns in this page grid is defined in ViewPropoerty.MaxPageColCount (0 means unlimited.
The page is centered in the cell of this imaginary grid.

You can set MaxPageColCount = 1, pages will be always centered horizontally, but there will be not possible to display more than 1 page side to side.

You can also use ViewProperty.FreePosPage and OnGetPagePos event.
DXS
Posts: 44
Joined: Fri Sep 16, 2005 10:31 am
Location: Cape Town, South Africa

Post by DXS »

Thank you, that worked :)

Is there a way to automatically keep the it vertically aligned as well?

Thanks again,
Andy
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Currently, there is no option for centering (except for free page positioning).
We will considering adding an option.
Post Reply