Beispiel #1
0
        public override void SetToolTip()
        {
            wLabel   L = DataGrid.Sets[0].Points[0].ToolTip;
            wGraphic G = L.Graphics;
            wFont    F = G.FontObject;

            DefaultTooltip Tip = (DefaultTooltip)Element.DataTooltip;

            Tip.SelectionMode = TooltipSelectionMode.OnlySender;

            if (L.Enabled)
            {
                Tip.BulletSize = 0;

                Tip.ShowSeries = false;
                Tip.Background = G.GetBackgroundBrush();
                Tip.Foreground = F.GetFontBrush();

                Tip.BorderBrush     = G.GetStrokeBrush();
                Tip.BorderThickness = G.GetStroke();

                Tip.FontFamily = F.ToMediaFont().Family;
                Tip.FontSize   = F.Size;
                Tip.FontStyle  = F.ToMediaFont().Italic;
                Tip.FontWeight = F.ToMediaFont().Bold;
            }

            Element.DataTooltip = Tip;
        }
Beispiel #2
0
        public void SetLabel(wLabel NewLabel)
        {
            NewLabel.Content = Label.Content;
            NewLabel.Format  = Label.Format;

            Label         = NewLabel;
            CustomLabels += 1;
        }
Beispiel #3
0
 public void SetDefaultLabels(wLabel CustomLabel)
 {
     for (int i = 0; i < Sets.Count; i++)
     {
         for (int j = 0; j < Sets[i].Points.Count; j++)
         {
             Sets[i].Points[j].SetLabel(CustomLabel);
         }
     }
 }
Beispiel #4
0
        public void SetChartLabels(wLabel NewLabel)
        {
            int Mode = (int)NewLabel.Position;

            ChartSeries.SmartLabelStyle.Enabled = DataList.Points[0].Label.HasLeader;
            ChartSeries.SmartLabelStyle.AllowOutsidePlotArea       = LabelOutsidePlotAreaStyle.Yes;
            ChartSeries.SmartLabelStyle.IsMarkerOverlappingAllowed = false;
            ChartSeries.SmartLabelStyle.MaxMovingDistance          = 600;
            ChartSeries.SmartLabelStyle.CalloutStyle = LabelCalloutStyle.None;
            ChartSeries.SmartLabelStyle.CalloutLineAnchorCapStyle = LineAnchorCapStyle.None;
        }
Beispiel #5
0
 public void SetUniformTooltips(wLabel newToolTip)
 {
     for (int i = 0; i < Sets.Count; i++)
     {
         for (int j = 0; j < Sets[i].Points.Count; j++)
         {
             Sets[i].Points[j].ToolTip.Enabled  = true;
             Sets[i].Points[j].ToolTip.Graphics = newToolTip.Graphics;
             Sets[i].Points[j].ToolTip.Font     = newToolTip.Font;
         }
     }
 }
Beispiel #6
0
        public void OnAddButonClick(object sender, EventArgs arg)
        {
            IsSaved = false;
            var btn = sender as ToolStripButton;

            switch (btn.Name)
            {
            case "sbLabel":
                var lbl = new wLabel();
                lbl.Name       = "label";
                lbl.Text       = "test";
                lbl.ShowBorder = false;
                lbl.Location   = new Point(10, 50);
                canvas21.Controls.Add(lbl);
                break;

            case "sbBarcode":
                var barcode = new wBarcode();
                barcode.Name       = "Barcode";
                barcode.EncodeType = BarcodeLib.TYPE.CODE128;
                barcode.Location   = new Point(10, 50);
                barcode.Text       = "E123456";
                canvas21.Controls.Add(barcode);
                break;

            case "sbImage":
                var img = new wImage();
                img.Name     = "image";
                img.Location = new Point(10, 50);
                canvas21.Controls.Add(img);
                break;

            case "sbQRCoder":
                var qrcode = new wQRCoder();
                qrcode.Name     = "qrcode";
                qrcode.Text     = "hello";
                qrcode.Location = new Point(10, 50);
                canvas21.Controls.Add(qrcode);
                break;

            case "sbTable":
                var tb = new wTable();
                tb.Name = "table";
                //tb.Size=new Size(200,100);
                tb.Location = new Point(10, 10);
                canvas21.Controls.Add(tb);
                break;
            }
            canvas21.SelectControl = canvas21.Controls[canvas21.Controls.Count - 1];
            canvas21.Refresh();
        }
Beispiel #7
0
        public void SetUniformLabel(wLabel NewLabel, double Angle)
        {
            for (int i = 0; i < Sets.Count; i++)
            {
                for (int j = 0; j < Sets[i].Points.Count; j++)
                {
                    Sets[i].Points[j].Graphics.FontObject.Angle = Angle;

                    Sets[i].Points[j].Label.HasLeader = NewLabel.HasLeader;
                    Sets[i].Points[j].Label.Graphics  = NewLabel.Graphics;
                    Sets[i].Points[j].Label.Position  = NewLabel.Position;
                    Sets[i].Points[j].Label.Alignment = NewLabel.Alignment;

                    Sets[i].Points[j].CustomLabels += 1;
                }
            }
        }
Beispiel #8
0
        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            IGH_Goo Element = null;
            int     X       = 0;
            int     P       = 0;
            double  A       = 0;
            bool    L       = true;

            System.Drawing.Color C = System.Drawing.Color.Transparent;
            System.Drawing.Color F = System.Drawing.Color.Transparent;
            double T = 0;

            if (!DA.GetData(0, ref Element))
            {
                return;
            }
            if (!DA.GetData(1, ref X))
            {
                return;
            }
            if (!DA.GetData(2, ref P))
            {
                return;
            }
            if (!DA.GetData(3, ref A))
            {
                return;
            }
            if (!DA.GetData(4, ref C))
            {
                return;
            }
            if (!DA.GetData(5, ref F))
            {
                return;
            }
            if (!DA.GetData(6, ref T))
            {
                return;
            }

            wObject W;

            Element.CastTo(out W);

            wLabel CustomLabel = new wLabel();

            wGraphic G = CustomLabel.Graphics;

            if (P == 0)
            {
                L = false;
            }

            CustomLabel.HasLeader = L;
            CustomLabel.Graphics  = new wGraphic(new wColor(C), G.Foreground, new wColor(F), T);
            CustomLabel.Position  = (wLabel.LabelPosition)P;
            CustomLabel.Alignment = (wLabel.LabelAlignment)X;

            CustomLabel.Graphics = G;

            switch (W.Type)
            {
            case "Pollen":

                switch (W.SubType)
                {
                case "DataPoint":
                    DataPt Pt = (DataPt)W.Element;

                    Pt.Graphics.FontObject.Angle = A;

                    Pt.Label.HasLeader = L;
                    Pt.Label.Graphics  = new wGraphic(new wColor(C), G.Foreground, new wColor(F), T);
                    Pt.Label.Position  = (wLabel.LabelPosition)P;
                    Pt.Label.Alignment = (wLabel.LabelAlignment)X;
                    Pt.CustomLabels   += 1;

                    W.Element = Pt;
                    break;

                case "DataSet":
                    DataSetCollection St = (DataSetCollection)W.Element;
                    St.SetUniformLabel(CustomLabel, A);

                    St.Graphics.FontObject.Angle = A;

                    St.Label.HasLeader = L;
                    St.Label.Graphics  = new wGraphic(new wColor(C), G.Foreground, new wColor(F), T);
                    St.Label.Position  = (wLabel.LabelPosition)P;
                    St.Label.Alignment = (wLabel.LabelAlignment)X;

                    W.Element = St;
                    break;
                }
                break;
            }

            DA.SetData(0, W);
            DA.SetData(1, CustomLabel);
        }
Beispiel #9
0
        public MainForm()
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();

            wExplorer1.Canvas = canvas21;

            var m_lbl = new wLabel();

            m_lbl.Name                = "hello";
            m_lbl.Text                = "test";
            m_lbl.VeticalAlignment    = StringAlignment.Center;
            m_lbl.HorizontalAlignment = StringAlignment.Center;
            m_lbl.Location            = new Point(10, 50);

            canvas21.Controls.Add(m_lbl);
            canvas21.SizeF = new SizeF(canvas21.Width, canvas21.Height);
            canvas21.SelectControlChangedEvent += new EventHandler(
                delegate(object sender, EventArgs args) {
                IsSaved = false;
                var ctl = canvas21.SelectControl;
                if (m_property != null)
                {
                    m_property.Parent.Controls.Remove(m_property);
                    m_property.Dispose();
                    m_property = null;
                }
                if (ctl != null)
                {
                    if (ctl is wLabel)
                    {
                        m_property = new Editer.wLabelEditer(ctl as wLabel);
                    }
                    else if (ctl is wImage)
                    {
                        m_property = new Spoon.Tools.TemplatePrint.Editer.wImageEditer(ctl as wImage);
                    }
                    else if (ctl is wBarcode)
                    {
                        m_property = new Spoon.Tools.TemplatePrint.Editer.wBarcodeEditer(ctl as wBarcode);
                    }
                    else if (ctl is wQRCoder)
                    {
                        m_property = new Spoon.Tools.TemplatePrint.Editer.wQRCoderEditer(ctl as wQRCoder);
                    }
                    else if (ctl is wTable)
                    {
                        m_property = new Spoon.Tools.TemplatePrint.Editer.wTableEditer(ctl as wTable);
                    }
                    else
                    {
                        m_property = new Spoon.Tools.TemplatePrint.Editer.wControlEditer(canvas21.SelectControl);
                    }
                }
                else
                {
                    m_property = new Spoon.Tools.TemplatePrint.Editer.wCanvasEditer(canvas21);
                }
                tabPage1.Controls.Add(m_property);
                m_property.Dock = DockStyle.Fill;
            }
                );

//			canvas21.LostFocus+=new EventHandler(
//				delegate(object sender,EventArgs e){
//					m_scrollPos.X=(canvas21.Parent as Panel).HorizontalScroll.Value;// splitContainer1.Panel1.HorizontalScroll.Value;
//					m_scrollPos.Y=(canvas21.Parent as Panel).VerticalScroll.Value;//splitContainer1.Panel1.VerticalScroll.Value;
//					System.Diagnostics.Debug.WriteLine(string.Format("Lost {0},{1}",m_scrollPos.X,m_scrollPos.Y));
//				}
//			);
//			canvas21.GotFocus+=new EventHandler(
//				delegate(object sender,EventArgs e){
//					splitContainer1.Panel1.HorizontalScroll.Value=m_scrollPos.X;
//					splitContainer1.Panel1.VerticalScroll.Value=m_scrollPos.Y;
//					System.Diagnostics.Debug.WriteLine(string.Format("Got {0},{1}",m_scrollPos.X,m_scrollPos.Y));
//				}
//			);

            if (Helper.CommandHelper.Configs.ContainsKey("file"))
            {
                OpenFile(Helper.CommandHelper.Configs["file"]);
            }
            if (Helper.CommandHelper.Configs.ContainsKey("set-printername"))
            {
                m_defaultPrinter = Helper.CommandHelper.Configs["set-printername"];
            }
            if (Helper.CommandHelper.Configs.ContainsKey("set-data-excel"))
            {
                m_dataPath = Helper.CommandHelper.Configs["set-data-excel"];
            }
        }
Beispiel #10
0
 public void SetToolTip(wLabel NewToolTip)
 {
     ToolTip = NewToolTip;
 }
Beispiel #11
0
        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            IGH_Goo Element = null;
            IGH_Goo Gx      = null;
            IGH_Goo Fx      = null;

            if (!DA.GetData(0, ref Element))
            {
                return;
            }
            if (!DA.GetData(1, ref Gx))
            {
                return;
            }
            if (!DA.GetData(2, ref Fx))
            {
                return;
            }

            wObject W;

            Element.CastTo(out W);

            wLabel CustomToolTip = new wLabel();

            wGraphic G = CustomToolTip.Graphics;
            wFont    F = CustomToolTip.Font;

            Gx.CastTo(out G);
            Fx.CastTo(out F);

            CustomToolTip.Graphics = G;
            CustomToolTip.Font     = F;

            switch (W.Type)
            {
            case "Pollen":

                switch (W.SubType)
                {
                case "DataPoint":
                    DataPt Pt = (DataPt)W.Element;

                    Pt.ToolTip.Enabled             = true;
                    Pt.ToolTip.Graphics            = G;
                    Pt.ToolTip.Font                = F;
                    Pt.ToolTip.Graphics.FontObject = F;

                    W.Element = Pt;
                    break;

                case "DataSet":
                    DataSetCollection St = (DataSetCollection)W.Element;
                    St.SetUniformTooltips(CustomToolTip);

                    St.ToolTip.Enabled             = true;
                    St.ToolTip.Graphics            = G;
                    St.ToolTip.Font                = F;
                    St.ToolTip.Graphics.FontObject = F;

                    W.Element = St;
                    break;
                }
                break;
            }

            DA.SetData(0, W);
            DA.SetData(1, CustomToolTip);
        }