protected override NWidget CreateExampleControls()
        {
            NStackPanel stack = new NStackPanel();

            // Create radio buttons for the different data groupings
            stack.Add(new NRadioButton("Optimal"));
            stack.Add(new NRadioButton("Equal Interval"));
            stack.Add(new NRadioButton("Equal Distribution"));

            // Create a radio button group to hold the radio buttons
            NRadioButtonGroup group = new NRadioButtonGroup(stack);

            group.SelectedIndex         = 0;
            group.SelectedIndexChanged += OnDataGroupingSelectedIndexChanged;

            // Create the data grouping group box
            NGroupBox dataGroupingGroupBox = new NGroupBox("Data Grouping", group);

            // Add the data grouping group box to the parent stack
            NStackPanel parentStack = (NStackPanel)base.CreateExampleControls();

            parentStack.Add(dataGroupingGroupBox);

            return(parentStack);
        }
Exemplo n.º 2
0
        protected override NWidget CreateExampleContent()
        {
            NTab tab = new NTab();

            // create a tab page with vertically arranged radio buttons
            NTabPage verticalTabPage = new NTabPage("Vertical Radio Group");

            tab.TabPages.Add(verticalTabPage);

            NRadioButtonGroup verticalRadioGroup = new NRadioButtonGroup();

            verticalRadioGroup.HorizontalPlacement = ENHorizontalPlacement.Left;
            verticalRadioGroup.VerticalPlacement   = ENVerticalPlacement.Top;
            verticalTabPage.Content = verticalRadioGroup;

            NStackPanel verticalStack = new NStackPanel();

            verticalRadioGroup.Content = verticalStack;

            for (int i = 0; i < 5; i++)
            {
                NRadioButton radioButton = new NRadioButton("Item " + i.ToString());
                verticalStack.Add(radioButton);
            }

            NRadioButton disabledRadioButton1 = new NRadioButton("Disabled");

            disabledRadioButton1.Enabled = false;
            verticalStack.Add(disabledRadioButton1);
            verticalRadioGroup.SelectedIndexChanged += OnVerticalRadioGroupSelectedIndexChanged;

            // create a tab page with horizontally arranged radio buttons
            NTabPage horizontalTabPage = new NTabPage("Horizontal Radio Group");

            tab.TabPages.Add(horizontalTabPage);

            NRadioButtonGroup horizontalRadioGroup = new NRadioButtonGroup();

            horizontalRadioGroup.VerticalPlacement   = ENVerticalPlacement.Top;
            horizontalRadioGroup.HorizontalPlacement = ENHorizontalPlacement.Left;
            horizontalTabPage.Content = horizontalRadioGroup;

            NStackPanel horizontalStack = new NStackPanel();

            horizontalStack.Direction    = ENHVDirection.LeftToRight;
            horizontalRadioGroup.Content = horizontalStack;

            for (int i = 0; i < 5; i++)
            {
                NRadioButton radioButton = new NRadioButton("Item " + i.ToString());
                horizontalStack.Add(radioButton);
            }

            NRadioButton disabledRadioButton2 = new NRadioButton("Disabled");

            disabledRadioButton2.Enabled = false;
            horizontalStack.Add(disabledRadioButton2);
            horizontalRadioGroup.SelectedIndexChanged += OnHorizontalRadioGroupSelectedIndexChanged;
            return(tab);
        }
Exemplo n.º 3
0
        protected override NWidget CreateExampleControls()
        {
            NStackPanel stack = new NStackPanel();

            // Create the color box
            m_ColorBox = new NColorBox();
            m_ColorBox.SelectedColor         = NColor.MediumBlue;
            m_ColorBox.SelectedColorChanged += OnColorBoxSelectedColorChanged;
            stack.Add(NPairBox.Create("Color:", m_ColorBox));

            // Create the size radio button group
            NStackPanel radioStack = new NStackPanel();
            double      size       = InitialSize;

            for (int i = 0; i < 4; i++)
            {
                string       sizeStr     = size.ToString(CultureInfo.InvariantCulture);
                NRadioButton radioButton = new NRadioButton(sizeStr + "x" + sizeStr);
                radioStack.Add(radioButton);
                size *= 2;
            }

            m_RadioGroup = new NRadioButtonGroup(radioStack);
            m_RadioGroup.SelectedIndex         = 0;
            m_RadioGroup.SelectedIndexChanged += OnRadioGroupSelectedIndexChanged;
            NPairBox pairBox = NPairBox.Create("Size:", m_RadioGroup);

            pairBox.Box1.VerticalPlacement = ENVerticalPlacement.Top;
            stack.Add(pairBox);

            return(new NUniSizeBoxGroup(stack));
        }
Exemplo n.º 4
0
        protected override NWidget CreateExampleControls()
        {
            NStackPanel stack = new NStackPanel();

            stack.FillMode = ENStackFillMode.Last;
            stack.FitMode  = ENStackFitMode.Last;

            // Create the tool bar button type radio group
            NStackPanel buttonTypeStack = new NStackPanel();

            ENToolBarButtonType[] buttonTypes = NEnum.GetValues <ENToolBarButtonType>();
            for (int i = 0, count = buttonTypes.Length; i < count; i++)
            {
                // Get the current button type and its string representation
                ENToolBarButtonType buttonType = buttonTypes[i];
                string text = NStringHelpers.InsertSpacesBeforeUppersAndDigits(buttonType.ToString());

                // Create a radio button for the current button type
                NRadioButton radioButton = new NRadioButton(text);
                buttonTypeStack.Add(radioButton);
            }

            NRadioButtonGroup buttonTypeGroup = new NRadioButtonGroup(buttonTypeStack);

            buttonTypeGroup.SelectedIndexChanged += OnButtonTypeGroupSelectedIndexChanged;
            buttonTypeGroup.SelectedIndex         = 2;
            stack.Add(new NGroupBox("Button Type", buttonTypeGroup));

            // Create the events log
            m_EventsLog = new NExampleEventsLog();
            stack.Add(m_EventsLog);

            return(stack);
        }
Exemplo n.º 5
0
        protected override NWidget CreateExampleControls()
        {
            NStackPanel stack = (NStackPanel)base.CreateExampleControls();

            stack.FillMode = ENStackFillMode.Last;

            // selection mode
            {
                m_RadioGroup = new NRadioButtonGroup();

                NStackPanel radioStack = new NStackPanel();
                m_RadioGroup.Content = radioStack;

                radioStack.Add(new NRadioButton("Glue To Nearest Port"));
                radioStack.Add(new NRadioButton("Glue To Shape Box Intersection"));
                radioStack.Add(new NRadioButton("Glue To Geometry Intersection"));
                radioStack.Add(new NRadioButton("Glue To Shape Box"));;
                radioStack.Add(new NRadioButton("Glue To Geometry Contour"));
                radioStack.Add(new NRadioButton("Glue To Port"));

                stack.Add(new NGroupBox("Select Glue Mode", m_RadioGroup));
            }

            // glue properties
            {
                NStackPanel holdersStack = new NStackPanel();
                stack.Add(holdersStack);

                m_BeginGlueHolder = new NGroupBox("Begin Glue Properties");
                holdersStack.Add(m_BeginGlueHolder);

                m_EndGlueHolder = new NGroupBox("End Glue Properties");
                holdersStack.Add(m_EndGlueHolder);
            }

            // timer
            {
                NStackPanel timerStack = new NStackPanel();

                NButton startRotationButton = new NButton("Start Rotation");
                startRotationButton.Click += delegate(NEventArgs args) { m_Timer.Start(); };
                timerStack.Add(startRotationButton);

                NButton stopRotationButton = new NButton("Stop Rotation");
                stopRotationButton.Click += delegate(NEventArgs args) { m_Timer.Stop(); };
                timerStack.Add(stopRotationButton);

                stack.Add(timerStack);
            }

            // select the first glue mode
            m_RadioGroup.SelectedIndexChanged += OnRadioGroupSelectedIndexChanged;
            m_RadioGroup.SelectedIndex         = 0;

            return(stack);
        }
Exemplo n.º 6
0
        protected override NWidget CreateExampleControls()
        {
            NStackPanel stack = (NStackPanel)base.CreateExampleControls();

            stack.Add(new NRadioButton("Time grouping first"));
            stack.Add(new NRadioButton("Group grouping first"));

            NRadioButtonGroup groupingOrderGroup = new NRadioButtonGroup(stack);

            groupingOrderGroup.SelectedIndexChanged += OnRadioGroupSelectedIndexChanged;
            groupingOrderGroup.SelectedIndex         = 0;

            return(groupingOrderGroup);
        }
        protected override NWidget CreateExampleControls()
        {
            NGroupBox         groupBox   = new NGroupBox("Gradients Variant:");
            NRadioButtonGroup radioGroup = new NRadioButtonGroup();

            groupBox.Content = radioGroup;

            NStackPanel radioButtonsStack = new NStackPanel();

            radioGroup.Content = radioButtonsStack;

            for (int i = 0; i < 16; i++)
            {
                NRadioButton radioButton = new NRadioButton("Variant " + i.ToString());
                radioButtonsStack.Add(radioButton);
            }

            radioGroup.SelectedIndex         = 0;
            radioGroup.SelectedIndexChanged += new Function <NValueChangeEventArgs>(OnRadioGroupSelectedIndexChanged);

            // Canvas width editor
            m_CanvasWidthUpDown               = new NNumericUpDown();
            m_CanvasWidthUpDown.Minimum       = 100;
            m_CanvasWidthUpDown.Maximum       = 350;
            m_CanvasWidthUpDown.Value         = defaultCanvasWidth;
            m_CanvasWidthUpDown.Step          = 1;
            m_CanvasWidthUpDown.DecimalPlaces = 0;
            m_CanvasWidthUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnNumericUpDownValueChanged);

            // Canvas height editor
            m_CanvasHeightUpDown               = new NNumericUpDown();
            m_CanvasHeightUpDown.Minimum       = 100;
            m_CanvasHeightUpDown.Maximum       = 350;
            m_CanvasHeightUpDown.Value         = defaultCanvasHeight;
            m_CanvasHeightUpDown.Step          = 1;
            m_CanvasHeightUpDown.DecimalPlaces = 0;
            m_CanvasHeightUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnNumericUpDownValueChanged);

            NStackPanel stack = new NStackPanel();

            stack.FillMode = ENStackFillMode.None;
            stack.FitMode  = ENStackFitMode.None;
            stack.Add(groupBox);
            stack.Add(NPairBox.Create("Canvas Width:", m_CanvasWidthUpDown));
            stack.Add(NPairBox.Create("Canvas Height:", m_CanvasHeightUpDown));

            return(new NUniSizeBoxGroup(stack));
        }
Exemplo n.º 8
0
        protected override NWidget CreateExampleControls()
        {
            NStackPanel stack = (NStackPanel)base.CreateExampleControls();

            stack.Add(new NRadioButton("No recurrence"));
            stack.Add(new NRadioButton("Every 3 hours"));
            stack.Add(new NRadioButton("Every day"));
            stack.Add(new NRadioButton("Every week on Monday and Friday"));
            stack.Add(new NRadioButton("The third day of every other month"));
            stack.Add(new NRadioButton("The last Sunday of every month"));
            stack.Add(new NRadioButton("May 7 and July 7 of every year"));
            stack.Add(new NRadioButton("The first Monday and Tuesday of\nMay, June and August"));
            stack.Add(new NRadioButton("Every second day for 1 month from today"));
            stack.Add(new NRadioButton("Every day for 5 occurrences from today"));

            NRadioButtonGroup group = new NRadioButtonGroup(stack);

            group.SelectedIndex         = 2;
            group.SelectedIndexChanged += OnRadioGroupSelectedIndexChanged;
            return(group);
        }
Exemplo n.º 9
0
        protected override NWidget CreateExampleControls()
        {
            NRadioButton drawAtPointButton = new NRadioButton("Draw Image at Point");
            NRadioButton drawInRectButton  = new NRadioButton("Draw Image in Rectangle");

            NStackPanel radioStack = new NStackPanel();

            radioStack.Add(drawAtPointButton);
            radioStack.Add(drawInRectButton);

            m_RadioGroup = new NRadioButtonGroup();
            m_RadioGroup.HorizontalPlacement   = ENHorizontalPlacement.Left;
            m_RadioGroup.VerticalPlacement     = ENVerticalPlacement.Top;
            m_RadioGroup.Content               = radioStack;
            m_RadioGroup.SelectedIndex         = m_PaintImageInRectangle ? 1 : 0;
            m_RadioGroup.SelectedIndexChanged += new Function <NValueChangeEventArgs>(OnValueChanged);

            // Image X position editor
            m_PositionXUpDown               = new NNumericUpDown();
            m_PositionXUpDown.Minimum       = 0;
            m_PositionXUpDown.Maximum       = 800;
            m_PositionXUpDown.Value         = m_PosX;
            m_PositionXUpDown.Step          = 1;
            m_PositionXUpDown.DecimalPlaces = 0;
            m_PositionXUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnValueChanged);

            // Image Y position editor
            m_PositionYUpDown               = new NNumericUpDown();
            m_PositionYUpDown.Minimum       = 0;
            m_PositionYUpDown.Maximum       = 600;
            m_PositionYUpDown.Value         = m_PosY;
            m_PositionYUpDown.Step          = 1;
            m_PositionYUpDown.DecimalPlaces = 0;
            m_PositionYUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnValueChanged);

            // Image height editor
            m_WidthUpDown               = new NNumericUpDown();
            m_WidthUpDown.Enabled       = m_PaintImageInRectangle;
            m_WidthUpDown.Minimum       = 0;
            m_WidthUpDown.Maximum       = 400;
            m_WidthUpDown.Value         = m_Width;
            m_WidthUpDown.Step          = 1;
            m_WidthUpDown.DecimalPlaces = 0;
            m_WidthUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnValueChanged);

            // Image height editor
            m_HeightUpDown               = new NNumericUpDown();
            m_HeightUpDown.Enabled       = m_PaintImageInRectangle;
            m_HeightUpDown.Minimum       = 0;
            m_HeightUpDown.Maximum       = 400;
            m_HeightUpDown.Value         = m_Height;
            m_HeightUpDown.Step          = 1;
            m_HeightUpDown.DecimalPlaces = 0;
            m_HeightUpDown.ValueChanged += new Function <NValueChangeEventArgs>(OnValueChanged);

            NStackPanel stack = new NStackPanel();

            stack.FillMode = ENStackFillMode.None;
            stack.FitMode  = ENStackFitMode.None;
            stack.Add(m_RadioGroup);
            stack.Add(NPairBox.Create("X Position:", m_PositionXUpDown));
            stack.Add(NPairBox.Create("Y Position:", m_PositionYUpDown));
            stack.Add(NPairBox.Create("Width:", m_WidthUpDown));
            stack.Add(NPairBox.Create("Height:", m_HeightUpDown));

            return(new NUniSizeBoxGroup(stack));
        }