示例#1
0
        protected override NWidget CreateExampleContent()
        {
            // create a tab control for the different border walls
            NTab tab = new NTab();

            NTabPage boxBorderPage = new NTabPage("Box Border");

            tab.TabPages.Add(boxBorderPage);

            NTabPage crossBorderPage = new NTabPage("Cross Border");

            tab.TabPages.Add(crossBorderPage);

            NTabPage openBorderPage = new NTabPage("Opened Border");

            tab.TabPages.Add(openBorderPage);

            // create the three elements that demonstrate the border walls
            m_BoxBorderElement                = new NCustomBorderWallWidget();
            boxBorderPage.Content             = m_BoxBorderElement;
            m_BoxBorderElement.BorderWallType = ENCustomBorderWallType.Rectangle;

            m_CrossBorderElement                = new NCustomBorderWallWidget();
            crossBorderPage.Content             = m_CrossBorderElement;
            m_CrossBorderElement.BorderWallType = ENCustomBorderWallType.Cross;

            m_OpenedBorderElement  = new NCustomBorderWallWidget();
            openBorderPage.Content = m_OpenedBorderElement;
            m_OpenedBorderElement.BorderWallType = ENCustomBorderWallType.Opened;

            // init the custom border elements
            NCustomBorderWallWidget[] elements = GetCustomBorderElements();
            NUIThemeColorMap          colors   = new NUIThemeColorMap(ENUIThemeScheme.WindowsClassic);

            for (int i = 0; i < elements.Length; i++)
            {
                elements[i].BorderThickness = new NMargins(2);
                elements[i].Border          = NBorder.CreateRaised3DBorder(colors);
                elements[i].Margins         = new NMargins(10);
            }

            return(tab);
        }
示例#2
0
        protected override NWidget CreateExampleContent()
        {
            // Create a table layout panel
            NTableFlowPanel table = new NTableFlowPanel();

            table.Padding           = new NMargins(10);
            table.BackgroundFill    = new NColorFill(NColor.White);
            table.MaxOrdinal        = 3;
            table.HorizontalSpacing = 10;
            table.VerticalSpacing   = 10;
            table.ColFillMode       = ENStackFillMode.Equal;
            table.ColFitMode        = ENStackFitMode.Equal;
            table.RowFitMode        = ENStackFitMode.Equal;
            table.RowFillMode       = ENStackFillMode.None;
            table.UniformWidths     = ENUniformSize.Max;
            table.UniformHeights    = ENUniformSize.Max;

            // add some predefined borders
            // 3D Borders
            NUIThemeColorMap map = new NUIThemeColorMap(ENUIThemeScheme.WindowsClassic);

            table.Add(CreateBorderedWidget("3D Border",
                                           NBorder.Create3DBorder(NColor.Green.Lighten().Lighten(), NColor.Green.Lighten(), NColor.Green.Darken(), NColor.Green)
                                           ));
            table.Add(CreateBorderedWidget("Raised Border (using Theme Colors)",
                                           NBorder.CreateRaised3DBorder(map)
                                           ));
            table.Add(CreateBorderedWidget("Sunken Border (using Theme Colors)",
                                           NBorder.CreateSunken3DBorder(map)
                                           ));

            // Filled Borders
            table.Add(CreateBorderedWidget("Solid Color",
                                           NBorder.CreateFilledBorder(NColor.Red)
                                           ));
            table.Add(CreateBorderedWidget("Solid Color With Rounded Corners",
                                           NBorder.CreateFilledBorder(NColor.Blue, 10, 13)
                                           ));
            table.Add(CreateBorderedWidget("Gradient Filling With Outline",
                                           NBorder.CreateFilledBorder(NFill.CreatePredefined(ENPredefinedFillPattern.GradientVertical, NColor.Red, NColor.Blue), new NStroke(1, NColor.Green), new NStroke(1, NColor.Green))
                                           ));

            // Outer Outline Borders
            table.Add(CreateBorderedWidget("Outer Outline Border",
                                           NBorder.CreateOuterOutlineBorder(new NStroke(1, NColor.Red, ENDashStyle.Dash))
                                           ));
            table.Add(CreateBorderedWidget("Outer Outline Border with Rounding",
                                           NBorder.CreateOuterOutlineBorder(new NStroke(1, NColor.Red, ENDashStyle.Dash), 10)
                                           ));
            table.Add(CreateBorderedWidget("Outer Outline Border",
                                           NBorder.CreateOuterOutlineBorder(new NStroke(1, NColor.Red, ENDashStyle.Dash))
                                           ));
            table.Add(CreateBorderedWidget("Outer Outline Border with Rounding",
                                           NBorder.CreateOuterOutlineBorder(new NStroke(1, NColor.Red, ENDashStyle.Dash), 10)
                                           ));

            // Inner Outline Borders
            table.Add(CreateBorderedWidget("Inner Outline Border",
                                           NBorder.CreateInnerOutlineBorder(new NStroke(1, NColor.Red, ENDashStyle.Dash))
                                           ));
            table.Add(CreateBorderedWidget("Inner Outline Border with Rounding",
                                           NBorder.CreateInnerOutlineBorder(new NStroke(1, NColor.Green, ENDashStyle.Dash), 10)
                                           ));
            table.Add(CreateBorderedWidget("Inner Outline Border",
                                           NBorder.CreateInnerOutlineBorder(new NStroke(1, NColor.Green, ENDashStyle.Dash))
                                           ));
            table.Add(CreateBorderedWidget("Inner Outline Border with Rounding",
                                           NBorder.CreateInnerOutlineBorder(new NStroke(1, NColor.Green, ENDashStyle.Dash), 10)
                                           ));

            // Double border
            table.Add(CreateBorderedWidget("Double Border",
                                           NBorder.CreateDoubleBorder(NColor.Blue)
                                           ));

            table.Add(CreateBorderedWidget("Double Border with Two Colors",
                                           NBorder.CreateDoubleBorder(NColor.Blue, NColor.Red)
                                           ));

            table.Add(CreateBorderedWidget("Double Border with Two Colors and Rounding",
                                           NBorder.CreateDoubleBorder(NColor.Blue, NColor.Red, 10, 12)
                                           ));

            // Two color borders
            table.Add(CreateBorderedWidget("Two Colors Border",
                                           NBorder.CreateTwoColorBorder(NColor.Blue, NColor.Red)
                                           ));

            table.Add(CreateBorderedWidget("Two Colors Border with Rounding",
                                           NBorder.CreateTwoColorBorder(NColor.Blue, NColor.Red, 10, 12)
                                           ));

            // Three color borders
            table.Add(CreateBorderedWidget("Three Colors Border",
                                           NBorder.CreateThreeColorBorder(NColor.Red, NColor.Green, NColor.Blue)
                                           ));

            table.Add(CreateBorderedWidget("Three Colors Border with Rounding",
                                           NBorder.CreateThreeColorBorder(NColor.Red, NColor.Green, NColor.Blue, 10, 12)
                                           ));

            return(table);
        }