示例#1
0
/// <summary>
/// Setup filter controls with current criteria values
/// </summary>

        void SetupFilter(FilterType ft)
        {
            if (ft == FilterType.BasicCriteria)
            {
                FilterBasicControl.Setup(ColInfo, this);
            }
            else if (ft == FilterType.CheckBoxList)
            {
                FilterListControl.Setup(ColInfo);
            }
            else if (ft == FilterType.ItemSlider)
            {
                FilterItemControl.Setup(ColInfo);
            }
            else if (ft == FilterType.RangeSlider)
            {
                FilterRangeControl.Setup(ColInfo);
            }
            else if (ft == FilterType.StructureSearch)
            {
                FilterStructureControl.Setup(ColInfo);
            }
        }
示例#2
0
        /// <summary>
        /// Add a filter item
        /// </summary>
        /// <param name="qc"></param>
        /// <param name="criteriaText"></param>

        void AddFilter(QueryColumn qc)
        {
            Control    control = null, focusControl = null;
            ColumnInfo colInfo;


            try { colInfo = ResultsFormat.GetColumnInfo(Qm, qc); }
            catch { return; }             // ignore if col no longer in query

            int buttonDy = 4;

            if (qc.SecondaryFilterType == FilterType.BasicCriteria)
            {
                FilterBasicCriteriaControl fbc = new FilterBasicCriteriaControl();
                fbc.Setup(colInfo, this);
                if (qc == ActiveQueryColumn)
                {
                    focusControl = fbc.Value;                                          // put focus on value if this is the active column
                }
                control = fbc;
            }

            else if (qc.SecondaryFilterType == FilterType.CheckBoxList)
            {
                FilterCheckBoxListControl flc = new FilterCheckBoxListControl();
                flc.Setup(colInfo);
                control = flc;
            }

            else if (qc.SecondaryFilterType == FilterType.ItemSlider)
            {
                FilterItemSliderControl fis = new FilterItemSliderControl();
                fis.Setup(colInfo);
                control  = fis;
                buttonDy = 16;
            }

            else if (qc.SecondaryFilterType == FilterType.RangeSlider)
            {
                FilterRangeSliderControl frs = new FilterRangeSliderControl();
                frs.Setup(colInfo);
                control  = frs;
                buttonDy = 16;
            }

            else if (qc.SecondaryFilterType == FilterType.StructureSearch)
            {
                FilterStructureControl fss = new FilterStructureControl();
                fss.Setup(colInfo);
                control = fss;
            }

            control.Top   = PanelYPos;
            control.Left  = 0;
            control.Width = ScrollablePanel.Width - 34;
            ScrollablePanel.Controls.Add(control);
            if (focusControl != null)
            {
                focusControl.Focus();
            }

//			if (qc.SecondaryFilterType != FilterType.StructureSearch)
            AddFilterDropDownButton(qc, ScrollablePanel.Width - 32, PanelYPos + buttonDy);

            PanelYPos += control.Height + 2;

            return;
        }