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_ContentPanel = new NStackPanel(); m_ContentPanel.VerticalSpacing = 3; // Create the first group box NGroupBox groupBox1 = new NGroupBox("Group Box 1"); m_ContentPanel.Add(groupBox1); NButton button = new NButton("Button inside group box"); groupBox1.Content = button; // Create the second group box NGroupBox groupBox2 = new NGroupBox("Group Box 2 - Centered Header"); groupBox2.Header.HorizontalPlacement = ENHorizontalPlacement.Center; m_ContentPanel.Add(groupBox2); NStackPanel stack1 = new NStackPanel(); groupBox2.Content = stack1; stack1.Add(new NLabel("Label 1 in stack")); stack1.Add(new NLabel("Label 2 in stack")); stack1.Add(new NLabel("Label 3 in stack")); return(m_ContentPanel); }
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 stackPanel = (NStackPanel)base.CreateExampleControls(); NButton showImageExportButton = new NButton("Show Raster Image Export Dialog..."); showImageExportButton.Click += OnShowImageExportButtonClick; stackPanel.Add(showImageExportButton); NButton copyImageToClipboardButton = new NButton("Copy Raster Image to Clipboard"); copyImageToClipboardButton.Click += OnCopyImageToClipboardButtonClick; stackPanel.Add(copyImageToClipboardButton); NButton saveAsRasterImageFileButton = new NButton("Save as Raster Image File..."); saveAsRasterImageFileButton.Click += OnSaveAsRasterImageFileButtonClick; stackPanel.Add(saveAsRasterImageFileButton); NButton saveAsVectorImageFileButton = new NButton("Save as Vector Image File..."); saveAsVectorImageFileButton.Click += OnSaveAsVectorImageFileButtonClick; stackPanel.Add(saveAsVectorImageFileButton); return(stackPanel); }
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(); // Create the example's content NButton openYAutoSizeWindowButton = new NButton("Open Y auto sizable Window..."); openYAutoSizeWindowButton.HorizontalPlacement = ENHorizontalPlacement.Left; openYAutoSizeWindowButton.VerticalPlacement = ENVerticalPlacement.Top; openYAutoSizeWindowButton.Click += new Function <NEventArgs>(OnOpenYAutoSizeWindowButtonClick); stack.Add(openYAutoSizeWindowButton); NButton openXAutoSizeWindowButton = new NButton("Open X auto sizable Window..."); openXAutoSizeWindowButton.HorizontalPlacement = ENHorizontalPlacement.Left; openXAutoSizeWindowButton.VerticalPlacement = ENVerticalPlacement.Top; openXAutoSizeWindowButton.Click += new Function <NEventArgs>(OnOpenXAutoSizeWindowButtonClick); stack.Add(openXAutoSizeWindowButton); NButton openAutoSizeWindowButton = new NButton("Open X and Y auto sizable and auto centered Window..."); openAutoSizeWindowButton.HorizontalPlacement = ENHorizontalPlacement.Left; openAutoSizeWindowButton.VerticalPlacement = ENVerticalPlacement.Top; openAutoSizeWindowButton.Click += new Function <NEventArgs>(OnOpenAutoSizeWindowButtonClick); stack.Add(openAutoSizeWindowButton); return(stack); }
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); }
private void AddToolBarItem(NToolBar toolBar, NImage image, string text, string tooltip) { NWidget item; if (text == null) { text = string.Empty; } if (image == null) { item = new NButton(text); } else { item = new NButton(NPairBox.Create(image, text)); } if (!string.IsNullOrEmpty(tooltip)) { item.Tooltip = new NTooltip(tooltip); } toolBar.Items.Add(item); NCommandBar.SetText(item, text); if (image != null) { NCommandBar.SetImage(item, (NImage)image.DeepClone()); } }
protected override NWidget CreateExampleControls() { NStackPanel stack = new NStackPanel(); NButton testBinarySerializationButton = new NButton("Test Binary Serialization"); testBinarySerializationButton.Tag = ENPersistencyFormat.Binary; testBinarySerializationButton.MouseDown += OnTestSerializationButtonMouseDown; testBinarySerializationButton.Click += OnTestSerializationButtonClick; stack.Add(testBinarySerializationButton); NButton testXmlSerializationButton = new NButton("Test XML Serialization"); testXmlSerializationButton.Tag = ENPersistencyFormat.Xml; testXmlSerializationButton.MouseDown += OnTestSerializationButtonMouseDown; testXmlSerializationButton.Click += OnTestSerializationButtonClick; stack.Add(testXmlSerializationButton); NButton clearLogButton = new NButton("Clear Log"); clearLogButton.Click += new Function <NEventArgs>(OnClearLogButtonClick); stack.Add(clearLogButton); return(stack); }
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; }
/// <summary> /// /// </summary> /// <returns></returns> protected override NWidget CreateExampleControls() { NStackPanel stack = new NStackPanel(); NUniSizeBoxGroup boxGroup = new NUniSizeBoxGroup(stack); NButton changeXValuesButton = new NButton("Change X Values"); changeXValuesButton.Click += new Function <NEventArgs>(OnChangeXValuesButtonClick); stack.Add(changeXValuesButton); NCheckBox xAxisRoundToTickCheckBox = new NCheckBox("X Axis Round To Tick"); xAxisRoundToTickCheckBox.CheckedChanged += new Function <NValueChangeEventArgs>(OnXAxisRoundToTickCheckBoxCheckedChanged); stack.Add(xAxisRoundToTickCheckBox); NCheckBox invertXAxisCheckBox = new NCheckBox("Invert X Axis"); invertXAxisCheckBox.CheckedChanged += new Function <NValueChangeEventArgs>(OnInvertXAxisCheckBoxCheckedChanged); stack.Add(invertXAxisCheckBox); NCheckBox invertYAxisCheckBox = new NCheckBox("Invert Y Axis"); invertYAxisCheckBox.CheckedChanged += new Function <NValueChangeEventArgs>(OnInvertYAxisCheckBoxCheckedChanged); stack.Add(invertYAxisCheckBox); return(boxGroup); }
protected override NWidget CreateExampleControls() { NStackPanel stack = new NStackPanel(); // Create the property editors NList <NPropertyEditor> editors = NDesigner.GetDesigner(m_Barcode).CreatePropertyEditors( m_Barcode, NMatrixBarcode.BackgroundFillProperty, NMatrixBarcode.TextFillProperty, NMatrixBarcode.ErrorCorrectionProperty, NMatrixBarcode.SizeModeProperty, NMatrixBarcode.ScaleProperty, NMatrixBarcode.TextProperty ); for (int i = 0, count = editors.Count; i < count; i++) { stack.Add(editors[i]); } NButton exportToSvgButton = new NButton("Export to SVG..."); exportToSvgButton.Click += OnExportToSvgButtonClick; stack.Add(exportToSvgButton); return(new NUniSizeBoxGroup(stack)); }
private void OnShowDialogButtonClick(NEventArgs arg1) { NStackPanel stack = new NStackPanel(); stack.Margins = new NMargins(10); stack.VerticalSpacing = 10; NButton openButton = new NButton("Open File..."); openButton.Content.HorizontalPlacement = ENHorizontalPlacement.Center; openButton.Click += new Function <NEventArgs>(OnOpenButtonClick); stack.Add(openButton); NButton saveButton = new NButton("Save to File..."); saveButton.Content.HorizontalPlacement = ENHorizontalPlacement.Center; saveButton.Click += new Function <NEventArgs>(OnSaveButtonClick); stack.Add(saveButton); NButtonStrip closeButtonStrip = new NButtonStrip(); closeButtonStrip.InitCloseButtonStrip(); stack.Add(closeButtonStrip); // create a dialog that is owned by this widget window NTopLevelWindow dialog = NApplication.CreateTopLevelWindow(); dialog.SetupDialogWindow("Show File Dialogs", false); dialog.Content = stack; dialog.Open(); }
/// <summary> /// /// </summary> /// <returns></returns> protected override NWidget CreateExampleControls() { NStackPanel stack = new NStackPanel(); NUniSizeBoxGroup group = new NUniSizeBoxGroup(stack); NComboBox hitTestModeComboBox = new NComboBox(); hitTestModeComboBox.FillFromEnum <ENHitTestMode>(); hitTestModeComboBox.SelectedIndexChanged += OnHitTestModeComboBoxSelectedIndexChanged; hitTestModeComboBox.SelectedIndex = (int)ENScaleOrientation.Auto; stack.Add(NPairBox.Create("Hit Test Mode:", hitTestModeComboBox)); NComboBox orientationComboBox = new NComboBox(); orientationComboBox.FillFromEnum <ENCartesianChartOrientation>(); orientationComboBox.SelectedIndex = (int)m_Chart.Orientation; orientationComboBox.SelectedIndexChanged += new Function <NValueChangeEventArgs>(OnOrientationComboBoxSelectedIndexChanged); stack.Add(NPairBox.Create("Orientation:", orientationComboBox)); NButton resetColorsButton = new NButton("Reset Colors"); resetColorsButton.Click += OnResetColorsButtonClick; stack.Add(resetColorsButton); return(group); }
private NWidget CreateComputerInfoWidget(NMobileCopmuterInfo info) { NStackPanel stack = new NStackPanel(); stack.Add(CreateHeaderLabel(info.Name)); // Create a pair box with the image and the description NLabel descriptionLabel = new NLabel(info.Description); descriptionLabel.TextWrapMode = ENTextWrapMode.WordWrap; NPairBox pairBox = new NPairBox(info.Image, descriptionLabel); pairBox.Box1.Border = NBorder.CreateFilledBorder(NColor.Black); pairBox.Box1.BorderThickness = new NMargins(1); pairBox.Spacing = 5; stack.Add(pairBox); NButton backButton = new NButton("Back"); backButton.Content.HorizontalPlacement = ENHorizontalPlacement.Center; backButton.Tag = 0; stack.Add(backButton); return(stack); }
protected override void LoadExample() { m_nFreeSeats = 0; m_nReservedSeats = 0; m_nRevenue = 0; view.BeginInit(); view.GlobalVisibility.ShowPorts = false; view.HorizontalRuler.Visible = false; view.VerticalRuler.Visible = false; view.ScrollBars = ScrollBars.None; view.Grid.Visible = false; document.BeginInit(); InitDocument(); document.EndInit(); view.EndInit(); // Init controls NButton button = new NButton(); button.Text = "Clear Reservations"; button.SetBounds(5, 5, commonControlsPanel.Width - 10, 20); button.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; button.Click += OnClearAllButtonClick; this.Controls.Add(button); }
protected override NWidget CreateExampleContent() { m_SingleVisiblePanel = new NSingleVisiblePanel(); m_SingleVisiblePanel.HorizontalPlacement = ENHorizontalPlacement.Left; m_SingleVisiblePanel.VerticalPlacement = ENVerticalPlacement.Top; m_SingleVisiblePanel.PreferredWidth = 400; m_SingleVisiblePanel.Border = NBorder.CreateFilledBorder(NColor.Red); m_SingleVisiblePanel.BorderThickness = new NMargins(1); NStackPanel mainStack = new NStackPanel(); m_SingleVisiblePanel.Add(mainStack); mainStack.Add(CreateHeaderLabel("Mobile Computers")); for (int i = 0, count = MobileComputers.Length; i < count; i++) { NMobileCopmuterInfo info = MobileComputers[i]; // Create the topic's button NButton button = new NButton(info.Name); button.Tag = i + 1; mainStack.Add(button); // Create and add the topic's content m_SingleVisiblePanel.Add(CreateComputerInfoWidget(info)); } m_SingleVisiblePanel.VisibleIndexChanged += new Function <NValueChangeEventArgs>(OnVisibleIndexValueChanged); m_SingleVisiblePanel.AddEventHandler(NButtonBase.ClickEvent, new NEventHandler <NEventArgs>(new Function <NEventArgs>(OnButtonClicked))); return(m_SingleVisiblePanel); }
/// <summary> /// /// </summary> /// <returns></returns> protected override NWidget CreateExampleControls() { NStackPanel stack = new NStackPanel(); NUniSizeBoxGroup boxGroup = new NUniSizeBoxGroup(stack); m_EnableInitialPositioningCheckBox = new NCheckBox("Enable Initial Positioning"); m_EnableInitialPositioningCheckBox.CheckedChanged += new Function <NValueChangeEventArgs>(OnEnableInitialPositioningCheckBoxCheckedChanged); stack.Add(m_EnableInitialPositioningCheckBox); m_RemoveOverlappedLabelsCheckBox = new NCheckBox("Remove Overlapped Labels"); m_RemoveOverlappedLabelsCheckBox.CheckedChanged += new Function <NValueChangeEventArgs>(OnRemoveOverlappedLabelsCheckBoxCheckedChanged); stack.Add(m_RemoveOverlappedLabelsCheckBox); m_EnableLabelAdjustmentCheckBox = new NCheckBox("Enable Label Adjustment"); m_EnableLabelAdjustmentCheckBox.CheckedChanged += new Function <NValueChangeEventArgs>(OnEnableLabelAdjustmentCheckBoxCheckedChanged); stack.Add(m_EnableLabelAdjustmentCheckBox); m_LocationsComboBox = new NComboBox(); m_LocationsComboBox.Items.Add(new NComboBoxItem("Top")); m_LocationsComboBox.Items.Add(new NComboBoxItem("Top - Bottom")); m_LocationsComboBox.SelectedIndexChanged += new Function <NValueChangeEventArgs>(OnLocationsComboBoxSelectedIndexChanged); stack.Add(m_LocationsComboBox); NButton generateDataButton = new NButton("Generate Data"); generateDataButton.Click += new Function <NEventArgs>(OnGenerateDataButtonClick); stack.Add(generateDataButton); m_EnableInitialPositioningCheckBox.Checked = true; m_RemoveOverlappedLabelsCheckBox.Checked = true; m_EnableLabelAdjustmentCheckBox.Checked = true; m_LocationsComboBox.SelectedIndex = 0; return(boxGroup); }
/// <summary> /// Called when some of the window action buttons has been clicked. /// </summary> /// <param name="args"></param> private void OnWindowActionButtonClicked(NEventArgs args) { if (m_TreeView.SelectedItem == null) { return; } NTopLevelWindow window = (m_TreeView.SelectedItem.Tag as NTopLevelWindow); if (window == null) { return; } NButton button = (NButton)args.TargetNode; NLabel label = (NLabel)button.Content; switch (label.Text) { case ActivateButtonText: window.Activate(); break; case FocusButtonText: window.Focus(); break; case CloseButtonText: window.Close(); break; } }
protected override NWidget CreateExampleControls() { NStackPanel stack = new NStackPanel(); NButton toggleTimerButton = new NButton("Stop Timer"); toggleTimerButton.Click += OnToggleTimerButtonClick; toggleTimerButton.Tag = 0; stack.Add(toggleTimerButton); NComboBox paletteColorModeCombo = new NComboBox(); paletteColorModeCombo.FillFromEnum <ENPaletteColorMode>(); paletteColorModeCombo.SelectedIndexChanged += OnPaletteColorModeComboSelectedIndexChanged; paletteColorModeCombo.SelectedIndex = (int)ENPaletteColorMode.Spread; stack.Add(NPairBox.Create("Palette Color Mode:", paletteColorModeCombo)); NCheckBox invertScaleCheckBox = new NCheckBox("Invert Scale"); invertScaleCheckBox.CheckedChanged += OnInvertScaleCheckBoxCheckedChanged; invertScaleCheckBox.Checked = false; stack.Add(invertScaleCheckBox); NCheckBox smoothPaletteCheckBox = new NCheckBox("Smooth Palette"); smoothPaletteCheckBox.CheckedChanged += OnSmoothPaletteCheckBoxCheckedChanged; smoothPaletteCheckBox.Checked = true; stack.Add(smoothPaletteCheckBox); return(stack); }
/// <summary> /// /// </summary> /// <returns></returns> protected override NWidget CreateExampleControls() { NStackPanel stack = new NStackPanel(); NUniSizeBoxGroup group = new NUniSizeBoxGroup(stack); NButton changeDataButton = new NButton("Change Data"); changeDataButton.Click += OnChangeDataButtonClick; stack.Add(changeDataButton); NButton saveStateToFileButton = new NButton("Save State To File..."); saveStateToFileButton.Click += OnSaveStateToFileButtonClick; stack.Add(saveStateToFileButton); NButton loadStateFromFileButton = new NButton("Load State From File..."); loadStateFromFileButton.Click += OnLoadStateFromFileButtonClick; stack.Add(loadStateFromFileButton); NButton saveStateToStreamButton = new NButton("Save State To Stream"); saveStateToStreamButton.Click += OnSaveStateToStreamButtonClick; stack.Add(saveStateToStreamButton); NButton loadStateFromStreamButton = new NButton("Load State from Stream"); loadStateFromStreamButton.Click += OnLoadStateFromStreamButtonClick; stack.Add(loadStateFromStreamButton); return(group); }
/// <summary> /// /// </summary> /// <returns></returns> protected override NWidget CreateExampleControls() { NStackPanel stack = new NStackPanel(); NUniSizeBoxGroup boxGroup = new NUniSizeBoxGroup(stack); NComboBox firstBarLabelFormatComboBox = CreateLabelFormatComboBox(); firstBarLabelFormatComboBox.SelectedIndexChanged += new Function <NValueChangeEventArgs>(OnFirstBarLabelFormatComboBoxSelectedIndexChanged); stack.Add(NPairBox.Create("First Bar Label Format: ", firstBarLabelFormatComboBox)); NComboBox secondBarLabelFormatComboBox = CreateLabelFormatComboBox(); secondBarLabelFormatComboBox.SelectedIndexChanged += new Function <NValueChangeEventArgs>(OnSecondBarLabelFormatComboBoxSelectedIndexChanged); stack.Add(NPairBox.Create("Second Bar Label Format: ", secondBarLabelFormatComboBox)); NComboBox thirdBarLabelFormatComboBox = CreateLabelFormatComboBox(); thirdBarLabelFormatComboBox.SelectedIndexChanged += new Function <NValueChangeEventArgs>(OnThirdBarLabelFormatComboBoxSelectedIndexChanged); stack.Add(NPairBox.Create("Third Bar Label Format: ", thirdBarLabelFormatComboBox)); NButton positiveDataButton = new NButton("Positive Values"); positiveDataButton.Click += new Function <NEventArgs>(OnPositiveDataButtonClick); stack.Add(positiveDataButton); NButton positiveAndNegativeDataButton = new NButton("Positive and Negative Values"); positiveAndNegativeDataButton.Click += new Function <NEventArgs>(OnPositiveAndNegativeDataButtonClick); stack.Add(positiveAndNegativeDataButton); return(boxGroup); }
/// <summary> /// Called when a request has been completed. Updates the item for the request. /// </summary> /// <param name="request"></param> private void UpdateRequestListBoxItem(NHttpRequest request, NHttpResponse response) { // first clear the boder of all items for (int i = 0; i < m_RequestsListBox.Items.Count; i++) { m_RequestsListBox.Items[i].Border = null; } // highlight the completed item in red NListBoxItem item = m_Request2ListBoxItem[request]; item.Border = NBorder.CreateFilledBorder(NColor.LightCoral); // update the group box header NGroupBox groupBox = (NGroupBox)item.Content; NLabel headerLabel = (NLabel)groupBox.Header.Content; headerLabel.Text += " Response Status: " + response.Status.ToString() + ", Received In: " + (response.ReceivedAt - request.SentAt).TotalSeconds.ToString() + " seconds"; // Disable the Abort button (the first button of the item (first descentant of type button)) NButton abortButton = (NButton)item.GetFirstDescendant(NIsFilter <NNode, NButton> .Instance); abortButton.Enabled = false; // Enable the Headers Button (the last button of the item) NButton headersButton = (NButton)item.GetLastDescendant(NIsFilter <NNode, NButton> .Instance); headersButton.Tag = new object[] { request, response }; headersButton.Enabled = true; }
private NWidget CreatePredefinedRequestsWidget() { NGroupBox groupBox = new NGroupBox("Predefined Requests"); NStackPanel stack = new NStackPanel(); groupBox.Content = stack; stack.Direction = ENHVDirection.LeftToRight; // get Google logo NButton getGoogleLogoButton = new NButton("Get Google LOGO"); getGoogleLogoButton.Click += new Function <NEventArgs>(GetGoogleLogoClick); stack.Add(getGoogleLogoButton); // get Google thml NButton getGoogleHtmlButton = new NButton("Get Google HTML"); getGoogleHtmlButton.Click += new Function <NEventArgs>(GetGoogleHtmlClick); stack.Add(getGoogleHtmlButton); // get wikipedia logo NButton getWikipediaLogoButton = new NButton("Get Wikipedia LOGO"); getWikipediaLogoButton.Click += new Function <NEventArgs>(OnGetWikipediaLogoClick); stack.Add(getWikipediaLogoButton); // get wikipedia home page HTML NButton getWikipediaHtmlButton = new NButton("Get Wikipedia HTML"); getWikipediaHtmlButton.Click += new Function <NEventArgs>(OnGetWikipediaHtmlClick); stack.Add(getWikipediaHtmlButton); return(groupBox); }
private void OnSwitchUIButtonClick(NEventArgs arg) { NButton switchUIButton = (NButton)arg.TargetNode; NLabel label = (NLabel)switchUIButton.Content; // Remove the rich text view from its parent m_RichText.ParentNode.RemoveChild(m_RichText); if (label.Text == SwitchToRibbon) { // We are in "Command Bars" mode, so switch to "Ribbon" label.Text = SwitchToCommandBars; // Create the ribbon m_ExampleTabPage.Content = m_RibbonBuilder.CreateUI(m_RichText); } else { // We are in "Ribbon" mode, so switch to "Command Bars" label.Text = SwitchToRibbon; // Create the command bars if (m_CommandBarBuilder == null) { m_CommandBarBuilder = new NRichTextCommandBarBuilder(); } m_ExampleTabPage.Content = m_CommandBarBuilder.CreateUI(m_RichText); } }
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); }
protected override NWidget CreateExampleControls() { NStackPanel stack = new NStackPanel(); stack.FitMode = ENStackFitMode.Last; stack.FillMode = ENStackFillMode.Last; // capture touch check m_CaptureTouchCheck = new NCheckBox("Capture Touch"); stack.Add(m_CaptureTouchCheck); // handle touch events check m_HandleTouchEventsCheck = new NCheckBox("Handle Touch Events"); stack.Add(m_HandleTouchEventsCheck); // track move events m_LogMoveEventsCheck = new NCheckBox("Track Move Events"); stack.Add(m_LogMoveEventsCheck); // Create clear canvas button NButton clearCanvasButton = new NButton("Clear Canvas"); clearCanvasButton.Click += clearCanvas_Click; stack.Add(clearCanvasButton); // Create the events log m_EventsLog = new NExampleEventsLog(); stack.Add(m_EventsLog); 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); }
/// <summary> /// /// </summary> /// <returns></returns> protected override NWidget CreateExampleControls() { NStackPanel stack = new NStackPanel(); NStackPanel propertyStack = new NStackPanel(); stack.Add(new NUniSizeBoxGroup(propertyStack)); m_BlueSectionBeginUpDown = CreateUpDown(0.0); propertyStack.Add(new NPairBox("Begin:", m_BlueSectionBeginUpDown, true)); m_BlueSectionEndUpDown = CreateUpDown(20.0); propertyStack.Add(new NPairBox("End:", m_BlueSectionEndUpDown, true)); m_RedSectionBeginUpDown = CreateUpDown(80.0); propertyStack.Add(new NPairBox("Begin:", m_RedSectionBeginUpDown, true)); m_RedSectionEndUpDown = CreateUpDown(100.0); propertyStack.Add(new NPairBox("End:", m_RedSectionEndUpDown, true)); m_StopStartTimerButton = new NButton("Stop Timer"); propertyStack.Add(m_StopStartTimerButton); return(stack); }
/// <summary> /// /// </summary> /// <returns></returns> protected override NWidget CreateExampleControls() { NStackPanel stack = new NStackPanel(); NUniSizeBoxGroup boxGroup = new NUniSizeBoxGroup(stack); NCheckBox enableInitialPositioningCheckBox = new NCheckBox("Enable Initial Positioning"); enableInitialPositioningCheckBox.CheckedChanged += new Function <NValueChangeEventArgs>(OnEnableInitialPositioningCheckBoxCheckedChanged); stack.Add(enableInitialPositioningCheckBox); NCheckBox enableLabelAdjustmentCheckBox = new NCheckBox("Enable Label Adjustment"); enableLabelAdjustmentCheckBox.CheckedChanged += new Function <NValueChangeEventArgs>(OnEnableLabelAdjustmentCheckBoxCheckedChanged); stack.Add(enableLabelAdjustmentCheckBox); NButton generateDataButton = new NButton("Generate Data"); generateDataButton.Click += new Function <NEventArgs>(OnGenerateDataButtonClick); stack.Add(generateDataButton); enableInitialPositioningCheckBox.Checked = true; enableLabelAdjustmentCheckBox.Checked = true; return(boxGroup); }
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; }