[ Show ]
Support VoyForums
[ Shrink ]
VoyForums Announcement: Programming and providing support for this service has been a labor of love since 1997. We are one of the few services online who values our users' privacy, and have never sold your information. We have even fought hard to defend your privacy in legal cases; however, we've done it with almost no financial support -- paying out of pocket to continue providing the service. Due to the issues imposed on us by advertisers, we also stopped hosting most ads on the forums many years ago. We hope you appreciate our efforts.

Show your support by donating any amount. (Note: We are still technically a for-profit company, so your contribution is not tax-deductible.) PayPal Acct: Feedback:

Donate to VoyForums (PayPal):

Login ] [ Contact Forum Admin ] [ Main index ] [ Post a new message ] [ Search | Check update time | Archives: 1234[5]678910 ]

[ Next Thread | Previous Thread | Next Message | Previous Message ]

Date Posted: 06:34:06 09/19/02 Thu
Author: Michel
Subject: Re: Automatic ZoomToSelection
In reply to: Ed Fessler 's message, "Automatic ZoomToSelection" on 10:40:45 09/18/02 Wed

Hi Ed,

The ZoomToSelection works in conjunction with the TRubberBandMouseHandler, not the quick select.

You can try the following code (taken from .ZoomToSelection)
in an OnQuickSelect event handler:

OldZoom := ZoomPercent;

XZoom := ZoomPercent * (Self.Width / (Rect.Right - Rect.Left + 1) * 1.0);
YZoom := ZoomPercent * (Self.Height / (Rect.Bottom - Rect.Top + 1) * 1.0);

{ limit the zoom value to 1000 % }
SetZoomPercent( MinFloat(MinFloat(XZoom,1000), YZoom) );

HorzScrollBar.Position := SafeTrunc(Rect.Left * (ZoomPercent / OldZoom));
VertScrollBar.Position := SafeTrunc(Rect.Top * (ZoomPercent / OldZoom));

I will also look at this in more detail.

Best regards,


>I want to make my program so that it zooms to the user
>selection as soon as they are done selecting (Unlike
>the demo where it is a 2 step process). I tried using
>the mmQuickSelect but I get an error message when I
>call ZoomToSelection that says "Rubberband mouse
>handler not active" I tried using mmSelect, but I am
>not sure where to put my ZoomToSelection call so that
>it will occur when the user is done selecting. If I
>need to use mmUser to do this an example would be
>Thanks in advance,
>Ed Fessler
>Ed Fessler

[ Next Thread | Previous Thread | Next Message | Previous Message ]


[ Contact Forum Admin ]

Forum timezone: GMT-5
VF Version: 3.00b, ConfDB:
Before posting please read our privacy policy.
VoyForums(tm) is a Free Service from Voyager Info-Systems.
Copyright © 1998-2019 Voyager Info-Systems. All Rights Reserved.