Modifying TCursor

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
AMS
Newbie
Newbie
Posts: 24
Joined: Wed Mar 31, 2004 5:00 am
Location: South Africa
Contact:

Modifying TCursor

Post by AMS » Mon Sep 12, 2005 12:24 pm

Hi Guys,
All the TControl objects have a Cursor property that can be modified at design or runtime with values such as crDefault, crSQLWait, crHandPoint etc. TChart also has the Cursor property that can only be set a design time. When set at runtime the cursor is overridden or something...

Could you give me some pointers on how I can control this property at runtime, remember that this is not TCursorTool.

I used this example with a form containing a TChart and TPanel component. It works for TPanel but not TChart.

Code: Select all

class TfrmMain : public TForm
{
__published:	// IDE-managed Components
  TChart          *Chart;
  TChartEditor    *ChartEditor;
  TPopupMenu      *PopupMenu;
  TMenuItem       *ChartProperties;
  TPanel          *Panel;
  TComboBox       *ComboBox;
  void __fastcall FormShow(TObject *Sender);
  void __fastcall ChartPropertiesClick(TObject *Sender);
  void __fastcall ComboBoxChange(TObject *Sender);
private:	// User declarations

public:		// User declarations
  __fastcall TfrmMain(TComponent* Owner);
};

//---------------------------------------------------------------------------
__fastcall TfrmMain::TfrmMain(TComponent* Owner)
  : TForm(Owner)
{                           
}
//---------------------------------------------------------------------------

void __fastcall TfrmMain::FormShow(TObject *Sender)
{
  TLineSeries *ptrToLineSeries;

  Chart->Legend->CheckBoxes = true;

  for( int i=0; i < 3; i++ )
  {
    ptrToLineSeries = new TLineSeries(Chart);
    ptrToLineSeries->Title = "Series " + AnsiString(i);

    ptrToLineSeries->FillSampleValues(20);
    ptrToLineSeries->ShowInLegend = true;
    ptrToLineSeries->Pointer->Visible = true;

    Chart->AddSeries( ptrToLineSeries );
  }

}
//---------------------------------------------------------------------------
void __fastcall TfrmMain::ChartPropertiesClick(TObject *Sender)
{
  ChartEditor->Execute();
}
//---------------------------------------------------------------------------

void __fastcall TfrmMain::ComboBoxChange(TObject *Sender)
{

  // Update the Cursor Image for the objects when the mouse moves over them.
  //  This is used during various phases of the program.
  switch( ComboBox->ItemIndex )
  {
    case 0:
      Chart->Cursor = crDefault;
      Panel->Cursor = crDefault;
    break;

    case 1:
      Chart->Cursor = crHourGlass;
      Panel->Cursor = crHourGlass;
    break;

    case 2:
      Chart->Cursor = crSQLWait;
      Panel->Cursor = crSQLWait;
    break;

    case 3:
      Chart->Cursor = crAppStart;
      Panel->Cursor = crAppStart;
    break;
  }
}
Regards, John.

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 Sep 13, 2005 3:19 pm

Hi John,

I've been able to reproduce what you report and it's a bug in TeeChart for BCB. I've added this to our defect 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

Post Reply