Esempio n. 1
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);
        }
Esempio n. 2
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));
        }
Esempio n. 3
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);
        }
Esempio n. 4
0
        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()
        {
            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));
        }
Esempio n. 6
0
        private NStackPanel CreateButtons()
        {
            // Create buttons
            NStackPanel stack = new NStackPanel();

            stack.VerticalSpacing = 10;

            NCheckBox checkBox = new NCheckBox("Check Box");

            stack.Add(checkBox);

            NRadioButton radioButton = new NRadioButton("Radio Button");

            stack.Add(radioButton);

            NButton button = new NButton("Button");

            stack.Add(button);

            return(stack);
        }
Esempio n. 7
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));
        }