Legend scroll bar thumb not tracking with mouse

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
DanKerlee
Newbie
Newbie
Posts: 8
Joined: Tue May 13, 2008 12:00 am

Legend scroll bar thumb not tracking with mouse

Post by DanKerlee » Mon Mar 30, 2009 4:22 pm

Hello, I'm having these issues with the Legend Scroll Bar thumb:

Legend scroll bar set up as DrawStyle = dsWhenNeeded
When user drags the Legend Scrollbar Thumb with the mouse, the thumb does not stay with the mouse cursor. This does elminate the dsWhenNeeded problem below.

Legend scroll bar set up as DrawStyle = dsAlways : Thumb can be dragged all the way to the right, where it gets "locked" or "stuck" and cannot be pulled back to the left with the mouse, or moved back with the left arrow. This still has the dsWhenNeeded problem above.

Delphi 2009, TeeChart Pro v8.04.11395 Win32 (XP)

object chrtTst: TChart
Left = 2
Top = 2
Width = 1057
Height = 473
Legend.Alignment = laTop
Legend.CheckBoxes = True
Legend.ColorWidth = 5
Legend.Symbol.Width = 5
Title.Text.Strings = (
'Test Legend')
View3D = False
Align = alClient
Color = clWhite
TabOrder = 0
OnMouseDown = chrtTstMouseDown
OnMouseUp = chrtTstMouseUp
ColorPaletteIndex = 13
object ctScrollBar: TLegendScrollBar
ArrowBrush.Color = 10671002
BackColor = 8095338
Brush.Color = clWhite
Brush.BackColor = 8095338
DrawStyle = dsWhenNeeded
Pen.Color = clWindowFrame
Size = 15
Thumb.Brush.Color = clSilver
Thumb.Brush.BackColor = clSilver
Thumb.Gradient.EndColor = 10790258
Thumb.Gradient.StartColor = 10790258
Thumb.Gradient.Visible = True
Thumb.Size = 17
ThumbBrush.Color = clSilver
ThumbBrush.BackColor = clSilver
ThumbSize = 17
end
end

Additionally at Runtime:
chrtTst.Legend.ColumnWidthAuto := False;
chrtTst.Legend.ColumnWidths[0] := GetWidestTitle; (my code - returns a reasonable number)
chrtTst.Legend.VertMargin := ctScrollBar.Size + 7; (when scroll bar is active)

How can I overcome problems with thumb/mouse positioning and also perhaps the thumb "locking", as described above? I am trying to keep the Legend position, and fixed column widths if possible.

Thanks..

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Mar 30, 2009 4:41 pm

Hi DanKerlee,

Could you please send us a simple example project we can run "as-is" to reproduce the problem here?

You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

DanKerlee
Newbie
Newbie
Posts: 8
Joined: Tue May 13, 2008 12:00 am

Example posted

Post by DanKerlee » Mon Mar 30, 2009 6:42 pm

Narcis, I posted an example although unfortunately this one only shows the first problem. However if I fix that one it will really help,

Thanks,
dan

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Mar 31, 2009 7:54 am

Hi dan,

Thanks for the example project but I'm not able to run it here because it uses RzXxxx components which we don't have here. It also uses a database connection which couldn't be openned. Can you please arrange a simple example project we can run "as-is"?

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

DanKerlee
Newbie
Newbie
Posts: 8
Joined: Tue May 13, 2008 12:00 am

Post by DanKerlee » Tue Mar 31, 2009 2:39 pm

Narcis, I took out the Raise controls that I missed earlier, if there are still problems compling perhaps there is a uses reference that can be removed somewhere.. the database objects were not used but should have been removed and are gone now, sorry for the confusion. You should find ThumbTest2.zip uploaded now,

Thanks,
Dan

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Thu Apr 02, 2009 10:01 am

Hi Dan,

I think I could reproduce the problem here with a simpler code:

Code: Select all

uses series, TeeLegendScrollBar;

procedure TForm1.FormCreate(Sender: TObject);
var
  I: Integer;
begin
  for I := 0 to 80 do
  begin
    Chart1.AddSeries(TBarSeries.Create(nil));
    Chart1[i].FillSampleValues(1);
    Chart1[i].Title := 'bar series number ' + IntToStr(i);
  end;

  Chart1.Legend.CheckBoxes := true;
  Chart1.Legend.MaxNumRows := 12;
  Chart1.Legend.Alignment := laTop;

  Chart1.Tools.Add(TLegendScrollBar.Create(nil));
  (Chart1.Tools[0] as TLegendScrollBar).Thumb.Style := stsThumb1;
  (Chart1.Tools[0] as TLegendScrollBar).DrawStyle := dsAlways;  //dsWhenNeeded

  Chart1.Legend.ColumnWidthAuto := False;
  Chart1.Legend.ColumnWidths[0] := 120;
end;
It seems that the thumb doesn't go with the mouse with this "little thumbs".

In the other hand, I haven't been able to see the "locked" problem with dsAlways. Could you please try to modify the code above to see the thumb locked problem?

Thanks in advance
Last edited by Yeray on Fri Apr 03, 2009 3:18 pm, edited 1 time in total.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

DanKerlee
Newbie
Newbie
Posts: 8
Joined: Tue May 13, 2008 12:00 am

Post by DanKerlee » Thu Apr 02, 2009 7:09 pm

Thanks, Yeray,
I've posted another project that uses your code, (it frees the existing scroll bar and re-instantiates it, slightly different and possibly significant), ALSO, the lockup is slightly different than originally described as the thumb is simply moved to the right as far as possible, not over the control arrow. There are a few more notes inside the form as well. I've included the original form in this project also but the proj opens with the new form.
Thanks, Dan

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Fri Apr 03, 2009 9:30 am

Hi Dan,

I've seen in your application that you call SetScrollBars on AfterDraw event, and debugging, I've seen that pChart.Legend.Items.Count gives a wrong value when the bar is on its end and then it's deactivated.

I would recommend you not to call this method on AferDraw event if it's not necessary and maybe adjust your condition to activate/deactivate the tool.

Thanks for helping us in this testing process.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

DanKerlee
Newbie
Newbie
Posts: 8
Joined: Tue May 13, 2008 12:00 am

Post by DanKerlee » Fri Apr 03, 2009 2:58 pm

Yeray, not setting the margin (in SetScrollBars) seems to help with the locking issue, but that isn't the main point - the main one is the thumb not tracking with the mouse, as shown in the first post. Can we please find out more about that? Thanks, Dan

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Fri Apr 03, 2009 3:14 pm

Hi Dan,

Excuse me, when I reproduced the problem I forgot to mention that I added the bug to the wish list to be fixed asap (TF02014057).
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply