access teechart commander methods

TeeChart for ActiveX, COM and ASP
Post Reply
Dominik
Newbie
Newbie
Posts: 9
Joined: Thu Oct 06, 2016 12:00 am

access teechart commander methods

Post by Dominik » Tue Mar 14, 2017 2:53 pm

Hi,

I’m currently trying to implement a teechart-chart into our application’s new gui. Instead of using the tee-commander controlling the functions of the chart, I’m building my own menu with selected menu-actions of the tee-commander.

Is it (or how is it) possible to access the commander’s methods (e.g. rotate and zoom)? What I’m trying to achieve is having my own button for rotating the chart just like the rotate button on the tee-commander does.

Thanks in advance and best regards,
Dominik
Attachments
teechart_commander_v2017.PNG
teechart_commander_v2017.PNG (11.49 KiB) Viewed 3104 times

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

Re: access teechart commander methods

Post by Yeray » Wed Mar 15, 2017 8:44 am

Hello,

The easiest way for the rotation would probably be using a TRotateTool, and activate/deactivate it through your button.
The buttons in the commander basically set move/rotation modes. These modes use the mouse events to modify the Chart's Aspect Rotation/Elevation properties for the Rotation, and the HorizOffset/VertOffset for the Move.
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

Dominik
Newbie
Newbie
Posts: 9
Joined: Thu Oct 06, 2016 12:00 am

Re: access teechart commander methods

Post by Dominik » Tue Apr 18, 2017 1:56 pm

Hi,

I'm still trying to get this working the simple way.

In an older post here in the forum (http://216.92.243.79/support/viewtopic. ... 97a3a9f480) Yeray wrote, that that the "rotate" and "move" buttons are used as flags within the TeeChart Commander.

Is it possible to access these flags in order to have my buttons having the exact same behaviour as the TeeChart Commander's buttons have?

Thanks in advance
Dominik

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

Re: access teechart commander methods

Post by Yeray » Thu Apr 20, 2017 8:49 am

Hello,

The only way I can think to have the exact same behaviour is by using it, hidden. Ie:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
begin
  TeeCommander1.Hide;
end;

procedure TForm1.MoveButtonClick(Sender: TObject);
begin
  TeeCommander1.ButtonMove.Click;
  TeeCommander1.ButtonMove.Down:=True;
end;

procedure TForm1.DepthButtonClick(Sender: TObject);
begin
  TeeCommander1.ButtonDepth.Click;
  TeeCommander1.ButtonDepth.Down:=True;
end;

procedure TForm1.ZoomButtonClick(Sender: TObject);
begin
  TeeCommander1.ButtonZoom.Click;
  TeeCommander1.ButtonZoom.Down:=True;
end;
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

Dominik
Newbie
Newbie
Posts: 9
Joined: Thu Oct 06, 2016 12:00 am

Re: access teechart commander methods

Post by Dominik » Fri Apr 21, 2017 9:33 am

Hi Yeray,

thanks for your reply.

Using the TeeComander hidden was the plan. :wink:

I just tried your code but I can not access the method "click" and the property "down" of the ITeeCommanderButton-Object. Are these methods/properties public in TeeChart ActiveX?

Thats a excerpt of my code:

Code: Select all

    Dim button As TeeChart.ITeeCommanderButton 'Can be Mouse-, Rotate- or Zoom-Button.
    
    Select Case MenuNo
        Case sxMenuItems.sxMouse 'Mouse Cursor for Click-Events
            Set button = Me.TeeCommander1.Object.ButtonMove
            button.Click
            button.Down = True
        Case sxMenuItems.sxRotate 'Rotating the Chart
            Set button = Me.TeeCommander1.Object.DepthButtonClick
            button.Click
            button.Down = True
        Case sxMenuItems.sxZoom 'Zooming the Chart
            Set button = Me.TeeCommander1.Object.ButtonZoom
            button.Click
            button.Down = True
    End Select
Do you have an idea?

Thanks in advance and best regards
Dominik

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

Re: access teechart commander methods

Post by Yeray » Fri Apr 28, 2017 7:17 am

Hello,
Dominik wrote:Are these methods/properties public in TeeChart ActiveX?
Sorry, that's the problem.
I've added it to the public tracker:
http://bugs.teechart.net/show_bug.cgi?id=1852
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

Dominik
Newbie
Newbie
Posts: 9
Joined: Thu Oct 06, 2016 12:00 am

Re: access teechart commander methods

Post by Dominik » Fri Apr 28, 2017 7:40 am

Hi Yeray,

thanks for your support.

Best regards
Dominik

Post Reply