Ejemplo n.º 1
0
        private NTabPage CreateEnumPage()
        {
            NTabPage    page  = new NTabPage("Enum");
            NStackPanel stack = new NStackPanel();

            page.Content = stack;
            stack.HorizontalPlacement = ENHorizontalPlacement.Left;

            NList <NPropertyEditor> editors = SimpleNodeDesigner.CreatePropertyEditors(m_SimpleNode,
                                                                                       NSimpleNode.ComboBoxEnumValueProperty,
                                                                                       NSimpleNode.HRadioGroupEnumProperty,
                                                                                       NSimpleNode.VRadioGroupEnumProperty);

            NGroupBox groupBox = new NGroupBox(editors[0].EditedProperty.ToString());

            stack.Add(groupBox);
            groupBox.Content = editors[0];

            for (int i = 1, count = editors.Count; i < count; i++)
            {
                NPropertyEditor editor = editors[i];
                stack.Add(editor);
            }

            return(page);
        }
Ejemplo n.º 2
0
        protected override NWidget CreateExampleControls()
        {
            NStackPanel stack = new NStackPanel();

            for (int i = 0, count = m_PairBoxes.Length; i < count; i++)
            {
                // Create the pair box property editors
                NPairBox pairBox = m_PairBoxes[i];
                NList <NPropertyEditor> editors = NDesigner.GetDesigner(pairBox).CreatePropertyEditors(pairBox,
                                                                                                       NPairBox.FillModeProperty,
                                                                                                       NPairBox.FitModeProperty
                                                                                                       );

                NUniSizeBox box1 = (NUniSizeBox)pairBox.Box1;
                editors.Add(NDesigner.GetDesigner(box1).CreatePropertyEditor(
                                box1,
                                NUniSizeBox.UniSizeModeProperty
                                ));

                NUniSizeBox box2 = (NUniSizeBox)pairBox.Box2;
                editors.Add(NDesigner.GetDesigner(box2).CreatePropertyEditor(
                                box2,
                                NUniSizeBox.UniSizeModeProperty
                                ));

                // Create the properties stack panel
                NStackPanel propertyStack = new NStackPanel();
                for (int j = 0, editorCount = editors.Count; j < editorCount; j++)
                {
                    propertyStack.Add(editors[j]);
                }

                // Add the box 1 preferred height editor
                NPropertyEditor editor = NDesigner.GetDesigner(box1.Content).CreatePropertyEditor(box1.Content, NWidget.PreferredHeightProperty);
                NLabel          label  = editor.GetFirstDescendant <NLabel>();
                label.Text = "Box 1 Preferred Height:";
                propertyStack.Add(editor);

                // Add the box 2 preferred height editor
                editor     = NDesigner.GetDesigner(box2.Content).CreatePropertyEditor(box2.Content, NWidget.PreferredHeightProperty);
                label      = editor.GetFirstDescendant <NLabel>();
                label.Text = "Box 2 Preferred Height:";
                propertyStack.Add(editor);

                // Create a group box for the properties
                NGroupBox groupBox = new NGroupBox("Pair Box " + (i + 1).ToString());
                groupBox.Content = propertyStack;
                stack.Add(groupBox);
            }

            return(new NUniSizeBoxGroup(stack));
        }
Ejemplo n.º 3
0
        protected override NWidget CreateExampleControls()
        {
            NStackPanel stack    = (NStackPanel)base.CreateExampleControls();
            NSchedule   schedule = m_ScheduleView.Content;

            schedule.ViewModeChanged += OnScheduleViewModeChanged;

            // Add the view mode property editor, i.e. a combo box for selecting the schedule's active view mode
            NPropertyEditor propertyEditor = NDesigner.GetDesigner(schedule).CreatePropertyEditor(schedule, NSchedule.ViewModeProperty);

            propertyEditor.Margins = new NMargins(0, NDesign.VerticalSpacing, 0, 0);
            stack.Add(propertyEditor);

            // Add a width numeric up down
            m_WidthUpDown               = new NNumericUpDown();
            m_WidthUpDown.Value         = schedule.Width;
            m_WidthUpDown.Minimum       = 100;
            m_WidthUpDown.Step          = 10;
            m_WidthUpDown.ValueChanged += OnWidthUpDownValueChanged;
            stack.Add(NPairBox.Create("Width", m_WidthUpDown));

            // Add a height numeric up down
            m_HeightUpDown               = new NNumericUpDown();
            m_HeightUpDown.Value         = schedule.Height;
            m_HeightUpDown.Minimum       = 100;
            m_HeightUpDown.Step          = 10;
            m_HeightUpDown.ValueChanged += OnHeightUpDownValueChanged;
            stack.Add(NPairBox.Create("Height", m_HeightUpDown));

            // Add a duration numeric up down
            m_DurationUpDown               = new NNumericUpDown();
            m_DurationUpDown.Value         = schedule.ActiveViewMode.Duration;
            m_DurationUpDown.Minimum       = 1;
            m_DurationUpDown.Enabled       = false;
            m_DurationUpDown.ValueChanged += OnDurationUpDownValueChanged;

            NPairBox pairBox = new NPairBox(m_DurationUpDown, "days");

            pairBox.Spacing = NDesign.HorizontalSpacing;
            stack.Add(NPairBox.Create("Duration", pairBox));

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

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

            // Create the content type group box
            NPropertyEditor contentTypePropertyEditor = NDesigner.GetDesigner(this).CreatePropertyEditor(this, ContentTypeProperty);

            stack.Add(contentTypePropertyEditor);

            // Create the properties group box
            NStackPanel             propertiesStack = new NStackPanel();
            NList <NPropertyEditor> editors         = NDesigner.GetDesigner(m_ListBox).CreatePropertyEditors(m_ListBox,
                                                                                                             NWidget.EnabledProperty,
                                                                                                             NWidget.HorizontalPlacementProperty,
                                                                                                             NWidget.VerticalPlacementProperty,
                                                                                                             NScrollContentBase.HScrollModeProperty,
                                                                                                             NScrollContentBase.VScrollModeProperty,
                                                                                                             NScrollContentBase.NoScrollHAlignProperty,
                                                                                                             NScrollContentBase.NoScrollVAlignProperty,
                                                                                                             NListBox.IntegralVScrollProperty
                                                                                                             );

            for (int i = 0, count = editors.Count; i < count; i++)
            {
                propertiesStack.Add(editors[i]);
            }

            NGroupBox propertiesGroupBox = new NGroupBox("Properties", new NUniSizeBoxGroup(propertiesStack));

            stack.Add(propertiesGroupBox);

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

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

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

            // Create the properties group box
            NStackPanel             propertiesStack = new NStackPanel();
            NList <NPropertyEditor> editors         = NDesigner.GetDesigner(m_ListBox).CreatePropertyEditors(m_ListBox,
                                                                                                             NListBox.EnabledProperty,
                                                                                                             NListBox.HorizontalPlacementProperty,
                                                                                                             NListBox.VerticalPlacementProperty
                                                                                                             );

            for (int i = 0, count = editors.Count; i < count; i++)
            {
                propertiesStack.Add(editors[i]);
            }

            NPropertyEditor editor = NDesigner.GetDesigner(m_ListBox.Selection).CreatePropertyEditor(m_ListBox.Selection,
                                                                                                     NListBoxSelection.ModeProperty);
            NLabel label = (NLabel)editor.GetDescendants(new NInstanceOfSchemaFilter(NLabel.NLabelSchema))[0];

            label.Text = "Selection Mode:";
            propertiesStack.Add(editor);

            NGroupBox propertiesGroupBox = new NGroupBox("Properties", new NUniSizeBoxGroup(propertiesStack));

            stack.Add(propertiesGroupBox);

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

            return(stack);
        }