TeeUseMouseWheel and OnAllowScroll problem
TeeUseMouseWheel and OnAllowScroll problem
The problem is that scrolling with MouseWheell doesn't fire OnAllowScroll event thus preventing me from control of moving all series outside ChartRect.
Regards, Alexander
=================
TeeChart Pro v8.05, Delphi 5 & Turbo Delphi Professional for Win32., Delphi & C++Builder 2009
=================
TeeChart Pro v8.05, Delphi 5 & Turbo Delphi Professional for Win32., Delphi & C++Builder 2009
Hi Alexander,
yes, since we add this checking on our sources (which is on our wish list) it will have to be done manually.
You could use the OnAfterDraw event to do it, using similar code to the following one :
yes, since we add this checking on our sources (which is on our wish list) it will have to be done manually.
You could use the OnAfterDraw event to do it, using similar code to the following one :
Code: Select all
procedure TForm1.Chart1AllowScroll(Sender: TChartAxis; var AMin,
AMax: Double; var AllowScroll: Boolean);
begin
// your code here...
end;
procedure TForm1.Chart1AfterDraw(Sender: TObject);
var axisleftmin,axisleftmax : double;
scroll : boolean;
begin
axisleftmin := Chart1.axes.left.minimum;
axisleftmax := Chart1.axes.left.maximum;
scroll := true;
if TeeUseMouseWheel=true then
Chart1AllowScroll(chart1.Axes.Left,axisleftmin,axisleftmax,scroll);
end;
Pep Jorge
http://support.steema.com
http://support.steema.com
Seems you meant in a such way?
Unfortunately, at the point, marked with questions, previous minimum and maximum of an axis are already lost and refusing scroll is not possible
Have a good weekend!
Code: Select all
if TeeUseMouseWheel=true then
begin
Chart1AllowScroll(chart1.Axes.Left,axisleftmin,axisleftmax,scroll);
if scroll then
chart1.Axes.Left.SetMinMax(axisleftmin,axisleftmax)
else
???
end;
Have a good weekend!
Regards, Alexander
=================
TeeChart Pro v8.05, Delphi 5 & Turbo Delphi Professional for Win32., Delphi & C++Builder 2009
=================
TeeChart Pro v8.05, Delphi 5 & Turbo Delphi Professional for Win32., Delphi & C++Builder 2009
Hi Alexander,
hmmm... how about ?
hmmm... how about ?
Code: Select all
private
min, max : double;
procedure TForm1.Chart1AllowScroll(Sender: TChartAxis; var AMin,
AMax: Double; var AllowScroll: Boolean);
begin
if (Chart1.AllowPanning = pmVertical) or (Chart1.AllowPanning = pmBoth) then
if (Amin<=min) or (Amax >= Max) then
AllowScroll := false;
end;
procedure TForm1.Chart1AfterDraw(Sender: TObject);
var axisleftmin,axisleftmax : double;
axisleftmin2,axisleftmax2 : double;
scroll : boolean;
begin
if assigned(Series1) then
begin
if min = -1 then
min := Chart1.Axes.Left.Minimum;
if max = -1 then
max := Chart1.Axes.Left.Maximum;
if TeeUseMouseWheel=true then
begin
axisleftmin := Chart1.axes.left.minimum;
axisleftmax := Chart1.axes.left.maximum;
Chart1AllowScroll(chart1.Axes.Left,axisleftmin,axisleftmax,scroll);
if scroll then
begin
min := axisleftmin;
max := axisleftmax;
end
else begin
Chart1.Axes.Left.SetMinMax(min,max);
end;
end;
end;
end;
Pep Jorge
http://support.steema.com
http://support.steema.com
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Hi, Narchs!
It's not a problem for me to enable scroll, the issue is how to handle it in a uniform way with trapping OnAllowScroll event and in accordance with AllowPanning value.
For better understanding let me bring up just an example - for some reasons I prevent a user from dragging series with Right Mouse by AllowPanning=pmHorizontal, however it (politely to say - he or she) is still able to shift series in vertical using MouseWheel.
For my projects I have already found a workaround, but in general I suggest this behavior must be changed.
It's not a problem for me to enable scroll, the issue is how to handle it in a uniform way with trapping OnAllowScroll event and in accordance with AllowPanning value.
For better understanding let me bring up just an example - for some reasons I prevent a user from dragging series with Right Mouse by AllowPanning=pmHorizontal, however it (politely to say - he or she) is still able to shift series in vertical using MouseWheel.
For my projects I have already found a workaround, but in general I suggest this behavior must be changed.
Regards, Alexander
=================
TeeChart Pro v8.05, Delphi 5 & Turbo Delphi Professional for Win32., Delphi & C++Builder 2009
=================
TeeChart Pro v8.05, Delphi 5 & Turbo Delphi Professional for Win32., Delphi & C++Builder 2009
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Alexander,
Ok, as Pep said, this is already listed on our wish-list to be implemented for next releases.
Ok, as Pep said, this is already listed on our wish-list to be implemented for next releases.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
That's true, but because we discussed with him OnAllowScroll event I just added to the discussion AllowPanning issue. If it's also included into your wish list I'm almost (until next release:) satisfied.narcis wrote: Ok, as Pep said, this is already listed on our wish-list to be implemented for next releases.
Hi Alexander,
Thanks for the advise. Yes, it's on our wish list too.By the way, scrolling with mouse seems ignores AllowPanning value
Pep Jorge
http://support.steema.com
http://support.steema.com