Page 1 of 1

access teechart commander methods

Posted: Tue Mar 14, 2017 2:53 pm
by 16679289
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

Re: access teechart commander methods

Posted: Wed Mar 15, 2017 8:44 am
by yeray
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.

Re: access teechart commander methods

Posted: Tue Apr 18, 2017 1:56 pm
by 16679289
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

Re: access teechart commander methods

Posted: Thu Apr 20, 2017 8:49 am
by yeray
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;

Re: access teechart commander methods

Posted: Fri Apr 21, 2017 9:33 am
by 16679289
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

Re: access teechart commander methods

Posted: Fri Apr 28, 2017 7:17 am
by yeray
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

Re: access teechart commander methods

Posted: Fri Apr 28, 2017 7:40 am
by 16679289
Hi Yeray,

thanks for your support.

Best regards
Dominik