Exemple #1
0
 private void AddElementCssUri(string cssUri)
 {
     if (!string.IsNullOrEmpty(cssUri))
     {
         string linkId = "TinyMceStyleSheet";
         if (!ContainsControlId(Page.Header, linkId))
         {
             var link = new HtmlControls.HtmlGenericControl("link")
             {
                 ID = linkId,
             };
             link.Attributes.Add("href", cssUri);
             link.Attributes.Add("rel", "stylesheet");
             link.Attributes.Add("type", "text/css");
             Page.Header.Controls.Add(link);
         }
     }
 }
Exemple #2
0
    private void SetupMenu()
    {
        // Calculate innerlayer max width 32 pixel per icon
        int ScrollingLayerWidth = Icons.Count * 26 + extraMenuWidth;

        WebControls.Table    Container = new WebControls.Table();
        WebControls.TableRow tr        = new WebControls.TableRow();
        Container.Rows.Add(tr);

        // // scroll-left image
        WebControls.TableCell td      = new WebControls.TableCell();
        WebControls.Image     scrollL = scrollImage();
        scrollL.ImageUrl = _ClientFilesPath + "images/arrawBack.gif";
        scrollL.Attributes.Add("onMouseOver", "this.className = 'editorArrowOver'; scrollR('" + this.ClientID + "_sl','" + this.ClientID + "_slh'," + ScrollingLayerWidth + ");");
        td.Controls.Add(scrollL);
        tr.Cells.Add(td);

        // // Menulayers
        td = new WebControls.TableCell();

        HtmlControls.HtmlGenericControl outerLayer = new HtmlControls.HtmlGenericControl();
        outerLayer.TagName = "div";
        outerLayer.ID      = this.ID + "_slh";
        outerLayer.Attributes.Add("class", "slh");
        outerLayer.Style.Add("height", "26px");
        string tmp = this.Width.ToString;

        outerLayer.Style.Add("width", (this.Width.Value - 18).ToString + "px");
        td.Controls.Add(outerLayer);

        HtmlControls.HtmlGenericControl menuLayer = new HtmlControls.HtmlGenericControl();
        menuLayer.TagName = "div";
        menuLayer.ID      = this.ID + "_sl";
        menuLayer.Style.Add("top", "0px");
        menuLayer.Style.Add("left", "0px");
        menuLayer.Attributes.Add("class", "sl");
        menuLayer.Style.Add("height", "26px");
        menuLayer.Style.Add("width", ScrollingLayerWidth + "px");

        HtmlControls.HtmlGenericControl nobr = new HtmlControls.HtmlGenericControl();
        nobr.TagName = "nobr";
        menuLayer.Controls.Add(nobr);

        // // add all icons to the menu layer
        foreach (Control item in Icons)
        {
            menuLayer.Controls.Add(item);

            if (item.ID != "")
            {
                iconIds = iconIds + item.ID + ",";
            }
        }

        outerLayer.Controls.Add(new LiteralControl("<script>" + Constants.vbCrLf + "RegisterScrollingMenuButtons('" + this.ClientID + "', '" + iconIds + "');" + Constants.vbCrLf + "</script>"));

        outerLayer.Controls.Add(menuLayer);

        tr.Cells.Add(td);

        // // scroll-right image
        td = new WebControls.TableCell();
        WebControls.Image scrollR = scrollImage();
        scrollR.ImageUrl = _ClientFilesPath + "images/arrowForward.gif";
        scrollR.Attributes.Add("onMouseOver", "this.className = 'editorArrowOver'; scrollL('" + this.ClientID + "_sl','" + this.ClientID + "_slh'," + ScrollingLayerWidth + ");");
        td.Controls.Add(scrollR);
        tr.Cells.Add(td);

        this.Controls.Add(Container);
    }