/// <summary>Constructor.</summary>
        public TabPanelButton(TabPanel panel) : base(panel.Button)
        {
            IsLoaded = false;
            Panel = panel;
            SetCss(Css.Position, Css.Absolute);
            Width = panel.ButtonWidth;
            Height = 24;
            Model.CanToggle = true;

            Helper.Template.GetAsync(TabPanelSetView.TemplateUrl, "#tmplTabPanelSet", delegate(Template template)
                            {
                                // Setup button.
                                TemplateForStates(0, AllStates, "#tmplTabPanelBtn_Bg");
                                TemplateForState(1, ButtonState.MouseOver, "#tmplTabPanelBtn_BgOver");
                                TemplateForStates(1, DownAndPressed, "#tmplTabPanelBtn_BgPressed");

                                // Text
                                TemplateForStates(2, AllStates, "#tmplTabPanelBtn_Text");
                                CssForStates(2, NotDownOrPressed, "c_tabPanelButton text normal");
                                CssForStates(2, DownAndPressed, "c_tabPanelButton text pressed");

                                // Wire up events.
                                panel.PropertyChanged += OnModelPropertyChanged;

                                // Finish up.
                                SyncVisibility();
                                UpdateLayout();

                                // Finish up.
                                FireLoaded();
                            });
        }
예제 #2
0
        public override void Initialize()
        {
            base.Initialize();

            TabPanel tab;
            tab = new TabPanel((int)Preferences.Width, (int)Preferences.Height);
            tab.AddTab("mytab1", new Label(ResourceManager.CreateImage("cell_jekyll")));
            tab.AddTab("mytab2", new Label(ResourceManager.CreateImage("cell_hyde")));

            AddComponent(tab, 0, 0);
        }
예제 #3
0
        public static TabPanel BuildSourceTabs(string idSuffix, string url)
        {
            List<FileInfo> files = SourceModel.GetFiles(url, false);            

            TabPanel tabs = new TabPanel
            {
                ID = "tpw" + idSuffix,
                Border = false,
                ActiveTabIndex = 0
            };

            int i = 0;
            foreach (FileInfo fileInfo in files)
            {
                Panel panel = new Panel();
                panel.ID = "tptw" + idSuffix + i++;
                panel.Title = fileInfo.Name;
                
                switch (fileInfo.Extension)
                {
                    case ".aspx":
                    case ".cshtml":
                    case ".ascx":
                        panel.Icon = Icon.PageWhiteCode;
                        break;
                    case ".cs":
                        panel.Icon = Icon.PageWhiteCsharp;
                        break;
                    case ".xml":
                    case ".xsl":
                        panel.Icon = Icon.ScriptCodeRed;
                        break;
                    case ".js":
                        panel.Icon = Icon.Script;
                        break;
                    case ".css":
                        panel.Icon = Icon.Css;
                        break;
                }
                panel.Loader = new ComponentLoader();
                panel.Loader.Url = ExamplesModel.ApplicationRoot + "/Source/GetSourceFile";
                panel.Loader.Mode = LoadMode.Frame;
                panel.Loader.Params.Add(new Parameter("file", SourceModel.PhysicalToVirtual(fileInfo.FullName), ParameterMode.Value));
                panel.Loader.LoadMask.ShowMask = true;

                tabs.Items.Add(panel);
            }

            return tabs;
        }
예제 #4
0
    private void criarTabs()
    {
        HyperLink linkDownloadAtividadesPorDia = new HyperLink();
        linkDownloadAtividadesPorDia.Text = "Faça o download das atividades organizadas por dia da semana";
        linkDownloadAtividadesPorDia.NavigateUrl =
            controladorPDF.obterUrlEnviaAtividadesPDF(TipoAgrupamentoAtividade.DiaDaSemana);
        linkDownloadAtividadesPorDia.CssClass = "linkTabGroupProgramacao";
        HyperLink linkDownloadAtividadesPorTipo = new HyperLink();
        linkDownloadAtividadesPorTipo.Text = "Faça o download das atividades organizadas por tipo de atividade";
        linkDownloadAtividadesPorTipo.NavigateUrl =
            controladorPDF.obterUrlEnviaAtividadesPDF(TipoAgrupamentoAtividade.TipoAtividade);
        linkDownloadAtividadesPorTipo.CssClass = "linkTabGroupProgramacao";

        TabContainer tabGroup = new TabContainer();
        tabGroup.ID = "ID_Tabgroup_" + DateTime.Now.Ticks;
        string tipoAbaSelecionada = Request.QueryString["tipoAbaInicial"];
        if (String.IsNullOrEmpty(tipoAbaSelecionada))
        {
            tipoAbaSelecionada = controladorConfiguracao.obterValor(Configuracao.IdAbaPadraoAtividades);
        }
        foreach (string tipo in obterListaTiposAtividade())
        {
            TabPanel aba = new TabPanel();
            aba.HeaderText = Funcoes.ColocarPrimeiraLetraMaiuscula(tipo);
            tabGroup.Tabs.Add(aba);

            PreenchedorAtividadesPorTipo preenchedorAtividades = new PreenchedorAtividadesPorTipo();
            preenchedorAtividades.preencheAtividades(tipo);
            aba.Controls.Add(preenchedorAtividades.Tabela);
            if (tipoAbaSelecionada != null
                && Funcoes.SubstituirCaracteresEspeciais(tipo).ToLower().Trim() == tipoAbaSelecionada.ToLower().Trim())
            {
                tabGroup.ActiveTab = aba;
            }
        }
        phTabContainer.Controls.Clear();
        phTabContainer.Controls.Add(linkDownloadAtividadesPorDia);
        phTabContainer.Controls.Add(linkDownloadAtividadesPorTipo);
        phTabContainer.Controls.Add(tabGroup);
    }
예제 #5
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            btnShowList = (GetTemplateChild("btnShowList") as Button);

            itemPanel = (GetTemplateChild("TabPanelTop") as TabPanel);

            HeadList = (GetTemplateChild("HeadList") as Popup);

            btnShowList.Click += new RoutedEventHandler(btnShowList_Click);

            this.SizeChanged += new SizeChangedEventHandler(EosTabControl_SizeChanged);

            itemPanel.SizeChanged += new SizeChangedEventHandler(itemPanel_SizeChanged);

            btnShowList.LostFocus += new RoutedEventHandler(btnShowList_LostFocus);

            btnShowList.MouseEnter += new MouseEventHandler(btnShowList_MouseEnter);

            btnShowList.MouseLeave += new MouseEventHandler(btnShowList_MouseLeave);

            this.MouseLeftButtonDown += new MouseButtonEventHandler(EosTabControl_MouseLeftButtonDown);
        }
예제 #6
0
        public override void DataBind()
        {
            if (_dataSet == DataSource)
            {
                return;
            }

            tbGrids.Tabs.Clear();

            var dataSet = (DataSet)DataSource;

            foreach (DataTable dataTable in dataSet.Tables)
            {
                var tabPanel = new TabPanel();
                tabPanel.HeaderText = dataTable.TableName;

                var dataGrid = new ASPxGridView();

                var keyFields  = dataTable.Columns.Cast <DataColumn>().Select(n => n.ColumnName);
                var keyColumns = String.Join(";", keyFields);

                dataGrid.AutoGenerateColumns = (dataGrid.Columns.Count == 0);
                dataGrid.KeyFieldName        = keyColumns;
                dataGrid.DataSource          = dataTable;
                dataGrid.DataBind();

                tabPanel.Controls.Add(dataGrid);

                tbGrids.Tabs.Add(tabPanel);
                tbGrids.ActiveTab = (tbGrids.ActiveTab ?? tabPanel);
            }

            _dataSet = DataSource;

            base.DataBind();
        }
예제 #7
0
        string GetTabContent(TabPanel tab, bool isContent)
        {
            if (tab == null)
            {
                return(String.Empty);
            }

            if (isContent)
            {
                if (tab.ContentTemplate == null)
                {
                    return(String.Empty);
                }

                return(GetTemplateContent(tab.ContentTemplate, "_content"));
            }

            if (tab.HeaderTemplate != null)
            {
                return(GetTemplateContent(tab.HeaderTemplate, "_header"));
            }

            return(tab.HeaderText);
        }
예제 #8
0
    private void Rebind()
    {
        var list = BusinessFacade.Instance.GetFoodsList();

        if (list == null || list.Length == 0)
        {
            this.rptFoods.DataSource = null;
            this.rptFoods.DataBind();
            return;
        }

        TabPanel pnl = this.Tabs.ActiveTab;

        if (pnl.HeaderText == MyGlobalResources.Other)
        {
            Food[] foods = list.Where(f => f.FoodName.Trim() != string.Empty &&
                                      (f.FoodName.Trim()[0] < 'א' ||
                                       f.FoodName.Trim()[0] > 'ת')).ToArray();

            this.rptFoods.DataSource = foods;
            this.rptFoods.DataBind();
        }
        else if (pnl.HeaderText == MyGlobalResources.Temporary)
        {
            Food[] foods = list.Where(f => f.IsTemporary).ToArray();
            this.rptFoods.DataSource = foods;
            this.rptFoods.DataBind();
        }
        else
        {
            Food[] foods = list.Where(f => f.FoodName.Trim().StartsWith(pnl.HeaderText[0].ToString()) ||
                                      f.FoodName.Trim().StartsWith(pnl.HeaderText[1].ToString())).ToArray();
            this.rptFoods.DataSource = foods;
            this.rptFoods.DataBind();
        }
    }
예제 #9
0
        private void mouse_leftdown(object sender, RoutedEventArgs e)
        {
            Colorpicker colorPicker;
            TabItem     myTabitem = sender as TabItem;// myBorder is a Instance of Border

            if (myTabitem.IsSelected == false)
            {
                TabPanel tabPanel = VisualTreeHelper.GetParent(myTabitem) as TabPanel;
                //Console.WriteLine( tabPanel.Children.Count );
                for (int i = 0; i < tabPanel.Children.Count; i++)
                {
                    TabItem tabItem = tabPanel.Children[i] as TabItem;
                    if (tabItem.IsSelected == true)
                    {
                        colorPicker          = new Colorpicker(tabItem.Background);
                        tabItem.Background   = colorPicker.lighter();
                        myTabitem.IsSelected = false;
                    }
                }
                colorPicker          = new Colorpicker(myTabitem.Background);
                myTabitem.Background = colorPicker.darker();
                myTabitem.IsSelected = true;
            }
        }//mouse left down button for tabcontrol end here
예제 #10
0
        /// <summary>Adds the tab panel to a parent container and returns it.</summary>
        /// <param name="container">The parent container onto which to add the container defined by this interface.</param>
        /// <returns>The newly added tab panel.</returns>
        public override Control AddTo(Control container)
        {
            TabPanel p = new TabPanel();

            p.ID             = Name;
            p.TabText        = GetLocalizedText("TabText") ?? TabText;
            p.RegisterTabCss = registerTabCss;
            if (string.IsNullOrEmpty(CssClass))
            {
                p.CssClass = "tabPanel primaryTabs";

                var parentTab = container.Closest(c => c is TabPanel || c is ItemEditor);
                if (parentTab != null)
                {
                    p.CssClass = "tabPanel " + parentTab.ClientID + "Tabs";
                }
            }
            else
            {
                p.CssClass = CssClass;
            }
            container.Controls.Add(p);
            return(p);
        }
        private void AddValidator(TabPanel themeTabPanel)
        {
            var validator = new CustomValidator();

            validator.Display         = ValidatorDisplay.None;
            validator.ServerValidate += (s, e) =>
            {
                var control         = (s as CustomValidator);
                var themeEditor     = control.Parent.Controls.Cast <Control>().Where(x => x is ItemEditor).Cast <ItemEditor>().First();
                var resourcePlugins = N2.Context.Current.Resolve <IPluginFinder>()
                                      .GetPlugins <BootstrapResourceAttribute>()
                                      .Where(x => x.ResourceType == BootstrapResourceAttribute.ResourceTypeEnum.CssOrLess)
                                      .ToList();
                themeEditor.UpdateObject(new CommandContext(themeEditor.Definition,
                                                            themeEditor.CurrentItem,
                                                            "theme-editor",
                                                            N2.Context.Current.RequestContext.User));
                var variables = Less.ThemedLessEngine.GetThemeVariables(themeEditor.CurrentItem as Models.BootstrapThemeConfiguration);
                foreach (var resource in resourcePlugins)
                {
                    var themedLocation = Less.ThemedLessEngine.GetThemedFile(Path.Combine(Url.ResolveTokens("{ThemesUrl}/Default/"), resource.Name), themeEditor.ID);
                    try
                    {
                        Less.ThemedLessEngine.CompileLess(themedLocation, null, themeEditor.ID, variables);
                    }
                    catch (Exception ex)
                    {
                        control.ErrorMessage = "Error with theme \"" + themeEditor.ID + "\":    " + ex.Message;
                        e.IsValid            = false;
                        return;
                    }
                }
                e.IsValid = true;
            };
            themeTabPanel.Controls.Add(validator);
        }
예제 #12
0
            public TabIndexRange(TabControl tabControl)
            {
                ControlTemplate tmpl = tabControl.Template as ControlTemplate;

                Viewer     = tmpl.FindName("tabPanelScrollViewer", tabControl) as ScrollViewer;
                Panel      = tmpl.FindName("headerPanel", tabControl) as TabPanel;
                PartialMin = int.MaxValue;
                FullMin    = int.MaxValue;
                FullMax    = -1;
                PartialMax = -1;
                int n = tabControl.Items.Count;

                for (int i = 0; i < n; i++)
                {
                    TabItem item = tabControl.Items[i] as TabItem;
                    Point[] p    = new Point[] { new Point(0, 0), new Point(item.ActualWidth + 1, item.ActualHeight + 1) };
                    p[0] = item.TranslatePoint(p[0], Viewer);
                    p[1] = item.TranslatePoint(p[1], Viewer);
                    if (Viewer.ActualWidth <= p[1].X)
                    {
                        Normalize();
                        return;
                    }
                    if (p[0].X < Viewer.ActualWidth && 0 < p[1].X)
                    {
                        PartialMin = Math.Min(PartialMin, i);
                        PartialMax = i;
                    }
                    if (0 <= p[0].X && p[1].X < Viewer.ActualWidth)
                    {
                        FullMin = Math.Min(FullMin, i);
                        FullMax = i;
                    }
                }
                Normalize();
            }
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            _button   = Template.FindName("HideGridButton", this) as Button;
            _tabPanel = Template.FindName("TabPanel", this) as TabPanel;
            _border   = Template.FindName("ContentBorder", this) as Border;


            if (_button != null)
            {
                _button.PreviewMouseUp += Button_Clicked;
            }

            if (_tabPanel != null)
            {
                foreach (TabItem tabItem in _tabPanel.Children)
                {
                    tabItem.PreviewMouseDown += TabItem_PreviewMouseDown;
                }

                _tabPanel.PreviewMouseWheel += TabControl_PreviewMouseWheel;
            }
        }
예제 #14
0
        private Panel ContentBuilder(SueetieContentPart content)
        {
            Panel body = new Panel();

            body.CssClass = "content";
            AjaxControlToolkit.TabContainer tabs = new TabContainer();
            tabs.ID       = "tabs";
            tabs.CssClass = "tabs";
            AjaxControlToolkit.TabPanel tabEdit = new TabPanel();
            tabEdit.HeaderText = "Edit";
            tabs.Tabs.Add(tabEdit);
            AjaxControlToolkit.TabPanel tabUsers = new TabPanel();
            tabUsers.HeaderText = "Users";
            // Removed the addition of the Users Tab
            //tabs.Tabs.Add(tabUsers);
            UpdatePanel udpEditor = new UpdatePanel();

            udpEditor.UpdateMode         = UpdatePanelUpdateMode.Always;
            udpEditor.ChildrenAsTriggers = true;
            udpEditor.ContentTemplate    = new TemplateBuilder(EditorBuilder(content));
            tabEdit.ContentTemplate      = new TemplateBuilder(udpEditor);
            body.Controls.Add(tabs);
            return(body);
        }
예제 #15
0
    /// <summary>
    /// Prepares the layout of the web part.
    /// </summary>
    protected override void PrepareLayout()
    {
        StartLayout(true);

        // Tab headers
        string[] headers = TextHelper.EnsureLineEndings(TabHeaders, "\n").Split('\n');

        if ((ActiveTabIndex >= 1) && (ActiveTabIndex <= Tabs))
        {
            tabs.ActiveTabIndex = ActiveTabIndex - 1;
        }

        for (int i = 1; i <= Tabs; i++)
        {
            // Create new tab
            TabPanel tab = new TabPanel();
            tab.ID = "tab" + i;

            // Prepare the header
            string header = null;
            if (headers.Length >= i)
            {
                header = ResHelper.LocalizeString(headers[i - 1]);
            }
            if (String.IsNullOrEmpty(header))
            {
                header = "Tab " + i;
            }

            tabs.Tabs.Add(tab);

            AddZone(ID + "_" + i, header, tab);

            if (IsDesign)
            {
                header = EditableWebPartProperty.GetHTMLCode(null, this, "TabHeaders", i, EditablePropertyTypeEnum.TextBox, header, null, null, null, true);
            }
            else
            {
                header = EditableWebPartProperty.ApplyReplacements(HttpUtility.HtmlEncode(header), false);
            }

            tab.HeaderText = header;
        }

        // Wireframe design
        tabs.TabStripPlacement = GetTabStripPlacement(TabStripPlacement);
        tabs.CssClass          = "WireframeTabs";

        // Set width / height
        string width = Width;

        if (!String.IsNullOrEmpty(width))
        {
            tabs.Width = new Unit(width);
        }

        if (IsDesign && AllowDesignMode)
        {
            // Pane actions
            if (Tabs > 1)
            {
                AppendRemoveAction(GetString("Layout.RemoveTab"), "Tabs", "icon-times", null);
                Append(" ");
            }

            AppendAddAction(GetString("Layout.AddTab"), "Tabs", "icon-plus", null);

            resElem.ResizedElementID = tabs.ClientID;
        }

        // Render the actions
        string actions = FinishLayout(false);

        if (!String.IsNullOrEmpty(actions))
        {
            pnlActions.Visible = true;
            ltlActions.Text    = actions;
        }
    }
 static void PersistTemplateContent(TabPanel panel, IDesignerHost host, string content, string propertyName) {
     var template = ControlParser.ParseTemplate(host, content);
     PersistTemplate(panel, host, template, propertyName);
 }
예제 #17
0
        private static void ScrollTabItemAsRight(TabControl tabControl, ScrollViewer viewer, TabPanel panel, int index)
        {
            if (index < 0 || tabControl.Items.Count <= index)
            {
                return;
            }
            TabItem item = tabControl.Items[index] as TabItem;
            Point   p1   = item.TranslatePoint(new Point(item.ActualWidth + 1, item.ActualHeight + 1), panel);
            double  x0   = p1.X - viewer.ActualWidth;
            Point   p0   = item.TranslatePoint(new Point(), panel);
            int     i0   = index;

            for (int i = index - 1; 0 <= i; i--)
            {
                item = tabControl.Items[i] as TabItem;
                Point p = item.TranslatePoint(new Point(), panel);
                if (p.X < x0)
                {
                    break;
                }
                i0 = i;
                p0 = p;
                if (p.X == x0)
                {
                    break;
                }
            }
            viewer.ScrollToHorizontalOffset(p0.X);
        }
예제 #18
0
 public void TestInit()
 {
     _writer = new StringBuilderWriter();
     _option = new TabPanel(_writer);
 }
 private void AddMultilineTab(string project, TabContainer multilineContainer, string tabName, string tabID, bool readOnly)
 {
     TabPanel MultilinePanel = new TabPanel();
     MultilinePanel.HeaderText = tabName;
     MultilinePanel.ID = tabID;
     TextBox Multilinebox = new TextBox();
     Multilinebox.CssClass = "HPMTabText";
     Multilinebox.ID = "mlbox" + tabID;
     Multilinebox.TextMode = TextBoxMode.MultiLine;
     Multilinebox.ReadOnly = true;
     MultilinePanel.Controls.Add(Multilinebox);
     // dummy used to store readonly state of field
     LiteralControl dummy = new LiteralControl();
     dummy.Visible = false;
     dummy.Text = Convert.ToString(readOnly);
     dummy.ID = "dummy";
     MultilinePanel.Controls.Add(dummy);
     multilineContainer.Controls.Add(MultilinePanel);
 }
예제 #20
0
        private void ProcessNewEvents()
        {
            List <LogEvent> logEventsToProcess = null;

            lock (this)
            {
                if (_haveNewEvents)
                {
                    logEventsToProcess = _newEvents;
                    _newEvents         = new List <LogEvent>();
                    _haveNewEvents     = false;
                }
            }

            if (logEventsToProcess != null)
            {
                logger.Info("Processing start {0} items.", logEventsToProcess.Count);
                int t0 = Environment.TickCount;
                foreach (LogEvent logEvent in logEventsToProcess)
                {
                    LogEvent removedEvent = _bufferedEvents.AddAndRemoveLast(logEvent);
                    if (removedEvent != null)
                    {
                        _filteredEvents.Remove(removedEvent);
                    }

                    if (TryFilters(logEvent))
                    {
                        _filteredEvents.Add(logEvent);
                    }

                    _totalEvents++;

                    for (int i = 0; i < Columns.Count; ++i)
                    {
                        if (Columns[i].Grouping != LogColumnGrouping.None)
                        {
                            TabPanel.ApplyGrouping(Columns[i], logEvent[i]);
                        }
                    }

                    /*
                     * // LogEventAttributeToNode(logEvent["Level"], _levelsTreeNode, _level2NodeCache, (char)0);
                     * LogEventAttributeToNode((string)logEvent["Logger"], _loggersTreeNode, _logger2NodeCache, '.');
                     * LogEventAttributeToNode((string)logEvent["SourceAssembly"], _assembliesTreeNode, _assembly2NodeCache, (char)0);
                     * TreeNode node = LogEventAttributeToNode((string)logEvent["SourceType"], _classesTreeNode, _class2NodeCache, '.');
                     * // LogEventAttributeToNode(logEvent.SourceMethod, node,
                     * LogEventAttributeToNode((string)logEvent["Thread"], _threadsTreeNode, _thread2NodeCache, (char)0);
                     * LogEventAttributeToNode((string)logEvent["SourceApplication"], _applicationsTreeNode, _application2NodeCache, (char)0);
                     * LogEventAttributeToNode((string)logEvent["SourceMachine"], _machinesTreeNode, _machine2NodeCache, (char)0);
                     * LogEventAttributeToNode((string)logEvent["SourceFile"], _filesTreeNode, _file2NodeCache, (char)'\\');
                     * */
                }
                int t1  = Environment.TickCount;
                int ips = -1;
                if (t1 > t0)
                {
                    ips = 1000 * logEventsToProcess.Count / (t1 - t0);
                }
                logger.Info("Processing finished {0} items. Total {1} ips: {2} time: {3}.", _filteredEvents.Count, logEventsToProcess.Count, ips, t1 - t0);
                TabPanel.listViewLogMessages.VirtualListSize = _filteredEvents.Count;
                TabPanel.listViewLogMessages.Invalidate();
                UpdateStatusBar();
            }
        }
예제 #21
0
        public override void OnInitialize()
        {
            TabPanel ItemMenu = new TabPanel(450, 450, new Tab("Change Item", this), new Tab(" Change Player", new PlayerModUI()));

            ItemMenu.VAlign             = 0.6f;
            ItemMenu.HAlign             = 0.2f;
            ItemMenu.OnCloseBtnClicked += () => GetInstance <Creativetools>().UserInterface.SetState(new MainUI());
            Append(ItemMenu);

            var DamageSlider = MakeSlider(new UIIntRangedDataValue("", 0, 0, 999), out DamageDataProperty, ItemMenu, top: 50, left: -10);

            SliderButtons("Set Damage", DamageSlider, button => button.OnClick += (evt, elm) => ChangeDamage(DamageDataProperty.Data));

            var CritSlider = MakeSlider(new UIIntRangedDataValue("", 0, 0, 100), out CritDataProperty, ItemMenu, top: 100, left: -10);

            SliderButtons("Set Crit", CritSlider, button => button.OnClick += (evt, elm) => ChangeCrit(CritDataProperty.Data));

            var KnockSlider = MakeSlider(new UIFloatRangedDataValue("", 0, 0, 100), out KnockbackDataProperty, ItemMenu, top: 150, left: -10);

            SliderButtons("Set Knockback", KnockSlider, button => button.OnClick += (evt, elm) => ChangeKnock(KnockbackDataProperty.Data));

            var UsetimeSlider = MakeSlider(new UIIntRangedDataValue("", 0, 0, 50), out UsetimeDataProperty, ItemMenu, top: 200, left: -10);

            SliderButtons("Set Usetime", UsetimeSlider, button => button.OnClick += (evt, elm) => ChangeUseTime(UsetimeDataProperty.Data));

            var DefenseSlider = MakeSlider(new UIIntRangedDataValue("", 0, 0, 100), out DefenseDataProperty, ItemMenu, top: 250, left: -10);

            SliderButtons("Set Defense", DefenseSlider, button => button.OnClick += (evt, elm) => ChangeDefense(DefenseDataProperty.Data));

            var ShootSlider = MakeSlider(new UIFloatRangedDataValue("", 0, 0, 999), out ShootspeedDataProperty, ItemMenu, top: 300, left: -10);

            SliderButtons("Set Bullet speed", ShootSlider, button => button.OnClick += (evt, elm) => ChangeShoot(ShootspeedDataProperty.Data));

            var SizeSlider = MakeSlider(new UIFloatRangedDataValue("", 0, 0, 50), out SizeDataProperty, ItemMenu, top: 350, left: -10);

            SliderButtons("Set Size", SizeSlider, button => button.OnClick += (evt, elm) => ChangeSize(SizeDataProperty.Data));

            UITextPanel <string> AutoswingButton = new UITextPanel <string>("Toggle Autoswing");

            AutoswingButton.SetPadding(4);
            AutoswingButton.MarginLeft = 10;
            AutoswingButton.MarginTop  = 400;
            AutoswingButton.Width.Set(10, 0f);
            AutoswingButton.OnClick += (evt, elm) =>
            {
                ToggleAutoSwing();
                Main.PlaySound(SoundID.MenuTick);
            };
            ItemMenu.Append(AutoswingButton);

            UITextPanel <string> TurnaroundButton = new UITextPanel <string>("Toggle Turnaround");

            TurnaroundButton.SetPadding(4);
            TurnaroundButton.MarginLeft = 275;
            TurnaroundButton.MarginTop  = 400;
            TurnaroundButton.Width.Set(10, 0f);
            TurnaroundButton.OnClick += (evt, elm) =>
            {
                ToggleTurnAround();
                Main.PlaySound(SoundID.MenuTick);
            };
            ItemMenu.Append(TurnaroundButton);
        }
예제 #22
0
    private void criarTabs()
    {
        TabContainer tabGroup = new TabContainer();
        tabGroup.ID = "ID_Tabgroup_" + DateTime.Now.Ticks;
        bool ehProgramacaoDiaria = TipoProgramacaoEscolhida == TipoProgramacao.Diaria;
        foreach (DateTime data in obterListaDatasTab())
        {
            TabPanel aba = new TabPanel();
            aba.HeaderText = ehProgramacaoDiaria ? Funcoes.ColocarPrimeiraLetraMaiuscula(Linguagem.FormatarDiaDaSemana(data)) : Linguagem.FormatarDataCurta(data);
            tabGroup.Tabs.Add(aba);

            aba.Controls.Add(
                new LiteralControl("<h4>" +
                        Funcoes.ColocarPrimeiraLetraMaiuscula(Linguagem.FormatarDiaPorExtensoIncluindoDiaSemana(data)) +
                        "</h4>"));

            HyperLink linkDownloadProgramacaoDiaria = new HyperLink();
            linkDownloadProgramacaoDiaria.NavigateUrl =
                controladorPDF.obterUrlEnviaProgramacaoPDF(data, TipoProgramacao.Diaria); ;
            linkDownloadProgramacaoDiaria.Text = "Faça o download da programação diária";
            linkDownloadProgramacaoDiaria.CssClass = "linkTabGroupProgramacao";
            aba.Controls.Add(linkDownloadProgramacaoDiaria);

            HyperLink linkDownloadProgramacaoDiaDaSemana = new HyperLink();
            linkDownloadProgramacaoDiaDaSemana.NavigateUrl =
                controladorPDF.obterUrlEnviaProgramacaoPDF(data, TipoProgramacao.DiaDaSemana); ;
            linkDownloadProgramacaoDiaDaSemana.Text = "Faça o download da programação de " + data.ToString("dddd");
            linkDownloadProgramacaoDiaDaSemana.CssClass = "linkTabGroupProgramacao";
            aba.Controls.Add(linkDownloadProgramacaoDiaDaSemana);

            aba.Controls.Add(
                new LiteralControl("<h3>Temas dos estudos do dia</h3>"));

            PreenchedorProgramacao preenchedorProgramacao = new PreenchedorProgramacao();
            preenchedorProgramacao.preencheProgramacao(data);
            aba.Controls.Add(preenchedorProgramacao.Tabela);

            Pagina pagAtividades = controladorPaginas.obterPagina(Pagina.IdAtividades);
            HyperLink linkTodasAtividades = new HyperLink();
            linkTodasAtividades.NavigateUrl = "~/" + pagAtividades.EnderecoVirtualComExtensao;
            linkTodasAtividades.Text = "Veja todas as atividades públicas";
            linkTodasAtividades.CssClass = "linkTabGroupProgramacao";

            HyperLink linkDownloadAtividadesPorDia = new HyperLink();
            linkDownloadAtividadesPorDia.Text = "Faça o download das atividades organizadas por dia da semana";
            linkDownloadAtividadesPorDia.NavigateUrl =
                controladorPDF.obterUrlEnviaAtividadesPDF(TipoAgrupamentoAtividade.DiaDaSemana);
            linkDownloadAtividadesPorDia.CssClass = "linkTabGroupProgramacao";
            HyperLink linkDownloadAtividadesPorTipo = new HyperLink();
            linkDownloadAtividadesPorTipo.Text = "Faça o download das atividades organizadas por tipo de atividade";
            linkDownloadAtividadesPorTipo.NavigateUrl =
                controladorPDF.obterUrlEnviaAtividadesPDF(TipoAgrupamentoAtividade.TipoAtividade);
            linkDownloadAtividadesPorTipo.CssClass = "linkTabGroupProgramacao";

            aba.Controls.Add(
               new LiteralControl("<br /><hr />"));
            aba.Controls.Add(linkTodasAtividades);
            aba.Controls.Add(linkDownloadAtividadesPorDia);
            aba.Controls.Add(linkDownloadAtividadesPorTipo);
            aba.Controls.Add(
                new LiteralControl("<h3>Atividades públicas do dia</h3>"));

            PreenchedorAtividadesPorDia preenchedorAtividades = new PreenchedorAtividadesPorDia();
            preenchedorAtividades.preencheAtividades(data);
            aba.Controls.Add(preenchedorAtividades.Tabela);
        }
        phTabContainer.Controls.Clear();
        phTabContainer.Controls.Add(tabGroup);
    }
        /// <summary>
        /// Add controls to page. Important to give every control an unique ID that is identical between postbacks otherwise AJAX UpdatePanel won't work.
        /// </summary>
        private void AddProjectControls()
        {
            try
            {
                HPMProjectEnum projects = m_VirtSession.ProjectEnum();

                TabContainer ProjectsTabContainer = new TabContainer();
                //ProjectsTabContainer.ScrollBars = ScrollBars.Auto;
                ProjectsTabContainer.ID = "ProjectTabs";
                ProjectsTabContainer.AutoPostBack = true;
                ProjectsTabContainer.CssClass = "HPMProjectTab";
                ProjectsTabContainer.ActiveTabChanged += new EventHandler(projectTabs_ActiveTabChanged);

                int noProjects = 0;
                //Loop through projects
                for (HPMUInt32 i = 0; i < projects.m_Projects.Length; ++i)
                {
                    HPMUniqueID projectID = projects.m_Projects[i];
                    HPMProjectProperties projectprops = m_VirtSession.ProjectGetProperties(projectID);
                    HPMUniqueID qaProjectID = m_VirtSession.ProjectOpenQAProjectBlock(projectID);

                    if (!m_VirtSession.ProjectResourceUtilIsMember(projectID, m_ResourceID))
                        continue;
                    noProjects++;
                    string qaProject = Convert.ToString(qaProjectID.m_ID);

                    TabPanel ProjectPanel = new TabPanel();
                    ProjectPanel.HeaderTemplate = new HPMHeaderTemplate(ListItemType.Header, projectprops.m_Name);
                    ProjectPanel.HeaderText = projectprops.m_Name;
                    ProjectPanel.ID = "Panel" + qaProject;

                    ProjectPanel.Controls.Add(new LiteralControl("<div id=\"searchrow" + qaProject + "\"class=\" searchrow\">"));
                    Label FindLabel = new Label();
                    FindLabel.CssClass = "HPMTextAndLabelStyle";
                    FindLabel.Text = "Find by keywords";
                    ProjectPanel.Controls.Add(FindLabel);
                    TextBox SearchBox = new TextBox();
                    SearchBox.ID = "Search" + qaProject;
                    SearchBox.AutoPostBack = true;
                    SearchBox.AutoCompleteType = AutoCompleteType.None;
                    SearchBox.Text = String.Empty;
                    SearchBox.TextChanged += new EventHandler(findContext_SelectionChanged);
                    ProjectPanel.Controls.Add(SearchBox);

                    ProjectPanel.Controls.Add(new LiteralControl("<span class=\"HPMLeftSpace\">"));
                    Label ReportLabel = new Label();
                    ReportLabel.Text = "Report";
                    ReportLabel.CssClass = "HPMTextAndLabelStyle";
                    ProjectPanel.Controls.Add(ReportLabel);
                    DropDownList ReportList = new DropDownList();
                    ReportList.ID = "Reports" + qaProject;
                    ReportList.DataTextField = "Value";
                    ReportList.DataValueField = "Key";
                    ReportList.AutoPostBack = true;
                    ReportList.SelectedIndexChanged += new EventHandler(findContext_SelectionChanged);

                    ProjectPanel.Controls.Add(ReportList);
                    ProjectPanel.Controls.Add(new LiteralControl("</span>"));
                    ProjectPanel.Controls.Add(new LiteralControl("</div>"));
                    if (CanAddBugs(qaProjectID, m_ResourceID))
                    {
                        ProjectPanel.Controls.Add(new LiteralControl("<div id=\"reportrow" + qaProject + "\" class=\"reportrow\">"));
                        Button AddButton = new Button();
                        AddButton.ID = "ReportBugButton" + qaProject;
                        AddButton.Text = "Report new bug";
                        AddButton.Click += new System.EventHandler(button_AddBugClick);
                        AddButton.CssClass = "HPMButtonStyle";
                        ProjectPanel.Controls.Add(AddButton);
                        ProjectPanel.Controls.Add(new LiteralControl("</div>"));
                    }

                    GridView gView = new GridView();
                    gView.CssClass = "HPMGridViewStyle";
                    gView.RowStyle.CssClass = "HPMRowStyle";
                    gView.EmptyDataRowStyle.CssClass = "HPMEmptyRowStyle";
                    gView.PagerStyle.CssClass = "HPMPagerStyle";
                    gView.SelectedRowStyle.CssClass = "HPMSelectedRowStyle";
                    gView.HeaderStyle.CssClass = "HPMHeaderStyle";
                    gView.EditRowStyle.CssClass = "HPMEditRowStyle";
                    gView.AlternatingRowStyle.CssClass = "HPMAltRowStyle";
                    gView.DataKeyNames = new string[] { "_ID" };

                    gView.ID = "BugTable" + qaProject;
                    gView.AllowSorting = true;
                    gView.AllowPaging = true;
                    gView.PageSize = Convert.ToInt32(((Hashtable)ConfigurationManager.GetSection("HPM"))["bugsperpage"].ToString());
                    gView.AutoGenerateColumns = false;
                    gView.Sorting += new GridViewSortEventHandler(gView_Sorting);
                    gView.RowCancelingEdit += new GridViewCancelEditEventHandler(gView_CancelingRowEdit);
                    gView.RowEditing += new GridViewEditEventHandler(gView_RowEdit);
                    gView.RowUpdating += new GridViewUpdateEventHandler(gView_RowUpdating);
                    gView.RowDeleting += new GridViewDeleteEventHandler(gView_RowDeleting);
                    gView.PageIndexChanging += new GridViewPageEventHandler(gView_PageIndexChanging);
                    gView.SelectedIndexChanging += new GridViewSelectEventHandler(gView_SelectIndexChanging);
                    gView.RowDataBound += new GridViewRowEventHandler(gView_RowDataBound);

                    Panel gViewPanel = new Panel();
                    gViewPanel.ScrollBars = ScrollBars.Horizontal;
                    gViewPanel.ID = "BugTablePanel" + qaProject;
                    gViewPanel.CssClass = "tbin";
                    gViewPanel.Controls.Add(gView);
                    ProjectPanel.Controls.Add(gViewPanel);

                    ProjectPanel.Controls.Add(new LiteralControl("<div id=\"itemselectedrow" + qaProject + "\" class=\"itemselectedrow\">"));
                    Label NothingSelectedLabel = new Label();
                    NothingSelectedLabel.ID = "NotingSelectedLabel" + qaProject;
                    NothingSelectedLabel.Text = "No item selected";
                    ProjectPanel.Controls.Add(NothingSelectedLabel);
                    ProjectPanel.Controls.Add(new LiteralControl("</div>"));
                    TabContainer BugMultilineTabContainer = new TabContainer();
                    BugMultilineTabContainer.ID = "MultilineTabs" + qaProject;
                    BugMultilineTabContainer.CssClass = "HPMMultilineTab";
                    ProjectPanel.Controls.Add(BugMultilineTabContainer);
                    ProjectsTabContainer.Controls.Add(ProjectPanel);
                    AddColumns(gView, BugMultilineTabContainer, qaProjectID, qaProject);
                }

                UpdatePanel1.ContentTemplateContainer.Controls.Add(ProjectsTabContainer);
                if (noProjects == 0)
                    SetErrorMessage("No projects configured for user", "");
            }
            catch (HPMSdkException error)
            {
                SetErrorMessage("Could not get project info from Hansoft", error.ErrorAsStr());
            }
            catch (HPMSdkManagedException error)
            {
                SetErrorMessage("Could not get project info from Hansoft", error.ErrorAsStr());
            }

        }
        // Helper method to save the value of a template.  This sets up all the right Undo state.
        static void PersistTemplate(TabPanel panel, IDesignerHost host, ITemplate template, string propertyName) {
            using(var transaction = host.CreateTransaction("SetEditableDesignerRegionContent")) {
                var propertyInfo = panel.GetType().GetProperty(propertyName);
                if(propertyInfo == null)
                    return;

                propertyInfo.SetValue(panel, template, null);
                transaction.Commit();
            }
        }
예제 #25
0
    /// <summary>
    /// Prepares the layout of the web part.
    /// </summary>
    protected override void PrepareLayout()
    {
        StartLayout();

        Append("<div");

        // Width
        string width = this.Width;
        if (!string.IsNullOrEmpty(width))
        {
            Append(" style=\"width: ", width, "\"");
        }

        if (IsDesign)
        {
            Append(" id=\"", ShortClientID, "_env\">");

            Append("<table class=\"LayoutTable\" cellspacing=\"0\" style=\"width: 100%;\">");

            if (this.ViewMode == ViewModeEnum.Design)
            {
                Append("<tr><td class=\"LayoutHeader\" colspan=\"2\">");

                // Add header container
                AddHeaderContainer();

                Append("</td></tr>");
            }

            Append("<tr><td style=\"width: 100%;\">");
        }
        else
        {
            Append(">");
        }

        // Add the tabs
        TabContainer tabs = new TabContainer();
        tabs.ID = "tabs";
        AddControl(tabs);

        if (IsDesign)
        {
            Append("</td>");

            // Resizers
            if (AllowDesignMode)
            {
                // Width resizer
                Append("<td class=\"HorizontalResizer\" onmousedown=\"", GetHorizontalResizerScript("env", "Width", false, "tabs_body"), " return false;\">&nbsp;</td></tr>");

                // Height resizer
                Append("<tr><td class=\"VerticalResizer\" onmousedown=\"", GetVerticalResizerScript("tabs_body", "Height"), " return false;\">&nbsp;</td>");
                Append("<td class=\"BothResizer\" onmousedown=\"", GetHorizontalResizerScript("env", "Width", false, "tabs_body"), " ", GetVerticalResizerScript("tabs_body", "Height"), " return false;\">&nbsp;</td>");
            }

            Append("</tr>");
        }

        // Tab headers
        string[] headers = TabHeaders.Split(new char[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);

        if ((this.ActiveTabIndex >= 1) && (this.ActiveTabIndex <= Tabs))
        {
            tabs.ActiveTabIndex = this.ActiveTabIndex - 1;
        }

        for (int i = 1; i <= Tabs; i++)
        {
            // Create new tab
            TabPanel tab = new TabPanel();
            tab.ID = "tab" + i;

            // Prepare the header
            string header = null;
            if (headers.Length >= i)
            {
                header = headers[i - 1];
            }
            if (String.IsNullOrEmpty(header))
            {
                header = "Tab " + i;
            }

            tab.HeaderText = header;
            tabs.Tabs.Add(tab);

            AddZone(this.ID + "_" + i, header, tab);
        }

        // Setup the tabs
        tabs.ScrollBars = ControlsHelper.GetScrollbarsEnum(this.Scrollbars);

        if (!String.IsNullOrEmpty(this.TabsCSSClass))
        {
            tabs.CssClass = this.TabsCSSClass;
        }

        tabs.TabStripPlacement = (this.TabStripPlacement.ToLower() == "bottom" ? AjaxControlToolkit.TabStripPlacement.Bottom : AjaxControlToolkit.TabStripPlacement.Top);

        if (!String.IsNullOrEmpty(this.Height))
        {
            tabs.Height = new Unit(this.Height);
        }

        if (IsDesign)
        {
            // Footer
            if (AllowDesignMode)
            {
                Append("<tr><td class=\"LayoutFooter\" colspan=\"2\"><div class=\"LayoutFooterContent\">");

                Append("<div class=\"LayoutLeftActions\">");

                // Pane actions
                if (this.Tabs > 1)
                {
                    AppendRemoveAction(ResHelper.GetString("Layout.RemoveTab"), "Tabs");
                    Append(" ");
                }
                AppendAddAction(ResHelper.GetString("Layout.AddTab"), "Tabs");

                Append("</div></div></td></tr>");
            }

            Append("</table>");
        }

        Append("</div>");

        FinishLayout();
    }
예제 #26
0
 private void UpdateStatusBar()
 {
     TabPanel.UpdateCounters(_bufferedEvents.Count, _bufferedEvents.Capacity, _filteredEvents.Count, _totalEvents, _lastEventInfo);
 }
 public TabPanelEventArgs(TabPanel panel) { Panel = panel; }
예제 #28
0
 public void UpdateFonts()
 {
     TabPanel.UpdateFonts();
 }
예제 #29
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="surl1"></param>
        /// <param name="surl2"></param>
//        protected void ApplyImage(string surl1, string surl2)
//        {
//            try
//            {
//                var tpl = new XTemplate { ID = "Template1" };
//                if (surl1 != string.Empty || surl2 != string.Empty)
//                {
//                    tpl.Html = @"<div class=""details"">
//			        <tpl for=""."">
//				       <center>
//                        <img src=""{url1}""  onload=""resizeimg(this);""  alt=""车辆图片(双击图片进行放大)"" onDblClick=""OpenPicPage(this.src)""; />&nbsp;&nbsp;
//                        <img src=""{url2}""  onload=""resizeimg(this);"" alt=""车辆图片(双击图片进行放大)"" onDblClick=""OpenPicPage(this.src)"";/>
//                        </center>
//			        </tpl>
//		            </div>";
//                    tpl.Overwrite(this.ImagePanel, new
//                    {
//                        url1 = surl1,
//                        url2 = surl2
//                    });
//                }
//                else
//                {
//                    tpl.Html = @"<div class=""details"">
//			        <tpl for=""."">
//				       <center>
//                        <img src=""{url1}""  onload=""resizeimg(this);""  />&nbsp;&nbsp;
//                        <img src=""{url2}""  onload=""resizeimg(this);"" />
//                        </center>
//			        </tpl>
//		            </div>";
//                    tpl.Overwrite(this.ImagePanel, new
//                    {
//                        url1 = surl1,
//                        url2 = surl2
//                    });
//                }
//                tpl.Render();
//            }
//            catch (Exception ex)
//            {
//                ILog.WriteErrorLog(ex);
//                logManager.InsertLogError("FlowMonitor.aspx-ApplyImage", ex.Message, "ApplyImage has an exception");
//            }
//        }

        /// <summary>
        ///
        /// </summary>
        /// <param name="sdata"></param>
        private void AddWindow(string sdata)
        {
            try
            {
                Window win = new Window();
                win.ID          = "Window1";
                win.Title       = "报警详细信息";
                win.Icon        = Icon.Application;
                win.Width       = Unit.Pixel(800);
                win.Height      = Unit.Pixel(490);
                win.Plain       = true;
                win.Border      = false;
                win.BodyBorder  = false;
                win.Collapsible = true;

                TabPanel center = new TabPanel();
                center.ID             = "CenterPanel";
                center.ActiveTabIndex = 0;

                Ext.Net.Panel tab2 = new Ext.Net.Panel();
                tab2.ID        = "Tab2";
                tab2.Title     = "报警信息";
                tab2.Border    = false;
                tab2.BodyStyle = "padding:6px;";

                Container container = new Container();
                container.Layout = "Column";
                container.Height = 130;

                Container container1 = new Container();
                container1.LabelAlign  = LabelAlign.Left;
                container1.Layout      = "Form";
                container1.ColumnWidth = 0.35;
                container1.Items.Add(CommonExt.AddTextField("txtcxkk", "报警卡口", Bll.Common.GetdatabyField(sdata, "col1")));
                container1.Items.Add(CommonExt.AddTextField("txtbjyz", "报警阈值(%)", Bll.Common.GetdatabyField(sdata, "col6")));
                container1.Items.Add(CommonExt.AddTextField("txtpzsj", "配置时间", Bll.Common.GetdatabyField(sdata, "col11", "")));

                Container container2 = new Container();
                container2.LabelAlign  = LabelAlign.Left;
                container2.Layout      = "Form";
                container2.ColumnWidth = 0.3;
                container2.Items.Add(CommonExt.AddTextField("txttjzq", "统计周期", Bll.Common.GetdatabyField(sdata, "col5")));
                container2.Items.Add(CommonExt.AddTextField("txtkkpzr", "卡口配置人", Bll.Common.GetdatabyField(sdata, "col9")));
                container2.Items.Add(CommonExt.AddComboBox("cmbcljg", "处理结果", "Storecljg", "请选择...", false, 224, 105, Bll.Common.GetdatabyField(sdata, "col10")));

                Container container3 = new Container();
                container3.LabelAlign  = LabelAlign.Left;
                container3.Layout      = "Form";
                container3.ColumnWidth = 0.4;
                container3.Items.Add(CommonExt.AddTextField("txtbjsj", "报警时间", Bll.Common.GetdatabyField(sdata, "col4", "")));
                container3.Items.Add(CommonExt.AddTextField("txtkkfx", "卡口方向", Bll.Common.GetdatabyField(sdata, "col14")));
                container3.Items.Add(CommonExt.AddButton("btnSavecljg", "保存", "Disk", "Ovel.Savecljg(" + Bll.Common.GetdatabyField(sdata, "col0") + ")"));
                //container3.Items.Add(CommonExt.AddButton("butCancel", "退出", "Cancel", win.ClientID + ".hide()"));

                container.Items.Add(container1);
                container.Items.Add(container2);
                container.Items.Add(container3);

                tab2.Items.Add(container);
                center.Items.Add(tab2);

                //Ext.Net.Panel south = new Ext.Net.Panel();
                //south.ID = "SouthPanel";
                //south.Title = "图片信息";
                //south.Height = Unit.Pixel(380);
                //south.BodyStyle = "padding:6px;";

                //string img1 = Bll.Common.GetdatabyField(sdata, "col14");
                //string img2 = Bll.Common.GetdatabyField(sdata, "col15");
                //south.Html = GetHtml(img1, img2);

                BorderLayout layout = new BorderLayout();
                layout.South.Split       = true;
                layout.South.Collapsible = true;
                layout.Center.Items.Add(center);
                //layout.South.Items.Add(south);

                win.Items.Add(layout);

                win.Render(this.Form);
                win.Show();
            }
            catch (Exception ex)
            {
                ILog.WriteErrorLog(ex);
                logManager.InsertLogError("FlowMonitor.aspx-AddWindow", ex.Message, "AddWindow has an exception");
            }
        }
        /// <summary>Adds a new panel to the set.</summary>
        /// <param name="title">The title of the panel (shown in the tab button).</param>
        /// <param name="buttonWidth">The pixel width of the button.</param>
        public TabPanel AddPanel(string title, int buttonWidth)
        {
            // Setup initial conditions.
            if (Script.IsNullOrUndefined(buttonWidth)) buttonWidth = 100;
            TabPanel panel = new TabPanel(title, buttonWidth);

            // Wire up events.
            panel.Disposed += delegate
                                  {
                                      panels.Remove(panel);
                                      EnsureSelection();
                                  };
            panel.VisibilityChanged += delegate { EnsureSelection(); };

            // Insert the panel.
            panels.Add(panel);

            // Finish up.
            FirePanelAdded(panel);
            EnsureSelection();
            return panel;
        }
        /// <summary>
        /// Shows the dialog.
        /// </summary>
        /// <param name="history">The history.</param>
        internal void ShowDialog(JAMS.History history)
        {
            m_CurrentlyDisplayed = true;

            Style["Display"] = "inline";

            //Create the child controls.
            Panel titleBar = new Panel();

            titleBar.ID = GetChildControlID("TitleBar");
            titleBar.Style["background-color"] = "#CEE5FE";
            titleBar.Style["margin"]           = "-3, -3, 6, -3";
            Extender.PopupDragHandleControlID  = GetChildControlID("TitleBar");
            Extender.OkControlID = GetChildControlID("HistoryDialogOK");

            Label head = new Label();

            head.Text = "History for Job: " + history.JobName + " - ";
            titleBar.Controls.Add(head);

            head      = new Label();
            head.Text = "JAMS Entry: " + history.JAMSEntry;
            titleBar.Controls.Add(head);
            Controls.AddAt(0, titleBar);

            m_TabContainer = new TabContainer {
                ID = GetChildControlID("HistoryTabContainer")
            };
            m_TabContainer.Height = Unit.Pixel(350);

            var general = new TabPanel {
                ID = GetChildControlID("GeneralTab")
            };
            var status = new TabPanel {
                ID = GetChildControlID("StatusTab")
            };
            var statistics = new TabPanel {
                ID = GetChildControlID("StatisticsTab")
            };
            var logfile = new TabPanel {
                ID = GetChildControlID("LogFileTab")
            };

            general.HeaderText    = "General";
            status.HeaderText     = "Status";
            statistics.HeaderText = "Statistics";
            logfile.HeaderText    = "Log File";

            m_TabContainer.Tabs.Add(general);
            m_TabContainer.Tabs.Add(status);
            m_TabContainer.Tabs.Add(statistics);
            m_TabContainer.Tabs.Add(logfile);

            m_TabContainer.ActiveTabIndex = 0;
            m_TabContainer.ScrollBars     = ScrollBars.Auto;

            m_OkButton                 = new System.Web.UI.HtmlControls.HtmlButton();
            m_OkButton.ID              = GetChildControlID("HistoryDialogOK");
            m_OkButton.InnerText       = "OK";
            m_OkButton.Style["margin"] = "20px, 50px, 10px, 0px";

            var buttonPanel = new Panel();

            buttonPanel.ID = GetChildControlID("History_Button_Panel");
            buttonPanel.Controls.Add(m_OkButton);
            buttonPanel.EnableViewState = false;
            buttonPanel.HorizontalAlign = HorizontalAlign.Center;

            //Create the controls on the tabs, fill in data from the History object.

            //General Tab
            var job = new Label {
                Text = string.Format("Job\n  {0}\n\n  {1}", history.JobName, history.Job.Description), CssClass = "tabContents"
            };
            var system = new Label {
                Text = string.Format("System\n  {0}", history.Job.ParentFolderName), CssClass = "tabContents"
            };
            var setup = new Label {
                Text = string.Format("Setup\n  {0}", history.Setup.SetupName), CssClass = "tabContents"
            };
            var submitInfo = new Label
            {
                Text =
                    string.Format(
                        "Submit Information\n  JAMS Entry {0}, Queue Entry {1}, RON {2}",
                        history.JAMSEntry, history.BatchQueue, history.RON),
                CssClass = "tabContents"
            };

            general.Controls.Add(job);
            general.Controls.Add(system);
            general.Controls.Add(setup);
            general.Controls.Add(submitInfo);

            //Status Tab
            var finalStatus = new Label {
                Text = string.Format("Final Status\n  {0}", history.FinalStatus), CssClass = "tabContents"
            };
            var note = new Label {
                Text = string.Format("Note\n  {0}", history.Note), CssClass = "tabContents"
            };
            var jobStatusText = new Label {
                Text = string.Format("Job Status Text\n  {0}", history.JobStatus), CssClass = "tabContents"
            };

            status.Controls.Add(finalStatus);
            status.Controls.Add(note);
            status.Controls.Add(jobStatusText);

            //Stats Tab
            var times = new Label {
                Text = string.Format("Times\n  ")
            };
            var timesTable = new Table();

            for (int i = 0; i < 4; i++)
            {
                var timeRow = new TableRow();
                timesTable.Rows.Add(timeRow);
            }

            var cells = new List <TableCell>();

            cells.Add(new TableCell {
                Text = "Scheduled At: "
            });
            cells.Add(new TableCell {
                Text = history.ScheduledTime.ToString()
            });
            cells.Add(new TableCell {
                Text = "Scheduled For: "
            });
            cells.Add(new TableCell {
                Text = history.HoldTime.ToString()
            });
            cells.Add(new TableCell {
                Text = "Started: "
            });
            cells.Add(new TableCell {
                Text = history.StartTime.ToString()
            });
            cells.Add(new TableCell {
                Text = "Completed: "
            });
            cells.Add(new TableCell {
                Text = history.CompletionTime.ToString()
            });

            int j = 0;

            for (int i = 0; i < timesTable.Rows.Count; i++)
            {
                timesTable.Rows[i].Cells.Add(cells[j]);
                timesTable.Rows[i].Cells.Add(cells[j + 1]);
                j = j + 2;
            }

            var stats = new Label {
                Text = "Statistics"
            };
            var statsTable = new Table();

            for (int i = 0; i < 7; i++)
            {
                var statRow = new TableRow();
                statsTable.Rows.Add(statRow);
            }

            var statCells = new List <TableCell>();

            switch (history.EntryType)
            {
            case HistoryType.Job:
            {
                statCells.Add(new TableCell {
                        Text = ""
                    });
                statCells.Add(new TableCell {
                        Text = "Current"
                    });
                statCells.Add(new TableCell {
                        Text = "Minimum"
                    });
                statCells.Add(new TableCell {
                        Text = "Maximum"
                    });
                statCells.Add(new TableCell {
                        Text = "Average"
                    });
                statCells.Add(new TableCell {
                        Text = "% of Avg."
                    });

                statCells.Add(new TableCell {
                        Text = "Elapsed Time: "
                    });
                statCells.Add(new TableCell {
                        Text = history.ElapsedTime.ToString()
                    });
                statCells.Add(new TableCell {
                        Text = history.Job.MinElapsedTime.ToString()
                    });
                statCells.Add(new TableCell {
                        Text = history.Job.MaxElapsedTime.ToString()
                    });
                statCells.Add(new TableCell {
                        Text = history.Job.AvgElapsedTime.ToString()
                    });
                statCells.Add(new TableCell
                    {
                        Text = CalcPercent(history.ElapsedTime.TotalSeconds,
                                           history.Job.AvgElapsedTime.TotalSeconds)
                    });

                statCells.Add(new TableCell {
                        Text = "Cpu Time: "
                    });
                statCells.Add(new TableCell {
                        Text = history.CpuTime.ToString()
                    });
                statCells.Add(new TableCell {
                        Text = history.Job.MinCpuTime.ToString()
                    });
                statCells.Add(new TableCell {
                        Text = history.Job.MaxCpuTime.ToString()
                    });
                statCells.Add(new TableCell {
                        Text = history.Job.AvgCpuTime.ToString()
                    });
                statCells.Add(new TableCell
                    {
                        Text = CalcPercent(history.CpuTime.TotalSeconds,
                                           history.Job.AvgCpuTime.TotalSeconds)
                    });

                statCells.Add(new TableCell {
                        Text = "Direct I/O: "
                    });
                statCells.Add(new TableCell {
                        Text = history.DirectIOCount.ToString()
                    });
                statCells.Add(new TableCell {
                        Text = history.Job.MinDirectIOCount.ToString()
                    });
                statCells.Add(new TableCell {
                        Text = history.Job.MaxDirectIOCount.ToString()
                    });
                statCells.Add(new TableCell {
                        Text = history.Job.AvgDirectIOCount.ToString()
                    });
                statCells.Add(new TableCell {
                        Text = CalcPercent(history.DirectIOCount, history.Job.AvgDirectIOCount)
                    });

                statCells.Add(new TableCell {
                        Text = "Buffered I/O: "
                    });
                statCells.Add(new TableCell {
                        Text = history.BufferedIOCount.ToString()
                    });
                statCells.Add(new TableCell {
                        Text = history.Job.MinBufferedIOCount.ToString()
                    });
                statCells.Add(new TableCell {
                        Text = history.Job.MaxBufferedIOCount.ToString()
                    });
                statCells.Add(new TableCell {
                        Text = history.Job.AvgBufferedIOCount.ToString()
                    });
                statCells.Add(new TableCell {
                        Text = CalcPercent(history.BufferedIOCount, history.Job.AvgBufferedIOCount)
                    });

                statCells.Add(new TableCell {
                        Text = "Page Faults: "
                    });
                statCells.Add(new TableCell {
                        Text = history.PageFaults.ToString()
                    });
                statCells.Add(new TableCell {
                        Text = history.Job.MinPageFaults.ToString()
                    });
                statCells.Add(new TableCell {
                        Text = history.Job.MaxPageFaults.ToString()
                    });
                statCells.Add(new TableCell {
                        Text = history.Job.AvgPageFaults.ToString()
                    });
                statCells.Add(new TableCell {
                        Text = CalcPercent(history.PageFaults, history.Job.AvgPageFaults)
                    });

                statCells.Add(new TableCell {
                        Text = "Peak W/S: "
                    });
                statCells.Add(new TableCell {
                        Text = history.WorkingSetPeak.ToString()
                    });
                statCells.Add(new TableCell {
                        Text = history.Job.MinWorkingSetPeak.ToString()
                    });
                statCells.Add(new TableCell {
                        Text = history.Job.MaxWorkingSetPeak.ToString()
                    });
                statCells.Add(new TableCell {
                        Text = history.Job.AvgWorkingSetPeak.ToString()
                    });
                statCells.Add(new TableCell {
                        Text = CalcPercent(history.WorkingSetPeak, history.Job.AvgWorkingSetPeak)
                    });

                break;
            }

            case HistoryType.Setup:
            {
                statCells.Add(new TableCell {
                        Text = ""
                    });
                statCells.Add(new TableCell {
                        Text = "Current"
                    });
                statCells.Add(new TableCell {
                        Text = "Minimum"
                    });
                statCells.Add(new TableCell {
                        Text = "Maximum"
                    });
                statCells.Add(new TableCell {
                        Text = "Average"
                    });
                statCells.Add(new TableCell {
                        Text = "% of Avg."
                    });

                statCells.Add(new TableCell {
                        Text = "Elapsed Time: "
                    });
                statCells.Add(new TableCell {
                        Text = history.ElapsedTime.ToString()
                    });
                statCells.Add(new TableCell {
                        Text = history.Setup.MinElapsedTime.ToString()
                    });
                statCells.Add(new TableCell {
                        Text = history.Setup.MaxElapsedTime.ToString()
                    });
                statCells.Add(new TableCell {
                        Text = history.Setup.AvgElapsedTime.ToString()
                    });
                statCells.Add(new TableCell
                    {
                        Text = CalcPercent(history.ElapsedTime.TotalSeconds,
                                           history.Setup.AvgElapsedTime.TotalSeconds)
                    });

                statCells.Add(new TableCell {
                        Text = "Cpu Time: "
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });

                statCells.Add(new TableCell {
                        Text = "Direct I/O: "
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });

                statCells.Add(new TableCell {
                        Text = "Buffered I/O: "
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });

                statCells.Add(new TableCell {
                        Text = "Page Faults: "
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });

                statCells.Add(new TableCell {
                        Text = "Peak W/S: "
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });

                break;
            }

            default:
            {
                statCells.Add(new TableCell {
                        Text = ""
                    });
                statCells.Add(new TableCell {
                        Text = "Current"
                    });
                statCells.Add(new TableCell {
                        Text = "Minimum"
                    });
                statCells.Add(new TableCell {
                        Text = "Maximum"
                    });
                statCells.Add(new TableCell {
                        Text = "Average"
                    });
                statCells.Add(new TableCell {
                        Text = "% of Avg."
                    });

                statCells.Add(new TableCell {
                        Text = "Elapsed Time: "
                    });
                statCells.Add(new TableCell {
                        Text = history.ElapsedTime.ToString()
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });

                statCells.Add(new TableCell {
                        Text = "Cpu Time: "
                    });
                statCells.Add(new TableCell {
                        Text = history.CpuTime.ToString()
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });

                statCells.Add(new TableCell {
                        Text = "Direct I/O: "
                    });
                statCells.Add(new TableCell {
                        Text = history.DirectIOCount.ToString()
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });

                statCells.Add(new TableCell {
                        Text = "Buffered I/O: "
                    });
                statCells.Add(new TableCell {
                        Text = history.BufferedIOCount.ToString()
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });

                statCells.Add(new TableCell {
                        Text = "Page Faults: "
                    });
                statCells.Add(new TableCell {
                        Text = history.PageFaults.ToString()
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });

                statCells.Add(new TableCell {
                        Text = "Peak W/S: "
                    });
                statCells.Add(new TableCell {
                        Text = history.WorkingSetPeak.ToString()
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });
                statCells.Add(new TableCell {
                        Text = StrNa
                    });

                break;
            }
            }

            j = 0;
            for (int i = 0; i < statsTable.Rows.Count; i++)
            {
                statsTable.Rows[i].Cells.Add(statCells[j]);
                statsTable.Rows[i].Cells.Add(statCells[j + 1]);
                statsTable.Rows[i].Cells.Add(statCells[j + 2]);
                statsTable.Rows[i].Cells.Add(statCells[j + 3]);
                statsTable.Rows[i].Cells.Add(statCells[j + 4]);
                statsTable.Rows[i].Cells.Add(statCells[j + 5]);
                j = j + 6;
            }

            statistics.Controls.Add(times);
            statistics.Controls.Add(timesTable);
            statistics.Controls.Add(stats);
            statistics.Controls.Add(statsTable);

            //LogFile tab
            var logLocation = new Label {
                Text = history.LogFilename, CssClass = "tabContents"
            };

            var logLabel = new Label {
                CssClass = "tabContents"
            };

            Stream log = null;

            try
            {
                // try getting the log file. If we can't, just say the log is unavailable.
                log = history.LogFile;
            }
            catch (Exception ex)
            {
                string exMessage = "The log file is not available";
                while (ex != null)
                {
                    exMessage = string.Format("{0}{1}{2}", exMessage, Environment.NewLine, ex.Message);
                    ex        = ex.InnerException;
                }
                logLabel.Text = exMessage;
            }
            if (log != null)
            {
                StreamReader logSR = new StreamReader(log, true);
                logLabel.Text = logSR.ReadToEnd();
                log.Close();
            }

            var preTag = new System.Web.UI.HtmlControls.HtmlGenericControl();

            preTag.TagName = "pre";
            preTag.Controls.Add(logLabel);

            logfile.Controls.Add(logLocation);
            logfile.Controls.Add(preTag);

            //Once all the controls have been created, add them to the dialog.
            Controls.Add(m_TabContainer);
            Controls.Add(buttonPanel);
        }
예제 #32
0
 public static IDisposable BeginProfilePanel(this HtmlHelper helper, TabPanel tabPanel, int activeTabID)
 {
     return(new ProfilePanel(helper, tabPanel, activeTabID));
 }
예제 #33
0
        public MainWindow(UpdateMonitor InUpdateMonitor, string InApiUrl, string InDataFolder, string InCacheFolder, bool bInRestoreStateOnLoad, string InOriginalExecutableFileName, bool bInUnstable, DetectProjectSettingsResult[] StartupProjects, LineBasedTextWriter InLog, UserSettings InSettings)
        {
            InitializeComponent();

            UpdateMonitor = InUpdateMonitor;
            MainThreadSynchronizationContext = SynchronizationContext.Current;
            ApiUrl                     = InApiUrl;
            DataFolder                 = InDataFolder;
            CacheFolder                = InCacheFolder;
            bRestoreStateOnLoad        = bInRestoreStateOnLoad;
            OriginalExecutableFileName = InOriginalExecutableFileName;
            bUnstable                  = bInUnstable;
            Log      = InLog;
            Settings = InSettings;

            // While creating tab controls during startup, we need to prevent layout calls resulting in the window handle being created too early. Disable layout calls here.
            SuspendLayout();
            TabPanel.SuspendLayout();

            TabControl.OnTabChanged  += TabControl_OnTabChanged;
            TabControl.OnNewTabClick += TabControl_OnNewTabClick;
            TabControl.OnTabClicked  += TabControl_OnTabClicked;
            TabControl.OnTabClosing  += TabControl_OnTabClosing;
            TabControl.OnTabClosed   += TabControl_OnTabClosed;
            TabControl.OnTabReorder  += TabControl_OnTabReorder;
            TabControl.OnButtonClick += TabControl_OnButtonClick;

            SetupDefaultControl();

            int SelectTabIdx = -1;

            foreach (DetectProjectSettingsResult StartupProject in StartupProjects)
            {
                int TabIdx = -1;
                if (StartupProject.bSucceeded)
                {
                    TabIdx = TryOpenProject(StartupProject.Task, -1, OpenProjectOptions.Quiet);
                }
                else if (StartupProject.ErrorMessage != null)
                {
                    CreateErrorPanel(-1, StartupProject.Task.SelectedProject, StartupProject.ErrorMessage);
                }

                if (TabIdx != -1 && Settings.LastProject != null && StartupProject.Task.SelectedProject.Equals(Settings.LastProject))
                {
                    SelectTabIdx = TabIdx;
                }
            }

            if (SelectTabIdx != -1)
            {
                TabControl.SelectTab(SelectTabIdx);
            }
            else if (TabControl.GetTabCount() > 0)
            {
                TabControl.SelectTab(0);
            }

            StartScheduleTimer();

            if (bUnstable)
            {
                Text += String.Format(" (UNSTABLE BUILD {0})", Assembly.GetExecutingAssembly().GetName().Version);
            }

            AutomationLog    = new TimestampLogWriter(new BoundedLogWriter(Path.Combine(DataFolder, "Automation.log")));
            AutomationServer = new AutomationServer(Request => { MainThreadSynchronizationContext.Post(Obj => PostAutomationRequest(Request), null); }, AutomationLog);

            // Allow creating controls from now on
            TabPanel.ResumeLayout(false);
            ResumeLayout(false);

            bAllowCreatingHandle = true;
        }
        private void AddButton(TabPanel panel)
        {
            // Create button.
            TabPanelButton tab = new TabPanelButton(panel);
            toolbarElement.Append(tab.Container);

            // Wire up events.
            WirePanelEvents(true, panel, tab);

            // Finish up.
            buttonViews.Add(tab);
            UpdateButtonPositions();
        }
예제 #35
0
        private static void ScrollTabItemAsLeft(TabControl tabControl, ScrollViewer viewer, TabPanel panel, int index)
        {
            if (index < 0 || tabControl.Items.Count <= index)
            {
                return;
            }
            TabPanel pnl  = tabControl.FindName("headerPanel") as TabPanel;
            TabItem  item = tabControl.Items[index] as TabItem;
            Point    p    = item.TranslatePoint(new Point(), panel);

            viewer.ScrollToHorizontalOffset(p.X);
        }
예제 #36
0
파일: Tabs.ascx.cs 프로젝트: prsolans/rsg
    /// <summary>
    /// Prepares the layout of the web part.
    /// </summary>
    protected override void PrepareLayout()
    {
        StartLayout(true);

        // Tab headers
        string[] headers = TextHelper.EnsureLineEndings(TabHeaders, "\n").Split('\n');

        if ((ActiveTabIndex >= 1) && (ActiveTabIndex <= Tabs))
        {
            tabs.ActiveTabIndex = ActiveTabIndex - 1;
        }

        for (int i = 1; i <= Tabs; i++)
        {
            // Create new tab
            TabPanel tab = new TabPanel();
            tab.ID = "tab" + i;

            // Prepare the header
            string header = null;
            if (headers.Length >= i)
            {
                header = ResHelper.LocalizeString(headers[i - 1]);
            }
            if (String.IsNullOrEmpty(header))
            {
                header = "Tab " + i;
            }

            tabs.Tabs.Add(tab);

            AddZone(ID + "_" + i, header, tab);

            if (IsDesign)
            {
                header = EditableWebPartProperty.GetHTMLCode(null, this, "TabHeaders", i, EditablePropertyTypeEnum.TextBox, header, null, null, null, true);
            }
            else
            {
                header = EditableWebPartProperty.ApplyReplacements(HttpUtility.HtmlEncode(header), false);
            }

            tab.HeaderText = header;
        }

        // Wireframe design
        tabs.TabStripPlacement = GetTabStripPlacement(TabStripPlacement);
        tabs.CssClass = "WireframeTabs";

        // Set width / height
        string width = Width;
        if (!String.IsNullOrEmpty(width))
        {
            tabs.Width = new Unit(width);
        }

        if (IsDesign && AllowDesignMode)
        {
            // Pane actions
            if (Tabs > 1)
            {
                AppendRemoveAction(GetString("Layout.RemoveTab"), "Tabs", "icon-times", null);
                Append(" ");
            }

            AppendAddAction(GetString("Layout.AddTab"), "Tabs", "icon-plus", null);

            resElem.ResizedElementID = tabs.ClientID;
        }

        // Render the actions
        string actions = FinishLayout(false);
        if (!String.IsNullOrEmpty(actions))
        {
            pnlActions.Visible = true;
            ltlActions.Text = actions;
        }
    }
        private void AddPanel(TabPanel panel)
        {
            // Setup initial conditions.
            if (!view.IsLoaded) return;

            // Add the button.
            AddButton(panel);

            // Add the DIV.
            Css.SetVisibility(panel.Div, false);
            panelsContainer.Append(panel.Div);
        }
        string GetTabContent(TabPanel tab, bool isContent) {
            if(tab == null)
                return String.Empty;

            if(isContent) {
                if(tab.ContentTemplate == null)
                    return String.Empty;

                return GetTemplateContent(tab.ContentTemplate, "_content");
            }

            if(tab.HeaderTemplate != null)
                return GetTemplateContent(tab.HeaderTemplate, "_header");

            return tab.HeaderText;
        }
 private void WirePanelEvents(bool add, TabPanel panel, TabPanelButton tab)
 {
     if (add)
     {
         panel.Disposed += HandlePanelDisposed;
         panel.VisibilityChanged += HandlePanelVisibilityChanged;
         tab.Model.IsPressedChanged += OnIsPressedChanged;
     }
     else
     {
         panel.Disposed -= HandlePanelDisposed;
         panel.VisibilityChanged -= HandlePanelVisibilityChanged;
         tab.Model.IsPressedChanged -= OnIsPressedChanged;
     }
 }
예제 #40
0
        static void PersistTemplateContent(TabPanel panel, IDesignerHost host, string content, string propertyName)
        {
            var template = ControlParser.ParseTemplate(host, content);

            PersistTemplate(panel, host, template, propertyName);
        }
예제 #41
0
        public override void OnInitialize()
        {
            TabPanel Menu = new TabPanel(450, 500, new Tab("Custom NPC", this), new Tab(" Custom Item", new CustomItemUI()));

            Menu.VAlign             = 0.6f;
            Menu.HAlign             = 0.2f;
            Menu.OnCloseBtnClicked += () => GetInstance <Creativetools>().UserInterface.SetState(new MainUI());
            Append(Menu);

            UITextPanel <string> CreateButton = new UITextPanel <string>(Language.GetTextValue("Create NPC"));

            CreateButton.SetPadding(4);
            CreateButton.HAlign    = 0.05f;
            CreateButton.MarginTop = 460;
            CreateButton.OnClick  += CreateButtonButtonClicked;
            Menu.Append(CreateButton);

            UITextPanel <string> CodeButton = new UITextPanel <string>(Language.GetTextValue("Copy Code"));

            CodeButton.SetPadding(4);
            CodeButton.HAlign    = 0.5f;
            CodeButton.MarginTop = 460;
            CodeButton.OnClick  += CodeButtonClicked;
            Menu.Append(CodeButton);

            UITextPanel <string> FileButton = new UITextPanel <string>(Language.GetTextValue("Select Texture"));

            FileButton.SetPadding(4);
            FileButton.HAlign    = 0.9f;
            FileButton.MarginTop = 460;
            FileButton.OnClick  += FileButtonClicked;
            Menu.Append(FileButton);

            nametext           = new NewUITextBox("Enter name here");
            nametext.HAlign    = 0.5f;
            nametext.MarginTop = 50;
            nametext.Width.Set(-40f, 1f);
            Menu.Append(nametext);

            MakeSlider(new UIIntRangedDataValue("Life: ", 0, 0, 999), out LifeDataProperty, Menu, top: 100);
            MakeSlider(new UIIntRangedDataValue("Damage: ", 0, 0, 999), out DamageDataProperty, Menu, top: 150);
            MakeSlider(new UIIntRangedDataValue("Defense: ", 0, 0, 999), out DefenseDataProperty, Menu, top: 200);
            MakeSlider(new UIIntRangedDataValue("AiStyle: ", 1, 0, 111), out AiSyleDataProperty, Menu, top: 250);
            MakeSlider(new UIFloatRangedDataValue("Knockback resist: ", 0, 0, 1), out KnockbackDataProperty, Menu, 300);
            MakeSlider(new UIFloatRangedDataValue("Scale: ", 1, 0, 10), out ScaleDataProperty, Menu, top: 350);

            FrameDataProperty = new UIIntRangedDataValue("", 1, 1, 20);
            UIElement FrameSlider = new UIRange <int>(FrameDataProperty)
            {
                MarginTop = 410, HAlign = 0.35f
            };

            FrameSlider.Width.Set(0, 0.4f);
            FrameSlider.Append(new UIText("Frame count:")
            {
                HAlign = 0.9f, MarginTop = -15
            });
            Menu.Append(FrameSlider);

            UITextPanel <string> NoCollideButton = new UITextPanel <string>("Collision: true")
            {
                HAlign = 0.05f, MarginTop = 400
            };

            NoCollideButton.OnClick += (evt, elm) =>
            {
                CustomNPC.cNoCollide = !CustomNPC.cNoCollide;
                NoCollideButton.SetText("Collision: " + !CustomNPC.cNoCollide);
            };
            Menu.Append(NoCollideButton);

            UITextPanel <string> ImmortalButton = new UITextPanel <string>("Immortal: false")
            {
                HAlign = 0.95f, MarginTop = 400
            };

            ImmortalButton.OnClick += (evt, elm) =>
            {
                CustomNPC.cImmortal = !CustomNPC.cImmortal;
                ImmortalButton.SetText("Immortal: " + CustomNPC.cImmortal);
            };
            Menu.Append(ImmortalButton);
        }
예제 #42
0
        public override void Initialize()
        {
            base.Initialize();

            SetBackground(ResourceManager.CreateImage("Images/background"), Adjustment.CENTER);

            //Init all lists
            gridContainerList = new List<Container<GridLayout>>();
            imageList = new List<ImageItem>();
            pendingUrlImages = new List<string>();

            //Search Text Area
            this.searchTextArea = new TextArea(SEARCH_TEXTAREA_TEXT, 1, 100);
            this.searchTextArea.BackgroundImage = ResourceManager.CreateImage("Images/top_search");
            this.searchTextArea.Padding = new Padding(25, 0, 0, 70);
            this.searchTextArea.Size = new Vector2(searchTextArea.BackgroundImage.Size.X, searchTextArea.BackgroundImage.Size.Y);
            AddComponent(searchTextArea, -80.0f, Preferences.ViewportManager.TopAnchor);

            //Search Button
            searchButton = new Button(ResourceManager.CreateImage("Images/bt_search"), ResourceManager.CreateImage("Images/bt_search_pressed"));
            searchButton.Pivot = new Vector2(1, 0);
            searchButton.Released += delegate
            {
                //Clear previous images
                ClearContent();
                //Search new images using TextArea text
                SearchImages(searchTextArea.Text);
            };
            AddComponent(searchButton, Preferences.ViewportManager.TopRightAnchor +  new Vector2( -12, 12));

            //Content Tab Panel
            contentTabPanel = new TabPanel(458, 632);
            //AddComponent(contentTabPanel, 0, BUTTON_HEIGHT + SPACING);
            AddComponent(contentTabPanel, 11, 90);
            //ZoomPanel
            zoomPanel = new ZoomPanel(this);
        }
 private void FirePanelAdded(TabPanel panel)
 {
     if (PanelAdded != null) PanelAdded(this, new TabPanelEventArgs(panel));
 }
예제 #44
0
 /**
  * @brief OnApplyTemplate callback.
  * @see https://msdn.microsoft.com/nl-nl/library/system.windows.frameworkelement.onapplytemplate(v=vs.110).aspx
  */
 public override void OnApplyTemplate()
 {
     base.OnApplyTemplate();
     tab_panel_ = Template.FindName("HeaderPanel", this) as TabPanel;
 }
예제 #45
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            _tabPanel = Template.FindName("TabPanel", this) as TabPanel;
            _border   = Template.FindName("ContentBorder", this) as Border;

            _optionsButton  = Template.FindName("OptionsButton", this) as ImageButton;
            _feedbackButton = Template.FindName("FeedbackButton", this) as ImageButton;
            _helpButton     = Template.FindName("HelpButton", this) as ImageButton;
            _hideButton     = Template.FindName("HideGridButton", this) as Button;

            //Options
            if (_optionsButton != null)
            {
                _optionsButton.Click += (sender, args) =>
                {
                    var options = new Options {
                        Owner = Window.GetWindow(this)
                    };
                    options.ShowDialog();
                }
            }
            ;

            //Feedback
            if (_feedbackButton != null)
            {
                _feedbackButton.Click += (sender, args) =>
                {
                    var feed = new Feedback {
                        Owner = Window.GetWindow(this)
                    };
                    feed.ShowDialog();
                }
            }
            ;

            //Help
            if (_helpButton != null)
            {
                _helpButton.Click += (sender, args) =>
                {
                    try
                    {
                        Process.Start("https://github.com/NickeManarin/ScreenToGif/wiki/Help");
                    }
                    catch (Exception ex)
                    {
                        LogWriter.Log(ex, "Openning the Help");
                    }
                }
            }
            ;

            //Hide tab
            if (_hideButton != null)
            {
                _hideButton.Click += HideButton_Clicked;
            }

            //Show tab (if hidden)
            if (_tabPanel != null)
            {
                foreach (TabItem tabItem in _tabPanel.Children)
                {
                    tabItem.PreviewMouseDown += TabItem_PreviewMouseDown;
                }

                _tabPanel.PreviewMouseWheel += TabControl_PreviewMouseWheel;
            }

            UpdateVisual();
        }
예제 #46
0
 public void Init() {
     _result = new Str();
     _tabPanel = new TabPanel();
     _tabPanel.Id( "tabPanel" );
 }
예제 #47
0
        protected override void OnPreInit(EventArgs e)
        {
            base.OnPreInit(e);

            #region 总体布局
            _viewPort = new Viewport();
            _viewPort.Layout = "border";
            _copyright = new Panel();
            _copyright.Title = "版权";
            _copyright.TitleAlign = TitleAlign.Center;
            _copyright.Collapsible = false;
            _copyright.Region = Region.South;
            _copyright.Split = true;
            _menu = new Panel();
            _menu.Title = "导航菜单";
            _menu.Collapsible = true;
            _menu.Region = Region.West;
            _menu.Split = true;
            _menu.Width = 200;
            _workArea = new Ext.Net.TabPanel();
            _workArea.Title = "欢迎使用";
            _workArea.Region = Region.Center;
            _workArea.ID = "tabWork";
            _title = new Panel();
            _title.Title = WebName;
            _title.Collapsible = false;
            _title.Region = Region.North;
            _title.Split = true;
            _viewPort.Items.Add(_title);
            _viewPort.Items.Add(_workArea);
            _viewPort.Items.Add(_copyright);
            _viewPort.Items.Add(_menu);
            #endregion

            #region 个人区
            _personPanel = new Ext.Net.Panel();
            _personPanel.Collapsed = true;
            _personPanel.Collapsible = true;
            _personPanel.Title = "欢迎使用";
            _personPanel.Height = 110;
            _personPanel.BodyPadding = 10;
            _personPanel.Layout = "table";
            _personPanel.LayoutConfig.Add(new TableLayoutConfig()
            {
                Columns = 2
            });
            Image avatarImg = new Image();
            avatarImg.RowSpan = 2;
            avatarImg.Width = avatarImg.Height = 70;
            avatarImg.ImageUrl = BaseResource.avatar;
            _personPanel.Add(avatarImg);
            _personPanel.Add(new Label(userInfo.Username));

            ButtonGroup buttonGroup = new ButtonGroup();
            buttonGroup.Width = 80;
            buttonGroup.Layout = "vbox";
            buttonGroup.Add(new KeyButton()
            {
                Text = "修改密码",
                ID = "btnChangePassword",
                OnClientClick = "App.winChangePassword.show();App.winChangePassword.getLoader().load();"
            });

            btnExit = new Button()
            {
                Text = "安全退出",
                ID = "btnExit",
                Icon = Icon.KeyDelete
            };
            var clickEvent = btnExit.DirectEvents.Click;
            clickEvent.Event += clickEvent_Event;
            clickEvent.EventMask.Set("正在退出");
            clickEvent.Confirmation.ConfirmRequest = true;
            clickEvent.Confirmation.Title = "提示";
            clickEvent.Confirmation.Message = "确定退出?";
            buttonGroup.Add(btnExit);
            _personPanel.Add(buttonGroup);
            _menu.Add(_personPanel);
            winChangePassword = new Window()
            {
                Icon = Icon.Key,
                BodyPadding = 10,
                Width = 300,
                Height = 210,
                Modal = true,
                Hidden = true,
                AutoShow = false,
                ID = "winChangePassword",
                Title = "修改密码",
                Loader = new ComponentLoader()
                {
                    Url = ResolveClientUrl("~/user/changepassword.aspx"),
                    Mode = LoadMode.Frame
                }
            };
            winChangePassword.Loader.LoadMask.Set("正在加载");
            Controls.Add(winChangePassword);
            #endregion

            _menuPanel = new TreePanel()
            {
                Title = "功能菜单",
                Height = 500,
                RootVisible = false,
                ID = "mainMenu"
            };

            _menuStore = new TreeStore()
            {
                NodeParam = "parentId"
            };
            _menuStore.ReadData += _menuStore_ReadData;
            _menuPanel.Store.Add(_menuStore);
            _menuPanel.Root.Add(new Node()
            {
                NodeID = "0",
                Text = "Root",
                Expanded = true
            });
            _menu.Add(_menuPanel);
            var itemClick = _menuPanel.DirectEvents.ItemClick;
            itemClick.Before = "var tree=arguments[0],eventType=arguments[1],eventName=arguments[2],extraParams=arguments[3];var tab = App.tabWork.getComponent('menu' + extraParams.id);if (tab) {App.tabWork.setActiveTab(tab);return false;}return tree.getStore().getNodeById(extraParams.id).isLeaf();";
            itemClick.EventMask.Set("正在加载");
            itemClick.Event += itemClick_Event;
            itemClick.ExtraParams.Add(new Parameter("id", "record.data.id", ParameterMode.Raw));

            #region 隐藏顶级窗口
            _winParentWindow = new Window();
            _winParentWindow.Hidden = true;
            _winParentWindow.Loader = new ComponentLoader();
            _winParentWindow.Loader.Mode = LoadMode.Frame;
            _winParentWindow.Width = 800;
            _winParentWindow.Modal = true;
            _winParentWindow.Height = 600;
            _winParentWindow.ID = "_topWin";
            Controls.Add(_winParentWindow);
            #endregion

            Controls.Add(_viewPort);
        }
예제 #48
0
 public void TestInit() {
     _writer = new StringBuilderWriter();
     _option = new TabPanel( _writer );
 }
        // Calculates and applies the minimum width necessary to accommodate the tabs in the
        // specified tab control
        private void adjustColumnMinWidth()
        {
            if (Target == null || TabControl == null || Column < 0 ||
                Column >= Target.ColumnDefinitions.Count ||
                TabControl.Items.Count == 0)
            {
                return;
            }

            ColumnDefinition cDef = Target.ColumnDefinitions[Column];

            // Difference between column width and tab control width. This difference needs to be
            // preserved when calculating the new column width.
            double tabControlMargin = cDef.ActualWidth - TabControl.ActualWidth;

            double aggregateTabWidths = 0;
            double tabPanelMargin     = 0;

            // Calculate width for each tab
            for (int i = 0; i < TabControl.Items.Count; i++)
            {
                TabItem tab = TabControl.Items[i] as TabItem;
                if (tab == null)
                {
                    return; // Unexpected object type - bail out
                }
                double threshholdWidth = double.IsNaN(tab.MinWidth) ? 0 : tab.MinWidth;
                if (tab.ActualWidth > threshholdWidth)
                {
                    // Aggregate tab width and margin
                    aggregateTabWidths += tab.ActualWidth + tab.Margin.Left + tab.Margin.Right;

                    if (i == 0)
                    {
                        // Get the margin of the panel containing the tabs.  Note that this is the only
                        // dimension on an element external to the tabs that is taken into account, so
                        // if the TabControl's template has been modified to include other elements, this
                        // measurement will not be sufficient.

                        TabPanel tabPanel = tab.FindAncestorOfType <TabPanel>();
                        if (tabPanel != null)
                        {
                            tabPanelMargin += tabPanel.Margin.Left + tabPanel.Margin.Right;
                        }
                    }
                }
                else
                {
                    return; // nothing to measure - bail out
                }
            }

            // Apply calculated widths as column min width. The constant 2 is applied as this is necessary
            // to prevent wrapping, but walking the visual tree and measuring could not account for these
            // 2 pixels
            double newMinWidth = tabControlMargin + tabPanelMargin + aggregateTabWidths + 2;

            if (double.IsNaN(cDef.MinWidth) || newMinWidth > cDef.MinWidth)
            {
                cDef.MinWidth = newMinWidth;
            }
        }
        private string BuildSourceTabs(string id, string wId, ExampleConfig cfg, DirectoryInfo dir)
        {
            List <string> files = cfg != null ? cfg.OuterFiles : new List <string>();

            FileInfo[]      filesInfo = dir.GetFiles();
            List <FileInfo> fileList  = new List <FileInfo>(filesInfo);

            int dIndex = 0;

            for (int ind = 0; ind < fileList.Count; ind++)
            {
                if (fileList[ind].Name.ToLower() == "default.aspx")
                {
                    dIndex = ind;
                }
            }

            if (dIndex > 0)
            {
                FileInfo fi = fileList[dIndex];
                fileList.RemoveAt(dIndex);
                fileList.Insert(0, fi);
            }

            foreach (string file in files)
            {
                fileList.Add(new FileInfo(file));
            }

            DirectoryInfo[] resources = dir.GetDirectories("resources", SearchOption.TopDirectoryOnly);

            if (resources.Length > 0)
            {
                GetSubFiles(fileList, resources[0]);
            }

            TabPanel tabs = new TabPanel
            {
                ID             = "tpw" + id,
                Border         = false,
                ActiveTabIndex = 0
            };

            int i = 0;

            foreach (FileInfo fileInfo in fileList)
            {
                if (excludeList.Contains(fileInfo.Name) || excludeExtensions.Contains(fileInfo.Extension.ToLower()))
                {
                    continue;
                }

                Panel panel = new Panel();
                panel.ID    = "tptw" + id + i++;
                panel.Title = fileInfo.Name;
                panel.CustomConfig.Add(new ConfigItem("url", UIHelpers.PhysicalToVirtual(fileInfo.FullName), ParameterMode.Value));
                switch (fileInfo.Extension)
                {
                case ".aspx":
                case ".ascx":
                    panel.Icon = Icon.PageWhiteCode;
                    break;

                case ".cs":
                    panel.Icon = Icon.PageWhiteCsharp;
                    break;

                case ".xml":
                case ".xsl":
                    panel.Icon = Icon.ScriptCodeRed;
                    break;

                case ".js":
                    panel.Icon = Icon.Script;
                    break;

                case ".css":
                    panel.Icon = Icon.Css;
                    break;
                }
                panel.Loader      = new ComponentLoader();
                panel.Loader.Url  = UIHelpers.ApplicationRoot + "/GenerateSource.ashx";
                panel.Loader.Mode = LoadMode.Frame;
                panel.Loader.Params.Add(new Parameter("f", UIHelpers.PhysicalToVirtual(fileInfo.FullName), ParameterMode.Value));
                panel.Loader.LoadMask.ShowMask = true;

                tabs.Items.Add(panel);
            }

            return(tabs.ToScript(RenderMode.AddTo, wId));
        }
예제 #51
0
    protected void ComponentAdminControl(string ControlName, string UserModuleID)
    {
        bool   IsSortable = true;
        string ctrlSrc    = GetAppPath() + "/Modules/WBComponentAdmin/" + ControlName;

        if (Directory.Exists(Server.MapPath(ctrlSrc)))
        {
            List <ModuleControlInfo> lstModCtls = new List <ModuleControlInfo>();
            string[] files = Directory.GetFiles(Server.MapPath(ctrlSrc)).Select(file => Path.GetFileName(file)).ToArray();
            ctrlSrc = ctrlSrc + "/";
            string[] ControlTitle;
            TabContainerManagePages.Visible = false;
            foreach (string fileName in files)
            {
                string NameOnly = Path.GetFileNameWithoutExtension(fileName);
                if (Path.GetExtension(fileName) == ".ascx")
                {
                    ControlTitle = NameOnly.Split('-');
                    int len = ControlTitle.Length;
                    if (len > 1)
                    {
                        NameOnly = String.Join("-", ControlTitle.Take(len - 1));//name can have dash.
                        try
                        {
                            lstModCtls.Add(new ModuleControlInfo {
                                ControlTitle = NameOnly, ControlSrc = ctrlSrc + fileName, DisplayOrder = Int32.Parse(ControlTitle.Last())
                            });
                        }
                        catch
                        {  // having dash but not number in last
                            IsSortable = false;
                            lstModCtls.Add(new ModuleControlInfo {
                                ControlTitle = NameOnly, ControlSrc = ctrlSrc + fileName
                            });
                        }
                    }
                    else //with out dash
                    {
                        lstModCtls.Add(new ModuleControlInfo {
                            ControlTitle = ControlTitle[0], ControlSrc = ctrlSrc + fileName
                        });
                        IsSortable = false;
                    }
                }
            }
            if (IsSortable)
            {
                lstModCtls = lstModCtls.OrderBy(o => o.DisplayOrder).ToList();
            }
            foreach (ModuleControlInfo CtrlInfo in lstModCtls)
            {
                TabPanel tp = new TabPanel();
                tp.HeaderText = CtrlInfo.ControlTitle;
                SageUserControl ctl = this.Page.LoadControl(CtrlInfo.ControlSrc) as SageUserControl;
                ctl.EnableViewState  = true;
                ctl.SageUserModuleID = UserModuleID;
                tp.Controls.Add(ctl);
                TabContainerManagePages.Tabs.Add(tp);
            }
            TabContainerManagePages.Visible = true;
        }
        else
        {
            TabContainerManagePages.Visible = false;
            StringBuilder redirecPath = new StringBuilder();
            redirecPath.Append(url.Scheme);
            redirecPath.Append("://");
            redirecPath.Append(url.Authority);
            redirecPath.Append(PortalAPI.PageNotAccessibleURL);
            HttpContext.Current.Response.Redirect(redirecPath.ToString());
        }
    }
예제 #52
0
		public static void Execute (Atom parent)
		{

			var d = new Div ("bs-docs-example");

			var top = new TabPanel (new TabPanelOptions{
				TabsPosition="top",
				Bordered=true,

			});
			top.Content.Style.MinHeight = "100px";

			var t1 = new Tab ();
			t1.Caption="First Tab";
			t1.Body.Append ("Firs tab body");
			AlertFn.Success (t1.Body.FirstChild, "Cayita is awesome");
			top.Add (t1);

			top.Add (tab=>{
				tab.Caption= "Second Tab";
				tab.Body.AddClass("well");  
				tab.Body.Append("Hello second tab");  
				tab.Body.Style.Color="red";  
			});

			top.Add (tab=>{
				tab.Caption= "El Coyote";
				tab.Body.Append( new Div(cd=>{
					cd.ClassName="span1";
					cd.Append( new Image{Src="img/coyote.jpg"});
				}));
				tab.Body.Append( new Div(cd=>{
					cd.ClassName="span11";
					cd.Append( CoyoteText);
				}));
			});

			d.Append (top);

			parent.JQuery.Append ("Tabs on top".Header(3)).Append(d);


			var right = new TabPanel (new TabPanelOptions{
				TabsPosition="right",
			}, pn=>{
				pn.Add( tab=>{
					tab.Caption="First tab";  
					tab.Body.Append("Hello first tab".Header(3));
				});
				pn.Add( tab=>{
					tab.Caption= "Second tab";
					tab.Body.AddClass("well");  
					tab.Body.Append("Hello second tab");  
					tab.Body.Style.Color="blue";  
					tab.Body.Style.Height="80px";
				});
				pn.Add( tab=>{
					tab.Caption= "El Coyote";
					tab.Body.Append( new Div(cd=>{
						cd.ClassName="span1";
						cd.Append( new Image{Src="img/coyote.jpg"});
					}));
					tab.Body.Append( new Div(cd=>{
						cd.ClassName="span11";
						cd.Append( CoyoteText);
					}));
				});

			});

			new Div (ex=>{
				ex.ClassName="bs-docs-example";
				ex.Append(right);
				parent.JQuery.Append ("Tabs on right".Header(3)).Append(ex);
			});

			right.Show (2);


			var bottom = new TabPanel (new TabPanelOptions{
				TabsPosition="below",
			}, pn=>{
				pn.Add( tab=>{
					tab.Caption="First tab";  
					tab.Body.Append("Hello first tab".Header(3));
				});
				pn.Add( tab=>{
					tab.Caption= "Second tab";
					tab.Body.AddClass("well");  
					tab.Body.Append("Hello second tab");  
					tab.Body.Style.Color="blue";  
					tab.Body.Style.Height="80px";
				});
				pn.Add( tab=>{
					tab.Caption= "El Coyote";
					tab.Body.Append( new Div(cd=>{
						cd.ClassName="span1";
						cd.Append( new Image{Src="img/coyote.jpg"});
					}));
					tab.Body.Append( new Div(cd=>{
						cd.ClassName="span11";
						cd.Append( CoyoteText);
					}));
				});

			});

			bottom.Content.Style.MinHeight = "150px";

			new Div (ex=>{
				ex.ClassName="bs-docs-example";
				ex.Append(bottom);
				parent.JQuery.Append ("Tabs on bottom".Header(3)).Append(ex);
			});

			bottom.Show (1);

			var left = new TabPanel (new TabPanelOptions{
				TabsPosition="left", Bordered=true
			}, pn=>{
				pn.Add( tab=>{
					tab.Caption="First tab";  
					tab.Body.Append("Hello first tab".Header(3));
				});
				pn.Add( tab=>{
					tab.Caption= "Second tab";
					tab.Body.AddClass("well");  
					tab.Body.Append("Hello second tab");  
					tab.Body.Style.Color="blue";  
					tab.Body.Style.Height="80px";
				});
				pn.Add( tab=>{
					new Image(tab, i=>{i.Src="img/coyote.jpg"; i.Style.Height="106px";});
					new Label(tab, "El Coyote");
					tab.Body.Append(CoyoteText);
				});

			});
			left.Content.Style.MinHeight = "220px";

			new Div (ex=>{
				ex.ClassName="bs-docs-example";
				ex.Append(left);
				parent.JQuery.Append ("Tabs on left".Header(3)).Append(ex);
			});

			left.Show (0);


			parent.Append ("C# code".Header(3));

			var rq =jQuery.GetData<string> ("code/demotabpanel.html");
			rq.Done (s=> {
				var code=new Div();
				code.InnerHTML= s;
				parent.Append(code);
			});



		}