protected override NWidget CreateExampleContent() { NTab tab = new NTab(); // create a tab page with vertically arranged radio buttons NTabPage verticalTabPage = new NTabPage("Vertical Radio Group"); tab.TabPages.Add(verticalTabPage); NRadioButtonGroup verticalRadioGroup = new NRadioButtonGroup(); verticalRadioGroup.HorizontalPlacement = ENHorizontalPlacement.Left; verticalRadioGroup.VerticalPlacement = ENVerticalPlacement.Top; verticalTabPage.Content = verticalRadioGroup; NStackPanel verticalStack = new NStackPanel(); verticalRadioGroup.Content = verticalStack; for (int i = 0; i < 5; i++) { NRadioButton radioButton = new NRadioButton("Item " + i.ToString()); verticalStack.Add(radioButton); } NRadioButton disabledRadioButton1 = new NRadioButton("Disabled"); disabledRadioButton1.Enabled = false; verticalStack.Add(disabledRadioButton1); verticalRadioGroup.SelectedIndexChanged += OnVerticalRadioGroupSelectedIndexChanged; // create a tab page with horizontally arranged radio buttons NTabPage horizontalTabPage = new NTabPage("Horizontal Radio Group"); tab.TabPages.Add(horizontalTabPage); NRadioButtonGroup horizontalRadioGroup = new NRadioButtonGroup(); horizontalRadioGroup.VerticalPlacement = ENVerticalPlacement.Top; horizontalRadioGroup.HorizontalPlacement = ENHorizontalPlacement.Left; horizontalTabPage.Content = horizontalRadioGroup; NStackPanel horizontalStack = new NStackPanel(); horizontalStack.Direction = ENHVDirection.LeftToRight; horizontalRadioGroup.Content = horizontalStack; for (int i = 0; i < 5; i++) { NRadioButton radioButton = new NRadioButton("Item " + i.ToString()); horizontalStack.Add(radioButton); } NRadioButton disabledRadioButton2 = new NRadioButton("Disabled"); disabledRadioButton2.Enabled = false; horizontalStack.Add(disabledRadioButton2); horizontalRadioGroup.SelectedIndexChanged += OnHorizontalRadioGroupSelectedIndexChanged; return(tab); }
protected override NWidget CreateExampleControls() { NStackPanel stack = new NStackPanel(); stack.FillMode = ENStackFillMode.Last; stack.FitMode = ENStackFitMode.Last; // Create a tab NTab tab = new NTab(); stack.Add(tab); // Create the Horizontal scrollbar properties NStackPanel hsbStack = new NStackPanel(); NList <NPropertyEditor> editors = NDesigner.GetDesigner(m_HScrollBar).CreatePropertyEditors( m_HScrollBar, NHRangeScrollBar.EnabledProperty, NHRangeScrollBar.BeginValueProperty, NHRangeScrollBar.EndValueProperty, NHRangeScrollBar.SmallChangeProperty, NHRangeScrollBar.SnappingStepProperty, NHRangeScrollBar.MinimumProperty, NHRangeScrollBar.MaximumProperty ); for (int i = 0; i < editors.Count; i++) { hsbStack.Add(editors[i]); } tab.TabPages.Add(new NTabPage("Horizontal", hsbStack)); // Create the Vertical scrollbar properties NStackPanel vsbStack = new NStackPanel(); editors = NDesigner.GetDesigner(m_VScrollBar).CreatePropertyEditors( m_VScrollBar, NVRangeScrollBar.EnabledProperty, NVRangeScrollBar.BeginValueProperty, NVRangeScrollBar.EndValueProperty, NVRangeScrollBar.SmallChangeProperty, NVRangeScrollBar.SnappingStepProperty, NVRangeScrollBar.MinimumProperty, NVRangeScrollBar.MaximumProperty ); for (int i = 0; i < editors.Count; i++) { vsbStack.Add(editors[i]); } tab.TabPages.Add(new NTabPage("Vertical", vsbStack)); // Add events log m_EventsLog = new NExampleEventsLog(); stack.Add(m_EventsLog); return(new NUniSizeBoxGroup(stack)); }
private NTab CreateTab() { NTab tab = new NTab(); tab.TabPages.Add(new NTabPage("Page 1", "This is tab page 1")); tab.TabPages.Add(new NTabPage("Page 2", "This is tab page 2")); tab.TabPages.Add(new NTabPage("Page 3", "This is tab page 3")); return(tab); }
protected override NWidget CreateExampleControls() { NStackPanel stack = new NStackPanel(); stack.FillMode = ENStackFillMode.Last; stack.FitMode = ENStackFitMode.Last; // Create a tab NTab tab = new NTab(); stack.Add(tab); NProperty[] properties = new NProperty[] { NRangeSlider.EnabledProperty, NRangeSlider.BeginValueProperty, NRangeSlider.EndValueProperty, NRangeSlider.LargeChangeProperty, NRangeSlider.SnappingStepProperty, NRangeSlider.MinimumProperty, NRangeSlider.MaximumProperty, NRangeSlider.TicksPlacementProperty, NRangeSlider.TicksIntervalProperty, NRangeSlider.TicksLengthProperty }; // Create the Horizontal slider properties NStackPanel hsbStack = new NStackPanel(); NList <NPropertyEditor> editors = NDesigner.GetDesigner(m_HSlider).CreatePropertyEditors( m_HSlider, properties); for (int i = 0; i < editors.Count; i++) { hsbStack.Add(editors[i]); } tab.TabPages.Add(new NTabPage("Horzontal", hsbStack)); // Create the Vertical slider properties NStackPanel vsbStack = new NStackPanel(); editors = NDesigner.GetDesigner(m_VSlider).CreatePropertyEditors( m_VSlider, properties); for (int i = 0; i < editors.Count; i++) { vsbStack.Add(editors[i]); } tab.TabPages.Add(new NTabPage("Vertical", vsbStack)); // Add events log m_EventsLog = new NExampleEventsLog(); stack.Add(m_EventsLog); return(new NUniSizeBoxGroup(stack)); }
protected override NWidget CreateExampleControls() { NTab tab = new NTab(); m_SourceEventsLog = new NExampleEventsLog(); tab.TabPages.Add(new NTabPage("Source Events", m_SourceEventsLog)); m_TargetEventsLog = new NExampleEventsLog(); tab.TabPages.Add(new NTabPage("Target Events", m_TargetEventsLog)); return(tab); }
protected override NWidget CreateExampleContent() { NTab tab = new NTab(); tab.HeadersPosition = ENTabHeadersPosition.Left; tab.TabPages.Add(new NTabPage("Clipboard Text", CreateTextDemo())); tab.TabPages.Add(new NTabPage("Clipboard RTF", CreateRTFDemo())); tab.TabPages.Add(new NTabPage("Clipboard Raster", CreateRasterDemo())); return(tab); }
/// <summary> /// Renders the content of a single tab /// </summary> /// <param name="title"></param> /// <returns></returns> public ActionResult TabContent(string title) { ContentResult content = new ContentResult(); NTabStrip tabStrip = new NTabStrip(); NTab tab = new NTab(); tab.TabText = title; tabStrip.AddTab(tab); content.Content = tabStrip.GetHtml(); content.ContentType = "text/html"; return(content); }
protected override NWidget CreateExampleContent() { // create a tab m_Tab = new NTab(); m_Tab.TabPages.Add(CreatePage("Page 1", "This is the first tab page.")); m_Tab.TabPages.Add(CreatePage("Page 2", "This is the second tab page.")); m_Tab.TabPages.Add(CreatePage("Page 3", "This is the third tab page.\nIt is the largest both horizontally and vertically.")); m_Tab.TabPages.Add(CreatePage("Page 4", "This is the fourth tab page.")); m_Tab.TabPages.Add(CreatePage("Page 5", "This is the fifth tab page.")); m_Tab.SelectedIndex = 0; m_Tab.SelectedIndexChanged += new Function <NValueChangeEventArgs>(OnTabSelectedIndexChanged); // host it return(m_Tab); }
/// <summary> /// Creates the example content, controls and description. /// </summary> public virtual void Initialize() { m_SourceCodeHolder = new NContentHolder(); NWidget content = CreateExampleContent(); NWidget controls = CreateExampleControls(); NSplitter mainSplitter = new NSplitter(); mainSplitter.Orientation = ENHVOrientation.Vertical; mainSplitter.SplitMode = ENSplitterSplitMode.OffsetFromFarSide; mainSplitter.SplitOffset = 150; // create the description group, which is the master in the first split mainSplitter.Pane2.Content = CreateExampleDescription(); // create the example tab control NTab exampleTab = new NTab(); exampleTab.SelectedIndexChanged += OnExampleTabSelectedIndexChanged; m_ExampleTabPage = new NTabPage("Example", content); exampleTab.TabPages.Add(m_ExampleTabPage); exampleTab.TabPages.Add(new NTabPage("Source", m_SourceCodeHolder)); if (controls != null) { // create the second split, which is the slave of the first slit NSplitter exampleSplitter = new NSplitter(); exampleSplitter.SplitOffset = 300; exampleSplitter.SplitMode = ENSplitterSplitMode.OffsetFromFarSide; mainSplitter.Pane1.Content = exampleSplitter; // create the control group, which is the slave in the second split NGroupBox controlGroup = new NGroupBox("Controls", controls); exampleSplitter.Pane2.Content = controlGroup; // set the example tab control as the slave in the second split exampleSplitter.Pane1.Content = exampleTab; } else { mainSplitter.Pane1.Content = exampleTab; } Content = mainSplitter; }
protected override NWidget CreateExampleContent() { // create a tab control for the different border walls NTab tab = new NTab(); NTabPage boxBorderPage = new NTabPage("Box Border"); tab.TabPages.Add(boxBorderPage); NTabPage crossBorderPage = new NTabPage("Cross Border"); tab.TabPages.Add(crossBorderPage); NTabPage openBorderPage = new NTabPage("Opened Border"); tab.TabPages.Add(openBorderPage); // create the three elements that demonstrate the border walls m_BoxBorderElement = new NCustomBorderWallWidget(); boxBorderPage.Content = m_BoxBorderElement; m_BoxBorderElement.BorderWallType = ENCustomBorderWallType.Rectangle; m_CrossBorderElement = new NCustomBorderWallWidget(); crossBorderPage.Content = m_CrossBorderElement; m_CrossBorderElement.BorderWallType = ENCustomBorderWallType.Cross; m_OpenedBorderElement = new NCustomBorderWallWidget(); openBorderPage.Content = m_OpenedBorderElement; m_OpenedBorderElement.BorderWallType = ENCustomBorderWallType.Opened; // init the custom border elements NCustomBorderWallWidget[] elements = GetCustomBorderElements(); NUIThemeColorMap colors = new NUIThemeColorMap(ENUIThemeScheme.WindowsClassic); for (int i = 0; i < elements.Length; i++) { elements[i].BorderThickness = new NMargins(2); elements[i].Border = NBorder.CreateRaised3DBorder(colors); elements[i].Margins = new NMargins(10); } return(tab); }
protected override NWidget CreateExampleContent() { NTab tab = new NTab(); tab.TabPages.Add(CreateTabPage("Fill Styles", NStyleNode.FillProperty, NStyleNode.ColorFillProperty, NStyleNode.StockGradientFillProperty, NStyleNode.LinearGradientFillProperty, NStyleNode.RadialGradientFillProperty, NStyleNode.AdvancedGradientFillProperty, NStyleNode.HatchFillProperty, NStyleNode.ImageFillProperty )); tab.TabPages.Add(CreateTabPage("Stroke Styles", NStyleNode.StrokeProperty)); tab.TabPages.Add(CreateTabPage("Borders", NStyleNode.BorderProperty)); tab.TabPages.Add(CreateTabPage("Text Styles", NStyleNode.FontProperty)); return(tab); }
public override void Initialize() { base.Initialize(); NTab tab; foreach (NTabStrip strip in Controls) { strip.PaletteInheritance = PaletteInheritance.None; strip.ImageList = m_ImageList; for (int i = 0; i < 5; i++) { tab = new NTab(); tab.ImageIndex = i; strip.Tabs.Add(tab); } } this.nTabStrip5.ShowFocusRect = false; }
protected override NWidget CreateExampleContent() { NTab tab = new NTab(); m_SimpleNode = new NSimpleNode(); // Primitive types tab.TabPages.Add(CreateBooleanPage()); tab.TabPages.Add(CreateInt32Page()); tab.TabPages.Add(CreateInt64Page()); tab.TabPages.Add(CreateUInt32Page()); tab.TabPages.Add(CreateSinglePage()); tab.TabPages.Add(CreateDoublePage()); tab.TabPages.Add(CreateEnumPage()); // Nevron types tab.TabPages.Add(CreateAnglePage()); tab.TabPages.Add(CreateColorPage()); tab.TabPages.Add(CreateGraphicsCorePage()); tab.TabPages.Add(CreateTextPage()); return(tab); }
private void OnOpenAutoSizeWindowButtonClick(NEventArgs arg) { NTopLevelWindow window = new NTopLevelWindow(); window.Modal = true; // open the window in the center of its parent, window.StartPosition = ENWindowStartPosition.CenterOwner; // implement auto width and height sizing { // bind the window Width to the DefaultWidth of the window NBindingFx widthBindingFx = new NBindingFx(window, NTopLevelWindow.DefaultWidthProperty); widthBindingFx.Guard = true; window.SetFx(NTopLevelWindow.WidthProperty, widthBindingFx); // bind the window Height to the DefaultHeight of the window NBindingFx heightBindingFx = new NBindingFx(window, NTopLevelWindow.DesiredHeightProperty); heightBindingFx.Guard = true; window.SetFx(NTopLevelWindow.HeightProperty, heightBindingFx); } // implement auto center { // scratch X and Y define the window center // they are implemented by simply calculating the center X and Y via formulas window.SetFx(NScratchPropertyEx.XPropertyEx, "X+Width/2"); window.SetFx(NScratchPropertyEx.YPropertyEx, "Y+Height/2"); // now that we have an automatic center, we need to write expressions that define the X and Y from that center. // These are cyclic expressions - CenterX depends on X, and X depends on CenterX. // The expressions that are assigned to X and Y are guarded and permeable. // guard is needed because X and Y are updated when the user moves the window around. // permeable is needed to allow the X and Y values to change when the user moves the window around. // When the the X and Y values change -> center changes -> X and Y expressions are triggered but they produce the same X and Y results and the cycle ends. // When the Width and Height change -> center changes -> X and Y expression are triggered but they produce the same X and Y results and the cycle ends. NFormulaFx xfx = new NFormulaFx(NScratchPropertyEx.XPropertyEx.Name + "-Width/2"); xfx.Guard = true; xfx.Permeable = true; window.SetFx(NTopLevelWindow.XProperty, xfx); NFormulaFx yfx = new NFormulaFx(NScratchPropertyEx.YPropertyEx.Name + "-Height/2"); yfx.Guard = true; yfx.Permeable = true; window.SetFx(NTopLevelWindow.YProperty, yfx); } // create a dummy tab that sizes to the currently selected page, // and add two pages with different sizes to the tab. NTab tab = new NTab(); window.Content = tab; tab.SizeToSelectedPage = true; NTabPage page1 = new NTabPage("Small Content"); NButton btn = new NButton("I am small"); page1.Content = btn; tab.TabPages.Add(page1); NTabPage page2 = new NTabPage("Large Content"); NButton btn2 = new NButton("I am LARGE"); btn2.PreferredSize = new NSize(200, 200); page2.Content = btn2; tab.TabPages.Add(page2); // open the window OwnerWindow.Windows.Add(window); window.Open(); }