Teecommander

TeeChart FireMonkey (Windows,OSX,iOS & Android) for Embarcadero RAD Studio, Delphi and C++ Builder (XE5+)
walter0316
Newbie
Newbie
Posts: 37
Joined: Mon Jul 13, 2015 12:00 am

Teecommander

Post by walter0316 » Tue Mar 29, 2016 6:35 am

Hi
I want to make some buttons of the Teecommander for FMX myself.
How Can I call the MOVE-Function of the Teecommander by hitting one of my self-drawn buttons?
Can you list all commands of the teecommander?
Because my Teecommander has soo small buttons, I can not hit it on the screen, only with mouse it works fine.
thanks

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

Re: Teecommander

Post by Narcís » Tue Mar 29, 2016 2:05 pm

Hello,
How Can I call the MOVE-Function of the Teecommander by hitting one of my self-drawn buttons?
That's what that button does:

Code: Select all

  Procedure DoMove;
  var tmpZ : Double;
  begin
    if not FPanel.Canvas.SupportsFullRotation then // SupportsZoom2D
       Set3D;

    With FPanel.View3DOptions do
    begin
      tmpZ:=1;

      HorizOffsetFloat:=HorizOffsetFloat+((X-FOldX)*tmpZ);
      VertOffsetFloat:=VertOffsetFloat+((Y-FOldY)*tmpZ);
    end;

    {$IFDEF FMX}
    InvalidatePanel;
    {$ENDIF}

    FOldX:=X;
    FOldY:=Y;
  end;
InvalidedPanel method being like this:

Code: Select all

{$IFDEF FMX}
// When BufferedDisplay=True this is necessary because View3DOptions does not call
// FPanel.Invalidate
Procedure TTeeCommander.InvalidatePanel;
begin
  FPanel.Invalidate;
end;
{$ENDIF}
Can you list all commands of the teecommander?
I'm not 100% sure about what you request here. Anyway, being a source code customer, you should find all code behind TeeCommander at TeeComma.pas unit.
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

walter0316
Newbie
Newbie
Posts: 37
Joined: Mon Jul 13, 2015 12:00 am

Re: Teecommander

Post by walter0316 » Tue Mar 29, 2016 2:14 pm

yes I will look into the source. thanks
Maybe cou could tell me what I should write to a buttonclick method when I want that this botton should MOVE from the Commander.
Thanks a lot.

PS: BWT when I define a SERIES als POINT3DSeries and I click in the IDE Editor on the Series I get an error in XE6. (NOt found a property)
COuld you fix this please? IN the NON 3D POINT SERIES it works fine,

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

Re: Teecommander

Post by Narcís » Tue Mar 29, 2016 2:31 pm

Hi Walter,
walter0316 wrote: Maybe cou could tell me what I should write to a buttonclick method when I want that this botton should MOVE from the Commander.
I already posted that code in my previous answer.
walter0316 wrote: PS: BWT when I define a SERIES als POINT3DSeries and I click in the IDE Editor on the Series I get an error in XE6. (NOt found a property)
COuld you fix this please? IN the NON 3D POINT SERIES it works fine,
Thanks for reporting. I added it (bug #1481) to the bug tracking system to be fixed for future releases. Please feel free to sign up and add yourself to the CC List to be notified about status updates.
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

walter0316
Newbie
Newbie
Posts: 37
Joined: Mon Jul 13, 2015 12:00 am

Re: Teecommander

Post by walter0316 » Tue Mar 29, 2016 2:52 pm

is there a way to make the button larger so That I do not use a mouse but could use my fingers?
ANd How can I disable the Print and save button in the commander, as SHOWMODAL is not installed in my Tablet.

walter0316
Newbie
Newbie
Posts: 37
Joined: Mon Jul 13, 2015 12:00 am

Re: Teecommander

Post by walter0316 » Tue Mar 29, 2016 2:58 pm

thanks a lot.

Ok, I ssee the move button. But I do not understand it, sorry I am nooot sooo good in delphi like you.
I would need the code for the first 6 icons on the commander from left.
PLEASE could you give me a code example? I still learn a lot from you.
thanks
walter

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

Re: Teecommander

Post by Narcís » Tue Mar 29, 2016 3:00 pm

Hi Walter,
walter0316 wrote:is there a way to make the button larger so That I do not use a mouse but could use my fingers?
Yes, you can customize that at TCustomTeeCommander.CreateButton in TeeComma.pas.
walter0316 wrote:ANd How can I disable the Print and save button in the commander, as SHOWMODAL is not installed in my Tablet.
You should do as in the HideTabs feature as shown in the All Features\Welcome!\Componets\Chart Editor\Chart Editor dialog example in the features demo, available at TeeChart's program group.
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

walter0316
Newbie
Newbie
Posts: 37
Joined: Mon Jul 13, 2015 12:00 am

Re: Teecommander

Post by walter0316 » Tue Mar 29, 2016 3:20 pm

the demo does not work properly with XE6. Ara has send me a zip but not working fine. (delphi XE6)
So I have noe demo available.
thanks

walter0316
Newbie
Newbie
Posts: 37
Joined: Mon Jul 13, 2015 12:00 am

Re: Teecommander

Post by walter0316 » Tue Mar 29, 2016 3:22 pm

Yes, you can customize that at TCustomTeeCommander.CreateButton in TeeComma.pas.
Then I must recompile the stuff, and I do not know how it done,s o that it will work with XE6. I tried to get it run with the demo - demo has some prop in it which XE6 does not have.

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

Re: Teecommander

Post by Narcís » Wed Mar 30, 2016 6:35 am

walter0316 wrote:the demo does not work properly with XE6. Ara has send me a zip but not working fine. (delphi XE6)
So I have noe demo available.
This is the VCL demo included with the binary installer, not the Firemonkey demo. Please run Tee9New.exe to find out that demo.
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

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

Re: Teecommander

Post by Narcís » Wed Mar 30, 2016 6:36 am

walter0316 wrote: Then I must recompile the stuff, and I do not know how it done,s o that it will work with XE6.
Just run TeeRecompile tool shipped with the source code installer to compile all TeeChart packages and install them into your environment of choice.
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

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

Re: Teecommander

Post by Narcís » Wed Mar 30, 2016 6:56 am

walter0316 wrote: PLEASE could you give me a code example? I still learn a lot from you.
Find attached a basic example of how you should combine mouse events and commander code to achieve what you request. It is not fully functional, you should look further at TeeCommander on how events are combined.

Regarding mobile devices, you might be interested in a blog post I wrote about Delphi Gestures with TeeChart.
Attachments
CommanderMove.zip
(7.24 KiB) Downloaded 1804 times
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

walter0316
Newbie
Newbie
Posts: 37
Joined: Mon Jul 13, 2015 12:00 am

Re: Teecommander

Post by walter0316 » Wed Mar 30, 2016 9:04 am

Thank you very much.
Would you be also be so kind and give me an example how to disable/hide the last 4 Icons in the commander? THanks!!!

walter0316
Newbie
Newbie
Posts: 37
Joined: Mon Jul 13, 2015 12:00 am

Re: Teecommander

Post by walter0316 » Wed Mar 30, 2016 9:23 am

ok, Narcis, I had to ignore some Property missing and del the Presentation unit in the uses clause for my XE6.
I could run now the example.

BUt I do not understand, what I must change, when I want to do a ROTATE command.
WOuld you mind telling me how to change it?

I thought the commander would be like the commander from the DB, where the Commandercommang is a Type in the call.

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

Re: Teecommander

Post by Yeray » Wed Mar 30, 2016 11:46 am

Hello,

You can hide buttons from the TeeCommander as shown in the demo at "All features\Welcome !\Components\Toolbar\Custom buttons". Ie:

Code: Select all

 TeeCommander1.CreateControls( [ tcbRotate, tcbSeparator, tcb3D ] );
The "move" and the "rotate" buttons in the commander are used as flags.
This is the code being called at the MouseMove event when the "move" button is down (that's what Narcís' project shows):

Code: Select all

  Procedure DoMove;
  var tmpZ : Double;
  begin
    if not FPanel.Canvas.SupportsFullRotation then // SupportsZoom2D
       Set3D;

    With FPanel.View3DOptions do
    begin
      tmpZ:=1;

      HorizOffsetFloat:=HorizOffsetFloat+((X-FOldX)*tmpZ);
      VertOffsetFloat:=VertOffsetFloat+((Y-FOldY)*tmpZ);
    end;

    {$IFDEF FMX}
    InvalidatePanel;
    {$ENDIF}

    FOldX:=X;
    FOldY:=Y;
  end;
This is the code being called at the MouseMove event when the "rotate" button is down:

Code: Select all

  Procedure DoRotate;
  begin
    // 2D with circled series (Pie, Gauge, Polar, Smith, etc):
    if (not FPanel.View3D) and Assigned(ICircledSeries) then
       ICircledSeries.RotationAngle:=Round(HalfDivPi*ICircledSeries.PointToAngle(X,Y))+ICircledSeries.RotationAngle
    else
    begin
      Set3D;

      with FPanel,View3DOptions do
      begin
        Orthogonal:=False;

        if FAllowRotationX then
           IDifX:=90.0*(X-FOldX)/Width
        else
           IDifX:=0;

        if FAllowRotationY then
           IDifY:=90.0*(FOldY-Y)/Height
        else
           IDifY:=0;
      end;

      IShift:=Shift;

      DoRotation(IDifX,IDifY);
    end;

    FOldX:=X;
    FOldY:=Y;

    IRotating:=True;
  end;

Procedure TTeeCommander.DoRotation(const IDifX,IDifY:Double);

  function AllowFullRotation:Boolean;
  begin
    result:=FAllowFull or FPanel.Canvas.SupportsFullRotation;
  end;

  Function CorrectAngle(Const AAngle:Double):Double;
  begin
    result:=AAngle;

    if result>360 then result:=result-360
    else
    if result<0 then result:=360+result;
  end;

begin
  with FPanel.View3DOptions do
  if AllowFullRotation then
  begin
    if ssShift in IShift then
       Tilt:=Round(CorrectAngle(Tilt+IDifY))
    else
    begin
      RotationFloat:=CorrectAngle(RotationFloat+IDifX);
      ElevationFloat:=CorrectAngle(ElevationFloat+IDifY);
    end;
  end
  else
  begin
    if Assigned(ICircledSeries) then
    begin
      Rotation:=360;

      if not AllowFullRotation then
         Perspective:=0;

      if IDifX<>0 then
         with ICircledSeries do
              RotationAngle:=Round(CorrectAngle(RotationAngle+IDifX));
    end
    else
      RotationFloat:=TRotateTool.RotationChange(AllowFullRotation,RotationFloat,IDifX);

    ElevationFloat:=TRotateTool.ElevationChange(AllowFullRotation,ElevationFloat,IDifY);
  end;

  {$IFDEF FMX}
  InvalidatePanel;
  {$ENDIF}
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

Post Reply