protected void AddElement(NDrawingDocument document, NChemicalElement ce)
        {
            string str  = ce.number.ToString();
            NSizeF size = new NSizeF(10, 15);

            str += "<br/><font size='14'><b>" + ce.symbol + "</b></font><br/>";
            str += ce.weight;

            NShape element = null;

            element      = new NRectangleShape(GetElementBounds(ce.col, ce.row));
            element.Text = str;
            element.Style.InteractivityStyle = new NInteractivityStyle(true, null, ce.tooltip);
            element.Style.FillStyle          = ce.fillStyle;
            document.ActiveLayer.AddChild(element);
        }
示例#2
0
        protected void AddElement(NDrawingDocument document, NChemicalElement ce)
        {
            string str  = ce.number.ToString();
            NSizeF size = new NSizeF(10, 15);

            str += "<br/><font size='14'><b>" + ce.symbol + "</b></font><br/>";
            str += ce.weight;

            CursorType ct = CursorType.Default;

            if (ce.fillStyle == fsNonMetals)
            {
                ct = CursorType.Hand;
            }
            else if (ce.fillStyle == fsMetals)
            {
                ct = CursorType.Cross;
            }
            else if (ce.fillStyle == fsMatalloids)
            {
                ct = CursorType.SizeAll;
            }
            else if (ce.fillStyle == fsGases)
            {
                ct = CursorType.VSplit;
            }
            else if (ce.fillStyle == feMoccasin)
            {
                ct = CursorType.HSplit;
            }
            else if (ce.fillStyle == feGold)
            {
                ct = CursorType.Help;
            }
            else if (ce.fillStyle == feCentralGroup)
            {
                ct = CursorType.WaitCursor;
            }

            NShape element = null;

            element      = new NRectangleShape(GetElementBounds(ce.col, ce.row));
            element.Text = str;
            element.Style.InteractivityStyle = new NInteractivityStyle(true, null, null, ct);
            element.Style.FillStyle          = ce.fillStyle;
            document.ActiveLayer.AddChild(element);
        }
示例#3
0
        protected void AddElement(NDrawingDocument document, NChemicalElement ce)
        {
            string str  = ce.number.ToString();
            NSizeF size = new NSizeF(10, 15);

            str += "<br/><font size='14'><b>" + ce.symbol + "</b></font><br/>";
            str += ce.weight;

            NShape element = null;

            element      = new NRectangleShape(GetElementBounds(ce.col, ce.row));
            element.Text = str;
            string url = string.Format("http://www.google.com/search?hl=en&q={0}+chemical+element", HttpUtility.UrlEncode(ce.symbol.Replace("*", string.Empty)));

            element.Style.InteractivityStyle = new NInteractivityStyle(true, null, null, CursorType.Default, url);
            element.Style.FillStyle          = ce.fillStyle;
            document.ActiveLayer.AddChild(element);
        }