/// <summary> /// Creates an accordion section. /// </summary> /// <param name="image"></param> /// <param name="text"></param> /// <param name="content"></param> /// <param name="expanded"></param> /// <param name="stack"></param> /// <returns></returns> private NExpandableSection CreateAccordionSection(NImage image, string text, NWidget content, bool expanded, NStackPanel stack) { NExpandableSection section = new NExpandableSection(); section.Expanded = expanded; // create the content of the header. NPairBox headerContent = new NPairBox(); headerContent.Spacing = 7.0; headerContent.BoxesRelation = ENPairBoxRelation.Box1BeforeBox2; headerContent.Margins = new NMargins(7.0, 0); NImageBox imageBox = new NImageBox(image); NLabel label = new NLabel(text); headerContent.Box1 = imageBox; headerContent.Box2 = label; section.Header.Content = headerContent; // set section content section.Content = content; // add section to the accordion stack stack.Add(section); return(section); }
public NExampleEventsLog() { Header.Content = NWidget.FromObject("Events"); NStackPanel stack = new NStackPanel(); stack.FillMode = ENStackFillMode.Last; stack.FitMode = ENStackFitMode.Last; // log events m_LogEventCheck = new NCheckBox("Log Events"); m_LogEventCheck.Checked = true; stack.Add(m_LogEventCheck); // clear button NButton button = new NButton("Clear Events Log"); button.Content.HorizontalPlacement = ENHorizontalPlacement.Center; button.Click += new Function <NEventArgs>(OnClearEventsLogButtonClicked); stack.Add(button); // list m_EventsListBox = new NListBox(); stack.Add(m_EventsListBox); Content = stack; }
protected override NWidget CreateExampleContent() { NSplitter splitter = new NSplitter(); splitter.SplitMode = ENSplitterSplitMode.Proportional; splitter.SplitFactor = 0.5; // Create the command bars manager and the rich text NWidget panel = base.CreateExampleContent(); // Stack the command bar manager and an export button NButton exportButton = new NButton("Export"); exportButton.Content.HorizontalPlacement = ENHorizontalPlacement.Center; exportButton.Click += OnExportButtonClick; splitter.Pane1.Content = CreatePairBox(panel, exportButton); // Create the HTML rich text box m_HtmlTextBox = new NTextBox(); m_HtmlTextBox.AcceptsEnter = true; m_HtmlTextBox.AcceptsTab = true; m_HtmlTextBox.Multiline = true; m_HtmlTextBox.WordWrap = false; m_HtmlTextBox.VScrollMode = ENScrollMode.WhenNeeded; m_HtmlTextBox.HScrollMode = ENScrollMode.WhenNeeded; m_HtmlTextBox.ReadOnly = true; splitter.Pane2.Content = new NGroupBox("Exported HTML", m_HtmlTextBox); return(splitter); }
/// <summary> /// Sets a custom dock area to the specified widget and colors its background accordingly /// </summary> /// <param name="widget"></param> /// <param name="dockArea"></param> private void SetDockArea(NWidget widget, ENDockArea dockArea) { NDockLayout.SetDockArea(widget, dockArea); switch (dockArea) { case ENDockArea.Bottom: widget.BackgroundFill = new NColorFill(new NColor(0, 162, 232)); break; case ENDockArea.Center: widget.BackgroundFill = new NColorFill(new NColor(239, 228, 176)); break; case ENDockArea.Left: widget.BackgroundFill = new NColorFill(new NColor(34, 177, 76)); break; case ENDockArea.Right: widget.BackgroundFill = new NColorFill(new NColor(163, 73, 164)); break; case ENDockArea.Top: widget.BackgroundFill = new NColorFill(new NColor(237, 28, 36)); break; default: throw new Exception("New ENDockArea?"); } }
protected override NWidget CreateExampleContent() { // Create a dock panel with red border m_DockPanel = new NDockPanel(); m_DockPanel.Border = NBorder.CreateFilledBorder(NColor.Red); m_DockPanel.BorderThickness = new NMargins(1); // Create and dock several widgets NWidget widget = CreateDockedWidget(ENDockArea.Left); widget.PreferredSize = new NSize(100, 100); m_DockPanel.Add(widget); widget = CreateDockedWidget(ENDockArea.Top); widget.PreferredSize = new NSize(100, 100); m_DockPanel.Add(widget); widget = CreateDockedWidget(ENDockArea.Right); widget.PreferredSize = new NSize(100, 100); m_DockPanel.Add(widget); widget = CreateDockedWidget(ENDockArea.Bottom); widget.PreferredSize = new NSize(100, 100); m_DockPanel.Add(widget); widget = CreateDockedWidget(ENDockArea.Center); widget.PreferredSize = new NSize(300, 300); m_DockPanel.Add(widget); return(m_DockPanel); }
/// <summary> /// Creates the product groups stack panel. /// </summary> /// <param name="root"></param> /// <returns></returns> private NStackPanel CreateProductGroupsStack(NXmlElement root) { NMap <string, NStackPanel> stackMap = new NMap <string, NStackPanel>(); // Create the main stack NStackPanel mainStack = new NStackPanel(); mainStack.Direction = ENHVDirection.LeftToRight; mainStack.Margins = new NMargins(0, LaneSpacing * 2); // Create a stack panel for each license groups and add it to the main stack int count = root.ChildrenCount; for (int i = 0; i < count; i++) { NXmlElement categoryElement = root.GetChildAt(i) as NXmlElement; if (categoryElement == null) { continue; } string license = categoryElement.GetAttributeValue("license"); NStackPanel licenseGroupStack; if (!stackMap.TryGet(license, out licenseGroupStack)) { // A stack panel for the license group not found, so create one licenseGroupStack = CreateProductGroupStack(); stackMap.Add(license, licenseGroupStack); // Create a stack for the current group and its name NStackPanel stack = new NStackPanel(); stack.Direction = ENHVDirection.TopToBottom; // 1. Add the license group stack stack.Add(licenseGroupStack); // 2. Add the bracket NColor color = NColor.Parse(categoryElement.GetAttributeValue("color")); NWidget bracket = CreateLicenseGroupBracket(color); stack.Add(bracket); // 3. Add the label NLabel label = new NLabel(license); label.HorizontalPlacement = ENHorizontalPlacement.Center; label.TextFill = new NColorFill(color); label.Font = new NFont(NFontDescriptor.DefaultSansFamilyName, InfoFontSize); stack.Add(label); mainStack.Add(stack); } // Create an image box for the current category NImageBox imageBox = CreateImageBox(categoryElement); licenseGroupStack.Add(imageBox); } return(mainStack); }
private void OnSplitButtonSelectedIndexChanged(NValueChangeEventArgs arg) { NMenuSplitButton menuSplitButton = (NMenuSplitButton)arg.CurrentTargetNode; NMenuItem menuItem = (NMenuItem)menuSplitButton.Items[menuSplitButton.SelectedIndex]; NLabel label = (NLabel)menuItem.Content; menuSplitButton.ActionButton.Content = NWidget.FromObject(label.Text); }
private void OnAddSmallItemButtonClick(NEventArgs args) { NWidget item = CreateDockedWidget(); item.MinSize = new NSize(20, 20); item.PreferredSize = new NSize(60, 60); m_DockPanel.Add(item); }
private void OnAddLargeItemButtonClick(NEventArgs args) { NWidget item = CreateDockedWidget(); item.MinSize = new NSize(40, 40); item.PreferredSize = new NSize(100, 100); m_DockPanel.Add(item); }
private static NPairBox CreatePairBox(NWidget widget1, NWidget widget2) { NPairBox pairBox = new NPairBox(widget1, widget2, ENPairBoxRelation.Box1AboveBox2); pairBox.FitMode = ENStackFitMode.First; pairBox.FillMode = ENStackFillMode.First; pairBox.Spacing = NDesign.VerticalSpacing; return(pairBox); }
private static NPairBox CreatePairBox(string text, NWidget widget) { NLabel label = new NLabel(text); label.HorizontalPlacement = ENHorizontalPlacement.Right; label.VerticalPlacement = ENVerticalPlacement.Center; widget.VerticalPlacement = ENVerticalPlacement.Center; return(new NPairBox(label, widget, true)); }
/// <summary> /// Creates a paragraph that contains a widget /// </summary> /// <param name="widget"></param> /// <returns></returns> NParagraph CreateWidgetParagraph(NWidget widget) { NParagraph paragraph = new NParagraph(); NWidgetInline inline = new NWidgetInline(); inline.Content = widget; paragraph.Inlines.Add(inline); return(paragraph); }
private void pararCronometroToolStripMenuItem_Click(object sender, EventArgs e) { pararCronometro(); NWidget nw = new NWidget(); nw.insertaTiempoTarea(listaTareasPersonales.SelectedValue.ToString(), TiempoStatic.StartDate, DateTime.Now); TiempoStatic.StartDate = DateTime.Now; TiempoStatic.IsWorking = false; botonStart.Visible = true; botonApagar.Visible = false; }
private void OnAddRandomItemButtonClick(NEventArgs args) { int range = 50; Random rnd = new Random(); NWidget item = CreateDockedWidget(); item.MinSize = new NSize(rnd.Next(range), rnd.Next(range)); item.PreferredSize = new NSize(rnd.Next(range) + range, rnd.Next(range) + range); m_DockPanel.Add(item); }
protected override NWidget CreateExampleContent() { Array predefinedCursors = NEnum.GetValues(typeof(ENPredefinedCursor)); NStackPanel stack = new NStackPanel(); NGroupBox predefinedGroupBox = new NGroupBox("Predefined"); stack.Add(predefinedGroupBox); NSplitter splitter = new NSplitter(); splitter.SplitMode = ENSplitterSplitMode.Proportional; splitter.SplitFactor = 0.5d; predefinedGroupBox.Content = splitter; for (int i = 0; i < 2; i++) { NStackPanel pstack = new NStackPanel(); pstack.VerticalSpacing = 1; switch (i) { case 0: splitter.Pane1.Content = new NGroupBox("Use Native If Possible", pstack); break; case 1: splitter.Pane2.Content = new NGroupBox("Use Built-In", pstack); break; default: throw new Exception("More cases?"); } for (int j = 0; j < predefinedCursors.Length; j++) { ENPredefinedCursor predefinedCursor = (ENPredefinedCursor)predefinedCursors.GetValue(j); NWidget element = CreateDemoElement(NStringHelpers.InsertSpacesBeforeUppersAndDigits(predefinedCursor.ToString())); element.Cursor = new NCursor(predefinedCursor, i == 0); pstack.Add(element); } } NWidget customElement = CreateDemoElement("Custom"); customElement.Cursor = NResources.Cursor_CustomCursor_cur; NGroupBox customGroupBox = new NGroupBox("Custom", customElement); stack.Add(customGroupBox); return(stack); }
public void LoadFromStream(Stream stream) { // Load an xml document from the stream NXmlDocument xmlDocument = NXmlDocument.LoadFromStream(stream); // Process it if (xmlDocument == null || xmlDocument.ChildrenCount != 1) { return; } m_ExamplesMap = new NStringMap <NWidget>(false); // Get the root element (i.e. the <document> element) NXmlElement rootElement = (NXmlElement)xmlDocument.GetChildAt(0); // Process the head NXmlElement titleElement = (NXmlElement)rootElement.GetFirstChild("title"); m_HeaderLabel.Text = ((NXmlTextNode)titleElement.GetChildAt(0)).Text; NXmlElement statusColorsElement = (NXmlElement)rootElement.GetFirstChild("statusColors"); ParseStatusColors(statusColorsElement); // Process the categories NXmlElement categoriesElement = (NXmlElement)rootElement.GetFirstChild("categories"); ((NWelcomePanel)m_PagePanel[0]).Initialize(categoriesElement); for (int i = 0, count = categoriesElement.ChildrenCount; i < count; i++) { NXmlElement child = categoriesElement.GetChildAt(i) as NXmlElement; if (child == null) { continue; } if (child.Name != "category") { throw new Exception("The body element can contain only category elements"); } // Create a widget and add it to the categories panel NWidget category = CreateCategory(child); m_PagePanel.Add(category); } // Init the search box m_SearchBox.InitAutoComplete(m_ExamplesMap, new NExampleFactory()); m_SearchBox.ListBoxItemSelected += OnSearchBoxListBoxItemSelected; }
/// <summary> /// Creates the bracket of a license group. /// </summary> /// <param name="color"></param> /// <returns></returns> private NWidget CreateLicenseGroupBracket(NColor color) { NWidget bracket = new NWidget(); bracket.BackgroundFill = new NStockGradientFill(ENGradientStyle.Horizontal, ENGradientVariant.Variant1, new NColor(NColor.White, 128), NColor.White); bracket.Border = NBorder.CreateFilledBorder(color); bracket.BorderThickness = new NMargins(1, 0, 1, 1); bracket.PreferredHeight = IconSpacing / 2; bracket.Padding = new NMargins(0, NDesign.VerticalSpacing); bracket.Margins = new NMargins(IconSpacing / 4, 0); return(bracket); }
private void OnTargetWidgetMouseDown(NMouseButtonEventArgs args) { if (args.Button != ENMouseButtons.Right) { return; } // Mark the event as handled args.Cancel = true; // Create and show the popup NWidget popupContent = CreatePopupContent(); NPopupWindow popupWindow = new NPopupWindow(popupContent); NPopupWindow.OpenInContext(popupWindow, args.CurrentTargetNode, args.ScreenPosition); }
/// <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; }
private NWidget CreateWidget(string text, NFill backgroundFill) { NStackPanel stack = new NStackPanel(); stack.FitMode = ENStackFitMode.First; stack.FillMode = ENStackFillMode.First; NWidget widget = new NWidget(); widget.BackgroundFill = backgroundFill; stack.Add(widget); NLabel label = new NLabel(text); label.HorizontalPlacement = ENHorizontalPlacement.Center; stack.Add(label); return(stack); }
private void OnSearchBoxListBoxItemSelected(NEventArgs arg) { if (arg.Cancel) { return; } INSearchableListBox listBox = (INSearchableListBox)arg.TargetNode; NWidget selectedItem = ((NKeyValuePair <string, NWidget>)listBox.GetSelectedItem()).Value; if (selectedItem != null && TileSelected != null) { NItemInfo tileInfo = (NItemInfo)selectedItem.Tag; TileSelected(tileInfo.XmlElement); } // Mark the event as handled arg.Cancel = true; }
/// <summary> /// Binds the size of the shape to the embedded widget desired size. /// </summary> /// <param name="shape"></param> private void BindSizeToDesiredSize(NShape shape) { NWidget widget = shape.Widget; // bind shape width to button desired width NBindingFx bx = new NBindingFx(widget, NButton.DesiredWidthProperty); bx.Guard = true; shape.SetFx(NShape.WidthProperty, bx); // bind shape height to button desired height NBindingFx by = new NBindingFx(widget, NButton.DesiredHeightProperty); by.Guard = true; shape.SetFx(NShape.HeightProperty, by); shape.AllowResizeX = false; shape.AllowRotate = false; shape.AllowResizeY = false; }
private NNavigationBarPane CreateNavigationBarPane(string title, string tooltip, NImage largeImage, NImage smallImage, NWidget content) { NNavigationBarPane pane = new NNavigationBarPane(); // set pane content pane.Content = content; pane.Image = (NImage)smallImage.DeepClone(); pane.Text = title; // set header content NLabel titleLabel = new NLabel(title); titleLabel.VerticalPlacement = ENVerticalPlacement.Fit; NPairBox headerContent = new NPairBox(largeImage, titleLabel); headerContent.Spacing = 2; pane.Header.Content = headerContent; pane.Header.Tooltip = new NTooltip(tooltip); // set icon content pane.Icon.Content = new NImageBox(smallImage); pane.Icon.Tooltip = new NTooltip(tooltip); // add the pane m_NavigationBar.Panes.Add(pane); return(pane); }
/// <summary> /// Sets the currently selected dock area to the specified widget. /// </summary> /// <param name="widget"></param> private void SetCurrentDockArea(NWidget widget) { SetDockArea(widget, GetCurrentDockArea()); }
protected override NWidget CreateExampleContent() { NCommandBarManager manager = new NCommandBarManager(); // create two lanes NCommandBarLane lane0 = new NCommandBarLane(); manager.TopDock.Add(lane0); // create some toolbars in the second lane for (int i = 0; i < 10; i++) { NToolBar toolBar = new NToolBar(); lane0.Add(toolBar); toolBar.Text = "Bar" + i.ToString(); for (int j = 0; j < 8; j++) { string name = "BTN " + i.ToString() + "." + j.ToString(); NWidget item; if (j == 2) { item = new NColorBox(); } else if (j == 3) { NMenuSplitButton msb = new NMenuSplitButton(); msb.ActionButton.Content = NWidget.FromObject("Send/Receive"); msb.Menu.Items.Add(new NMenuItem("Send Receive All")); msb.Menu.Items.Add(new NMenuItem("Send All")); msb.Menu.Items.Add(new NMenuItem("Receive All")); item = msb; } else if (j == 4) { NComboBox comboBox = new NComboBox(); comboBox.Items.Add(new NComboBoxItem("Item 1")); comboBox.Items.Add(new NComboBoxItem("Item 2")); comboBox.Items.Add(new NComboBoxItem("Item 3")); comboBox.Items.Add(new NComboBoxItem("Item 4")); item = comboBox; } else { item = new NButton(name); } NCommandBar.SetText(item, name); toolBar.Items.Add(item); if (j == 2 || j == 6) { toolBar.Items.Add(new NCommandBarSeparator()); } } if (i == 2) { toolBar.Wrappable = true; } } manager.Content = new NLabel("Content Goes Here"); manager.Content.AllowFocus = true; manager.Content.MouseDown += new Function <NMouseButtonEventArgs>(OnContentMouseDown); manager.Content.Border = NBorder.CreateFilledBorder(NColor.Black); manager.Content.BackgroundFill = new NColorFill(NColor.White); manager.Content.BorderThickness = new NMargins(1); manager.Content.GotFocus += new Function <NFocusChangeEventArgs>(OnContentGotFocus); manager.Content.LostFocus += new Function <NFocusChangeEventArgs>(OnContentLostFocus); return(manager); }
protected override NWidget CreateExampleContent() { // create the host NStackPanel stack = new NStackPanel(); stack.VerticalSpacing = 2; NGroupBox contentGroupBox = new NGroupBox("Content"); stack.Add(contentGroupBox); NStackPanel contentStack = new NStackPanel(); contentStack.VerticalSpacing = 2; contentGroupBox.Content = contentStack; NWidget textTooltip = CreateDemoElement("Text tooltip"); textTooltip.Tooltip = new NTooltip("Tooltip text"); contentStack.Add(textTooltip); NWidget imageTooltip = CreateDemoElement("Image tooltip"); imageTooltip.Tooltip = new NTooltip(NResources.Image__48x48_Book_png); contentStack.Add(imageTooltip); NWidget richTooltip = CreateDemoElement("Rich tooltip"); NStackPanel richTooltipContent = new NStackPanel(); richTooltipContent.Add(new NLabel("The tooltip can contain any type of Nevron Open Vision Content")); richTooltipContent.Add(new NImageBox(NResources.Image__48x48_Book_png)); richTooltip.Tooltip = new NTooltip(richTooltipContent); contentStack.Add(richTooltip); NWidget dynamicContentTooltip = CreateDemoElement("Dynamic content"); dynamicContentTooltip.Tooltip = new NDynamicContentTooltip(); contentStack.Add(dynamicContentTooltip); NGroupBox behaviorGroupBox = new NGroupBox("Behavior"); stack.Add(behaviorGroupBox); NStackPanel behaviorStack = new NStackPanel(); behaviorStack.VerticalSpacing = 2; behaviorGroupBox.Content = behaviorStack; NWidget followMouse = CreateDemoElement("Follow mouse"); followMouse.Tooltip = new NTooltip("I am following the mouse"); followMouse.Tooltip.FollowMouse = true; behaviorStack.Add(followMouse); NWidget instantShowTooltip = CreateDemoElement("Shown instantly"); instantShowTooltip.Tooltip = new NTooltip("I was shown instantly"); instantShowTooltip.Tooltip.FirstShowDelay = 0; instantShowTooltip.Tooltip.NextShowDelay = 0; behaviorStack.Add(instantShowTooltip); NWidget doNotCloseOnClick = CreateDemoElement("Do not close on click"); doNotCloseOnClick.Tooltip = new NTooltip("I am not closed on click"); doNotCloseOnClick.Tooltip.CloseOnMouseDown = false; behaviorStack.Add(doNotCloseOnClick); NGroupBox positionGroupBox = new NGroupBox("Position"); stack.Add(positionGroupBox); NTableFlowPanel positionTable = new NTableFlowPanel(); positionGroupBox.Content = positionTable; positionTable.HorizontalSpacing = 2; positionTable.VerticalSpacing = 2; positionTable.Direction = ENHVDirection.LeftToRight; positionTable.MaxOrdinal = 3; foreach (ENTooltipPosition pos in NEnum.GetValues(typeof(ENTooltipPosition))) { NWidget posElement = CreateDemoElement(pos.ToString()); posElement.Tooltip = new NTooltip(pos.ToString()); posElement.Tooltip.FirstShowDelay = 0; posElement.Tooltip.NextShowDelay = 0; posElement.Tooltip.Position = pos; posElement.Tooltip.FollowMouse = true; posElement.Tooltip.ShowDuration = -1; positionTable.Add(posElement); } return(stack); }
private static NPairBox GetOwnerPairBox(NWidget widget) { return((NPairBox)widget.GetFirstAncestor(NPairBox.NPairBoxSchema)); }
protected override NWidget CreateExampleContent() { NMemoryDataTable dataTable = new NMemoryDataTable( new NFieldInfo("Company", typeof(String)), new NFieldInfo("RegionSales", typeof(Double[]))); Random rnd = new Random(); for (int i = 0; i < 1000; i++) { Double[] arr = new Double[10]; for (int j = 0; j < 10; j++) { arr[j] = rnd.Next(100); } dataTable.AddRow(NDummyDataSource.RandomCompanyName(), arr); } // create a view and get its grid NTableGridView view = new NTableGridView(); NTableGrid grid = view.Grid; grid.AutoCreateColumn += delegate(NAutoCreateColumnEventArgs arg) { if (arg.DataColumn.FieldName == "RegionSales") { NCustomColumnFormat pieColumnFormat = new NCustomColumnFormat(); pieColumnFormat.FormatDefaultDataCellDelegate = delegate(NDataCell theDataCell) { NWidget widget = new NWidget(); widget.PreferredSize = new NSize(400, 300); }; pieColumnFormat.CreateValueDataCellViewDelegate = delegate(NDataCell theDataCell, object value) { double[] values = (double[])value; NChartView chartView = new NChartView(); chartView.PreferredSize = new NSize(300, 60); NCartesianChart cartesianChart = new NCartesianChart(); NDockLayout.SetDockArea(cartesianChart, ENDockArea.Center); chartView.Surface.Content = cartesianChart; cartesianChart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XOrdinalYLinear); cartesianChart.Legend = null; cartesianChart.Axes[ENCartesianAxis.PrimaryX].Visible = false; NCartesianAxis yAxis = cartesianChart.Axes[ENCartesianAxis.PrimaryY]; NValueScaleLabelStyle labelStyle = new NValueScaleLabelStyle(); labelStyle.TextStyle.Font = new NFont("Arimo", 8); ((NLinearScale)yAxis.Scale).Labels.Style = labelStyle; NBarSeries barSeries = new NBarSeries(); barSeries.DataLabelStyle = new NDataLabelStyle(false); barSeries.InflateMargins = false; cartesianChart.Series.Add(barSeries); int count = values.Length; for (int i = 0; i < count; i++) { barSeries.DataPoints.Add(new NBarDataPoint(values[i])); } return(chartView); }; arg.DataColumn.Format = pieColumnFormat; } }; grid.DataSource = new NDataSource(dataTable); return(view); }
protected override NWidget CreateExampleContent() { NCommandBarManager manager = new NCommandBarManager(); // create two lanes NCommandBarLane lane0 = new NCommandBarLane(); manager.TopDock.Add(lane0); NCommandBarLane lane1 = new NCommandBarLane(); manager.TopDock.Add(lane1); NCommandBarLane lane2 = new NCommandBarLane(); manager.TopDock.Add(lane2); NCommandBarLane lane3 = new NCommandBarLane(); manager.TopDock.Add(lane3); // create a menu bar in the first lane NMenuBar menuBar = new NMenuBar(); lane0.Add(menuBar); menuBar.Items.Add(CreateFileMenu()); menuBar.Items.Add(CreateEditMenu()); menuBar.Items.Add(CreateViewMenu()); menuBar.Text = "Main Menu"; //Create File toolbar. NToolBar fileToolBar = new NToolBar(); lane1.Add(fileToolBar); fileToolBar.Text = "File"; AddToolBarItem(fileToolBar, Nevron.Nov.Presentation.NResources.Image_File_New_png, null, "New"); AddToolBarItem(fileToolBar, Nevron.Nov.Presentation.NResources.Image_File_Open_png, null, "Open"); fileToolBar.Items.Add(new NCommandBarSeparator()); AddToolBarItem(fileToolBar, Nevron.Nov.Presentation.NResources.Image_File_Save_png, null, "Save..."); AddToolBarItem(fileToolBar, Nevron.Nov.Presentation.NResources.Image_File_SaveAs_png, null, "Save As..."); //Create Edit toolbar. NToolBar editToolBar = new NToolBar(); lane1.Add(editToolBar); editToolBar.Text = "Edit"; AddToolBarItem(editToolBar, Nevron.Nov.Presentation.NResources.Image_Edit_Undo_png, "Undo"); AddToolBarItem(editToolBar, Nevron.Nov.Presentation.NResources.Image_Edit_Redo_png, "Redo"); editToolBar.Items.Add(new NCommandBarSeparator()); AddToolBarItem(editToolBar, Nevron.Nov.Presentation.NResources.Image_Edit_Copy_png, "Copy"); AddToolBarItem(editToolBar, Nevron.Nov.Presentation.NResources.Image_Edit_Cut_png, "Cut"); AddToolBarItem(editToolBar, Nevron.Nov.Presentation.NResources.Image_Edit_Paste_png, "Paste"); //Create View toolbar. NToolBar viewToolBar = new NToolBar(); lane1.Add(viewToolBar); viewToolBar.Text = "View"; //Add toggle buttons in a toggle button group which acts like radio buttons. AddToggleToolBarItem(viewToolBar, Nevron.Nov.Text.NResources.Image_Layout_Normal_png, "Normal Layout"); AddToggleToolBarItem(viewToolBar, Nevron.Nov.Text.NResources.Image_Layout_Web_png, "Web Layout"); AddToggleToolBarItem(viewToolBar, Nevron.Nov.Text.NResources.Image_Layout_Print_png, "Print Layout"); viewToolBar.Items.Add(new NCommandBarSeparator()); AddToolBarItem(viewToolBar, null, "Task Pane"); AddToolBarItem(viewToolBar, null, "Toolbars"); AddToolBarItem(viewToolBar, null, "Ruller"); NToolBar toolbar = new NToolBar(); lane2.Add(toolbar); toolbar.Text = "Toolbar"; toolbar.Wrappable = true; NColorBox colorBoxItem = new NColorBox(); colorBoxItem.Tooltip = new NTooltip("Select Color"); NCommandBar.SetText(colorBoxItem, "Select Color"); toolbar.Items.Add(colorBoxItem); NMenuSplitButton splitButton = new NMenuSplitButton(); splitButton.ActionButton.Content = NWidget.FromObject("Send/Receive"); splitButton.Menu.Items.Add(new NMenuItem("Send Receive All")); splitButton.SelectedIndexChanged += OnSplitButtonSelectedIndexChanged; splitButton.Menu.Items.Add(new NMenuItem("Send All")); splitButton.Menu.Items.Add(new NMenuItem("Receive All")); toolbar.Items.Add(splitButton); //Add toggle button which enable/disables the next fill split button. NToggleButton toggleButton = new NToggleButton("Enable"); toggleButton.CheckedChanged += OnToggleButtonCheckedChanged; toolbar.Items.Add(toggleButton); // Add fill split button NFillSplitButton fillButton = new NFillSplitButton(); fillButton.Tooltip = new NTooltip("Select Fill"); fillButton.Enabled = false; toolbar.Items.Add(fillButton); // Add shadow split button NShadowSplitButton shadowButton = new NShadowSplitButton(); shadowButton.Tooltip = new NTooltip("Select Shadow"); toolbar.Items.Add(shadowButton); // Add stroke split button NStrokeSplitButton strokeButton = new NStrokeSplitButton(); strokeButton.Tooltip = new NTooltip("Select Stroke"); toolbar.Items.Add(strokeButton); manager.Content = new NLabel("Content Goes Here"); manager.Content.AllowFocus = true; manager.Content.MouseDown += new Function <NMouseButtonEventArgs>(OnContentMouseDown); manager.Content.Border = NBorder.CreateFilledBorder(NColor.Black); manager.Content.BackgroundFill = new NColorFill(NColor.White); manager.Content.BorderThickness = new NMargins(1); manager.Content.GotFocus += new Function <NFocusChangeEventArgs>(OnContentGotFocus); manager.Content.LostFocus += new Function <NFocusChangeEventArgs>(OnContentLostFocus); return(manager); }