Ejemplo n.º 1
0
        protected override void RenderContents(HtmlTextWriter output)
        {
            if (this.DesignMode)
            {
                output.Write("<table style='border-color:Black;background-color:" + BackColor.ToString() + "'><tr><td style='vertical-align:middle;text-align:center'> ToolBar: " + ClientID + "</td></tr></table>");
            }
            else
            {
                List <WebButton> _buttons = Buttons;

                string htm   = "";
                string MapID = WebMapID;
                string ControlID;

                for (int i = 0; i < _buttons.Count; i++)
                {
                    WebButton b = _buttons[i];

                    if (b.Type != WebButtonType.Space)
                    {
                        ControlID = "Tool_" + MapID + i.ToString();
                    }
                    else
                    {
                        ControlID = "Space_" + MapID + i.ToString();
                    }

                    string command = b.Command.Replace("<WebMapID>", MapID);
                    command = command.Replace("<index>", ControlID);

                    if (b.Type != WebButtonType.Space)
                    {
                        htm += "<input id=\"" + ControlID +
                               "\" type=\"button" +
                               "\" title=\"" + b.ToolTip +
                               "\" onclick=\"" + command +
                               "\" ondrag(event)=\"return false\" onSelectStart=\"return false\"" +
                               "\" style=\"" + b.Style +
                               " background-image: url(" + b.ImageURL + ");" +
                               " background-color: transparent; border-width: 2px; height: 28px; width: 28px;\" />";
                    }
                    else
                    {
                        htm += "<img id=\"" + ControlID +
                               "\" title=\"" + b.ToolTip +
                               "\" onclick=\"" + command +
                               "\" ondrag(event)=\"return false\" onSelectStart=\"return false\"" +
                               " src=\"" + b.ImageURL + "\" style=\"" + b.Style + "\" />";
                    }
                }

                output.Write(htm);
            }
        }
Ejemplo n.º 2
0
        public void AddButton(WebButtonType type, string Command = "", string ImageURL = "", string Style = "", string ToolTip = "")
        {
            WebButton b = new WebButton();

            b.Type = type;

            if (ImageURL != "")
            {
                b.ImageURL = ImageURL;
            }
            else
            {
                b.ImageURL = Page.ClientScript.GetWebResourceUrl(this.GetType(), _images[(int)type]);
            }

            if (Command != "")
            {
                b.Command = Command;
            }
            else
            {
                b.Command = _commands[(int)type];
            }

            if (Style != "")
            {
                b.Style = Style;
            }
            else
            {
                b.Style = _styles[(int)type];
            }

            if (ToolTip != "")
            {
                b.ToolTip = ToolTip;
            }
            else
            {
                b.ToolTip = _tooltips[(int)type];
            }

            List <WebButton> btns = Buttons;

            btns.Add(b);
            Buttons = btns;
        }
Ejemplo n.º 3
0
        public void AddButton(WebButtonType type, string command = "", string imageUrl = "", string style = "", string toolTip = "")
        {
            WebButton b = new WebButton();

            b.Type = type;

            if (imageUrl != "")
            {
                b.ImageURL = imageUrl;
            }
            else
            {
                b.ImageURL = Page.ClientScript.GetWebResourceUrl(this.GetType(), _images[(int)type]);
            }

            if (command != "")
            {
                b.Command = command;
            }
            else
            {
                b.Command = _commands[(int)type];
            }

            if (style != "")
            {
                b.Style = style;
            }
            else
            {
                b.Style = _styles[(int)type];
            }

            if (toolTip != "")
            {
                b.ToolTip = toolTip;
            }
            else
            {
                b.ToolTip = _tooltips[(int)type];
            }

            List <WebButton> btns = Buttons;

            btns.Add(b);
            Buttons = btns;
        }
Ejemplo n.º 4
0
        public void AddButton(WebButtonType type, string Command = "", string imageURL = "", string style = "")
        {
            WebButton b = new WebButton();

            b.Type = type;


            if (imageURL != "")
            {
                b.ImageURL = imageURL;
            }
            else
            {
                b.ImageURL = Page.ClientScript.GetWebResourceUrl(this.GetType(), _images[(int)type]);
            }

            if (Command != "")
            {
                b.Command = Command;
            }
            else
            {
                b.Command = _commands[(int)type];
            }

            if (style != "")
            {
                b.style = style;
            }
            else
            {
                b.style = _stiles[(int)type];
            }


            List <WebButton> btns = Buttons;

            btns.Add(b);
            Buttons = btns;
        }
Ejemplo n.º 5
0
        public void AddButton(WebButtonType type, string Command = "", string ImageURL = "",  string Style="", string ToolTip="" )
        {
            WebButton b = new WebButton();
            b.Type = type;
            
            if (ImageURL != "")
            {
                b.ImageURL = ImageURL;
            }
            else
            {
                b.ImageURL = Page.ClientScript.GetWebResourceUrl(this.GetType(), _images[(int)type]);
            }

            if (Command != "")
            {
                b.Command = Command;
            }
            else
            {
                b.Command = _commands[(int)type];
            }

            if (Style != "")
            {
                b.Style = Style;
            }
            else
            {
                b.Style = _styles[(int)type];
            }

            if (ToolTip != "")
            {
                b.ToolTip = ToolTip;
            }
            else
            {
                b.ToolTip = _tooltips[(int)type];
            }

            List<WebButton> btns = Buttons;
            btns.Add(b);
            Buttons = btns;
              
        }
Ejemplo n.º 6
0
        public void AddButton(WebButtonType type, string Command = "", string imageURL = "",  string style="" )
        {
            WebButton b = new WebButton();

            b.Type = type;

            
            if (imageURL != "")
            {
                b.ImageURL = imageURL;
            }
            else
            {
                b.ImageURL = Page.ClientScript.GetWebResourceUrl(this.GetType(), _images[(int)type]);
            }

            if (Command != "")
            {
                b.Command = Command;
            }
            else
            {
                b.Command = _commands[(int)type];
            }

            if (style != "")
            {
                b.style = style;
            }
            else
            {
                b.style =  _stiles[(int)type];
            }


            List<WebButton> btns = Buttons;
            btns.Add(b);
            Buttons = btns;
              
        }