Ejemplo n.º 1
0
        /// <summary>
        /// Activate the HydroDesktop plugin
        /// </summary>
        public override void Activate()
        {
            // Add button to manage metadata.
            var btnDownloadMetadata = new SimpleActionItem("Manage", mnuDownloadMetadata_Click);

            btnDownloadMetadata.RootKey    = TableTabKey;
            btnDownloadMetadata.LargeImage = Properties.Resources.Metadata_Fetcher_32;
            btnDownloadMetadata.SmallImage = Properties.Resources.Metadata_Fetcher_16;
            //ToolTipTitle is not supported in HeaderControl
            //btnDownloadMetadata.ToolTipTitle = "Manage";
            btnDownloadMetadata.ToolTipText  = "Manage the contents of the local metadata catalog.";
            btnDownloadMetadata.GroupCaption = "Metadata";
            App.HeaderControl.Add(btnDownloadMetadata);

            // Add button to add more services to the list of services for metadata harvesting.
            var btnAddServices = new SimpleActionItem("Add", mnuAddServices_Click);

            btnAddServices.RootKey    = TableTabKey;
            btnAddServices.LargeImage = Properties.Resources.Metadata_Fetcher_Add_32;
            btnAddServices.SmallImage = Properties.Resources.Metadata_Fetcher_Add_16;
            //ToolTipTitle is not supported in HeaderControl
            //btnAddServices.ToolTipTitle = "Add";
            btnAddServices.ToolTipText  = "Add services to the list of services that can be harvested in metadata catalog.";
            btnAddServices.GroupCaption = "Metadata";
            App.HeaderControl.Add(btnAddServices);

            base.Activate();
        }
Ejemplo n.º 2
0
        private void AddSearchRibbon()
        {
            var head = App.HeaderControl;

            App.HeaderControl.Add(new SimpleActionItem(_searchKey, "Measure", MeasureTool_Click)
            {
                GroupCaption = Msg.Controls, SmallImage = ShaleNetwork.Properties.Resources.measure_16x16, LargeImage = ShaleNetwork.Properties.Resources.measure_32x32
            });

            head.Add(new SimpleActionItem(_searchKey, "SN Website", SN_Website_Click)
            {
                GroupCaption = Msg.Shale
            });
            head.Add(new SimpleActionItem(_searchKey, "Contact SN", Contact_SN_Click)
            {
                GroupCaption = Msg.Shale
            });

            _Shale = new SimpleActionItem(_searchKey, Msg.Shale_Data, Shale_Click)
            {
                LargeImage   = ShaleNetwork.Properties.Resources.SN_Logo,
                GroupCaption = Msg.Keyword,
                ToolTipText  = Msg.Shale_Tooltip
            };

            App.HeaderControl.Add(_Shale);
        }
        public override void Activate()
        {
            _ProjectExplorer      = ProjectManager.ShellService.ProjectExplorer as Control;
            _ProjectExplorer.Dock = DockStyle.Fill;
            App.DockManager.Add(new DockablePanel("kProjectExplorer", "Project",
                                                  _ProjectExplorer, DockStyle.Left)
            {
                SmallImage = Heiflow.Plugins.Default.Properties.Resources.CatalogShowTree16
            });

            var showPE = new SimpleActionItem("kView", "Project Explorer",
                                              delegate(object sender, EventArgs e)
                                              { App.DockManager.ShowPanel("kProjectExplorer"); }
                                              )
            {
                Key          = "kShowProjectExplorer",
                ToolTipText  = "Show Project Explorer",
                GroupCaption = "Model",
                LargeImage   = Resources.CatalogShowTree32
            };

            App.HeaderControl.Add(showPE);

            base.Activate();
            ProjectManager.ProjectService.Serializer.ProjectOpened += SerializationManager_ProjectChanged;
            AddMenuItems();
        }
Ejemplo n.º 4
0
        public override void Activate()
        {
            App.DockManager.Add(new DockablePanel("kDataGridPanel", "Table View",
                                                  _DataGridEx, DockStyle.None)
            {
                SmallImage = Resources.table_green_48
            });

            var showDataGrid = new SimpleActionItem("kView", "Table View",
                                                    delegate(object sender, EventArgs e)
                                                    { App.DockManager.ShowPanel("kDataGridPanel"); }
                                                    )
            {
                Key          = "kShowDataGridPanel",
                ToolTipText  = "Show Table View",
                GroupCaption = "Data",
                LargeImage   = Resources.table_green_48
            };

            App.HeaderControl.Add(showDataGrid);
            App.DockManager.HidePanel("kDataGridPanel");

            base.Activate();
            ProjectManager.ShellService.DataGridView = _DataGridEx;
            ProjectManager.ShellService.AddChild(_DataGridEx);
        }
        public override void Activate()
        {
            _Player = new AnimationPlayer();

            var panel = new DockablePanel("kAnimation", "Animation", _Player, DockStyle.Right)
            {
                SmallImage = Resources.TrackingDataAnimationTool16
            };

            App.DockManager.Add(panel);


            var showAnimation = new SimpleActionItem("kModel", "Animation",
                                                     ShowPanel)
            {
                Key          = "kShowAnimation",
                ToolTipText  = "Show Animation Player",
                GroupCaption = "Analysis",
                LargeImage   = Resources.TrackingDataAnimationTool32,
                SortOrder    = 5
            };

            App.HeaderControl.Add(showAnimation);
            App.DockManager.HidePanel("kAnimation");
            ProjectManager.ShellService.AnimationPlayer = _Player;
            ProjectManager.ShellService.AddChild(_Player);
            base.Activate();
        }
Ejemplo n.º 6
0
        public override void Activate()
        {
            this._PropertyGrid      = new PropertyGridEx();
            this._PropertyGrid.Name = "propGrid1";
            App.DockManager.Add
                (new DockablePanel("kPropGrid",
                                   "Property", _PropertyGrid, DockStyle.Right)
            {
                SmallImage = Properties.Resources.MetadataProperties16
            });

            var showPropertyGrid = new SimpleActionItem("kView", "Property",
                                                        delegate(object sender, EventArgs e)
                                                        { App.DockManager.ShowPanel("kPropGrid"); }
                                                        )
            {
                Key          = "kShowProperty",
                ToolTipText  = "Show Project Explorer",
                GroupCaption = "Common",
                LargeImage   = Resources.MetadataProperties32
            };

            App.HeaderControl.Add(showPropertyGrid);

            base.Activate();
            ProjectManager.ShellService.PropertyView = _PropertyGrid;
            ProjectManager.ShellService.AddChild(_PropertyGrid);
        }
Ejemplo n.º 7
0
        public override object Add(SimpleActionItem item)
        {
            var menu = new IconMenuItem(item.Caption, item.SmallImage, (sender, e) => item.OnClick(e))
            {
                Name = item.Key, Enabled = item.Enabled, Visible = item.Visible,
            };

            item.PropertyChanged += SimpleActionItemPropertyChanged;

            EnsureNonNullRoot(item);

            MenuItem root;

            if (item.MenuContainerKey == null)
            {
                root = !_mainmenu.MenuItems.ContainsKey(item.RootKey)
                    ? _mainmenu.MenuItems[_mainmenu.MenuItems.Add(new MenuItem(item.RootKey)
                {
                    Name = item.RootKey
                })]
                    : _mainmenu.MenuItems.Find(item.RootKey, true)[0];
            }
            else
            {
                root = _mainmenu.MenuItems.Find(item.MenuContainerKey, true)[0];
            }

            root.MenuItems.Add(menu);
            return(menu);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Sets up the handler to respond to buttons pressed on a ribbon or toolbar.
        /// </summary>
        private void AddButtons()
        {
            const string ShapeEditorMenuKey = "kShapeEditor";

            // _Header.Add(new RootItem(ShapeEditorMenuKey, "Shape Editing"));
            _header.Add(new SimpleActionItem(ShapeEditorMenuKey, ShapeEditorResources.New, NewButtonClick)
            {
                GroupCaption = "Shape Editor",
                SmallImage   = ShapeEditorResources.NewShapefile.ToBitmap(),
                RootKey      = HeaderControl.HomeRootItemKey
            });
            _addShape = new SimpleActionItem(ShapeEditorMenuKey, ShapeEditorResources.Add_Shape, AddShapeButtonClick)
            {
                GroupCaption = "Shape Editor",
                SmallImage   = ShapeEditorResources.NewShape.ToBitmap(),
                RootKey      = HeaderControl.HomeRootItemKey
            };
            _header.Add(_addShape);
            _header.Add(new SimpleActionItem(ShapeEditorMenuKey, ShapeEditorResources.Move_Vertex, MoveVertexButtonClick)
            {
                GroupCaption = "Shape Editor",
                SmallImage   = ShapeEditorResources.move,
                RootKey      = HeaderControl.HomeRootItemKey
            });
            _header.Add(new SimpleActionItem(ShapeEditorMenuKey, ShapeEditorResources.Snapping, SnappingButtonClick)
            {
                GroupCaption = "Shape Editor",
                SmallImage   = ShapeEditorResources.SnappingIcon.ToBitmap(),
                RootKey      = HeaderControl.HomeRootItemKey
            });
        }
Ejemplo n.º 9
0
        public override void Activate()
        {
            var importButtonTabKey = new SimpleActionItem("Import", menu_Click)
            {
                RootKey      = TableTabKey,
                SmallImage   = Resources.waterml_import1,
                LargeImage   = Resources.waterml_import1,
                GroupCaption = "Data Import",
                ToolTipText  = "Import data series into database.",
            };

            App.HeaderControl.Add(importButtonTabKey);

            var importButton = new SimpleActionItem(HeaderControl.ApplicationMenuKey, "Import...", menu_Click)
            {
                GroupCaption = HeaderControl.ApplicationMenuKey,
                SmallImage   = Resources.waterml_import1,
                LargeImage   = Resources.waterml_import1,
                ToolTipText  = "Import data series into database."
            };

            App.HeaderControl.Add(importButton);

            base.Activate();
        }
Ejemplo n.º 10
0
        public void TestNestedBeginCancelEnd()
        {
            var stack      = new TransactionalActionStackTestContainer(5);
            int orderCheck = 0;

            stack.Stack.BeginTransaction();
            stack.Stack.Add(new SimpleActionItem());
            stack.Stack.BeginTransaction();
            var action1 = new SimpleActionItem(); action1.OnUndo += () => { Assert.AreEqual(2, orderCheck); orderCheck++; };
            var action2 = new SimpleActionItem(); action2.OnUndo += () => { Assert.AreEqual(1, orderCheck); orderCheck++; };
            var action3 = new SimpleActionItem(); action3.OnUndo += () => { Assert.AreEqual(0, orderCheck); orderCheck++; };

            stack.Stack.Add(action1);
            stack.Stack.Add(action2);
            stack.Stack.Add(action3);
            var current = stack.Stack.GetCurrentTransactions();

            Assert.AreEqual(3, current.Count);
            stack.Stack.CancelTransaction();
            stack.CheckRaiseCount(0, 0, 0, 0, 0);
            stack.CheckTransactionCount(2, 0, 1, 0);
            stack.Stack.Add(new SimpleActionItem());
            current = stack.Stack.GetCurrentTransactions();
            Assert.AreEqual(2, current.Count);
            stack.Stack.EndTransaction("Test");
            Assert.AreEqual(3, orderCheck);
            Assert.Throws <InvalidOperationException>(() => stack.Stack.GetCurrentTransactions());
            stack.CheckRaiseCount(1, 0, 0, 0, 0);
            stack.CheckTransactionCount(2, 1, 1, 0);
        }
Ejemplo n.º 11
0
        //add a datasheet plugin root item
        public void AddRibbon(string sender)
        {
            rootHeaderItem           = new RootItem(strPanelKey, strPanelCaption);
            rootHeaderItem.SortOrder = (short)pluginType;
            App.HeaderControl.Add(rootHeaderItem);

            //tell ProjMngr if this is being Shown
            if (sender == "Show")
            {
                //make this the selected root
                App.HeaderControl.SelectRoot(strPanelKey);
            }

            //add sub-ribbon
            string rGroupCaption = strPanelCaption;

            btnRun              = new SimpleActionItem(strPanelKey, "Run", btnRun_Click);
            btnRun.LargeImage   = Properties.Resources.Run;
            btnRun.GroupCaption = rGroupCaption;
            btnRun.Enabled      = true;
            App.HeaderControl.Add(btnRun);

            btnCancel              = new SimpleActionItem(strPanelKey, "Cancel", btnCancel_Click);
            btnCancel.LargeImage   = Properties.Resources.Cancel;
            btnCancel.GroupCaption = rGroupCaption;
            btnCancel.Enabled      = false;
            App.HeaderControl.Add(btnCancel);
        }
Ejemplo n.º 12
0
        //add a datasheet plugin root item
        void AddDatasheetRibbon()
        {
            _DatasheetTab           = new RootItem(kDataSheet, _panelName);
            _DatasheetTab.SortOrder = 80;
            App.HeaderControl.Add(_DatasheetTab);



            //add sub-ribbons
            //section for adding data
            const string tGroupCaption = "Add";

            btnImport              = new SimpleActionItem(kDataSheet, "Import Data", btnImport_Click);
            btnImport.LargeImage   = Properties.Resources.OpenFile;
            btnImport.GroupCaption = tGroupCaption;
            btnImport.Enabled      = true;
            App.HeaderControl.Add(btnImport);



            //section for validating
            const string grpValidate = "Validate";

            btnValidate              = new SimpleActionItem(kDataSheet, "Validate Data", btnValidate_Click);
            btnValidate.LargeImage   = Properties.Resources.Validate;
            btnValidate.GroupCaption = grpValidate;
            btnValidate.Enabled      = false;
            App.HeaderControl.Add(btnValidate);


            //section for working with data
            const string grpManipulate = "Work with Data";

            btnComputeAO              = new SimpleActionItem(kDataSheet, "Compute A O", _frmDatasheet.btnComputeAO_Click);
            btnComputeAO.LargeImage   = Properties.Resources.Compute;
            btnComputeAO.GroupCaption = grpManipulate;
            btnComputeAO.Enabled      = false;
            App.HeaderControl.Add(btnComputeAO);


            btnManipulate              = new SimpleActionItem(kDataSheet, "Manipulate", _frmDatasheet.btnManipulate_Click);
            btnManipulate.LargeImage   = Properties.Resources.Manipulate;
            btnManipulate.GroupCaption = grpManipulate;
            btnManipulate.Enabled      = false;
            App.HeaderControl.Add(btnManipulate);


            btnTransform              = new SimpleActionItem(kDataSheet, "Transform", _frmDatasheet.btnTransform_Click);
            btnTransform.LargeImage   = Properties.Resources.Transform;
            btnTransform.GroupCaption = grpManipulate;
            btnTransform.Enabled      = false;
            App.HeaderControl.Add(btnTransform);


            btnGoToModeling              = new SimpleActionItem(kDataSheet, "Go To Model", _frmDatasheet.btnGoToModeling_Click);
            btnGoToModeling.LargeImage   = Properties.Resources.GoToModeling;
            btnGoToModeling.GroupCaption = grpManipulate;
            btnGoToModeling.Enabled      = false;
            App.HeaderControl.Add(btnGoToModeling);
        }
Ejemplo n.º 13
0
        public override void Activate()
        {
            App.HeaderControl.Add(new RootItem(AisMenuKey, Resources.MenuAIS));
            App.HeaderControl.Add(mnuDeviceStart = new SimpleActionItem(AisMenuKey, Resources.DeviceStart, DeviceStart)
            {
                LargeImage   = Resources.playback_start_32,
                SmallImage   = Resources.playback_start_16,
                ToolTipText  = "Start Decoding...",
                GroupCaption = AisGroupCaption
            });
            App.HeaderControl.Add(mnuDeviceStop = new SimpleActionItem(AisMenuKey, Resources.DeviceStop, DeviceStop)
            {
                LargeImage   = Resources.playback_stop_32,
                SmallImage   = Resources.playback_stop_16,
                ToolTipText  = "Stop Decoding",
                GroupCaption = AisGroupCaption,
                Enabled      = false
            });

            pseudoAisPort.LogFilePath   = Application.StartupPath + "\\AIS.log";
            pseudoAisPort.DataReceived += new EventHandler <SerialDataReceivedEventArgs>(pseudoAisPortDataReceived);

            refreshTimer.Enabled  = false;
            refreshTimer.Interval = 1500;
            refreshTimer.Tick    += new EventHandler(refreshTimerTick);

            helper       = new AISHelper(App.Map.Projection);
            vesselsLayer = helper.VesselsLayer;

            base.Activate();
        }
Ejemplo n.º 14
0
        //add a datasheet plugin root item
        void AddIPyPLSRibbon()
        {
            _PLSModelTab           = new RootItem(kPLSModel, _panelName);
            _PLSModelTab.SortOrder = 100;
            App.HeaderControl.Add(_PLSModelTab);



            //add sub-ribbons
            //section for adding data
            const string rGroupCaption = _panelName;

            btnRun              = new SimpleActionItem(kPLSModel, "Run", btnRunn_Click);
            btnRun.LargeImage   = Properties.Resources.Run;
            btnRun.GroupCaption = rGroupCaption;
            btnRun.Enabled      = true;
            App.HeaderControl.Add(btnRun);



            btnGoToPred              = new SimpleActionItem(kPLSModel, "Go To Prediction", _IPyPLS.btnSelectModel_Click);
            btnGoToPred.LargeImage   = Properties.Resources.GoToPrediction;
            btnGoToPred.GroupCaption = rGroupCaption;
            btnGoToPred.Enabled      = false;
            App.HeaderControl.Add(btnGoToPred);
        }
Ejemplo n.º 15
0
        private void AddMenuItems(IHeaderControl header)
        {
            // add sample menu items...
            if (header == null)
            {
                return;
            }

            const string SampleMenuKey = "kSample";

            header.Add(new RootItem(SampleMenuKey, "MyPlugin"));
            SimpleActionItem alphaItem = new SimpleActionItem(SampleMenuKey, "Alpha", null)
            {
                Key = "kA"
            };

            header.Add(alphaItem);
            header.Add(new SimpleActionItem(SampleMenuKey, "Bravo", null));
            header.Add(new SimpleActionItem(SampleMenuKey, "Charlie", null));
            header.Add(new MenuContainerItem(SampleMenuKey, "submenu", "B"));
            header.Add(new SimpleActionItem(SampleMenuKey, "submenu", "1", null));
            SimpleActionItem item = new SimpleActionItem(SampleMenuKey, "submenu", "2", null);

            header.Add(item);
            header.Add(new SimpleActionItem(SampleMenuKey, "submenu", "3", null));

            alphaItem.Enabled = false;
            header.Remove(item.Key);
        }
        public override void Activate()
        {
            this._Explorer      = Manager.DatabaseExplorerController.ViewModel.View as UserControl;
            this._Explorer.Name = "dbexplorer";

            var dock = new DockablePanel("kDatabaseExplorer", "Database",
                                         _Explorer, DockStyle.Right)
            {
                SmallImage = Properties.Resources.DatabaseServer16
            };

            App.DockManager.Add(dock);

            var showDatabase = new SimpleActionItem("kView", "ODM Database",
                                                    delegate(object sender, EventArgs e)
                                                    { App.DockManager.ShowPanel("kDatabaseExplorer"); })
            {
                Key          = "kShowDatabaseExplorer",
                ToolTipText  = "Show ODM Database Explorer",
                GroupCaption = "Data",
                LargeImage   = Heiflow.Plugins.Default.Properties.Resources.DatabaseServer32
            };

            App.HeaderControl.Add(showDatabase);
            this.App.DockManager.HidePanel("kDatabaseExplorer");
            base.Activate();
        }
Ejemplo n.º 17
0
        private void AddButtons()
        {
            switch (App.ShowExtensionsDialog)
            {
            case ShowExtensionsDialog.Default:
                var simpleAction = new SimpleActionItem(HeaderControl.ApplicationMenuKey, "Extension Manager...", ExtensionManager_Click);
                simpleAction.GroupCaption = HeaderControl.ApplicationMenuKey;
                simpleAction.SmallImage   = Resources.plugin_16x16;
                simpleAction.LargeImage   = Resources.plugin_32x32;
                simpleAction.SortOrder    = 100;
                App.HeaderControl.Add(simpleAction);

                //sample projects menu
                SimpleActionItem simpleActionItem = new SimpleActionItem(HeaderControl.ApplicationMenuKey, "Open sample project..", OpenSampleProjects_Click);
                simpleActionItem.GroupCaption = HeaderControl.ApplicationMenuKey;
                simpleActionItem.SmallImage   = Resources.plugin_16x16;
                simpleActionItem.LargeImage   = Resources.plugin_32x32;
                base.App.HeaderControl.Add(simpleActionItem);

                break;

            case ShowExtensionsDialog.MapGlyph:
                AppFunction fun = new AppFunction {
                    Manager = App, Map = App.Map
                };
                App.Map.MapFunctions.Insert(0, fun);
                fun.Activate();
                break;
            }
        }
Ejemplo n.º 18
0
        //add a datasheet plugin root item
        public void AddRibbon(string sender)
        {
            locationTab           = new RootItem(strPanelKey, strPanelCaption);
            locationTab.SortOrder = (short)pluginType;
            App.HeaderControl.Add(locationTab);

            //tell ProjMngr if this is being Shown
            if (sender == "Show")
            {
                //make this the selected root
                App.HeaderControl.SelectRoot(strPanelKey);
            }


            //section for working with data
            const string grpManipulate = "Waste time and space";

            btnNull              = new SimpleActionItem(strPanelKey, "Do nothing!", btnNull_Click);
            btnNull.LargeImage   = Properties.Resources.USGS;
            btnNull.GroupCaption = grpManipulate;
            btnNull.Enabled      = false;
            App.HeaderControl.Add(btnNull);

            //var validateBtn = new SimpleActionItem("Validate", btnValidate_Click) { RootKey = kVBLocation, ToolTipText = "Validate Data", LargeImage = Properties.Resources.validate };
            //App.HeaderControl.Add(validateBtn);

            //var computeBtn = new SimpleActionItem("Compute", btnCompute_Click) { RootKey = kVBLocation, ToolTipText = "Compute" };
            //App.HeaderControl.Add(computeBtn);

            //var manipulateBtn = new SimpleActionItem("Manipulate", btnManipulate_Click) { RootKey = kVBLocation, ToolTipText = "Manipulate", LargeImage = Properties.Resources.manipulate };
            //App.HeaderControl.Add(manipulateBtn);

            //var transformBtn = new SimpleActionItem("Transform", btnTransform_Click) { RootKey = kVBLocation, ToolTipText = "Transform", LargeImage = Properties.Resources.transform };
            //App.HeaderControl.Add(transformBtn);
        }
Ejemplo n.º 19
0
 /// <inheritdoc />
 public override void Activate()
 {
     _toolsButton = new SimpleActionItem(Resources.ToolsButtonText, ButtonClick);
     App.HeaderControl.Add(_toolsButton);
     ShowToolsPanel();
     base.Activate();
     OnAppCultureChanged(App, App.AppCulture);
 }
Ejemplo n.º 20
0
        public void TestConstruction()
        {
            var action = new SimpleActionItem();

            Assert.AreEqual(true, action.IsDone);
            Assert.AreEqual(false, action.IsFrozen);
            Assert.AreEqual(false, action.IsSaved);
        }
Ejemplo n.º 21
0
        //add a datasheet plugin root item
        public void AddRibbon(string sender)
        {
            rootDatasheetTab           = new RootItem(strPanelKey, strPanelCaption);
            rootDatasheetTab.SortOrder = (short)pluginType;
            App.HeaderControl.Add(rootDatasheetTab);

            //tell ProjMngr if this is being Shown
            if (sender == "Show")
            {
                //make this the selected root
                App.HeaderControl.SelectRoot(strPanelKey);
            }

            //add sub-ribbons
            const string tGroupCaption = "Add";

            btnImport              = new SimpleActionItem(strPanelKey, "Import Data", btnImport_Click);
            btnImport.LargeImage   = Properties.Resources.Import;
            btnImport.GroupCaption = tGroupCaption;
            btnImport.Enabled      = true;
            App.HeaderControl.Add(btnImport);

            //section for validating
            const string grpValidate = "Validate";

            btnValidate              = new SimpleActionItem(strPanelKey, "Validate Data", btnValidate_Click);
            btnValidate.LargeImage   = Properties.Resources.Validate;
            btnValidate.GroupCaption = grpValidate;
            btnValidate.Enabled      = false;
            App.HeaderControl.Add(btnValidate);

            //section for working with data
            const string grpManipulate = "Work with Data";

            btnComputeAO              = new SimpleActionItem(strPanelKey, "Compute A O", _frmDatasheet.btnComputeAO_Click);
            btnComputeAO.LargeImage   = Properties.Resources.Compute;
            btnComputeAO.GroupCaption = grpManipulate;
            btnComputeAO.Enabled      = false;
            App.HeaderControl.Add(btnComputeAO);

            btnManipulate              = new SimpleActionItem(strPanelKey, "Manipulate", _frmDatasheet.btnManipulate_Click);
            btnManipulate.LargeImage   = Properties.Resources.Manipulate;
            btnManipulate.GroupCaption = grpManipulate;
            btnManipulate.Enabled      = false;
            App.HeaderControl.Add(btnManipulate);

            btnTransform              = new SimpleActionItem(strPanelKey, "Transform", _frmDatasheet.btnTransform_Click);
            btnTransform.LargeImage   = Properties.Resources.Transform;
            btnTransform.GroupCaption = grpManipulate;
            btnTransform.Enabled      = false;
            App.HeaderControl.Add(btnTransform);

            btnGoToModeling              = new SimpleActionItem(strPanelKey, "Go To Model", btnGoToModeling_Click);
            btnGoToModeling.LargeImage   = Properties.Resources.GoToModeling;
            btnGoToModeling.GroupCaption = grpManipulate;
            btnGoToModeling.Enabled      = false;
            App.HeaderControl.Add(btnGoToModeling);
        }
Ejemplo n.º 22
0
        //Add a HydroR root item
        void AddHydroRRibbon()
        {
            _hydroRTab           = new RootItem(kHydroR, _panelName);
            _hydroRTab.SortOrder = 60;
            App.HeaderControl.Add(_hydroRTab);

            string rGroupCaption  = _panelName + " Tools";
            string rScriptCaption = "Script";

            _btnR              = new SimpleActionItem(kHydroR, "Start R", _hydroRControl.btnR_Click);
            _btnR.Key          = "kBtnR";
            _btnR.LargeImage   = Properties.Resources.Ricon;
            _btnR.GroupCaption = rGroupCaption;
            App.HeaderControl.Add(_btnR);

            var btnGenR = new SimpleActionItem(kHydroR, "Generate R Code", _hydroRControl.txtGenR_Click);

            btnGenR.LargeImage   = Properties.Resources.GenerateR;
            btnGenR.GroupCaption = rGroupCaption;
            App.HeaderControl.Add(btnGenR);

            var btnSendLine = new SimpleActionItem(kHydroR, "Send Line", _hydroRControl.btnSend_Click);

            btnSendLine.LargeImage   = Properties.Resources.SendLine;
            btnSendLine.GroupCaption = rGroupCaption;
            App.HeaderControl.Add(btnSendLine);

            var btnSendSel = new SimpleActionItem(kHydroR, "Send Selection", _hydroRControl.btnSendSel_Click);

            btnSendSel.LargeImage   = Properties.Resources.SendSelection;
            btnSendSel.GroupCaption = rGroupCaption;
            App.HeaderControl.Add(btnSendSel);

            var btnSendAll = new SimpleActionItem(kHydroR, "Send All", _hydroRControl.btnSendAll_Click);

            btnSendAll.LargeImage   = Properties.Resources.SendScript;
            btnSendAll.GroupCaption = rGroupCaption;
            App.HeaderControl.Add(btnSendAll);

            var btnOpen = new SimpleActionItem(kHydroR, "Open Script", _hydroRControl.btnOpen_Click);

            btnOpen.LargeImage   = Properties.Resources.OpenFile;
            btnOpen.GroupCaption = rScriptCaption;
            App.HeaderControl.Add(btnOpen);

            var btnSave = new SimpleActionItem(kHydroR, "Save Script", _hydroRControl.btnSave_Click);

            btnSave.LargeImage   = Properties.Resources.SaveFile;
            btnSave.GroupCaption = rScriptCaption;
            App.HeaderControl.Add(btnSave);

            _btnSettings              = new SimpleActionItem(kHydroR, "Path to R", _hydroRControl.btnSettings_Click);
            _btnSettings.LargeImage   = Properties.Resources.RSettings_32;
            _btnSettings.SmallImage   = Properties.Resources.RSettings_16;
            _btnSettings.GroupCaption = "Settings";
            _btnSettings.Click       += new EventHandler(_hydroRControl.btnSettings_Click);
            App.HeaderControl.Add(_btnSettings);
        }
Ejemplo n.º 23
0
        private void AddMenuItems(IHeaderControl header)
        {
            SimpleActionItem contourerItem = new SimpleActionItem("Contour...", new EventHandler(menu_Click))
            {
                Key = "kC"
            };

            header.Add(contourerItem);
        }
Ejemplo n.º 24
0
        public void TestUndo()
        {
            var action = new SimpleActionItem();

            action.Undo();
            Assert.AreEqual(false, action.IsDone);
            Assert.AreEqual(false, action.IsFrozen);
            Assert.AreEqual(false, action.IsSaved);
        }
Ejemplo n.º 25
0
        private void AddMenuItems(IHeaderControl header)
        {
            SimpleActionItem contourerItem = new SimpleActionItem("Contour...", MenuClick)
            {
                Key = "kC"
            };

            header.Add(contourerItem);
        }
Ejemplo n.º 26
0
        void AddMLRRibbon()
        {
            _MLRpredTab           = new RootItem(kIPyPrediction, _panelName);
            _MLRpredTab.SortOrder = 110;
            App.HeaderControl.Add(_MLRpredTab);

            //subribbon
            const string rGroupCaption = "Import";

            btnImportIVs              = new SimpleActionItem(kIPyPrediction, "Import IVs", _frmIPyPred.btnImportIVs_Click);
            btnImportIVs.LargeImage   = Properties.Resources.ImportIVs;
            btnImportIVs.GroupCaption = rGroupCaption;
            btnImportIVs.Enabled      = true;
            App.HeaderControl.Add(btnImportIVs);

            btnImportOBs              = new SimpleActionItem(kIPyPrediction, "Import OBs", _frmIPyPred.btnImportObs_Click);
            btnImportOBs.LargeImage   = Properties.Resources.ImportOBs;
            btnImportOBs.GroupCaption = rGroupCaption;
            btnImportOBs.Enabled      = true;
            App.HeaderControl.Add(btnImportOBs);

            const string sGroupCaption = "Manipulate";

            btnPlot              = new SimpleActionItem(kIPyPrediction, "Plot", _frmIPyPred.btnPlot_Click);
            btnPlot.LargeImage   = Properties.Resources.Plot;
            btnPlot.GroupCaption = sGroupCaption;
            btnPlot.Enabled      = true;
            App.HeaderControl.Add(btnPlot);

            btnClear              = new SimpleActionItem(kIPyPrediction, "Clear", _frmIPyPred.btnClearTable_Click);
            btnClear.LargeImage   = Properties.Resources.Clear;
            btnClear.GroupCaption = sGroupCaption;
            btnClear.Enabled      = true;
            App.HeaderControl.Add(btnClear);

            btnExportAsCSV              = new SimpleActionItem(kIPyPrediction, "Export as CSV", _frmIPyPred.btnExportTable_Click);
            btnExportAsCSV.LargeImage   = Properties.Resources.ExportAsCSV;
            btnExportAsCSV.GroupCaption = sGroupCaption;
            btnExportAsCSV.Enabled      = true;
            App.HeaderControl.Add(btnExportAsCSV);

            const string tGroupCaption = "Validate";

            btnIVDataValidation              = new SimpleActionItem(kIPyPrediction, "IV Data Validation", _frmIPyPred.btnIVDataValidation_Click);
            btnIVDataValidation.LargeImage   = Properties.Resources.IVDataVal;
            btnIVDataValidation.GroupCaption = tGroupCaption;
            btnIVDataValidation.Enabled      = true;
            App.HeaderControl.Add(btnIVDataValidation);

            btnMakePrediction              = new SimpleActionItem(kIPyPrediction, "Make Predictions", _frmIPyPred.btnMakePredictions_Click);
            btnMakePrediction.LargeImage   = Properties.Resources.MakePred;
            btnMakePrediction.GroupCaption = tGroupCaption;
            btnMakePrediction.Enabled      = true;
            App.HeaderControl.Add(btnMakePrediction);
        }
Ejemplo n.º 27
0
 /// <inheritdoc/>
 public override void Activate()
 {
     _aboutButton = new SimpleActionItem(HeaderControl.ApplicationMenuKey, Resources.btnAbout, ButtonClick)
     {
         GroupCaption = HeaderControl.ApplicationMenuKey,
         SortOrder    = 500, SmallImage = Resources.information_16x16,
         LargeImage   = Resources.information
     };
     App.HeaderControl.Add(_aboutButton);
     base.Activate();
 }
Ejemplo n.º 28
0
        public void TestAddAction()
        {
            var stack  = new ActionStackTestContainer(5);
            var action = new SimpleActionItem();

            stack.Stack.Add(action);
            Assert.AreEqual(true, stack.Stack.CanUndo);
            Assert.AreEqual(false, stack.Stack.CanRedo);
            Assert.AreEqual(1, stack.Stack.ActionItems.Count());
            Assert.AreEqual(action, stack.Stack.ActionItems.First());
            stack.CheckRaiseCount(1, 0, 0, 0, 0);
        }
Ejemplo n.º 29
0
 public override void Activate()
 {
     _heiflow_time = new SimpleActionItem("kModel", "HEIFLOW Time", HeiflowTime_Clicked)
     {
         Key          = "kHeiflowTime",
         ToolTipText  = "Set HEIFLOW Time",
         GroupCaption = "Time",
         LargeImage   = Properties.Resources.calendar_32,
         SortOrder    = 1
     };
     App.HeaderControl.Add(_heiflow_time);
 }
Ejemplo n.º 30
0
        public void TestSavePointEquity()
        {
            // Completely undo the stack
            var stack   = new ActionStackTestContainer(5);
            var action1 = new SimpleActionItem();

            stack.Stack.Add(action1);
            var savePoint1 = stack.Stack.CreateSavePoint(false);
            var savePoint2 = stack.Stack.CreateSavePoint(true);

            Assert.AreEqual(savePoint1, savePoint2);
        }