Esempio n. 1
0
        private NStackPanel CreateDropDownEdits()
        {
            NStackPanel stack = new NStackPanel();

            stack.VerticalSpacing = 10;

            NComboBox comboBox = new NComboBox();

            comboBox.Items.Add(new NComboBoxItem("Item 1"));
            comboBox.Items.Add(new NComboBoxItem("Item 2"));
            comboBox.Items.Add(new NComboBoxItem("Item 3"));
            comboBox.Items.Add(new NComboBoxItem("Item 4"));
            comboBox.SelectedIndex = 0;
            stack.Add(comboBox);

            NColorBox colorBox = new NColorBox();

            stack.Add(colorBox);

            NDateTimeBox dateTimeBox = new NDateTimeBox();

            stack.Add(dateTimeBox);

            NFillSplitButton splitButton = new NFillSplitButton();

            stack.Add(splitButton);

            return(stack);
        }
Esempio n. 2
0
        protected override NWidget CreateExampleContent()
        {
            m_DateTimeBox = new NDateTimeBox();
            m_DateTimeBox.VerticalPlacement    = ENVerticalPlacement.Top;
            m_DateTimeBox.HorizontalPlacement  = ENHorizontalPlacement.Left;
            m_DateTimeBox.SelectedDateChanged += new Function <NValueChangeEventArgs>(OnDateTimeBoxSelectedColorChanged);

            return(m_DateTimeBox);
        }
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleControls()
        {
            NStackPanel      stack    = new NStackPanel();
            NUniSizeBoxGroup boxGroup = new NUniSizeBoxGroup(stack);

            stack.Add(new NLabel("Allowed Date Time Units"));

            NDateTimeUnit[] dateTimeUnits = new NDateTimeUnit[] {
                NDateTimeUnit.Century,
                NDateTimeUnit.Decade,
                NDateTimeUnit.Year,
                NDateTimeUnit.HalfYear,
                NDateTimeUnit.Quarter,
                NDateTimeUnit.Month,
                NDateTimeUnit.Week,
                NDateTimeUnit.Day,
                NDateTimeUnit.HalfDay,
                NDateTimeUnit.Hour,
                NDateTimeUnit.Minute,
                NDateTimeUnit.Second,
                NDateTimeUnit.Millisecond,
                NDateTimeUnit.Tick
            };

            m_DateTimeUnitListBox = new NListBox();
            for (int i = 0; i < dateTimeUnits.Length; i++)
            {
                NDateTimeUnit dateTimeUnit         = dateTimeUnits[i];
                NCheckBox     dateTimeUnitCheckBox = new NCheckBox(NStringHelpers.InsertSpacesBeforeUppersAndDigits(dateTimeUnit.DateTimeUnit.ToString()));

                dateTimeUnitCheckBox.Checked         = true;
                dateTimeUnitCheckBox.CheckedChanged += new Function <NValueChangeEventArgs>(OnDateTimeUnitCheckBoxCheckedChanged);
                dateTimeUnitCheckBox.Tag             = dateTimeUnit;

                m_DateTimeUnitListBox.Items.Add(new NListBoxItem(dateTimeUnitCheckBox));
            }

            stack.Add(m_DateTimeUnitListBox);
            OnDateTimeUnitCheckBoxCheckedChanged(null);

            NCheckBox enableUnitSensitiveFormattingCheckBox = new NCheckBox("Enable Unit Sensitive Formatting");

            enableUnitSensitiveFormattingCheckBox.CheckedChanged += new Function <NValueChangeEventArgs>(OnEnableUnitSensitiveFormattingCheckBoxCheckedChanged);
            stack.Add(enableUnitSensitiveFormattingCheckBox);

            enableUnitSensitiveFormattingCheckBox.Checked = true;

            stack.Add(new NLabel("Start Date:"));
            m_StartDateTimeBox = new NDateTimeBox();
            m_StartDateTimeBox.SelectedDateChanged += new Function <NValueChangeEventArgs>(OnStartDateTimeBoxSelectedDateChanged);
            stack.Add(m_StartDateTimeBox);

            stack.Add(new NLabel("End Date:"));
            m_EndDateTimeBox = new NDateTimeBox();
            m_EndDateTimeBox.SelectedDateChanged += new Function <NValueChangeEventArgs>(OnEndDateTimeBoxSelectedDateChanged);
            stack.Add(m_EndDateTimeBox);

            NButton generateRandomDataButton = new NButton("Generate Random Data");

            generateRandomDataButton.Click += new Function <NEventArgs>(OnGenerateRandomDataButtonClick);
            stack.Add(generateRandomDataButton);

            m_StartDateTimeBox.SelectedDate = DateTime.Now;
            m_EndDateTimeBox.SelectedDate   = CultureInfo.CurrentCulture.Calendar.AddYears(m_StartDateTimeBox.SelectedDate, 2);

            return(boxGroup);
        }