Legend scroll bar thumb not tracking with mouse
Legend scroll bar thumb not tracking with mouse
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..
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..
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
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.
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 |
Instructions - How to post in this forum |
Example posted
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
Thanks,
dan
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
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.
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 |
Instructions - How to post in this forum |
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
Thanks,
Dan
Hi Dan,
I think I could reproduce the problem here with a simpler code:
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
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;
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,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
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
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
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.
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,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
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).
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,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |