void ColorMenu_MenuItemSelected(LayerUIMenuItem item)
 {
 }
        void setupMenuL_MenuItemSelected(LayerUIMenuItem item)
        {
            var sso = item.Tag as StockSkyOverlay;

            if (Earth3d.MainWindow.TourEdit != null && sso != null)
            {
                if (Earth3d.MainWindow.TourEdit.Tour.EditMode && Earth3d.MainWindow.TourEdit.Tour.CurrentTourStop != null)
                {
                    Undo.Push(new UndoTourStopChange(Language.GetLocalizedText(1290, "Add to Timeline"), Earth3d.MainWindow.TourEdit.Tour));

                    Earth3d.MainWindow.TourEdit.Tour.CurrentTourStop.KeyFramed = true;

                    var aniTarget = Earth3d.MainWindow.TourEdit.Tour.CurrentTourStop.FindTarget(sso.StockType.ToString());
                    aniTarget.SetKeyFrame(Earth3d.MainWindow.TourEdit.Tour.CurrentTourStop.TweenPosition, Key.KeyType.Linear);
                    TimeLine.RefreshUi();
                }
            }
        }
 void setupMenu_MenuItemSelected(LayerUIMenuItem item)
 {
     View.ShowFovSetup();
 }
 void setupMenuB_MenuItemSelected(LayerUIMenuItem item)
 {
     var sb = new ScreenBroadcast();
     sb.Show();
 }
        void setupMenuK_MenuItemSelected(LayerUIMenuItem item)
        {
            var sso = item.Tag as StockSkyOverlay;

            if (Earth3d.MainWindow.TourEdit != null && sso != null)
            {
                if (Earth3d.MainWindow.TourEdit.Tour.EditMode && Earth3d.MainWindow.TourEdit.Tour.CurrentTourStop != null)
                {

                    var target = Earth3d.MainWindow.TourEdit.Tour.CurrentTourStop.GetSettingAnimator(sso.StockType.ToString());
                    var type = AnimationTarget.AnimationTargetTypes.StockSkyOverlay;

                    Undo.Push(new UndoTourStopChange(Language.GetLocalizedText(1290, "Add to Timeline"), Earth3d.MainWindow.TourEdit.Tour));

                    Earth3d.MainWindow.TourEdit.Tour.CurrentTourStop.KeyFramed = true;

                    var aniTarget = new AnimationTarget(Earth3d.MainWindow.TourEdit.Tour.CurrentTourStop);
                    aniTarget.Target = target;
                    aniTarget.TargetType = type;
                    aniTarget.ParameterNames.AddRange(target.GetParamNames());
                    aniTarget.CurrentParameters = target.GetParams();
                    aniTarget.SetKeyFrame(0, Key.KeyType.Linear);
                    //todo add end frames?

                    Earth3d.MainWindow.TourEdit.Tour.CurrentTourStop.AnimationTargets.Add(aniTarget);
                    TimeLine.RefreshUi();
                }
            }
        }
 void Import_MenuItemSelected(LayerUIMenuItem item)
 {
     Constellations.ImportArtFile();
 }
        void newFilterMenu_MenuItemSelected(LayerUIMenuItem item)
        {
            var input = new SimpleInput(Language.GetLocalizedText(1121, "Filter name"), Language.GetLocalizedText(238, "Name"), "", 32);
            var retry = false;
            do
            {
                if (input.ShowDialog() == DialogResult.OK)
                {
                    foreach(var name in ConstellationFilter.Families.Keys)
                    {
                        if (name.ToLower().Trim() == input.ResultText.ToLower().Trim())
                        {
                            MessageBox.Show(Language.GetLocalizedText(516, "Name already exists, type a different name."), Language.GetLocalizedText(3, "Microsoft WorldWide Telescope"));
                            retry = true;
                            break;
                        }

                    }
                }
                else
                {
                    return;
                }
            } while (retry);

            var filterIn = item.Tag as ConstellationFilter;

            var newFilter = filterIn.Clone();

            ConstellationFilter.Families.Add(input.ResultText.Trim().Replace(";",""), newFilter);
            ConstellationFilter.SaveCustomFilters();
        }
 void filterMenuItem_ApplyMenuItemSelected(LayerUIMenuItem item)
 {
     var filter = item.Tag as ConstellationFilter;
     filter.Clone(ConstellationFilter.Families[item.Name]);
 }
 void filterMenuItem_IncludeMenuItemSelected(LayerUIMenuItem item)
 {
     var filter = item.Tag as ConstellationFilter;
     filter.Combine(ConstellationFilter.Families[item.Name]);
 }
Esempio n. 10
0
        void ColorMenu_MenuItemSelected(LayerUIMenuItem item)
        {
            var overlay = item.Tag as SkyOverlay;

            var picker = new PopupColorPicker();

            picker.Location = Cursor.Position;

            picker.Color = overlay.Color;

            if (picker.ShowDialog() == DialogResult.OK)
            {
                overlay.Color = picker.Color;
            }
        }
Esempio n. 11
0
 void DeleteFilterMenuItem_MenuItemSelected(LayerUIMenuItem item)
 {
     if (ConstellationFilter.Families.ContainsKey(item.Name))
     {
         ConstellationFilter.Families.Remove(item.Name);
     }
 }
Esempio n. 12
0
        private void AddFilterListInclude(LayerUIMenuItem includeMenu)
        {
            foreach (var id in ConstellationFilter.Families.Keys)
            {
                var filterMenuItem = new LayerUIMenuItem();

                filterMenuItem.Name = id;
                filterMenuItem.Tag = includeMenu.Tag;
                filterMenuItem.MenuItemSelected += filterMenuItem_IncludeMenuItemSelected;
                includeMenu.SubMenus.Add(filterMenuItem);
            }
        }
Esempio n. 13
0
        private void AddFilterListDelete(LayerUIMenuItem excludeMenu)
        {
            var anyCustomFilters = false;

            foreach (var id in ConstellationFilter.Families.Keys)
            {
                if (!ConstellationFilter.Families[id].Internal)
                {
                    var DeleteFilterMenuItem = new LayerUIMenuItem();

                    DeleteFilterMenuItem.Name = id;
                    DeleteFilterMenuItem.Tag = excludeMenu.Tag;
                    DeleteFilterMenuItem.MenuItemSelected += DeleteFilterMenuItem_MenuItemSelected;
                    excludeMenu.SubMenus.Add(DeleteFilterMenuItem);
                    anyCustomFilters = true;
                }
            }

            if (!anyCustomFilters)
            {
                var DeleteFilterMenuItem = new LayerUIMenuItem();

                DeleteFilterMenuItem.Name = Language.GetLocalizedText(1268, "No Custom Filters to Delete");
                DeleteFilterMenuItem.Tag = excludeMenu.Tag;
                excludeMenu.SubMenus.Add(DeleteFilterMenuItem);
                anyCustomFilters = true;
            }
        }
Esempio n. 14
0
        public override List<LayerUIMenuItem> GetNodeContextMenu(LayerUITreeNode node)
        {
            var items = new List<LayerUIMenuItem>();

            var colorMenu = new LayerUIMenuItem();
            colorMenu.Name = Language.GetLocalizedText(1116, "Color");
            colorMenu.MenuItemSelected += ColorMenu_MenuItemSelected;
            colorMenu.Tag = node.Tag;
            var so = node.Tag as StockSkyOverlay;
            if (so != null && so.HasColor)
            {
                items.Add(colorMenu);
            }

            if (so != null && so.StockType == StockSkyOverlayTypes.FiledOfView)
            {
                var setupMenu = new LayerUIMenuItem();
                setupMenu.Name = Language.GetLocalizedText(379, "Setup");
                setupMenu.MenuItemSelected += setupMenu_MenuItemSelected;
                setupMenu.Tag = node.Tag;
                items.Add(setupMenu);
            }

            if (so != null && so.StockType == StockSkyOverlayTypes.ScreenBroadcast)
            {
                var setupMenuB = new LayerUIMenuItem();
                setupMenuB.Name = Language.GetLocalizedText(379, "Setup");
                setupMenuB.MenuItemSelected += setupMenuB_MenuItemSelected;
                setupMenuB.Tag = node.Tag;
                items.Add(setupMenuB);
            }

            if (so != null && so.StockType == StockSkyOverlayTypes.ConstellationPictures)
            {
                var Import = new LayerUIMenuItem();
                Import.Name = Language.GetLocalizedText(1117, "Import...");
                Import.MenuItemSelected += Import_MenuItemSelected;
                Import.Tag = node.Tag;
                items.Add(Import);
            }

            var filter = node.Tag as ConstellationFilter;
            if (filter != null && node.Parent== null)
            {
                var applyMenu = new LayerUIMenuItem();
                applyMenu.Name = Language.GetLocalizedText(195, "Apply");
                applyMenu.Tag = filter;
                AddFilterListApply(applyMenu);
                items.Add(applyMenu);

                var includeMenu = new LayerUIMenuItem();
                includeMenu.Name = Language.GetLocalizedText(1118, "Include");
                includeMenu.Tag = filter;
                AddFilterListInclude(includeMenu);
                items.Add(includeMenu);

                var excludeMenu = new LayerUIMenuItem();
                excludeMenu.Name = Language.GetLocalizedText(1119, "Exclude");
                excludeMenu.Tag = filter;
                AddFilterListExclude(excludeMenu);
                items.Add(excludeMenu);

                var newFilterMenu = new LayerUIMenuItem();
                newFilterMenu.Name = Language.GetLocalizedText(1120, "New Filter...");
                newFilterMenu.MenuItemSelected += newFilterMenu_MenuItemSelected; ;
                newFilterMenu.Tag = node.Tag;
                items.Add(newFilterMenu);

                var deleteFilter = new LayerUIMenuItem();
                deleteFilter.Name = Language.GetLocalizedText(1269, "Delete Custom Filter");
                deleteFilter.Tag = filter;
                AddFilterListDelete(deleteFilter);
                items.Add(deleteFilter);

            }

            if (so != null) //todo && we are editing a keyframe slide )
            {
                if (Earth3d.MainWindow.TourEdit != null && Earth3d.MainWindow.TourEdit.Tour.EditMode && Earth3d.MainWindow.TourEdit.Tour.CurrentTourStop != null)
                {

                    if (Earth3d.MainWindow.TourEdit.Tour.CurrentTourStop.IsTargetAnimated(so.StockType.ToString()))
                    {
                        var setupMenuL = new LayerUIMenuItem();
                        setupMenuL.Name = Language.GetLocalizedText(1280, "Add Keyframe");
                        setupMenuL.MenuItemSelected += setupMenuL_MenuItemSelected;
                        setupMenuL.Tag = node.Tag;
                        items.Add(setupMenuL);
                    }
                    else
                    {
                        var setupMenuK = new LayerUIMenuItem();
                        setupMenuK.Name = Language.GetLocalizedText(1290, "Add to Timeline");
                        setupMenuK.MenuItemSelected += setupMenuK_MenuItemSelected;
                        setupMenuK.Tag = node.Tag;
                        items.Add(setupMenuK);
                    }
                }
            }

            return items;
        }
 void filterMenuItem_ExcludeMenuItemSelected(LayerUIMenuItem item)
 {
     ConstellationFilter filter = item.Tag as ConstellationFilter;
     filter.Remove(ConstellationFilter.Families[item.Name]);
 }
        private void AddFilterListExclude(LayerUIMenuItem excludeMenu)
        {
            foreach (string id in ConstellationFilter.Families.Keys)
            {
                LayerUIMenuItem filterMenuItem = new LayerUIMenuItem();

                filterMenuItem.Name = id;
                filterMenuItem.Tag = excludeMenu.Tag;
                filterMenuItem.MenuItemSelected += new MenuItemSelectedDelegate(filterMenuItem_ExcludeMenuItemSelected);
                excludeMenu.SubMenus.Add(filterMenuItem);
            }
        }