protected override NWidget CreateExampleContent() { m_FormulaEngine = new NFormulaEngine(); NStackPanel stack = new NStackPanel(); NDockLayout.SetDockArea(stack, ENDockArea.Center); m_InputTextBox = new NTextBox(); stack.Add(m_InputTextBox); NStackPanel hstack = new NStackPanel(); hstack.Direction = ENHVDirection.LeftToRight; stack.Add(hstack); NButton evaluateButton = new NButton("Evaluate"); evaluateButton.Click += new Function <NEventArgs>(OnEvaluateButtonClick); hstack.Add(evaluateButton); NButton evaluateAllButton = new NButton("Evaluate All"); evaluateAllButton.Click += new Function <NEventArgs>(OnEvaluateAllButtonClick); hstack.Add(evaluateAllButton); m_ResultTextBox = new NTextBox(); stack.Add(m_ResultTextBox); return(stack); }
protected override NWidget CreateExampleContent() { NStackPanel stack = new NStackPanel(); stack.HorizontalPlacement = Layout.ENHorizontalPlacement.Left; stack.VerticalPlacement = Layout.ENVerticalPlacement.Top; stack.MinWidth = 400; m_NameTextBox = new NTextBox(); m_AddressTextBox = new NTextBox(); m_MarriedCheckBox = new NCheckBox(); m_GenderComboBox = new NComboBox(); m_GenderComboBox.Items.Add(new NComboBoxItem("Male")); m_GenderComboBox.Items.Add(new NComboBoxItem("Female")); m_GenderComboBox.SelectedIndex = 0; m_OtherTextBox = new NTextBox(); stack.Add(new NPairBox(new NLabel("Name (string):"), m_NameTextBox, true)); stack.Add(new NPairBox(new NLabel("Address (string):"), m_AddressTextBox, true)); stack.Add(new NPairBox(new NLabel("Married (boolean):"), m_MarriedCheckBox, true)); stack.Add(new NPairBox(new NLabel("Gender (singleton):"), m_GenderComboBox, true)); stack.Add(new NPairBox(new NLabel("Other (string, non serialized):"), m_OtherTextBox, true)); return(new NUniSizeBoxGroup(stack)); }
private NWidget CreateCustomRequestWidget() { NGroupBox groupBox = new NGroupBox("Custom Request"); NDockPanel dock = new NDockPanel(); groupBox.Content = dock; NLabel label = new NLabel("URI:"); label.VerticalPlacement = ENVerticalPlacement.Center; NDockLayout.SetDockArea(label, ENDockArea.Left); dock.Add(label); m_CustomURITextBox = new NTextBox(); m_CustomURITextBox.Text = "http://www.nevron.com/gallery/FullGalleries/chart/pie/images/3D-pie-cut-edge-ring.png"; m_CustomURITextBox.Padding = new NMargins(0, 3, 0, 3); NDockLayout.SetDockArea(m_CustomURITextBox, ENDockArea.Center); dock.Add(m_CustomURITextBox); NButton submitButton = new NButton("Submit"); NDockLayout.SetDockArea(submitButton, ENDockArea.Right); submitButton.Click += new Function <NEventArgs>(OnSumbitCustomRequestClick); dock.Add(submitButton); return(groupBox); }
private NWidget CreateTextDemo() { NStackPanel stack = new NStackPanel(); stack.FillMode = ENStackFillMode.Last; stack.FitMode = ENStackFitMode.Last; NButton setTextButton = new NButton("Set Clipboard Text"); setTextButton.Click += new Function <NEventArgs>(OnSetTextButtonClick); NButton getTextButton = new NButton("Get Clipboard Text"); getTextButton.Click += new Function <NEventArgs>(OnGetTextButtonClick); NPairBox pairBox = new NPairBox(setTextButton, getTextButton); pairBox.HorizontalPlacement = ENHorizontalPlacement.Left; pairBox.Spacing = NDesign.HorizontalSpacing; stack.Add(pairBox); m_TextBox = new NTextBox(); m_TextBox.Text = "This is some text. You can edit it or enter more if you want.\n\n" + "When ready click the \"Set Clipboard Text\" button to move it to the clipboard."; m_TextBox.Multiline = true; stack.Add(m_TextBox); return(stack); }
protected override NWidget CreateExampleControls() { NStackPanel stack = new NStackPanel(); m_FindTextBox = new NTextBox(); m_FindTextBox.Text = "quick"; stack.Add(new NPairBox(new NLabel("Find:"), m_FindTextBox, ENPairBoxRelation.Box1AboveBox2)); m_ReplaceTextBox = new NTextBox(); m_ReplaceTextBox.Text = "slow"; stack.Add(new NPairBox(new NLabel("Replace:"), m_ReplaceTextBox, ENPairBoxRelation.Box1AboveBox2)); NButton findAllButton = new NButton("Find All"); findAllButton.Click += new Function <NEventArgs>(OnFindAllButtonClick); stack.Add(findAllButton); NButton replaceAllButton = new NButton("Replace All"); replaceAllButton.Click += new Function <NEventArgs>(OnReplaceAllButtonClick); stack.Add(replaceAllButton); NButton clearHighlightButton = new NButton("Clear Highlight"); clearHighlightButton.Click += new Function <NEventArgs>(OnClearHighlightButtonClick); stack.Add(clearHighlightButton); return(stack); }
protected override NWidget CreateExampleContent() { NSplitter splitter = new NSplitter(); splitter.SplitMode = ENSplitterSplitMode.Proportional; splitter.SplitFactor = 0.5; // Create the "HTML Code" group 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; NButton importButton = new NButton("Import"); importButton.Content.HorizontalPlacement = ENHorizontalPlacement.Center; importButton.Click += new Function <NEventArgs>(OnImportButtonClick); NPairBox pairBox = CreatePairBox(m_HtmlTextBox, importButton); splitter.Pane1.Content = new NGroupBox("HTML Code", pairBox); // Create the "Preview" group box m_PreviewRichText = new NRichTextView(); m_PreviewRichText.ReadOnly = true; m_PreviewRichText.DocumentLoaded += OnRichTextDocumentLoaded; splitter.Pane2.Content = new NGroupBox("Preview", m_PreviewRichText); return(splitter); }
protected override NWidget CreateExampleContent() { m_TextBox = new NTextBox(); m_TextBox.Hint = "Enter some text here."; return(m_TextBox); }
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); }
protected override NWidget CreateExampleControls() { NStackPanel stack = new NStackPanel(); NStackPanel propertyStack = new NStackPanel(); stack.Add(new NUniSizeBoxGroup(propertyStack)); m_RangeTooltipTextBox = new NTextBox(); m_RangeTooltipTextBox.Text = "Range Tooltip"; propertyStack.Add(new NPairBox("Range Tooltip:", m_RangeTooltipTextBox, true)); m_NeedleTooltipTextBox = new NTextBox(); m_NeedleTooltipTextBox.Text = "Needle Tooltip"; propertyStack.Add(new NPairBox("Needle Tooltip:", m_NeedleTooltipTextBox, true)); m_MarkerTooltipTextBox = new NTextBox(); m_MarkerTooltipTextBox.Text = "Marker Tooltip"; propertyStack.Add(new NPairBox("Marker Tooltip:", m_MarkerTooltipTextBox, true)); m_ScaleTooltipTextBox = new NTextBox(); m_ScaleTooltipTextBox.Text = "Scale Tooltip"; propertyStack.Add(new NPairBox("Scale Tooltip:", m_ScaleTooltipTextBox, true)); m_RangeTooltipTextBox.TextChanged += new Function <NValueChangeEventArgs>(UpdateTooltips); m_NeedleTooltipTextBox.TextChanged += new Function <NValueChangeEventArgs>(UpdateTooltips); m_MarkerTooltipTextBox.TextChanged += new Function <NValueChangeEventArgs>(UpdateTooltips); m_ScaleTooltipTextBox.TextChanged += new Function <NValueChangeEventArgs>(UpdateTooltips); UpdateTooltips(null); return(stack); }
protected override NWidget CreateExampleContent() { m_DecryptedTextBox = new NTextBox("This is some text to encrypt."); m_DecryptedTextBox.PreferredWidth = 200; m_DecryptedTextBox.Multiline = true; NGroupBox groupBox1 = new NGroupBox("Decrypted Text", m_DecryptedTextBox); groupBox1.Padding = new NMargins(NDesign.HorizontalSpacing, NDesign.VerticalSpacing); m_EncryptedTextBox = new NTextBox(); m_EncryptedTextBox.PreferredWidth = 200; m_EncryptedTextBox.Multiline = true; NGroupBox groupBox2 = new NGroupBox("Encrypted Text", m_EncryptedTextBox); groupBox2.Padding = new NMargins(NDesign.HorizontalSpacing, NDesign.VerticalSpacing); NPairBox pairBox = new NPairBox(groupBox1, groupBox2, ENPairBoxRelation.Box1BeforeBox2); pairBox.FitMode = ENStackFitMode.Equal; pairBox.FillMode = ENStackFillMode.Equal; pairBox.Spacing = NDesign.HorizontalSpacing; pairBox.PreferredHeight = 300; pairBox.VerticalPlacement = ENVerticalPlacement.Top; return(pairBox); }
protected override NWidget CreateExampleContent() { NSplitter splitter = new NSplitter(); splitter.SplitMode = ENSplitterSplitMode.Proportional; splitter.SplitFactor = 0.5; // Create the "Dom Tree" group box m_TreeView = CreateTreeView(); m_TreeView.SelectedPathChanged += OnTreeViewSelectedPathChanged; NToolBar toolBar = new NToolBar(); m_AddChildItemButton = CreateButton(NResources.Image_Add_png, "Add Child Item"); m_AddChildItemButton.Click += OnAddChildItemButtonClick; toolBar.Items.Add(m_AddChildItemButton); m_RemoveSelectedItemButton = CreateButton(NResources.Image_Delete_png, "Remove Selected Item"); m_RemoveSelectedItemButton.Click += OnRemoveSelectedItemButtonClick; toolBar.Items.Add(m_RemoveSelectedItemButton); toolBar.Items.Add(new NCommandBarSeparator()); m_AddAttributeButton = CreateButton(NResources.Image_Add_png, "Add Attribute"); m_AddAttributeButton.Click += OnAddAttributeButtonClick; toolBar.Items.Add(m_AddAttributeButton); m_RemoveAttributeButton = CreateButton(NResources.Image_Delete_png, "Remove Attribute"); m_RemoveAttributeButton.Click += OnRemoveAttributeButtonClick; toolBar.Items.Add(m_RemoveAttributeButton); toolBar.Items.Add(new NCommandBarSeparator()); m_SerializeButton = CreateButton(NResources.Image__16x16_Contacts_png, "Serialize"); m_SerializeButton.Enabled = true; m_SerializeButton.Click += OnSerializeButtonClick; toolBar.Items.Add(m_SerializeButton); NPairBox pairBox = new NPairBox(m_TreeView, toolBar, ENPairBoxRelation.Box1AboveBox2); pairBox.FillMode = ENStackFillMode.First; pairBox.FitMode = ENStackFitMode.First; pairBox.Spacing = NDesign.VerticalSpacing; splitter.Pane1.Content = pairBox; // Create the "XML output" group box m_XmlTextBox = new NTextBox(); m_XmlTextBox.AcceptsEnter = true; m_XmlTextBox.AcceptsTab = true; m_XmlTextBox.Multiline = true; m_XmlTextBox.WordWrap = false; m_XmlTextBox.VScrollMode = ENScrollMode.WhenNeeded; m_XmlTextBox.HScrollMode = ENScrollMode.WhenNeeded; splitter.Pane2.Content = m_XmlTextBox; // Select the "Document" tree view item m_TreeView.SelectedItem = DocumentItem; return(splitter); }
protected override NWidget CreateExampleContent() { m_TextBox = new NTextBox(); m_TextBox.Multiline = true; m_TextBox.VScrollMode = ENScrollMode.WhenNeeded; return(m_TextBox); }
private void OnAddAttributeButtonClick(NEventArgs arg) { NTopLevelWindow dialog = NApplication.CreateTopLevelWindow(); dialog.SetupDialogWindow("Enter attribute's name and value", false); NTableFlowPanel table = new NTableFlowPanel(); table.Direction = ENHVDirection.LeftToRight; table.ColFillMode = ENStackFillMode.Last; table.ColFitMode = ENStackFitMode.Last; table.MaxOrdinal = 2; NLabel nameLabel = new NLabel("Name:"); table.Add(nameLabel); NTextBox nameTextBox = new NTextBox(); table.Add(nameTextBox); NLabel valueLabel = new NLabel("Value:"); table.Add(valueLabel); NTextBox valueTextBox = new NTextBox(); table.Add(valueTextBox); table.Add(new NWidget()); NButtonStrip buttonStrip = new NButtonStrip(); buttonStrip.InitOKCancelButtonStrip(); table.Add(buttonStrip); dialog.Content = table; dialog.Opened += delegate(NEventArgs args) { nameTextBox.Focus(); }; dialog.Closed += delegate(NEventArgs args) { if (dialog.Result == ENWindowResult.OK) { NElementInfo elementInfo = (NElementInfo)m_TreeView.SelectedItem.Tag; elementInfo.Attributes.Set(nameTextBox.Text, valueTextBox.Text); UpdateTreeViewItemText(m_TreeView.SelectedItem); if (m_RemoveAttributeButton.Enabled == false) { m_RemoveAttributeButton.Enabled = true; } } }; dialog.Open(); }
private void OnEnterFolderDialogClosed(NEventArgs arg) { NTopLevelWindow dialog = (NTopLevelWindow)arg.TargetNode; if (dialog.Result == ENWindowResult.OK) { NTextBox textBox = (NTextBox)dialog.Content.GetFirstDescendant(NTextBox.NTextBoxSchema); MergeAndSaveToFolder(textBox.Text); } }
public EditableListBox() { this.DrawMode = DrawMode.Normal; this.ScrollAlwaysVisible = true; tbox = new NTextBox(this); tbox.Hide(); Controls.Add(tbox); tbox.EditEnded += new EventHandler(tbox_EditEnded); tbox.ItemChanged += new ItemsChangedEventHandler(tbox_ItemChanged); }
protected override NWidget CreateExampleContent() { m_TextBox = new NTextBox(); m_TextBox.Multiline = true; m_TextBox.AcceptsEnter = true; m_TextBox.AcceptsTab = true; m_TextBox.VScrollMode = ENScrollMode.WhenNeeded; m_TextBox.Text = "This is a sample text.\n\nYou can edit and save it.\n\nYou can also load text from a text file."; return(m_TextBox); }
protected override NWidget CreateExampleControls() { NStackPanel stack = new NStackPanel(); stack.VerticalSpacing = 10; // Create the predefined tests list box NListBox testListBox = new NListBox(); testListBox.Items.Add(CreateTestListBoxItem(new NRichTextBorders())); testListBox.Items.Add(CreateTestListBoxItem(new NRichTextLists())); testListBox.Items.Add(CreateTestListBoxItem(new NRichTextTables())); testListBox.Items.Add(CreateTestListBoxItem(new NRichTextTextStyles())); testListBox.Items.Add(CreateTestListBoxItem(new NRichTextElementPositioning())); testListBox.Selection.Selected += OnTestListBoxItemSelected; // Add the list box in a group box stack.Add(new NGroupBox("Predefined text documents", testListBox)); // Create the Load from file group box NDockPanel dockPanel = new NDockPanel(); dockPanel.HorizontalSpacing = 3; dockPanel.VerticalSpacing = 3; NButton loadButton = new NButton("Load"); loadButton.Click += OnLoadButtonClick; NDockLayout.SetDockArea(loadButton, ENDockArea.Bottom); dockPanel.Add(loadButton); m_FileNameTextBox = new NTextBox(); m_FileNameTextBox.VerticalPlacement = ENVerticalPlacement.Center; NDockLayout.SetDockArea(m_FileNameTextBox, ENDockArea.Center); dockPanel.Add(m_FileNameTextBox); NButton browseButton = new NButton("..."); browseButton.Click += OnBrowseButtonClick; NDockLayout.SetDockArea(browseButton, ENDockArea.Right); dockPanel.Add(browseButton); stack.Add(new NGroupBox("Load from file", dockPanel)); m_ElapsedTimeLabel = new NLabel(); stack.Add(m_ElapsedTimeLabel); // Select the initial test testListBox.Selection.SingleSelect(testListBox.Items[0]); return(stack); }
internal Control GetControl() { switch (m_ControlCombo.SelectedIndex) { case 0: return(null); case 1: NTextBox tb = new NTextBox(); tb.Text = "NTextBox"; return(tb); case 2: NComboBox cb = new NComboBox(); cb.ImageList = MainForm.TestImages; for (int i = 0; i < 20; i++) { cb.Items.Add(new NListBoxItem(i, "Item " + (i + 1), false)); } return(cb); case 3: NButton b = new NButton(); b.Text = "Test Button"; return(b); case 4: NNumericUpDown ud = new NNumericUpDown(); return(ud); case 5: NCheckBox chb = new NCheckBox(); chb.Text = "NCheckBox"; chb.TransparentBackground = true; return(chb); case 6: NRadioButton rb = new NRadioButton(); rb.Text = "NRadioButton"; rb.TransparentBackground = true; return(rb); case 7: NProgressBar bar = new NProgressBar(); bar.Properties.Style = Nevron.UI.WinForm.Controls.ProgressBarStyle.Gradient; bar.Properties.Value = 60; return(bar); } return(null); }
protected override NWidget CreateExampleControls() { NStackPanel stack = new NStackPanel(); m_PasswordTextBox = new NTextBox("password"); stack.Add(NPairBox.Create("Password", m_PasswordTextBox)); NButton encryptButton = new NButton("Encrypt"); encryptButton.Click += OnEncryptButtonClick; stack.Add(encryptButton); return(stack); }
private void OnMergeAndSaveToFolderButtonClick(NEventArgs arg) { NTextBox textBox = new NTextBox(); NButtonStrip buttonStrip = new NButtonStrip(); buttonStrip.InitOKCancelButtonStrip(); NPairBox pairBox = new NPairBox(textBox, buttonStrip, ENPairBoxRelation.Box1AboveBox2); NTopLevelWindow dialog = NApplication.CreateTopLevelWindow(); dialog.SetupDialogWindow("Enter Folder Path", false); dialog.Content = pairBox; dialog.Closed += OnEnterFolderDialogClosed; dialog.Open(); }
/// <summary> /// /// </summary> /// <returns></returns> protected override NWidget CreateExampleControls() { NStackPanel stack = new NStackPanel(); NUniSizeBoxGroup boxGroup = new NUniSizeBoxGroup(stack); stack.Add(new NLabel("X Axis Title")); NTextBox xAxisTitleTextBox = new NTextBox(); xAxisTitleTextBox.TextChanged += new Function <NValueChangeEventArgs>(OnXAxisTitleTextBoxTextChanged); stack.Add(NPairBox.Create("Text:", xAxisTitleTextBox)); xAxisTitleTextBox.Text = "X Axis Title"; NNumericUpDown xOffsetUpDown = new NNumericUpDown(); xOffsetUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnXOffsetUpDownValueChanged); stack.Add(NPairBox.Create("Offset:", xOffsetUpDown)); xOffsetUpDown.Value = 10; NComboBox xAlignmentCombo = new NComboBox(); xAlignmentCombo.FillFromEnum <ENHorizontalAlignment>(); xAlignmentCombo.SelectedIndexChanged += new Function <NValueChangeEventArgs>(OnXAlignmentComboSelectedIndexChanged); stack.Add(NPairBox.Create("Offset:", xAlignmentCombo)); xAlignmentCombo.SelectedIndex = (int)ENHorizontalAlignment.Center; stack.Add(new NLabel("Y Axis Title")); NTextBox yAxisTitleTextBox = new NTextBox(); yAxisTitleTextBox.TextChanged += new Function <NValueChangeEventArgs>(OnYAxisTitleTextBoxTextChanged); stack.Add(NPairBox.Create("Text:", yAxisTitleTextBox)); yAxisTitleTextBox.Text = "Y Axis Title"; NNumericUpDown yOffsetUpDown = new NNumericUpDown(); yOffsetUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnYOffsetUpDownValueChanged); stack.Add(NPairBox.Create("Offset:", yOffsetUpDown)); yOffsetUpDown.Value = 10; NComboBox yAlignmentCombo = new NComboBox(); yAlignmentCombo.FillFromEnum <ENHorizontalAlignment>(); yAlignmentCombo.SelectedIndexChanged += new Function <NValueChangeEventArgs>(OnYAlignmentComboSelectedIndexChanged); stack.Add(NPairBox.Create("Offset:", yAlignmentCombo)); yAlignmentCombo.SelectedIndex = (int)ENHorizontalAlignment.Center; return(boxGroup); }
protected override NWidget CreateExampleControls() { m_TextBox = new NTextBox(); m_TextBox.Multiline = true; m_TextBox.AcceptsEnter = true; m_TextBox.MinHeight = 200; m_TextBox.Text = "Type some text to measure"; m_TextBox.TextChanged += new Function <NValueChangeEventArgs>(OnTextBoxTextChanged); NStackPanel stack = new NStackPanel(); stack.Add(new NLabel("Text:")); stack.Add(m_TextBox); return(stack); }
/// <summary> /// This is the default constructor of the class. /// </summary> public TextBoxControlShape() : base() { //set the default size Rectangle = new RectangleF(0, 0, 70, 40); //set the connector leftConnector = new Connector(this, "Connector", true); leftConnector.ConnectorLocation = ConnectorLocation.West; Connectors.Add(leftConnector); //cannot be resized IsResizable = false; this.OnMouseDown += new MouseEventHandler(ComboControl_OnMouseDown); textbox = new NTextBox(this, 50, 15); textbox.OnResize += new Netron.GraphLib.NTextBox.ResizeInfo(combo_OnResize); this.Text = "Physicists"; this.Controls.Add(textbox); this.IsResizable = false; }
protected override NWidget CreateExampleContent() { NStackPanel stack = new NStackPanel(); stack.PreferredWidth = 300; stack.HorizontalPlacement = ENHorizontalPlacement.Left; // Create a text box for the message box title m_TitleTextBox = new NTextBox("Message Box"); stack.Add(CreatePairBox("Title:", m_TitleTextBox)); // Create a text box for the message box content m_ContentTextBox = new NTextBox("Here goes the content.\nIt can be multiline."); m_ContentTextBox.Multiline = true; m_ContentTextBox.AcceptsEnter = true; m_ContentTextBox.AcceptsTab = true; m_ContentTextBox.PreferredHeight = 100; m_ContentTextBox.HScrollMode = ENScrollMode.WhenNeeded; m_ContentTextBox.VScrollMode = ENScrollMode.WhenNeeded; m_ContentTextBox.WordWrap = false; stack.Add(CreatePairBox("Content:", m_ContentTextBox)); // Create the message box buttons combo box m_ButtonsComboBox = new NComboBox(); m_ButtonsComboBox.FillFromEnum <ENMessageBoxButtons>(); stack.Add(CreatePairBox("Buttons:", m_ButtonsComboBox)); // Create the message box icon combo box m_IconComboBox = new NComboBox(); m_IconComboBox.FillFromEnum <ENMessageBoxIcon>(); m_IconComboBox.SelectedIndex = 1; stack.Add(CreatePairBox("Icon:", m_IconComboBox)); // Create the show button NLabel label = new NLabel("Show"); label.HorizontalPlacement = ENHorizontalPlacement.Center; NButton showButton = new NButton(label); showButton.Click += new Function <NEventArgs>(OnShowButtonClick); stack.Add(showButton); return(new NUniSizeBoxGroup(stack)); }
protected override NWidget CreateExampleControls() { NStackPanel stack = new NStackPanel(); stack.FillMode = ENStackFillMode.Last; stack.FitMode = ENStackFitMode.Last; NTextBox promptCharTextBox = new NTextBox("_"); promptCharTextBox.MaxLength = 1; promptCharTextBox.SelectAllOnFocus = true; promptCharTextBox.HorizontalPlacement = ENHorizontalPlacement.Left; promptCharTextBox.TextChanged += OnPromptCharTextBoxTextChanged; stack.Add(NPairBox.Create("Prompt char: ", promptCharTextBox)); m_EventsLog = new NExampleEventsLog(); stack.Add(m_EventsLog); return(stack); }
private NGroupBox CreateNavigationGroupBox() { // Create the navigation pair box m_NavigationTextBox = new NTextBox(); m_NavigationTextBox.Text = DefaultAddress; m_NavigationTextBox.VerticalPlacement = ENVerticalPlacement.Center; NButton goButton = new NButton("Go"); goButton.VerticalPlacement = ENVerticalPlacement.Center; goButton.Click += new Function <NEventArgs>(OnGoButtonClick); NPairBox pairBox = new NPairBox(m_NavigationTextBox, goButton); pairBox.FitMode = ENStackFitMode.First; pairBox.FillMode = ENStackFillMode.First; pairBox.Spacing = 3; return(new NGroupBox("Import from URL", pairBox)); }
protected override NWidget CreateExampleControls() { NStackPanel stack = new NStackPanel(); m_BarcodeTextBox = new NTextBox("Nevron Software" + Environment.NewLine + Environment.NewLine + "https://www.nevron.com"); m_BarcodeTextBox.Multiline = true; m_BarcodeTextBox.AcceptsEnter = true; m_BarcodeTextBox.PreferredHeight = 100; m_BarcodeTextBox.TextChanged += OnBarcodeTextBoxTextChanged; stack.Add(m_BarcodeTextBox); m_GenerateImageButton = new NButton("Generate Image"); m_GenerateImageButton.Click += OnGenerateImageButtonClick; stack.Add(m_GenerateImageButton); OnGenerateImageButtonClick(null); return(stack); }
protected override NWidget CreateExampleControls() { NStackPanel stack = new NStackPanel(); m_FindTextBox = new NTextBox(); m_FindTextBox.Text = "princess"; stack.Add(new NPairBox(new NLabel("Find:"), m_FindTextBox, ENPairBoxRelation.Box1AboveBox2)); NButton selectAll = new NButton("Select All"); selectAll.Click += new Function <NEventArgs>(OnSelectAllButtonClick); stack.Add(selectAll); NButton deleteAllButton = new NButton("Delete All"); deleteAllButton.Click += new Function <NEventArgs>(OnDeleteAllButtonClick); stack.Add(deleteAllButton); return(stack); }
/// <summary> /// /// </summary> /// <returns></returns> protected override NWidget CreateExampleControls() { NStackPanel stack = new NStackPanel(); NUniSizeBoxGroup boxGroup = new NUniSizeBoxGroup(stack); NTextBox legendHeaderTextBox = new NTextBox(); legendHeaderTextBox.TextChanged += OnLegendHeaderTextBoxChanged; stack.Add(NPairBox.Create("Header: ", legendHeaderTextBox)); NTextBox legendFooterTextBox = new NTextBox(); legendFooterTextBox.TextChanged += OnLegendFooterTextBoxChanged; stack.Add(NPairBox.Create("Footer: ", legendFooterTextBox)); m_HorizontalInterlaceStripesCheckBox = new NCheckBox("Horizontal Interlace Stripes"); m_HorizontalInterlaceStripesCheckBox.CheckedChanged += OnVerticalInterlaceStripesCheckBoxCheckedChanged; stack.Add(m_HorizontalInterlaceStripesCheckBox); m_VerticalInterlaceStripesCheckBox = new NCheckBox("Vertical Interlace Stripes"); m_VerticalInterlaceStripesCheckBox.CheckedChanged += OnHorizontalInterlaceStripesCheckBoxCheckedChanged; stack.Add(m_VerticalInterlaceStripesCheckBox); NCheckBox showHorizontalGridLinesCheckBox = new NCheckBox("Show Horizontal Gridlines"); showHorizontalGridLinesCheckBox.Checked = true; showHorizontalGridLinesCheckBox.CheckedChanged += OnShowHorizontalGridLinesCheckBoxCheckedChanged; stack.Add(showHorizontalGridLinesCheckBox); NCheckBox showVerticalGridLinesCheckBox = new NCheckBox("Show Vertical Gridlines"); showVerticalGridLinesCheckBox.Checked = true; showVerticalGridLinesCheckBox.CheckedChanged += OnShowVerticalGridLinesCheckBoxCheckedChanged; stack.Add(showVerticalGridLinesCheckBox); return(boxGroup); }
protected override NWidget CreateExampleContent() { NSplitter splitter = new NSplitter(); splitter.SplitMode = ENSplitterSplitMode.Proportional; splitter.SplitFactor = 0.5; // Create the "XML content" group box NStackPanel stack = new NStackPanel(); stack.FitMode = ENStackFitMode.First; stack.FillMode = ENStackFillMode.First; stack.VerticalSpacing = NDesign.VerticalSpacing; m_XmlTextBox = new NTextBox(); m_XmlTextBox.AcceptsEnter = true; m_XmlTextBox.AcceptsTab = true; m_XmlTextBox.Multiline = true; m_XmlTextBox.WordWrap = false; m_XmlTextBox.VScrollMode = ENScrollMode.WhenNeeded; m_XmlTextBox.HScrollMode = ENScrollMode.WhenNeeded; m_XmlTextBox.Text = SampleXml; stack.Add(m_XmlTextBox); NButton parseButton = new NButton("Parse"); parseButton.Content.HorizontalPlacement = ENHorizontalPlacement.Center; parseButton.Click += OnParseButtonClick; stack.Add(parseButton); splitter.Pane1.Content = new NGroupBox("XML Content", stack); // Create the "DOM tree" group box m_DomTree = new NTreeView(); splitter.Pane2.Content = new NGroupBox("DOM Tree", m_DomTree); return(splitter); }
private void InitializeComponent() { /* * Window setup * */ this.Text = "Dagobar"; this.Size = new System.Drawing.Size(16 * windowCoeff, 9 * windowCoeff); this.MinimumSize = new System.Drawing.Size(this.Width / 2, this.Height / 2); #region "Controls Setup & Layout Setup" textBoxSend = new NTextBox(); textBoxSend.Font = new Nevron.Nov.Graphics.NFont("Lucidia Console", 12); textBoxSend.VerticalPlacement = Nevron.Nov.Layout.ENVerticalPlacement.Center; textBoxSend.Margins = new Nevron.Nov.Graphics.NMargins(1, 3, 0, 3); textBoxSend.KeyUp += textBoxSend_KeyUp; buttonSend = new NButton("Envoyer"); buttonSend.PreferredWidth = 100; buttonSend.Content.HorizontalPlacement = Nevron.Nov.Layout.ENHorizontalPlacement.Center; buttonSend.Margins = new Nevron.Nov.Graphics.NMargins(3.0); buttonSend.Click += buttonSend_Click; panelSend = new NStackPanel(); panelSend.Direction = Nevron.Nov.Layout.ENHVDirection.LeftToRight; panelSend.FillMode = Nevron.Nov.Layout.ENStackFillMode.First; panelSend.Add(textBoxSend); panelSend.Add(buttonSend); listBoxChat = new NListBox(); listBoxChat.Margins = new Nevron.Nov.Graphics.NMargins(1.0); panelChat = new NStackPanel(); panelChat.Direction = Nevron.Nov.Layout.ENHVDirection.TopToBottom; panelChat.FillMode = Nevron.Nov.Layout.ENStackFillMode.First; panelChat.Add(listBoxChat); panelChat.Add(panelSend); labelChannel = new NLabel("/--/"); labelChannel.HorizontalPlacement = Nevron.Nov.Layout.ENHorizontalPlacement.Center; labelChannel.Font = new Nevron.Nov.Graphics.NFont("Lucidia Console", 14); listBoxUsers = new NListBox(); listBoxUsers.Margins = new Nevron.Nov.Graphics.NMargins(1.0); panelUsers = new NStackPanel(); panelUsers.Direction = Nevron.Nov.Layout.ENHVDirection.TopToBottom; panelUsers.FillMode = Nevron.Nov.Layout.ENStackFillMode.Last; panelUsers.Add(labelChannel); panelUsers.Add(listBoxUsers); panelUsers.PreferredWidth = 150; panelTabChat = new NStackPanel(); panelTabChat.FillMode = Nevron.Nov.Layout.ENStackFillMode.First; panelTabChat.Direction = Nevron.Nov.Layout.ENHVDirection.LeftToRight; panelTabChat.Add(panelChat); panelTabChat.Add(panelUsers); panelMain = new NStackPanel(); panelMain.Direction = Nevron.Nov.Layout.ENHVDirection.LeftToRight; panelMain.FillMode = Nevron.Nov.Layout.ENStackFillMode.Last; panelMain.Add(panelTabChat); panelRibbonInformations = new NStackPanel(); panelRibbonInformations.FillMode = Nevron.Nov.Layout.ENStackFillMode.Equal; labelRibbonChannel = new NLabel("Chaîne : /--/"); labelRibbonChannel.HorizontalPlacement = Nevron.Nov.Layout.ENHorizontalPlacement.Center; labelRibbonViewers = new NLabel("Nombre de spectateurs : /--/"); labelRibbonViewers.HorizontalPlacement = Nevron.Nov.Layout.ENHorizontalPlacement.Center; labelRibbonVersion = new NLabel("Version : " + Properties.Settings.Default.Version); labelRibbonVersion.HorizontalPlacement = Nevron.Nov.Layout.ENHorizontalPlacement.Center; panelRibbonInformations.Add(labelRibbonChannel); panelRibbonInformations.Add(labelRibbonViewers); panelRibbonInformations.Add(labelRibbonVersion); ribbonGroupInformations = new NRibbonGroup("Informations"); ribbonGroupInformations.Header.DialogLauncherButton.Visibility = ENVisibility.Hidden; ribbonGroupInformations.PreferredHeight = 64; ribbonGroupInformations.Items.Add(panelRibbonInformations); listBoxPlugins = new NListBox(); listBoxPlugins.VScrollMode = ENScrollMode.Always; listBoxPlugins.PreferredHeight = 64; listBoxPlugins.PreferredWidth = 256; ribbonGroupPlugins = new NRibbonGroup("Plugins"); ribbonGroupPlugins.Header.DialogLauncherButton.Visibility = ENVisibility.Hidden; ribbonGroupPlugins.Items.Add(listBoxPlugins); ribbonButtonConfiguration = new NRibbonButton("Configuration", NImage.FromFile(Application.StartupPath + @"\Resources\settings.png"), NImage.FromFile(Application.StartupPath + @"\Resources\settings.png")); ribbonButtonConfiguration.PreferredWidth = 86; ribbonButtonConfiguration.Click += ribbonButtonConfiguration_Click; ribbonButtonChannel = new NRibbonButton("Changer de chaîne", NImage.FromFile(Application.StartupPath + @"\Resources\move_shit_around.png"), NImage.FromFile(Application.StartupPath + @"\Resources\move_shit_around.png")); ribbonButtonChannel.PreferredWidth = 86; ribbonButtonChannel.Click += ribbonButtonChannel_Click; ribbonButtonQuit = new NRibbonButton("Quitter", NImage.FromFile(Application.StartupPath + @"\Resources\quit.png"), NImage.FromFile(Application.StartupPath + @"\Resources\quit.png")); ribbonButtonQuit.PreferredWidth = 86; ribbonButtonQuit.Click += ribbonButtonQuit_Click; ribbonGroupActions = new NRibbonGroup("Actions"); ribbonGroupActions.Header.DialogLauncherButton.Visibility = ENVisibility.Hidden; ribbonGroupActions.Items.Add(ribbonButtonConfiguration); ribbonGroupActions.Items.Add(ribbonButtonChannel); ribbonGroupActions.Items.Add(ribbonButtonQuit); ribbonTagPageMain = new NRibbonTabPage("Dagobar"); ribbonTagPageMain.Groups.Add(ribbonGroupInformations); ribbonTagPageMain.Groups.Add(ribbonGroupPlugins); ribbonTagPageMain.Groups.Add(ribbonGroupActions); ribbon = new NRibbon(); ribbon.Tab.TabPages.Add(ribbonTagPageMain); panelRibbon = new NStackPanel(); panelRibbon.FillMode = Nevron.Nov.Layout.ENStackFillMode.Last; panelRibbon.Add(ribbon); panelRibbon.Add(panelMain); #endregion // Create main control controlMain = new NNovWidgetHost<NStackPanel>(panelRibbon); controlMain.Dock = DockStyle.Fill; }