Hi! I use custom EU Explorer (from your demo). How to implement scroll of report preview that will react on mouse weel scroll? Maybe this is not the right place to ask, but this would be a nice enchansement in some next release... THX! Benjamin
Mouse wheel scroll in the preview will be enabled in the next release of ReportBuilder. As for now, below is some simple code one of our customers gave to accomplish this.
Comments
Mouse wheel scroll in the preview will be enabled in the next release of
ReportBuilder. As for now, below is some simple code one of our customers
gave to accomplish this.
unit AJBPreviewPlugIn;
interface
uses
Messages, Controls, Classes, Types, ExtCtrls,
ppPreview, ppTypes, Forms;
type
TAJBPreviewPlugIn = class(TppPreview)
private
protected
public
procedure BeforePreview; override;
procedure MyMouseWheel(Sender: TObject; Shift: TShiftState; WheelDelta:
Integer;
MousePos: TPoint; var Handled: Boolean);
end;
TAJBCustomWheel = class(TControl)
public
property OnMouseWheel;
end;
implementation
uses
SysUtils, Dialogs, ppViewr;
procedure TAJBPreviewPlugIn.BeforePreview;
begin
inherited BeforePreview;
TAJBCustomWheel(Viewer.Owner).OnMouseWheel := MyMouseWheel;
end;
procedure TAJBPreviewPlugIn.MyMouseWheel(Sender: TObject; Shift:
TShiftState;
WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
var
lScrollBar: TControlScrollBar;
begin
lscrollbar := Viewer.ScrollBox.VertScrollBar;
lScrollBar.Position := lScrollBar.Position - (WheelDelta div 5);
end;
initialization
TppPreviewPlugIn.Register(TAJBPreviewPlugIn);
finalization
TppPreviewPlugIn.UnRegister(TAJBPreviewPlugIn);
end.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Thx for this code, but I'm not too familiar with rBuilder source and so
on...
Can you give me a little hint what to do with that code?
THX!
You should be able to simply place the code I gave you in a new unit. Save
this new unit, include it in your project and rebuild. That's it!.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
;-)
THX!