TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
-
Fang
- Newbie
- Posts: 66
- Joined: Wed Oct 13, 2004 4:00 am
Post
by Fang » Tue Apr 18, 2006 10:18 pm
hi,
In TeeLisB.pas, I looked at this function, but couldn't figure out how the SelectedSeries get updated, the only thing I can figure out is that "inherited" might get the ItemIndex updated. Please help.
Code: Select all
procedure TChartListBox.MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
inherited; // 7.01
HideEditor;
if ItemIndex<>-1 then
begin
tmp:=SeriesAtMousePos(p);
...
Many thanks, want to know this badly.
Fang
p.s sorry for this newbie question
-
Narcís
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
-
Contact:
Post
by Narcís » Wed Apr 19, 2006 8:29 am
Hi Fang,
It is a property which has "get" and "set" methods so it is updated in GetSelectedSeries and SetSelectedSeries.
-
Fang
- Newbie
- Posts: 66
- Joined: Wed Oct 13, 2004 4:00 am
Post
by Fang » Wed Apr 19, 2006 11:40 am
o, I know that.
But I don't see them get called either. Only here it's been referenced
Code: Select all
procedure TChartListBox.UpdateSeries;
begin
FillSeries(SelectedSeries);
end;
But I don't see why mousedown will trigger this.
-
Pep
- Site Admin
- Posts: 3303
- Joined: Fri Nov 14, 2003 5:00 am
-
Contact:
Post
by Pep » Fri Apr 28, 2006 3:43 pm
Hi Fang,
you can see it here, in the TeeListB.pas :
Code: Select all
Procedure TChartListBox.SetSelectedSeries(Value:TChartSeries);
begin
ItemIndex:=Items.IndexOfObject(Value);
if ItemIndex<>-1 then Selected[ItemIndex]:=True;
{$IFDEF CLX}
DoRefresh;
{$ENDIF}
end;
-
Fang
- Newbie
- Posts: 66
- Joined: Wed Oct 13, 2004 4:00 am
Post
by Fang » Fri Apr 28, 2006 4:33 pm
Hi Pep, Narcís,
this may sounds very obvious to you, but I just don't get the picture where this selectedseries get updated from mousedown or mouseclick event. It'll be great if you can point me where is the line which calls selectedseries in mousedown event. Ex. user click or press the mouse, which line tells the seletedseries to change, I can't see that. ( I know if I call selectedseries, it'll be set. )
Best Regards
Thank you very much.
Fang
p.s so far you guys are telling me what's the implementation of selectedseries , it's some mis-understanding here.
-
Pep
- Site Admin
- Posts: 3303
- Joined: Fri Nov 14, 2003 5:00 am
-
Contact:
Post
by Pep » Mon May 08, 2006 2:13 pm
Hi Fang,
this Function is the one which returns the Series that is selected :
Code: Select all
Function TChartListBox.GetSeries(Index:Integer):TChartSeries;
begin
if (Index<>-1) and (Index<Items.Count) then
result:=TChartSeries(Items.Objects[Index])
else
result:=nil;
end;
And, it's called in the LBSeriesDrawItem method, at the following line :
tmpSeries:=Series[Index];