コード例 #1
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);
        }