| View previous topic :: View next topic |
| Author |
Message |
Cosmin3
Joined: 05 Apr 2008 Posts: 54
|
Posted: Tue Mar 16, 2010 9:51 am Post subject: changing zoom with Ctrl + Mouse wheel |
|
|
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 |
|
 |
Sergey Tkachenko Site Admin
Joined: 27 Aug 2005 Posts: 6607
|
Posted: Wed Mar 17, 2010 3:28 pm Post subject: |
|
|
| 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 |
|
 |
Cosmin3
Joined: 05 Apr 2008 Posts: 54
|
Posted: Wed Mar 17, 2010 4:14 pm Post subject: |
|
|
I understand.
Thank you for your reply.
Best regards. |
|
| Back to top |
|
 |
proxy3d ScaleRichView Developer
Joined: 07 Aug 2006 Posts: 282
|
Posted: Sat May 15, 2010 5:16 am Post subject: |
|
|
| Added the new version of SRV 3.2 |
|
| Back to top |
|
 |
|