Пример #1
0
        protected override NWidget CreateExampleControls()
        {
            // Create the theme tree view
            NTheme        theme;
            NTreeViewItem rootItem, themeItem;
            NTreeView     themeTreeView = new NTreeView();

            // Add the "Inherit Styles" root tree view item
            rootItem     = new NTreeViewItem("Inherit Styles");
            rootItem.Tag = "inherit";
            themeTreeView.Items.Add(rootItem);
            themeTreeView.SelectedItem = rootItem;

            // Add the image based UI themes to the tree view
            rootItem          = new NTreeViewItem("Part Based");
            rootItem.Expanded = true;
            themeTreeView.Items.Add(rootItem);

            themeItem     = new NTreeViewItem("Windows XP Blue");
            themeItem.Tag = new NWindowsXPBlueTheme();
            rootItem.Items.Add(themeItem);

            themeItem     = new NTreeViewItem("Windows Aero");
            themeItem.Tag = new NWindowsAeroTheme();
            rootItem.Items.Add(themeItem);

            themeItem     = new NTreeViewItem("Windows 8");
            themeItem.Tag = new NWindows8Theme();
            rootItem.Items.Add(themeItem);

            themeItem     = new NTreeViewItem("Mac OS X 10.7 Lion");
            themeItem.Tag = new NMacLionTheme();
            rootItem.Items.Add(themeItem);

            themeItem     = new NTreeViewItem("Mac OS X 10.11 El Capitan");
            themeItem.Tag = new NMacElCapitanTheme();
            rootItem.Items.Add(themeItem);

            themeItem     = new NTreeViewItem("Nevron Dark");
            themeItem.Tag = new NNevronDarkTheme();
            rootItem.Items.Add(themeItem);

            themeItem     = new NTreeViewItem("Nevron Light");
            themeItem.Tag = new NNevronLightTheme();
            rootItem.Items.Add(themeItem);

            // Add the windows classic UI themes to the tree view
            rootItem          = new NTreeViewItem("Windows Classic");
            rootItem.Expanded = true;
            themeTreeView.Items.Add(rootItem);

            ENUIThemeScheme[] windowsClassicSchemes = NEnum.GetValues <ENUIThemeScheme>();
            for (int i = 0, count = windowsClassicSchemes.Length; i < count; i++)
            {
                ENUIThemeScheme scheme = windowsClassicSchemes[i];
                theme         = new NWindowsClassicTheme(scheme);
                themeItem     = new NTreeViewItem(NStringHelpers.InsertSpacesBeforeUppersAndDigits(scheme.ToString()));
                themeItem.Tag = theme;
                rootItem.Items.Add(themeItem);
            }

            // Subscribe to the selected path changed event
            themeTreeView.SelectedPathChanged += new Function <NValueChangeEventArgs>(OnThemeTreeViewSelectedPathChanged);

            return(themeTreeView);
        }
Пример #2
0
        /// <summary>
        /// Creates the menu drop down that allows the user to select a theme.
        /// </summary>
        /// <returns></returns>
        protected NMenuDropDown CreateThemesMenuDropDown()
        {
            NMenuDropDown themesMenu = new NMenuDropDown("Theme");

            // Add the Windows Classic themes
            NMenuItem windowsClassicMenuItem = new NMenuItem("Windows Classic");

            themesMenu.Items.Add(windowsClassicMenuItem);

            ENUIThemeScheme[] windowsClassicSchemes = NEnum.GetValues <ENUIThemeScheme>();
            for (int i = 0, count = windowsClassicSchemes.Length; i < count; i++)
            {
                ENUIThemeScheme      scheme    = (ENUIThemeScheme)windowsClassicSchemes.GetValue(i);
                NWindowsClassicTheme theme     = new NWindowsClassicTheme(scheme);
                NCheckableMenuItem   themeItem = new NCheckableMenuItem(NStringHelpers.InsertSpacesBeforeUppersAndDigits(scheme.ToString()));
                themeItem.Tag    = theme;
                themeItem.Click += OnThemeMenuItemClick;
                windowsClassicMenuItem.Items.Add(themeItem);
            }

            // Add the touch themes
            NMenuItem touchThemesMenuItem = new NMenuItem("Touch Themes");

            themesMenu.Items.Add(touchThemesMenuItem);

            // Add the Windows 8 touch theme
            NCheckableMenuItem windows8ThemeMenuItemTouch = new NCheckableMenuItem("Windows 8 Touch");

            windows8ThemeMenuItemTouch.Tag    = new NWindows8Theme(true);
            windows8ThemeMenuItemTouch.Click += OnThemeMenuItemClick;
            touchThemesMenuItem.Items.Add(windows8ThemeMenuItemTouch);

            // Add the dark theme
            NCheckableMenuItem darkThemeTouch = new NCheckableMenuItem("Nevron Dark Touch");

            darkThemeTouch.Tag    = new NNevronDarkTheme(true);
            darkThemeTouch.Click += OnThemeMenuItemClick;
            touchThemesMenuItem.Items.Add(darkThemeTouch);

            // Add the light theme
            NCheckableMenuItem lightThemeTouch = new NCheckableMenuItem("Nevron Light Touch");

            lightThemeTouch.Tag    = new NNevronLightTheme(true);
            lightThemeTouch.Click += OnThemeMenuItemClick;
            touchThemesMenuItem.Items.Add(lightThemeTouch);

            // Add the Windows XP Blue theme
            NCheckableMenuItem xpBlueMenuItem = new NCheckableMenuItem("Windows XP Blue");

            xpBlueMenuItem.Tag    = new NWindowsXPBlueTheme();
            xpBlueMenuItem.Click += OnThemeMenuItemClick;
            themesMenu.Items.Add(xpBlueMenuItem);

            // Add the Windows Aero theme
            NCheckableMenuItem aeroThemeMenuItem = new NCheckableMenuItem("Windows 7 Aero");

            aeroThemeMenuItem.Tag    = new NWindowsAeroTheme();
            aeroThemeMenuItem.Click += OnThemeMenuItemClick;
            themesMenu.Items.Add(aeroThemeMenuItem);

            // Add the Windows 8 theme (the default theme)
            NCheckableMenuItem windows8ThemeMenuItem = new NCheckableMenuItem("Windows 8");

            windows8ThemeMenuItem.Tag    = new NWindows8Theme();
            windows8ThemeMenuItem.Click += OnThemeMenuItemClick;
            themesMenu.Items.Add(windows8ThemeMenuItem);
            windows8ThemeMenuItem.Checked = true;
            m_CurrentThemeMenuItem        = windows8ThemeMenuItem;

            // Add the Mac Lion theme
            NCheckableMenuItem macLionThemeMenuItem = new NCheckableMenuItem("Mac OS X Lion");

            macLionThemeMenuItem.Tag    = new NMacLionTheme();
            macLionThemeMenuItem.Click += OnThemeMenuItemClick;
            themesMenu.Items.Add(macLionThemeMenuItem);

            // Add the Mac El Capitan theme
            NCheckableMenuItem macElCapitanTheme = new NCheckableMenuItem("Mac OS X El Capitan");

            macElCapitanTheme.Tag    = new NMacElCapitanTheme();
            macElCapitanTheme.Click += OnThemeMenuItemClick;
            themesMenu.Items.Add(macElCapitanTheme);

            // Add the dark theme
            NCheckableMenuItem darkTheme = new NCheckableMenuItem("Nevron Dark");

            darkTheme.Tag    = new NNevronDarkTheme();
            darkTheme.Click += OnThemeMenuItemClick;
            themesMenu.Items.Add(darkTheme);

            // Add the light theme
            NCheckableMenuItem lightTheme = new NCheckableMenuItem("Nevron Light");

            lightTheme.Tag    = new NNevronLightTheme();
            lightTheme.Click += OnThemeMenuItemClick;
            themesMenu.Items.Add(lightTheme);

            return(themesMenu);
        }