public TabStripItemBuilderTests() { Mock<ViewContext> viewContext = new Mock<ViewContext>(); _item = new TabStripItem(); _builder = new TabStripItemBuilder(_item, viewContext.Object); }
public TabStripItemBuilderTests() { Mock <ViewContext> viewContext = new Mock <ViewContext>(); _item = new TabStripItem(); _builder = new TabStripItemBuilder(_item, viewContext.Object); }
private void BoldSelectedDocument(TabStripItem tabItem) { if (this.boldedItem == tabItem) { return; } RadDock dockManager = this.DockManager; if (dockManager == null) { return; } //remove the Bold Font from the item. if (this.boldedItem != null) { this.boldedItem.ResetValue(VisualElement.FontProperty, ValueResetFlags.Local); this.boldedItem = null; } if (dockManager.DocumentManager.BoldActiveDocument && tabItem != null) { this.boldedItem = tabItem; Font currFont = tabItem.Font; if (!currFont.Bold) { tabItem.Font = new Font(currFont, currFont.Style | FontStyle.Bold); } } this.UpdateOverflowButton(); this.UpdateLayout(); }
/// <summary> /// Renders a TabStripItem. /// </summary> protected virtual void RenderItem(TabStrip control, TabStripItem item, PaintEventArgs e) { if (item.Selected) { e.Canvas.FillRectangle(item.Bounds, Theme.NeutralGray); } else if (item.Hovered && item.Enabled) { e.Canvas.FillRectangle(item.Bounds, Theme.HighlightColor); } // Draw focus rectangle if (control.Selected && control.ShowFocusCues && control.Tabs.FocusedIndex == control.Tabs.IndexOf(item)) { e.Canvas.DrawFocusRectangle(item.Bounds, e.LogicalToDeviceUnits(1)); } var font_color = !item.Enabled ? Theme.DisabledTextColor: item.Selected ? Theme.PrimaryColor : Theme.LightTextColor; var font_size = e.LogicalToDeviceUnits(Theme.FontSize); e.Canvas.DrawText(item.Text, Theme.UIFont, font_size, item.Bounds, font_color, ContentAlignment.MiddleCenter); }
private static void generateGroups(IEnumerable <VisibleProperty> tabWidgets, TabStripItem tab) { var groupsName = tabWidgets.Select(w => w.DataFormView.GroupName).Distinct().ToList(); foreach (var groupName in groupsName) { //var groupWidgets = tabWidgets.Where(w => w.DataFormView.GroupName == groupName); //var panel = new Panel(); //var groupPanel = new NsPanel(panel, viewContext, initializer, viewData, urlGenerator); ////groupPanel.Label(groupName); ////groupPanel.Width("49%"); ////groupPanel.Float(EnumPanelFloat.Left); //var df = groupPanel.AddDataForm(); //foreach (var groupWidget in groupWidgets) //{ // if (groupWidget.DataFormView.RepositoryType != null) // { // var cb = df.AddComboBox(groupWidget.PropertyInfo.Name).LoadOnDemand(true); // cb.DataSource(GetDataSourceByType(groupWidget.DataFormView.RepositoryType)); // cb.Label(groupWidget.PropertyInfo.Name); // } // else // { // df.AddField(groupWidget.PropertyInfo).Height = groupWidget.DataFormView.Height; // } //} } //tab.AddPanel(p => p.Clear(EnumPanelClear.Both)); }
private static void BuildTabularCheckboxList(HtmlHelper helper, string name, IEnumerable <SpecialSelectListItem> items, IEnumerable <SpecialSelectListItem> parentItems, IDictionary <string, object> checkboxHtmlAttributes, bool readOnly, StringBuilder output) { if (checkboxHtmlAttributes == null) { checkboxHtmlAttributes = new Dictionary <string, object>(); } if (!checkboxHtmlAttributes.ContainsKey("height")) { checkboxHtmlAttributes.Add("height", "500px"); } var tabStrip = helper.Telerik().TabStrip().Name(name).HtmlAttributes(checkboxHtmlAttributes).SelectedIndex(0).ToComponent(); foreach (var parentItem in GetParentItems(parentItems)) { var tabStripItem = new TabStripItem() { Text = parentItem.Text }; tabStrip.Items.Add(tabStripItem); string contnt = ""; foreach (var item in GetChidItems(items, parentItem)) { contnt += BuildCheckBox(name, checkboxHtmlAttributes, readOnly, item); } tabStripItem.Html = contnt; } output.Append(tabStrip.ToHtmlString()); }
public virtual TabStripItemBuilder Add() { var item = new TabStripItem(); container.Items.Add(item); return new TabStripItemBuilder(item, viewContext); }
public virtual TabStripItemBuilder Add() { var item = new TabStripItem(); container.Items.Add(item); return(new TabStripItemBuilder(item, viewContext)); }
/// <summary> /// Closes the corresponding <see cref="DockWindow">DockWindow</see> instance. /// </summary> /// <param name="item"></param> protected internal override void OnTabCloseButtonClicked(TabStripItem item) { DockWindow window = item.TabPanel as DockWindow; if (window != null) { window.Close(); } }
public TabStripHtmlBuilderTests() { writer = new Mock<HtmlTextWriter>(TextWriter.Null); tabStrip = TabStripTestHelper.CreateTabStrip(writer.Object, null); tabStrip.Name = "tabStrip1"; item = new TabStripItem(); item.Visible = true; builder = new TabStripHtmlBuilder(tabStrip, new Mock<IActionMethodCache>().Object); }
public TabStripHtmlBuilderTests() { writer = new Mock <HtmlTextWriter>(TextWriter.Null); tabStrip = TabStripTestHelper.CreateTabStrip(writer.Object, null); tabStrip.Name = "tabStrip1"; item = new TabStripItem(); item.Visible = true; builder = new TabStripHtmlBuilder(tabStrip, new Mock <IActionMethodCache>().Object); }
/// <summary> /// /// </summary> /// <param name="e"></param> protected override void OnControlRemoved(System.Windows.Forms.ControlEventArgs e) { base.OnControlRemoved(e); DockWindow window = e.Control as DockWindow; if (window.TabStripItem == this.boldedItem) { this.boldedItem = null; } UpdateView(); }
public static TabStripItem CreateTabStripItem <T>(T control, IProjectItem projectItem) where T : Control, ITabStripItemControl { var tabStripItem = new TabStripItem(); tabStripItem.Controls.Add(control); tabStripItem.Text = control.TabTitle; tabStripItem.ToolTip = control.TabToolTip; tabStripItem.Tag = projectItem; control.Dock = DockStyle.Fill; control.ParentTabStripItem = tabStripItem; return(tabStripItem); }
protected override void OnThemeChanged() { base.OnThemeChanged(); TabStripItem currentBoldItem = this.boldedItem; if (currentBoldItem != null) { //re-apply the bold style as it is set locally and the theme will not change it this.boldedItem = null; currentBoldItem.ResetValue(VisualElement.FontProperty, ValueResetFlags.Local); this.BoldSelectedDocument(currentBoldItem); } }
public override IProjectFile Open() { if (_textEditor == null) { _textEditor = new TextEditorContainer(FileSystemPath); if (_tabItem != null) { _tabItem.Close(); } _tabItem = TabStripItemFactory.CreateTabStripItem(_textEditor, this); _tabItem.Closed += TabItemClosed; } return(this); }
public override IProjectFile Open() { if (_projectPropertiesEditor == null) { _projectPropertiesEditor = new ProjectPropertiesEditor(this); if (_tabItem != null) { _tabItem.Close(); } _tabItem = TabStripItemFactory.CreateTabStripItem(_projectPropertiesEditor, this); _tabItem.Closed += TabItemClosed; } return(this); }
public IProjectFile Open() { if (_solutionPropertiesEditor == null) { _solutionPropertiesEditor = new SolutionPropertiesEditor(this); if (_tabItem != null) { _tabItem.Close(); } _tabItem = TabStripItemFactory.CreateTabStripItem(_solutionPropertiesEditor, this); _tabItem.Closed += TabItemClosed; } return(this); }
/// <summary> /// /// </summary> protected internal override void UpdateAfterTransaction() { base.UpdateAfterTransaction(); if (this.DockManager == null) { return; } DockWindow activeDocument = this.DockManager.DocumentManager.ActiveDocument; DockWindow active = this.ActiveWindow; TabStripItem item = active == activeDocument ? active.TabStripItem : null; this.BoldSelectedDocument(item); }
public override IProjectFile Open() { if (_apkViewer == null) { #if !MONO _apkViewer = new ApkViewer(this); if (_tabItem != null) { _tabItem.Close(); } _tabItem = TabStripItemFactory.CreateTabStripItem(_apkViewer, this); _tabItem.Closed += TabItemClosed; #endif } return(this); }
/// <summary> /// Updates the currently active window by setting bold if the specified window instance is the currently active document within the owning RadDock instance. /// </summary> /// <param name="window"></param> /// <param name="active"></param> protected internal override void UpdateActiveWindow(DockWindow window, bool active) { base.UpdateActiveWindow(window, active); if (window == null || this.DockManager == null || ((IComponentTreeHandler)this.DockManager).Initializing) { return; } TabStripItem item = null; if (active && window == this.DockManager.DocumentManager.ActiveDocument) { item = window.TabStripItem; } this.BoldSelectedDocument(item); }
/// <summary> /// Overrides the method to provide support for instanciating a DragDropService operation. /// </summary> /// <param name="mouse"></param> protected override void OnDragInitialized(Point mouse) { if (this.DockManager == null) { return; } DockWindow activeWindow = this.ActiveWindow; if (activeWindow == null) { return; } draggedItem = this.elementTree.GetElementAtPoint(mouse) as TabStripItem; object dragged = null; if (draggedItem != null) { if (!this.tabStripElement.ItemContainer.ControlBoundingRectangle.Contains(mouse)) { dragged = activeWindow; } if (this.TabPanels.Count == 1 && this.ActiveWindow.DockState == DockState.Floating) { dragged = null; } } else { if (activeWindow.DockState != DockState.AutoHide && this.IsDragAllowed(this.DragStart)) { dragged = this; } } if (dragged != null) { this.dockManager.BeginDrag(dragged); } }
public static Control TabStripItemTemplate(TabStripItem control) { return(new ContentPresenter { DataTemplates = new DataTemplates { new FuncDataTemplate <string>(x => new Border { [~Border.BackgroundProperty] = control[~TemplatedControl.BackgroundProperty], Padding = new Thickness(10), Child = new TextBlock { VerticalAlignment = Perspex.Layout.VerticalAlignment.Center, Text = x } }) }, Name = "PART_ContentPresenter", [~ContentPresenter.ContentProperty] = control[~ContentControl.ContentProperty], }); }
public void Close() { try { _closing = true; if (_tabItem != null) { _tabItem.Close(); _tabItem = null; } if (_solutionPropertiesEditor != null) { _solutionPropertiesEditor.Dispose(); _solutionPropertiesEditor = null; } } finally { _closing = false; } }
public override void Close() { try { _closing = true; if (_tabItem != null) { _tabItem.Close(); _tabItem = null; } if (_apkViewer != null) { _apkViewer.Dispose(); _apkViewer = null; } } finally { _closing = false; } }
public override void Close() { try { _closing = true; if (_tabItem != null) { _tabItem.Close(); _tabItem = null; } if (_projectPropertiesEditor != null) { _projectPropertiesEditor.Dispose(); _projectPropertiesEditor = null; } } finally { _closing = false; } }
public static Control TabStripItemTemplate(TabStripItem control) { return new ContentPresenter { DataTemplates = new DataTemplates { new FuncDataTemplate<string>(x => new Border { [~Border.BackgroundProperty] = control[~TemplatedControl.BackgroundProperty], Padding = new Thickness(10), Child = new TextBlock { VerticalAlignment = Perspex.Layout.VerticalAlignment.Center, Text = x } }) }, Name = "PART_ContentPresenter", [~ContentPresenter.ContentProperty] = control[~ContentControl.ContentProperty], }; }
private void RenderAllTabs(DESchemaObjectBase data, bool readOnly) { string defaultKey = this.tabStrip.SelectedKey; Dictionary <string, SchemaPropertyValueCollection> tabGroup = data.Properties.GroupByTab(); this.tabStrip.TabStrips.Clear(); foreach (SchemaTabDefine tab in data.Schema.Tabs) { SchemaPropertyValueCollection properties = null; if (tabGroup.TryGetValue(tab.Name, out properties) == false) { properties = new SchemaPropertyValueCollection(); } Control panel = this.RenderOnePanel(tab, this.panelContainer, properties, readOnly); var item = new TabStripItem() { Key = tab.Name, Text = tab.Description, ControlID = panel.ClientID, Tag = panel.Controls[0].ClientID }; this.tabStrip.TabStrips.Add(item); if (defaultKey.IsNullOrEmpty()) { defaultKey = item.Key; } } if (defaultKey.IsNotEmpty()) { this.tabStrip.SelectedKey = defaultKey; } }
public TabStripItemTests() { _tabStripItem = new TabStripItem(); }
public static object DataForm <TModel>(this HtmlHelper <TModel> helper, TModel model) { var viewContext = helper.ViewContext; var initializer = DI.Current.Resolve <IJavaScriptInitializer>(); var urlGenerator = DI.Current.Resolve <IUrlGenerator>(); var viewData = helper.ViewData; var biznesObject = new PracownikTest(); var viewPanel = new Panel(); var view = new NsPanel(viewPanel, helper, initializer, urlGenerator); var visibleProperty = new List <VisibleProperty>(); var type = biznesObject.GetType(); var properties = type.GetProperties(); foreach (var propertyInfo in properties) { var displays = propertyInfo.GetCustomAttributes(typeof(DataFormViewAttribute)); if (displays.Any()) { var display = displays.First() as DataFormViewAttribute; visibleProperty.Add(new VisibleProperty() { DataFormView = display, PropertyInfo = propertyInfo }); } } var tabsName = visibleProperty.Where(w => w.DataFormView.TabName != null) .Select(w => w.DataFormView.TabName).Distinct().ToList(); if (tabsName.Count > 1) { //var panel = view.AddPanel(); var tabsControl = helper.Kendo().TabStrip().ToComponent(); foreach (var tabName in tabsName) { //tabsControl.Items.Add(); var tab = new TabStripItem(); var tabWidgets = visibleProperty.Where(w => w.DataFormView.TabName == tabName); generateGroups(tabWidgets, tab); } } else { ////visibleProperty = visibleProperty.OrderBy(p => p.Order).ToList(); //var df = view.AddDataForm(); //if (title != null) //{ // df.AddLabel(title); //} //if (description != null) //{ // df.AddLabel(description); //} //view.ActiveDataForm = df; //generateGroups(visibleProperty, df); } return(new MvcHtmlString("")); }
private void RenderAllTabs(SchemaObjectBase data, bool readOnly) { string defaultKey = this.tabStrip.SelectedKey; Dictionary<string, SchemaPropertyValueCollection> tabGroup = data.Properties.GroupByTab(); this.tabStrip.TabStrips.Clear(); foreach (SchemaTabDefine tab in data.Schema.Tabs) { SchemaPropertyValueCollection properties = null; if (tabGroup.TryGetValue(tab.Name, out properties) == false) properties = new SchemaPropertyValueCollection(); Control panel = this.RenderOnePanel(tab, this.panelContainer, properties, readOnly); TabStripItem item = new TabStripItem() { Key = tab.Name, Text = tab.Description, ControlID = panel.ClientID, Tag = panel.Controls[0].ClientID }; this.tabStrip.TabStrips.Add(item); if (defaultKey.IsNullOrEmpty()) defaultKey = item.Key; } if (defaultKey.IsNotEmpty()) this.tabStrip.SelectedKey = defaultKey; }
/// <summary> /// /// </summary> /// <param name="e"></param> protected override void OnMouseCaptureChanged(EventArgs e) { base.OnMouseCaptureChanged(e); this.draggedItem = null; }