示例#1
0
        public override void Render(ToolbarRenderer r)
        {
            if (!Visible)
            {
                return;
            }

            HtmlTextWriter output = r.Output;

            output.Write("<td nowrap=\"true\" class=\"");
            output.Write(r.Style.Name);
            output.Write("_ButtonNormal\"");

            if (Function != string.Empty)
            {
                output.Write(" onClick=\"");
                output.Write(Function);
                output.Write("\"");
            }
            else if (Command != string.Empty)
            {
                output.Write(" onClick=\"javascript:");
                output.Write(r.ParentControl.Page.ClientScript.GetPostBackEventReference(r.ParentControl, Command));
                output.Write("\"");
            }

            output.Write(" unselectable=\"on\">");
            output.Write(Text);
            output.Write("</td>");
        }
示例#2
0
        public override void Render(ToolbarRenderer r)
        {
            if (!Visible)
            {
                return;
            }

            HtmlTextWriter output = r.Output;

            output.WriteLine("<td>");
            output.Indent++;
            _childControl.RenderControl(output);
            output.Indent--;
            output.WriteLine("</td>");
        }
示例#3
0
 public virtual void Render(ToolbarRenderer r)
 {
     return;
 }
示例#4
0
        public override void Render(ToolbarRenderer r)
        {
            if (!Visible)
            {
                return;
            }

            HtmlTextWriter output = r.Output;

            Unit height;
            Unit width;

            bool showTitle = _showTitle & Text.Length > 0;

            if (r.Style.ButtonStyle.Height.Value > 0)
            {
                height = r.Style.ButtonStyle.Height;
            }
            else
            {
                height = Height;
            }

            if (r.Style.ButtonStyle.Width.Value > 0)
            {
                width = r.Style.ButtonStyle.Width;
            }
            else
            {
                width = Width;
            }

            if (r.Style.ButtonType == ToolbarButtonType.FormButton)
            {
                output.WriteFullBeginTag("td");
                output.WriteLine();

                output.Indent++;
                output.WriteBeginTag("input");
                output.WriteAttribute("type", "button");
                if (Function != string.Empty)
                {
                    output.WriteAttribute("onclick", Function);
                }
                else if (Command != string.Empty)
                {
                    output.WriteAttribute("onclick", "javascript:" +
                                          r.ParentControl.Page.ClientScript.GetPostBackEventReference(r.ParentControl, Command) + ";");
                }
                output.WriteAttribute("unselectable", "on");
                output.WriteAttribute("value", Text);
                output.WriteLine(HtmlTextWriter.TagRightChar);

                output.Indent--;
                output.WriteEndTag("td");
            }
            else
            {
                output.WriteBeginTag("td");
                output.WriteAttribute("nowrap", "true");
                output.WriteAttribute("class", r.Style.Name + "_ButtonNormal");

                // if browser is IE 4+ then render a filter for disabled buttons
                if (!Enabled)
                {
                    output.WriteAttribute("style",
                                          "FILTER: progid:DXImageTransform.Microsoft.BasicImage( Rotation=0,Mirror=0,Invert=0,XRay=0,Grayscale=1,Opacity=0.50);");
                }

                if (this.Enabled)
                {
                    if (Function != string.Empty)
                    {
                        output.WriteAttribute("onclick", Function);
                    }
                    else if (Command != string.Empty)
                    {
                        output.Write(" onClick=\"javascript:");
                        output.Write(r.ParentControl.Page.ClientScript.GetPostBackEventReference(r.ParentControl, Command));
                        output.Write(";\"");
                    }

                    output.Write(" onMouseOver=\"gfx_tbov(this, '");
                    output.Write(r.Style.Name);
                    output.Write("', ");
                    output.Write(boolToNumber(r.Style.ButtonOverImage));
                    output.Write(", ");
                    output.Write(boolToNumber(r.Style.ButtonDownImage));
                    output.Write(");\"");

                    output.Write(" onMouseOut=\"gfx_tbot(this, '");
                    output.Write(r.Style.Name);
                    output.Write("', ");
                    output.Write(boolToNumber(r.Style.ButtonOverImage));
                    output.Write(", ");
                    output.Write(boolToNumber(r.Style.ButtonDownImage));
                    output.Write(");\"");

                    output.Write(" onMouseDown=\"gfx_tbdn(this, '");
                    output.Write(r.Style.Name);
                    output.Write("', ");
                    output.Write(boolToNumber(r.Style.ButtonOverImage));
                    output.Write(", ");
                    output.Write(boolToNumber(r.Style.ButtonDownImage));
                    output.Write(");\"");

                    output.Write(" onMouseUp=\"gfx_tbup(this, '");
                    output.Write(r.Style.Name);
                    output.Write("', ");
                    output.Write(boolToNumber(r.Style.ButtonOverImage));
                    output.Write(", ");
                    output.Write(boolToNumber(r.Style.ButtonDownImage));
                    output.Write(");\"");
                }

                output.WriteLine(HtmlTextWriter.TagRightChar);

                output.Indent++;
                output.Write("<img unselectable=\"on\" src=\"");
                output.Write(r.ParentControl.ResolveUrl(r.Style.ButtonPath));
                output.Write(Icon.ToLower());
                output.Write(".");
                output.Write(r.Style.ButtonExtension);
                output.Write("\" alt=\"");
                output.Write(ToolTip);
                output.Write("\" width=\"");
                output.Write(width.ToString());
                output.Write("\" height=\"");
                output.Write(height.ToString());
                output.Write("\" align=\"absmiddle\">");

                if (showTitle)
                {
                    output.WriteBeginTag("span");
                    output.WriteAttribute("unselectable", "on");
                    output.Write(HtmlTextWriter.TagRightChar);
                    output.Write(Text);
                    output.WriteEndTag("span");
                    output.Write("&nbsp;");
                }

                output.WriteLine();

                output.Indent--;
                output.WriteEndTag("td");
                output.WriteLine();
            }
        }
示例#5
0
 public override void Render(ToolbarRenderer output)
 {
     return;
 }
示例#6
0
文件: Toolbar.cs 项目: rahodges/Amns
        public virtual void Render(ToolbarRenderer r)
        {
            if (!_visible)
            {
                return;
            }

            HtmlTextWriter output = r.Output;

            output.WriteBeginTag("div");
            output.WriteAttribute("id", r.ParentControl.ID + "_ToolBar_" + _name);
            output.WriteAttribute("class", r.Style.Name + "_Toolbar");
            output.WriteLine(HtmlTextWriter.TagRightChar);
            output.Indent++;

            output.WriteBeginTag("table");
            output.WriteAttribute("border", "0");
            output.WriteAttribute("cellpadding", "0");
            output.WriteAttribute("cellspacing", "0");
            output.Write(HtmlTextWriter.TagRightChar);
            output.WriteLine();
            output.Indent++;
            output.WriteFullBeginTag("tr");
            output.WriteLine();
            output.Indent++;

            if (r.Style.StartImage)
            {
                output.WriteFullBeginTag("td");
                output.WriteLine();
                output.Indent++;
                output.WriteBeginTag("img");
                output.WriteAttribute("src", r.ParentControl.ResolveUrl(r.Style.ButtonPath) +
                                      "toolbar.start." +
                                      r.Style.ButtonExtension);
                output.WriteAttribute("border", "0");
                output.WriteAttribute("unselectable", "on");
                output.WriteLine(HtmlTextWriter.TagRightChar);
                output.Indent--;
                output.WriteEndTag("td");
                output.WriteLine();
            }

            output.WriteFullBeginTag("td");
            output.WriteLine();
            output.Indent++;
            output.WriteBeginTag("table");
            output.WriteAttribute("border", "0");
            output.WriteAttribute("cellpadding", "0");
            output.WriteAttribute("cellspacing", "0");

            if (!r.Style.BackColor.IsEmpty)
            {
                output.WriteAttribute("bgcolor", ColorTranslator.ToHtml(r.Style.BackColor));
            }
            output.WriteLine(HtmlTextWriter.TagRightChar);
            output.Indent++;

            output.WriteFullBeginTag("tr");
            output.WriteLine();
            output.Indent++;
            for (int x = 0; x < _items.Count; x++)
            {
                _items[x].Render(r);
            }
            output.Indent--;
            output.WriteEndTag("tr");
            output.WriteLine();

            output.Indent--;
            output.WriteEndTag("table");
            output.WriteLine();

            output.Indent--;
            output.WriteEndTag("td");
            output.WriteLine();

            if (r.Style.EndImage)
            {
                output.WriteFullBeginTag("td");
                output.WriteLine();
                output.Indent++;
                output.WriteBeginTag("img");
                output.WriteAttribute("src", r.ParentControl.ResolveUrl(r.Style.ButtonPath) +
                                      "toolbar.end." +
                                      r.Style.ButtonExtension);
                output.WriteAttribute("border", "0");
                output.WriteAttribute("unselectable", "on");
                output.WriteLine(HtmlTextWriter.TagRightChar);
                output.Indent--;
                output.WriteEndTag("td");
                output.WriteLine();
            }

            output.Indent--;
            output.WriteEndTag("tr");
            output.WriteLine();

            output.Indent--;
            output.WriteEndTag("table");
            output.WriteLine();

            output.Indent--;
            output.WriteEndTag("div");
            output.WriteLine();
        }