示例#1
0
        void FillTabControl(TabControl tabcontrol)
        {
            OpacApplication app = (OpacApplication)this.Page.Application["app"];

            string strDefaultFormatName = this.DefaultFormatName;

            List <string> format_ids = new List <string> {
                "simple",
                "simplest",
                "logic"
            };
            List <string> format_names = new List <string> {
                this.GetString("simple"),
                this.GetString("simplest"),
                this.GetString("logic")
            };

            tabcontrol.Columns.Clear();
            for (int i = 0; i < format_ids.Count; i++)
            {
                TabColumn column = new TabColumn();
                column.Name = format_names[i];
                column.ID   = format_ids[i];
                tabcontrol.Columns.Add(column);

                if (this.DefaultFormatName == format_ids[i])
                {
                    tabcontrol.ActiveTab = format_names[i];
                }
            }
        }
示例#2
0
        protected override void Render(HtmlTextWriter writer)
        {
            for (int i = 0; i < this.Columns.Count; i++)
            {
                TabColumn column = this.Columns[i];

                string strColumnID = column.ID;
                if (String.IsNullOrEmpty(strColumnID) == true)
                {
                    strColumnID = column.Name;
                }

                LiteralControl column_class = (LiteralControl)this.FindControl(strColumnID + "_class");
                if (strColumnID == this.ActiveTab)
                {
                    column_class.Text = strColumnID + " active";
                }
                else
                {
                    column_class.Text = strColumnID + " normal";
                }
            }

            base.Render(writer);
        }
示例#3
0
        protected override void CreateChildControls()
        {
            // 总表格
            this.Controls.Add(new AutoIndentLiteral("<table class='tab'>"));

            HiddenField active_tab = new HiddenField();

            active_tab.ID = "active_tab";
            this.Controls.Add(active_tab);

            // tab栏目
            this.Controls.Add(new AutoIndentLiteral("<tr>"));

            // 左边空白
            this.Controls.Add(new AutoIndentLiteral("<td class='leftblank'>"
                                                    + (String.IsNullOrEmpty(this.Description) == true ? "&nbsp;" : this.Description)
                                                    + "</td>"));


            for (int i = 0; i < this.Columns.Count; i++)
            {
                TabColumn column = this.Columns[i];

                if (String.IsNullOrEmpty(this.ResFilename) == false)
                {
                    CreateOneColumn(column.ID,
                                    GetString(this.ResFilename, column.Name));
                }
                else
                {
                    CreateOneColumn(column.ID,
                                    column.Name);
                }
            }


            // 右边空白
            this.Controls.Add(new AutoIndentLiteral("<td class='rightblank'>&nbsp;</td>"));


            this.Controls.Add(new AutoIndentLiteral("</tr>"));

            this.Controls.Add(new AutoIndentLiteral("<tr class='bottom_line'><td colspan='10'>&nbsp;</td></tr>"));

            this.Controls.Add(new AutoIndentLiteral("</table/>"));
        }
        static void FillTabList(TabControl tabcontrol,
    List<string> formatnames)
        {
            StringUtil.RemoveDupNoSort(ref formatnames);

            tabcontrol.Columns.Clear();
            for (int i = 0; i < formatnames.Count; i++)
            {
                TabColumn column = new TabColumn();
                column.Name = formatnames[i];
                tabcontrol.Columns.Add(column);
            }
        }
示例#5
0
        void FillTabControl(TabControl tabcontrol)
        {
            OpacApplication app = (OpacApplication)this.Page.Application["app"];


            string strDefaultFormatName = this.DefaultFormatName;

            List<string> format_ids = new List<string> {
                "simple",
                "simplest",
                "logic" };
            List<string> format_names = new List<string> { 
                this.GetString("simple"),
                this.GetString("simplest"),
                this.GetString("logic") };

            tabcontrol.Columns.Clear();
            for (int i = 0; i < format_ids.Count; i++)
            {
                TabColumn column = new TabColumn();
                column.Name = format_names[i];
                column.ID = format_ids[i];
                tabcontrol.Columns.Add(column);

                if (this.DefaultFormatName == format_ids[i])
                    tabcontrol.ActiveTab = format_names[i];
            }
        }