Can I make a TeeListBox serie highlighted without mouse clk

TeeChart for ActiveX, COM and ASP
Post Reply
Kasper
Newbie
Newbie
Posts: 12
Joined: Wed Jul 09, 2008 12:00 am

Can I make a TeeListBox serie highlighted without mouse clk

Post by Kasper » Mon Jan 12, 2009 9:32 am

When using a TeeListBox, and you click the mouse at a serie, it will become highlighted or blue (selected).
Is it posible to make this highlight, when the user e.g. clicks at the graph in the chart. ?

Regards
Kasper

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 Jan 12, 2009 10:35 am

Hi Kasper,

Yes, you can do something like this:

Code: Select all

Private Sub Form_Load()
    TChart1.AddSeries scLine
    TChart1.AddSeries scLine
    TChart1.AddSeries scLine
    
    TChart1.Series(0).FillSampleValues 10
    TChart1.Series(1).FillSampleValues 10
    TChart1.Series(2).FillSampleValues 10
    
    TeeListBox1.Chart = TChart1
End Sub

Private Sub TChart1_OnClickSeries(ByVal SeriesIndex As Long, ByVal ValueIndex As Long, ByVal Button As TeeChart.EMouseButton, ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
    TeeListBox1.SelectedSeries = SeriesIndex
    TeeListBox1.Repaint
End Sub
However I noticed that when setting new SelectedSeries, previously selected series doesn't unselect and added this issue (TV52013711) to the list to be fixed for future 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
Image Image Image Image Image Image
Instructions - How to post in this forum

Kasper
Newbie
Newbie
Posts: 12
Joined: Wed Jul 09, 2008 12:00 am

Post by Kasper » Mon Jan 12, 2009 11:48 am

Ok, I have forgotten the repaint method.. Yes it does not deselect the selection clicked by the mouse. Looking forward to a new release :wink:

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 Jan 20, 2009 9:21 am

Hi Kasper,

I've found that TV52013711 is not a bug as MultiSelect property exists in the VCL version and solves that problem:

Code: Select all

  ChartListBox1.MultiSelect:=false;
Notice that TeeChart Pro v8 ActiveX is a COM wrapper of TeeChart Pro v8 VCL.

However, I've also found that this property doesn't exist in the ActiveX version so I've added this issue (TA05013760) to the TeeChart Pro v8 ActiveX 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
Image Image Image Image Image Image
Instructions - How to post in this forum

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

Post by Narcís » Thu Feb 19, 2009 9:38 am

Hi Kasper,

We found that MutiSelect property is not neceessary here. Using code below you can select multiple items in the ChartListBox pressing Shift+Left button or selecting a series in the chart which would be highlighted in the ChartListBox.

Code: Select all

Private Sub Form_Load()
    TChart1.AddSeries scLine
    TChart1.AddSeries scLine
    TChart1.AddSeries scLine
    TChart1.Series(0).FillSampleValues 10
    TChart1.Series(1).FillSampleValues 10
    TChart1.Series(2).FillSampleValues 10
    TeeListBox1.Chart = TChart1
End Sub

Private Sub TChart1_OnClickSeries(ByVal SeriesIndex As Long, ByVal ValueIndex As Long, ByVal Button As TeeChart.EMouseButton, ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
    With TeeListBox1
        .SetFocus
        .SelectedSeries = SeriesIndex
        .UpdateSeries
    End With
End Sub
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

Post Reply