trichview.com Forum Index trichview.com
TRichView support forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

changing zoom with Ctrl + Mouse wheel

 
Post new topic   Reply to topic    trichview.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
Cosmin3



Joined: 05 Apr 2008
Posts: 54

PostPosted: Tue Mar 16, 2010 9:51 am    Post subject: changing zoom with Ctrl + Mouse wheel Reply with quote

Hi.
I'm trying to implement in my editor (which is using ScaleRichView) Ctrl+MouseWheel>>ChangingZoom. Just like in Word...
In SclRView.pas (at "TSRichViewEdit = class(TCustomControl)") I have declared a public variable: IsScrollDisabled (Boolean).
In TSRichViewEdit.HookMouseWheelEvent most of the code is running only if IsScrollDisabled is False. In essence when IsScrollDisabled is True ScaleRichView is not scrolling the text.
At ScaleRichView1 OnKeyDown event:
ScaleRichView1.IsScrollDisabled := (Shift = [ssCtrl]) and (Key = 17);
At ScaleRichView1 OnKeyUp event:
ScaleRichView1.IsScrollDisabled := False;
And at ScaleRichView1 OnMouseWheel event:

Code:
   if Shift = [ssCtrl] then begin
      if WheelDelta > 0 then
         if cmbListZoom.ItemIndex < cmbListZoom.Items.count - 3 then begin
            cmbListZoom.ItemIndex := cmbListZoom.ItemIndex + 1;
            cmbListZoomChange(Self);
         end;
      if WheelDelta < 0 then
         if (cmbListZoom.ItemIndex > 0) and (cmbListZoom.ItemIndex < cmbListZoom.Items.count - 2) then begin
            cmbListZoom.ItemIndex := cmbListZoom.ItemIndex - 1;
            cmbListZoomChange(Self);
         end;


3 questions:
1. Is it ok to do it like that or is there a better way...?
2. How can I know the value of Zoom factor for PageWidth and FullPage so I can increase/decrease properly on any Zoom value?
3. Is there a way to increase/decrease Zoom in smaller "steps"..?

Thank you in advance for any help.
Best regards.
Back to top
View user's profile Send private message
Sergey Tkachenko
Site Admin


Joined: 27 Aug 2005
Posts: 6607

PostPosted: Wed Mar 17, 2010 3:28 pm    Post subject: Reply with quote

We plan to add Ctrl+MouseWheel zooming as a standard optional feature (that can be turned off). Probably will be included in the next update.
Back to top
View user's profile Send private message Visit poster's website
Cosmin3



Joined: 05 Apr 2008
Posts: 54

PostPosted: Wed Mar 17, 2010 4:14 pm    Post subject: Reply with quote

I understand.
Thank you for your reply.
Best regards.
Back to top
View user's profile Send private message
proxy3d
ScaleRichView Developer


Joined: 07 Aug 2006
Posts: 282

PostPosted: Sat May 15, 2010 5:16 am    Post subject: Reply with quote

Added the new version of SRV 3.2
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    trichview.com Forum Index -> Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group