예제 #1
0
        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);
        }
예제 #2
0
        /// <summary>
        /// Creates a group box for the given group element or a directly a table panel if the
        /// given group element does not have a name. Group elements can contain only tile
        /// elements, label elements and other group elements.
        /// </summary>
        /// <param name="group"></param>
        /// <param name="borderColor"></param>
        /// <returns></returns>
        private NWidget CreateGroup(NXmlElement group, NColor borderColor)
        {
            // Create a table panel
            NTableFlowPanel tablePanel = CreateTablePanel(group, borderColor);

            // Get the group title
            string groupTitle = group.GetAttributeValue("name");

            if (String.IsNullOrEmpty(groupTitle))
            {
                return(tablePanel);
            }

            // Create a group box
            NLabel    headerLabel = new NLabel(groupTitle);
            NGroupBox groupBox    = new NGroupBox(headerLabel);

            groupBox.Header.HorizontalPlacement = ENHorizontalPlacement.Center;
            groupBox.Padding = new NMargins(ItemVerticalSpacing);
            groupBox.Border  = NBorder.CreateFilledBorder(borderColor);

            // Create the table panel with the examples tiles
            groupBox.Content = CreateTablePanel(group, borderColor);

            return(groupBox);
        }
예제 #3
0
        private NTable CreateTable()
        {
            NTable table = new NTable();

            int rowCount = 3;
            int colCount = 3;

            // first create the columns
            for (int i = 0; i < colCount; i++)
            {
                table.Columns.Add(new NTableColumn());
            }

            // then add rows with cells count matching the number of columns
            for (int row = 0; row < rowCount; row++)
            {
                NTableRow tableRow = new NTableRow();
                table.Rows.Add(tableRow);

                for (int col = 0; col < colCount; col++)
                {
                    NTableCell tableCell = new NTableCell();
                    tableRow.Cells.Add(tableCell);
                    tableCell.Margins = new NMargins(4);

                    tableCell.Border          = NBorder.CreateFilledBorder(NColor.Black);
                    tableCell.BorderThickness = new NMargins(1);

                    NParagraph paragraph = new NParagraph("This is table cell [" + row.ToString() + ", " + col.ToString() + "]");
                    tableCell.Blocks.Add(paragraph);
                }
            }

            return(table);
        }
예제 #4
0
        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);
        }
예제 #5
0
        private NShape CreateLabelShape(string text)
        {
            NShape labelShape = new NShape();

            // Configure shape
            labelShape.SetBounds(0, 0, 100, 30);
            labelShape.SetProtectionMask(ENDiagramItemOperationMask.All);
            labelShape.CanSplit  = false;
            labelShape.GraphPart = false;
            labelShape.RouteThroughHorizontally = true;
            labelShape.RouteThroughVertically   = true;

            // Set text and make text block resize to text
            labelShape.Text = text;
            ((NTextBlock)labelShape.TextBlock).ResizeMode = ENTextBlockResizeMode.TextSize;

            // Set text background and border
            labelShape.TextBlock.BackgroundFill  = new NColorFill(NColor.White);
            labelShape.TextBlock.Border          = NBorder.CreateFilledBorder(NColor.Black);
            labelShape.TextBlock.BorderThickness = new NMargins(1);
            labelShape.TextBlock.Padding         = new NMargins(2);

            // Add a port to the shape
            labelShape.Ports.Add(new NPort(0.5, 0.5, true));

            return(labelShape);
        }
예제 #6
0
        /// <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;
        }
예제 #7
0
        protected override NWidget CreateExampleContent()
        {
            // Create the rich text
            m_RichText            = new NRichTextView();
            m_RichText.AcceptsTab = true;
            m_RichText.Content.Sections.Clear();

            NSection section = new NSection();

            section.Blocks.Add(new NParagraph("Type some content here"));
            m_RichText.Content.Sections.Add(section);

            m_RichText.Content.Layout    = ENTextLayout.Web;
            m_RichText.VScrollMode       = ENScrollMode.Never;
            m_RichText.HScrollMode       = ENScrollMode.Never;
            m_RichText.HRuler.Visibility = ENVisibility.Hidden;
            m_RichText.VRuler.Visibility = ENVisibility.Hidden;
            m_RichText.PreferredWidth    = double.NaN;
            m_RichText.PreferredHeight   = double.NaN;
            m_RichText.Border            = NBorder.CreateFilledBorder(NColor.Black);
            m_RichText.BorderThickness   = new NMargins(1);

            m_RichText.HorizontalPlacement = Layout.ENHorizontalPlacement.Fit;
            m_RichText.VerticalPlacement   = Layout.ENVerticalPlacement.Top;

            return(m_RichText);
        }
예제 #8
0
        /// <summary>
        /// Creates the NOV description label placed in the header.
        /// </summary>
        /// <returns></returns>
        private NLabel CreateHeaderLabel()
        {
            NColor transparentWhite     = new NColor(NColor.White, 0);
            NColor textColor            = NExamplesHomePage.HeaderColor;
            NColor transparentTextColor = new NColor(textColor, 0);

            NLabel headerLabel = new NLabel("Enterprise-grade UI controls suite for .NET development on Windows and Mac");

            // Background and border
            headerLabel.BackgroundFill = new NLinearGradientFill(NAngle.Zero, new NColor[] {
                transparentWhite, NColor.White, NColor.White, transparentWhite
            });

            NBorder border = new NBorder();

            border.TopSide = new NBorderSide(new NLinearGradientFill(NAngle.Zero, new NColor[] {
                transparentTextColor, textColor, textColor, transparentTextColor
            }));
            border.BottomSide = new NBorderSide(new NLinearGradientFill(NAngle.Zero, new NColor[] {
                transparentTextColor, textColor, transparentTextColor
            }));
            headerLabel.Border          = border;
            headerLabel.BorderThickness = new NMargins(0, 1, 0, 1);

            // Text style
            headerLabel.TextFill = new NColorFill(textColor);
            headerLabel.Font     = new NFont(NFontDescriptor.DefaultSansFamilyName, HeaderFontSize);

            // Box model
            headerLabel.Padding             = new NMargins(0, LaneSpacing);
            headerLabel.HorizontalPlacement = ENHorizontalPlacement.Center;

            return(headerLabel);
        }
예제 #9
0
            public override NDocumentBlock CreateDocument()
            {
                NDocumentBlock document = base.CreateDocument();

                NSection   section = document.Sections[0];
                NParagraph p       = new NParagraph("Black solid border");

                section.Blocks.Add(p);
                p.Border          = NBorder.CreateFilledBorder(NColor.Black);
                p.BorderThickness = new NMargins(1);

                p = new NParagraph("Black dashed border");
                section.Blocks.Add(p);
                p.Border = new NBorder();
                p.Border.MiddleStroke = new NStroke(5, NColor.Black, ENDashStyle.Dash);
                p.BorderThickness     = new NMargins(5);

                p = new NParagraph("Green/DarkGreen two-color border");
                section.Blocks.Add(p);
                p.Border          = NBorder.CreateTwoColorBorder(NColor.Green, NColor.DarkGreen);
                p.BorderThickness = new NMargins(10);

                p = new NParagraph("A border with left, right and bottom sides and wide but not set top side");
                section.Blocks.Add(p);
                p.Border                       = new NBorder();
                p.Border.LeftSide              = new NThreeColorsBorderSide(NColor.Black, NColor.Gray, NColor.LightGray);
                p.Border.RightSide             = new NBorderSide();
                p.Border.RightSide.OuterStroke = new NStroke(10, NColor.Blue, ENDashStyle.Dot);
                p.Border.BottomSide            = new NBorderSide(NColor.Red);
                p.BorderThickness              = new NMargins(9, 50, 5, 5);

                return(document);
            }
예제 #10
0
        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);
        }
예제 #11
0
        protected override NWidget CreateExampleContent()
        {
            m_Label                 = new NLabel();
            m_Label.Border          = NBorder.CreateFilledBorder(NColor.Red);
            m_Label.BorderThickness = new NMargins(1);

            return(m_Label);
        }
예제 #12
0
        /// <summary>
        /// Creates a left tag border with the specified border
        /// </summary>
        /// <param name="color"></param>
        /// <returns></returns>
        private static NBorder CreateLeftTagBorder(NColor color)
        {
            NBorder border = new NBorder();

            border.LeftSide      = new NBorderSide();
            border.LeftSide.Fill = new NColorFill(color);

            return(border);
        }
예제 #13
0
        /// <summary>
        /// Creates a table cell with border
        /// </summary>
        /// <returns></returns>
        private NTableCell CreateTableCellWithBorder()
        {
            NTableCell tableCell = new NTableCell();

            tableCell.Border          = NBorder.CreateFilledBorder(NColor.Black);
            tableCell.BorderThickness = new NMargins(1);

            return(tableCell);
        }
        protected override void PopulateRichText()
        {
            NSection section = new NSection();

            m_RichText.Content.Sections.Add(section);

            section.Blocks.Add(GetDescriptionBlock("Table Master Cells Example", "This example shows how to programmatically create and add master cells.", 1));

            // first create the table
            NTable table = new NTable(5, 5);

            table.AllowSpacingBetweenCells = false;

            for (int row = 0; row < table.Rows.Count; row++)
            {
                for (int col = 0; col < table.Columns.Count; col++)
                {
                    NParagraph paragraph = new NParagraph("Normal Cell");

                    NTableCell tableCell = table.Rows[row].Cells[col];
                    tableCell.BorderThickness = new Nov.Graphics.NMargins(1);
                    tableCell.Border          = NBorder.CreateFilledBorder(NColor.Black);

                    // by default cells contain a single paragraph
                    tableCell.Blocks.Clear();
                    tableCell.Blocks.Add(paragraph);
                }
            }

            // set cell [0, 2] to be column master
            NTableCell colMasterCell = table.Rows[0].Cells[2];

            colMasterCell.ColSpan        = 2;
            colMasterCell.BackgroundFill = new NColorFill(ENNamedColor.LightSkyBlue);
            colMasterCell.Blocks.Clear();
            colMasterCell.Blocks.Add(new NParagraph("Column Master Cell"));

            // set cell [1, 0] to be row master
            NTableCell rowMasterCell = table.Rows[1].Cells[0];

            rowMasterCell.RowSpan        = 2;
            rowMasterCell.BackgroundFill = new NColorFill(ENNamedColor.LightSteelBlue);
            rowMasterCell.Blocks.Clear();
            rowMasterCell.Blocks.Add(new NParagraph("Row Master Cell"));

            // set cell [2, 2] to be column and row master
            NTableCell rowColMasterCell = table.Rows[2].Cells[2];

            rowColMasterCell.ColSpan        = 2;
            rowColMasterCell.RowSpan        = 2;
            rowColMasterCell.BackgroundFill = new NColorFill(ENNamedColor.MediumTurquoise);
            rowColMasterCell.Blocks.Clear();
            rowColMasterCell.Blocks.Add(new NParagraph("Row\\Col Master Cell"));

            section.Blocks.Add(table);
        }
예제 #15
0
        protected override NWidget CreateExampleContent()
        {
            m_Barcode                 = new NMatrixBarcode();
            m_Barcode.Symbology       = ENMatrixBarcodeSymbology.Pdf417;
            m_Barcode.Text            = "Nevron Software";
            m_Barcode.Border          = NBorder.CreateFilledBorder(NColor.Red);
            m_Barcode.BorderThickness = new NMargins(1);

            return(m_Barcode);
        }
예제 #16
0
        protected override NWidget CreateExampleContent()
        {
            // create a dummy button
            NButton button = new NButton("I can be transformed");

            m_TransformContent = new NTransformContent(button);
            m_TransformContent.BorderThickness = new NMargins(1);
            m_TransformContent.Border          = NBorder.CreateFilledBorder(NColor.Red);
            return(m_TransformContent);
        }
예제 #17
0
        protected override NWidget CreateExampleContent()
        {
            m_Barcode                 = new NMatrixBarcode();
            m_Barcode.Symbology       = ENMatrixBarcodeSymbology.QrCode;
            m_Barcode.Text            = "Nevron Software\r\n\r\nhttps://www.nevron.com";
            m_Barcode.Border          = NBorder.CreateFilledBorder(NColor.Red);
            m_Barcode.BorderThickness = new NMargins(1);

            return(m_Barcode);
        }
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Legend Appearance";

            m_Legend            = chartView.Surface.Legends[0];
            m_Legend.ExpandMode = ENLegendExpandMode.ColsFixed;
            m_Legend.ColCount   = 3;

            m_Legend.Border            = NBorder.CreateFilledBorder(NColor.Black);
            m_Legend.BorderThickness   = new NMargins(2);
            m_Legend.BackgroundFill    = new NStockGradientFill(NColor.White, NColor.LightGray);
            m_Legend.VerticalPlacement = Layout.ENVerticalPlacement.Top;

            // configure chart
            NCartesianChart chart = (NCartesianChart)chartView.Surface.Charts[0];

            chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XOrdinalYLinear);

            // add interlace stripe
            NLinearScale linearScale = chart.Axes[ENCartesianAxis.PrimaryY].Scale as NLinearScale;
            NScaleStrip  strip       = new NScaleStrip(new NColorFill(ENNamedColor.Beige), null, true, 0, 0, 1, 1);

            strip.Interlaced = true;
            //linearScale.Strips.Add(strip);

            // setup a bar series
            NBarSeries bar = new NBarSeries();

            bar.Name            = "Bar Series";
            bar.InflateMargins  = true;
            bar.UseXValues      = false;
            bar.LegendView.Mode = ENSeriesLegendMode.DataPoints;

            // add some data to the bar series
            bar.LegendView.Mode = ENSeriesLegendMode.DataPoints;
            bar.DataPoints.Add(new NBarDataPoint(18, "C++"));
            bar.DataPoints.Add(new NBarDataPoint(15, "Ruby"));
            bar.DataPoints.Add(new NBarDataPoint(21, "Python"));
            bar.DataPoints.Add(new NBarDataPoint(23, "Java"));
            bar.DataPoints.Add(new NBarDataPoint(27, "Javascript"));
            bar.DataPoints.Add(new NBarDataPoint(29, "C#"));
            bar.DataPoints.Add(new NBarDataPoint(26, "PHP"));
            bar.DataPoints.Add(new NBarDataPoint(17, "Objective C"));
            bar.DataPoints.Add(new NBarDataPoint(24, "SQL"));
            bar.DataPoints.Add(new NBarDataPoint(13, "Object Pascal"));
            bar.DataPoints.Add(new NBarDataPoint(19, "Visual Basic"));
            bar.DataPoints.Add(new NBarDataPoint(16, "Open Edge ABL"));

            chart.Series.Add(bar);

            return(chartView);
        }
        protected override NWidget CreateExampleContent()
        {
            // Create an image box
            m_ImageBox                     = new NImageBox(NResources.Image_SampleImage_png);
            m_ImageBox.Border              = NBorder.CreateFilledBorder(NColor.Red);
            m_ImageBox.BorderThickness     = new NMargins(1);
            m_ImageBox.HorizontalPlacement = ENHorizontalPlacement.Left;
            m_ImageBox.VerticalPlacement   = ENVerticalPlacement.Top;

            return(m_ImageBox);
        }
예제 #20
0
        private NContentHolder CreateDemoElement(string text)
        {
            NContentHolder element = new NContentHolder(text);

            element.Border          = NBorder.CreateFilledBorder(NColor.Black, 2, 5);
            element.BorderThickness = new NMargins(1);
            element.BackgroundFill  = new NColorFill(NColor.PapayaWhip);
            element.TextFill        = new NColorFill(NColor.Black);
            element.Padding         = new NMargins(1);
            return(element);
        }
예제 #21
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected NParagraph CreateSampleParagraph1(string text)
        {
            NParagraph paragraph = new NParagraph(GetRepeatingText(text, 10));

            paragraph.Margins         = new NMargins(10);
            paragraph.BorderThickness = new NMargins(10);
            paragraph.Padding         = new NMargins(10);
            paragraph.Border          = NBorder.CreateFilledBorder(NColor.Red);
            paragraph.BackgroundFill  = new NStockGradientFill(NColor.White, NColor.LightYellow);

            return(paragraph);
        }
예제 #22
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected NParagraph CreateSampleParagraph1()
        {
            NParagraph paragraph = new NParagraph("This paragraph has margins, border thickness and padding of 10dips.");

            paragraph.Margins         = new NMargins(10);
            paragraph.BorderThickness = new NMargins(10);
            paragraph.Padding         = new NMargins(10);
            paragraph.Border          = NBorder.CreateFilledBorder(NColor.Red);
            paragraph.BackgroundFill  = new NStockGradientFill(NColor.White, NColor.LightYellow);

            return(paragraph);
        }
예제 #23
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected NParagraph CreateFloatingParagraph(ENFloatMode floatMode)
        {
            NParagraph paragraph = new NParagraph(floatMode.ToString() + " flow paragraph.");

            paragraph.FloatMode       = floatMode;
            paragraph.PreferredWidth  = new NMultiLength(ENMultiLengthUnit.Dip, 100);
            paragraph.PreferredHeight = new NMultiLength(ENMultiLengthUnit.Dip, 100);
            paragraph.BorderThickness = new NMargins(1);
            paragraph.Border          = NBorder.CreateFilledBorder(NColor.Black);

            return(paragraph);
        }
        protected override void PopulateRichText()
        {
            NSection section = new NSection();

            m_RichText.Content.Sections.Add(section);

            section.Blocks.Add(GetDescriptionBlock("Table Cell Orientation Example", "This example shows how to programmatically modify the orientation of cells.", 1));

            // first create the table
            NTable table = new NTable(5, 5);

            table.AllowSpacingBetweenCells = false;

            for (int row = 0; row < table.Rows.Count; row++)
            {
                for (int col = 0; col < table.Columns.Count; col++)
                {
                    NParagraph paragraph = new NParagraph("Normal Cell");

                    NTableCell tableCell = table.Rows[row].Cells[col];
                    tableCell.BorderThickness = new Nov.Graphics.NMargins(1);
                    tableCell.Border          = NBorder.CreateFilledBorder(NColor.Black);

                    // by default cells contain a single paragraph
                    tableCell.Blocks.Clear();
                    tableCell.Blocks.Add(paragraph);
                }
            }

            // set cell [1, 0] to be row master
            NTableCell leftToRightCell = table.Rows[1].Cells[0];

            leftToRightCell.RowSpan        = int.MaxValue;
            leftToRightCell.BackgroundFill = new NColorFill(ENNamedColor.LightSteelBlue);
            leftToRightCell.Blocks.Clear();
            leftToRightCell.Blocks.Add(new NParagraph("Cell With Left to Right Orientation"));
            leftToRightCell.TextDirection       = ENTableCellTextDirection.LeftToRight;
            leftToRightCell.HorizontalAlignment = ENAlign.Center;
            leftToRightCell.VerticalAlignment   = ENVAlign.Center;

            // set cell [1, 0] to be row master
            NTableCell rightToLeftCell = table.Rows[1].Cells[table.Columns.Count - 1];

            rightToLeftCell.RowSpan        = int.MaxValue;
            rightToLeftCell.BackgroundFill = new NColorFill(ENNamedColor.LightGreen);
            rightToLeftCell.Blocks.Clear();
            rightToLeftCell.Blocks.Add(new NParagraph("Cell With Right to Left Orientation"));
            rightToLeftCell.TextDirection       = ENTableCellTextDirection.RightToLeft;
            rightToLeftCell.HorizontalAlignment = ENAlign.Center;
            rightToLeftCell.VerticalAlignment   = ENVAlign.Center;

            section.Blocks.Add(table);
        }
예제 #25
0
        /// <summary>
        ///
        /// </summary>
        protected override void PopulateRichText()
        {
            m_RichText.Content.Layout     = ENTextLayout.Print;
            m_RichText.Content.ZoomFactor = 0.5;

            for (int sectionIndex = 0; sectionIndex < 4; sectionIndex++)
            {
                NSection section = new NSection();

                section.Margins = NMargins.Zero;
                section.Padding = NMargins.Zero;

                string sectionText = string.Empty;

                switch (sectionIndex)
                {
                case 0:
                    sectionText       = "Paper size A4.";
                    section.PageSize  = new NPageSize(ENPaperKind.A4);
                    section.BreakType = ENSectionBreakType.NextPage;
                    section.Blocks.Add(GetDescriptionBlock("Section Pages", "This example shows how to set different page properties, like page size, page orientation and page border", 1));
                    break;

                case 1:
                    sectionText       = "Paper size A5.";
                    section.PageSize  = new NPageSize(ENPaperKind.A5);
                    section.BreakType = ENSectionBreakType.NextPage;
                    break;

                case 2:
                    sectionText             = "Paper size A4, paper orientation portrait.";
                    section.PageOrientation = ENPageOrientation.Landscape;
                    section.PageSize        = new NPageSize(ENPaperKind.A4);
                    section.BreakType       = ENSectionBreakType.NextPage;
                    break;

                case 3:
                    sectionText                 = "Paper size A4, page border solid 10dip.";
                    section.PageBorder          = NBorder.CreateFilledBorder(NColor.Black);
                    section.PageBorderThickness = new NMargins(10);
                    section.PageSize            = new NPageSize(ENPaperKind.A4);
                    section.BreakType           = ENSectionBreakType.NextPage;
                    break;
                }

                m_RichText.Content.Sections.Add(section);

                // add some content
                NParagraph paragraph = new NParagraph(sectionText);
                section.Blocks.Add(paragraph);
            }
        }
예제 #26
0
        /// <summary>
        /// Creates a simple label that demonstrates the specified border.
        /// </summary>
        /// <param name="text"></param>
        /// <param name="border"></param>
        /// <returns></returns>
        private NWidget CreateBorderedWidget(string text, NBorder border)
        {
            NLabel label = new NLabel(text);

            label.HorizontalPlacement = ENHorizontalPlacement.Fit;
            label.VerticalPlacement   = ENVerticalPlacement.Fit;
            label.Padding             = new NMargins(10);

            label.Border          = border;
            label.BorderThickness = new NMargins(5);

            return(label);
        }
예제 #27
0
        protected override NWidget CreateExampleContent()
        {
            m_WrapFlowPanel                 = new NWrapFlowPanel();
            m_WrapFlowPanel.Border          = NBorder.CreateFilledBorder(NColor.Red);
            m_WrapFlowPanel.BorderThickness = new NMargins(1);

            for (int i = 1; i <= 16; i++)
            {
                m_WrapFlowPanel.Add(new NButton("Button " + i.ToString()));
            }

            return(m_WrapFlowPanel);
        }
예제 #28
0
        /// <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);
        }
예제 #29
0
        /// <summary>
        /// Creates the default docked widget for this example, that is docked to the specified area.
        /// </summary>
        /// <param name="dockArea"></param>
        /// <returns></returns>
        private NWidget CreateDockedWidget(ENDockArea dockArea)
        {
            NLabel label = new NLabel(dockArea.ToString() + "(" + m_DockPanel.Count.ToString() + ")");

            label.HorizontalPlacement = ENHorizontalPlacement.Center;
            label.VerticalPlacement   = ENVerticalPlacement.Center;

            NWidget widget = new NContentHolder(label);

            widget.Border          = NBorder.CreateFilledBorder(NColor.Black);
            widget.BorderThickness = new NMargins(1);
            SetDockArea(widget, dockArea);
            return(widget);
        }
예제 #30
0
        private NWidget CreateBoxContent(string text, NColor borderColor)
        {
            NLabel label = new NLabel(text);

            label.HorizontalPlacement = ENHorizontalPlacement.Center;
            label.VerticalPlacement   = ENVerticalPlacement.Center;

            NContentHolder contentElement = new NContentHolder(label);

            contentElement.Border          = NBorder.CreateFilledBorder(borderColor);
            contentElement.BorderThickness = new NMargins(1);
            contentElement.Padding         = new NMargins(2);

            return(contentElement);
        }