DEL Key and List BOX

TeeChart for ActiveX, COM and ASP
Post Reply
tdm
Newbie
Newbie
Posts: 22
Joined: Fri Oct 22, 2004 4:00 am
Location: mérignac, france
Contact:

DEL Key and List BOX

Post by tdm » Mon Dec 20, 2004 10:40 am

Hi !
Does anyone knows if it is possible to prevent the user from pressing the keyboard's DEL key above a LisBox component ?
Indeed this key removes the selected serie of the Chart.
I wish the user could not delete any serie from the Chart.

So, I must catch the DEL key pressed EVENT but such an event doesn't exist...
If I could catch such an event, I could warn the user the pressing the del key will make the program to hang up.

Thanks for your help

Pep
Site Admin
Site Admin
Posts: 3296
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Mon Dec 20, 2004 11:06 am

Hi,
TeeListBox does not have a KeyDown event associated with it. The following boolean properties will be added for the next maintenance relesaes :

AskDelete
AllowDeleteSeries
AllowAddSeries

But it could be simulated using the following code, when run with a form with a small command button _underneath_ a TeeChart or TeListBox object :

Code: Select all

Private Sub Command1_KeyDown(KeyCode As Integer, Shift As Integer)
  MsgBox KeyCode
End Sub

Private Sub Form_Load()
With TChart1
 .AddSeries scArea
 .Series(0).FillSampleValues (10)
End With
With TeeListBox1
  .Chart = TChart1
  .ShowIcon = False
End With
End Sub

Private Sub TeeListBox1_GotFocus()
  Command1.SetFocus
End Sub

tdm
Newbie
Newbie
Posts: 22
Joined: Fri Oct 22, 2004 4:00 am
Location: mérignac, france
Contact:

what about the properties planned to add ?

Post by tdm » Mon May 02, 2005 9:19 am

Hi !
I can't find the properties you promised to me in the 7.0.0.4 release :
AskDelete
AllowDeleteSeries
AllowAddSeries
for the ITeeListBox component.
Where are they ?
thanks for your reply.

Pep
Site Admin
Site Admin
Posts: 3296
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Fri May 06, 2005 7:21 am

Hi,

you're correct. I'm sorry, I'll add them for the next v7.0.0.5 release.

tdm
Newbie
Newbie
Posts: 22
Joined: Fri Oct 22, 2004 4:00 am
Location: mérignac, france
Contact:

Post by tdm » Fri May 13, 2005 1:40 pm

Thanks !
I'm waiting the next release impatiently :).
bye.

Jenn
Newbie
Newbie
Posts: 19
Joined: Fri Jul 08, 2005 4:00 am
Location: Logan, Utah United States

Post by Jenn » Fri Nov 03, 2006 1:15 am

Hello Pep,

The following attributes have been added to the TeeListBox

AskDelete
AllowDeleteSeries
AllowAddSeries
ItemHeight

but it looks like we can only modify these at design time. There's no way to set these attributes during run time?

Thanks,

Jenn

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

Post by Narcís » Fri Nov 03, 2006 8:44 am

Hi Jenn,

Have you tried doing this?

Code: Select all

    With TeeListBox1
        .Chart = TChart1
        .AskDelete = True
        .AllowDeleteSeries = True
        .AllowAddSeries = True
        .ItemHeight = 20
    End With
Works fine for me here using Insert and Delete keys for adding and removing series.
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

Jenn
Newbie
Newbie
Posts: 19
Joined: Fri Jul 08, 2005 4:00 am
Location: Logan, Utah United States

Post by Jenn » Tue Nov 07, 2006 6:30 pm

Hello Josep,

I am using VC++, TeeChart Pro V7.0.1.2.
and I don't see how to modify the AskDelete, AllowDeleteSeries, and AllowAddSeries in the teelistbox.h file.

Is there something else I need to do when I update my TeeChart files to get the appropriate header files? I think I've done everything I need to do, but maybe there's somthing I'm missing. I can modify these settings using the dialog editor, but I don't seee how to change the options during run-time, at least not in VC++.

Thank you.

Jennifer Britt

Pep
Site Admin
Site Admin
Posts: 3296
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Mon Nov 13, 2006 9:39 am

Hi Jennifer,

using the latest v7.012 posted on our web site you should be able to do it using the following code :

Code: Select all

	m_listbox.SetChartLink(m_chart.GetChartLink());
	m_listbox.SetAskDelete(true);
	m_listbox.SetAllowDeleteSeries(true);
	m_listbox.SetAllowAddSeries(true);
	m_listbox.SetItemHeight(30);

Jenn
Newbie
Newbie
Posts: 19
Joined: Fri Jul 08, 2005 4:00 am
Location: Logan, Utah United States

Post by Jenn » Wed Nov 15, 2006 1:52 am

Hello Josep,

Thank you for your reply.

The problem I experienced, though, was that my header files were not updated when I updated my TeeChart7.ocx file. I thought that the header files in my Program Files\Steema Software directory would have been updated at the same time, but they were not.

I got around this problem by doing the following.
  • Create a new temporary project
    Add a TeeListBox component to the project. This generates new header files.
    Copy over the newly genearted files over to my working project.
I am not sure if there is a cleaner way around this, but that seemed to work for me. Can you please tell me if there is a cleaner way to do this when we update our TChart project?

Thank you!

Jennifer Britt

Pep
Site Admin
Site Admin
Posts: 3296
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Tue Nov 21, 2006 10:16 am

Hi Jennifer,

yes, you're correct, we forgot to update the header files with the new maintenance release. The steps you've done are correct ones.
Just in case you have any problems with this, here you can see how to regenerate then :
http://www.teechart.net/support/viewtop ... c&start=15.

Post Reply