示例#1
0
        public formFilter(oFunctionList functionList, oTabManager tabManager, oTabFunctionList tab, FILTER_TYPE filterType, oVisPlayBar playBar)
        {
            InitializeComponent();
            this.tabManager = tabManager;
            this.tab = tab;
            this.functionGrid.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.functionGrid_CellValueNeeded);
            this.functionList = functionList;
            this.functionListOutput = functionList.Clone();
            updatePredictedOutput();
            timerRefreshOutput.Enabled = false;
            this.playBar = playBar;

            // Make changes to the interface as determined by the filterType
            this.filterType = filterType;
            switch(filterType)
            {
                case FILTER_TYPE.FUNCTION_LIST_FILTERED:
                    // Do nothing special
                    break;
                case FILTER_TYPE.FUNCTION_LIST_FULL:
                    // We cannot replace this list
                    this.buttonApplyReplace.Visible = false;
                    break;
                case FILTER_TYPE.GENERAL:
                    // We do not want to change any tabs, just provide functionListOutput as the result
                    buttonApplyReplace.Visible = false;
                    buttonApplyNew.Text = "Apply";

                    // We cannot clip data to selection
                    this.radioTimeRangeClip.Enabled = false;

                    break;
            }
        }
示例#2
0
        /// <summary>
        /// This creates a new tab from a list of functions with specified name.
        /// </summary>
        /// <param name="name">Display name of the tab.</param>
        /// <param name="functionList">The list of functions to use.</param>
        /// <param name="select">Whether or not to select this new tab.</param>
        /// <param name="filtered">Whether or not is function subset - just for presentation.</param>
        public void addFunctionListTab(string name, oFunctionList functionList, bool select, bool filtered)
        {
            // Create the new oTab class and tab page
            oTabFunctionList tabFunctionList = new oTabFunctionList(this, toolStrip, panelMain, mainToolStrip, name, functionList, visMain, visPlayBar);

            tabs.Add(tabFunctionList);
            tabController.TabPages.Add(tabFunctionList.WorkingPage);
            tabFunctionList.WorkingPage.ImageIndex = tabController.ImageList.Images.IndexOfKey(filtered ? @"FunctionFilter.ico" : @"FunctionFull.ico");

            if (select)
            {
                // Deactivate the selected tab
                if (tabController.SelectedIndex >= 0 && tabController.SelectedIndex < tabController.TabPages.Count)
                {
                    tabs[tabController.SelectedIndex].deactivate();
                }

                // Select the new tab page
                tabController.SelectedIndex = tabs.Count - 1;
                tabs[tabs.Count - 1].activate();
            }
        }
示例#3
0
        /// <summary>
        /// This creates a new tab from a list of functions with specified name.
        /// </summary>
        /// <param name="name">Display name of the tab.</param>
        /// <param name="functionList">The list of functions to use.</param>
        /// <param name="select">Whether or not to select this new tab.</param>
        /// <param name="filtered">Whether or not is function subset - just for presentation.</param>
        public void addFunctionListTab(string name, oFunctionList functionList, bool select, bool filtered)
        {
            // Create the new oTab class and tab page
            oTabFunctionList tabFunctionList = new oTabFunctionList(this, toolStrip, panelMain, mainToolStrip, name, functionList, visMain, visPlayBar);
            tabs.Add(tabFunctionList);
            tabController.TabPages.Add(tabFunctionList.WorkingPage);
            tabFunctionList.WorkingPage.ImageIndex = tabController.ImageList.Images.IndexOfKey(filtered ? @"FunctionFilter.ico" : @"FunctionFull.ico");

            if( select )
            {
                // Deactivate the selected tab
                if( tabController.SelectedIndex >= 0 && tabController.SelectedIndex < tabController.TabPages.Count )
                    tabs[tabController.SelectedIndex].deactivate();

                // Select the new tab page
                tabController.SelectedIndex = tabs.Count - 1;
                tabs[tabs.Count - 1].activate();
            }
        }