Intercepting the "Add" button on TEditor.

TeeChart for ActiveX, COM and ASP
Post Reply
TonyVSUK
Advanced
Posts: 163
Joined: Wed Mar 01, 2006 12:00 am

Intercepting the "Add" button on TEditor.

Post by TonyVSUK » Tue Mar 24, 2009 6:54 pm

Hello all,

I use TChart in some of my software. There is one thing I cannot work out if I can do or not.

What I want to do is have the end user click the "Add" button on the Editor dialog, select the chart type they want, and then let me display a dialog so that the user can select one of a set of pre-defined series titles. Once they click OK to select the series title, I can then squirt in the data points.

Does that make sense?

I have searched through everything I can find, and cannot work out if this is possible.

Thanks in advance for any help.

Tony.

TonyVSUK
Advanced
Posts: 163
Joined: Wed Mar 01, 2006 12:00 am

Post by TonyVSUK » Tue Mar 24, 2009 7:21 pm

Note : I am still using tchart version 7.

I've just run the tchart 8 demo for the first time, and it seems there is an "OnAddSeries" event.

So it looks like I need to upgrade ASAP.

Tony.

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

Post by Yeray » Wed Mar 25, 2009 9:16 am

Hi Tony,

I'm not sure to understand what are you exactly trying to do. I understand that you have a TeeEditor and you want to "do something" when the user adds a series.

I only can think in a solution if you are not allowing the user to remove a series at the same time. You could check if there are more series than before calling TeeEditor1.ShowEditor:

Code: Select all

Private Sub Command1_Click()
Dim OldSeriesNum As Integer
  OldSeriesNum = TChart1.SeriesCount
  TeeEditor1.ShowEditor
  
  If TChart1.SeriesCount > OldSeriesNum Then
    'do what you want
  End If
End Sub
If this is not what are you trying to do, please try to explain the process you are exactly trying to achieve and we'll see if it's still possible with v7.
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

TonyVSUK
Advanced
Posts: 163
Joined: Wed Mar 01, 2006 12:00 am

Post by TonyVSUK » Wed Mar 25, 2009 9:25 am

Don't worry. I've already upgraded to version 8 and I can do what I need to using that.

But to clarify, I have some GUI building software. In the background, there are a series of pre-defined time series (I have the time series name and values). So what I wanted to do was have the user add a series, and then let them select which time series they want to display on that series.

I wanted the user to click "Add" and select the series type, then instead of having the name "Series0", I wanted to show them a dialog and let them select from a drop down box. I can do this using V8 by intercepting the "OnAddSeries" function (I can display my dialog, if the user clicks OK, I modify the newly added series, if they click cancel, I can just remove it).

Tony.

Post Reply