Page 1 of 1

Small Problem with TChartListBox

Posted: Mon May 15, 2006 9:41 am
by 9333771
Hi,

Here it’s a list of small varios problem I meet:

#1 How to disabled the editor of TChartListBox ?

I didn’t found a property for this either a post on the forum.
I try to filter the F2 key in the OnKeyDown of the form (with KeyPreview), but the editor is display anyway.

#2 I want to select the clicked serie on a chart in the TChartListBox.

The problem is : I want only ONE serie selected at once.
So I set the TChartListbox.MultiSelect at false, and in the Chart.OnClickSeries I do this:

Code: Select all

ChartListBox.Selected[Chartlistbox.Items.IndexOfObject(Series)] := true;
But I got two serie selected (in light blue) with this code. To solve the probleme, I have to select with the mouse in the TChartListbox one serie (in dark blue). THEN I can click on the chart to select one serie (in dark blue).

I tried to before unselectby code (by different way) the current selected serie, but it’s didn’t work either.

Context:
I use Serie.InternalUse, and I call by hand ChartListBox.UpdateSeries to refresh the display when I change the InternalUse flag.
I also set to nil ChartListBox.Chart before adding serie to avoid having flash in the list.

Can you help me? Something is wrong? Did I miss an option?


Thanks in advance,

Context:
TeeChart 7.05 win32
Delphi Architect 9.0

Posted: Tue May 16, 2006 8:46 am
by Pep
Hi Mariano,

1) To disable this feature you can use the following code :

Code: Select all

procedure TForm1.ChartListBox1KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
Chartlistbox1.Enabled:=false;
Chartlistbox1.Enabled:=true;
end;
2) Using the following code should work fine :

Code: Select all

procedure TForm1.Chart1ClickSeries(Sender: TCustomChart;
  Series: TChartSeries; ValueIndex: Integer; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
ChartListBox1.Selected[Chartlistbox1.Items.IndexOfObject(Series)] := true;
Chartlistbox1.UpdateSeries;
end;

Posted: Tue May 16, 2006 10:46 am
by 9333771
Thanks for your quick answer.

I will try this soon.

best regards,

Posted: Wed May 17, 2006 7:48 am
by 9333771
Hi,

Thanks it’s working. :-)

#1
When I do this, I loose the focus. And if I add a SetFocus, the editor is display anyway. It’s not a big problem for me, so I will leave it like this.

#2
Perfect.

Best regards,

Posted: Sun May 21, 2006 10:03 pm
by Pep
Hi Mariano,

1) Ok, for the moment I think is the only way to disable it, I'll add this feature as a wish for further releases.