Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 1234 - Child views can not be added
Summary: Child views can not be added
Status: RESOLVED FIXED
Alias: None
Product: .NET TeeChart
Classification: Unclassified
Component: Android (show other bugs)
Version: unspecified
Hardware: PC Android
: --- normal
Target Milestone: ---
Assignee: Steema Issue Manager
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-11 06:16 EDT by narcís calvet
Modified: 2015-06-11 07:04 EDT (History)
1 user (show)

See Also:
Chart Series: ---
Delphi / C++ Builder RAD IDE Version:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description narcís calvet 2015-06-11 06:16:01 EDT
Child views can not be added over a TChart component. For example, you can not draw a button over it. The call to the method below prevents that.

    /// <summary>
    /// Removes current view items.
    /// </summary>
    private void CleanView()
    {
      this.RemoveAllViewsInLayout();
      this.SetBackgroundDrawable(null);
    }

Code to reproduce it: 

  public class MainActivity : Activity
  {
    protected override void OnCreate(Bundle bundle)
    {
      base.OnCreate(bundle);
      InitializeChart();
    }

    private Steema.TeeChart.TChart tChart1;
    private Steema.TeeChart.Styles.Pie pie1;

    private void InitializeChart()
    {
      tChart1 = new Steema.TeeChart.TChart(this);
      tChart1.Aspect.View3D = false;
      tChart1.Legend.Visible = false;

      pie1 = new Steema.TeeChart.Styles.Pie(tChart1.Chart);      
      pie1.Circled = true;
      pie1.Marks.Visible = false;
      pie1.Add(25);
      pie1.Add(25);
      pie1.Add(25);
      pie1.Add(25);

      SetContentView(tChart1);
      AddButtons();
    }

    private void AddButtons()
    {
      var button1 = new Button(this);
      button1.Text = "button1";
      button1.Click += delegate {
        Toast
          .MakeText(this, button1.Text + " clicked!", ToastLength.Short)
          .Show();
      };

      var buttonRect = new System.Drawing.Rectangle(500, 500, 300, 100);
      var layout1 = new Android.Widget.FrameLayout.LayoutParams(buttonRect.Width, buttonRect.Height);
      layout1.SetMargins(buttonRect.Left, buttonRect.Top, buttonRect.Right, buttonRect.Bottom);
      //layout1.Gravity = 0;

      button1.LayoutParameters = layout1;

      tChart1.AddView(button1);
    }
  }