Exemplo n.º 1
0
 public FindOption this[string strOptionName] {
     get { return(this.Search(strOptionName)); }
     set {
         FindOption opt = this.Search(strOptionName);
         opt = value;
     }
 }
Exemplo n.º 2
0
        private ComboBox CreateComboBoxOperator(FindOption fOption, int iWidth)
        {
            ComboBox cboCompare = new ComboBox();

            cboCompare.DropDownStyle = ComboBoxStyle.DropDownList;
            cboCompare.Dock          = DockStyle.Left;
            cboCompare.Width         = iWidth;
            //
            foreach (FindOperator oper in fOption.FindOperators)
            {
                //cboCompare.Items.Add(oper.Name);
                cboCompare.Items.Add(oper.Display);
            }

            if (cboCompare.Items.Count > 0)
            {
                int index = cboCompare.Items.IndexOf(fOption.SelectedOperator.Name);
                if (index >= 0)
                {
                    cboCompare.SelectedIndex = index;
                }
                else
                {
                    cboCompare.SelectedIndex = 0;
                }
                return(cboCompare);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 3
0
        //		private IValueType m_valueType1;
        //		private IValueType m_valueType2;



        private CheckBox CreateCheckBox(FindOption fOption)
        {
            CheckBox chkBox = new CheckBox();

            //chkBox.Size = new Size(chkBox.Height + 5, chkBox.Height);
            chkBox.Size    = new Size(chkBox.Height - 10, chkBox.Height);
            chkBox.Dock    = DockStyle.Left;
            chkBox.Checked = fOption.Checked;
            return(chkBox);
        }
Exemplo n.º 4
0
        private Label CreateLabelName(FindOption fOption, int iWidth)
        {
            Label lbl = new Label();

            lbl.FlatStyle = FlatStyle.Standard;
            lbl.Text      = fOption.Caption;
            lbl.Dock      = DockStyle.Left;
            lbl.TextAlign = ContentAlignment.MiddleLeft;
            lbl.AutoSize  = false;
            lbl.Width     = iWidth;
            return(lbl);
        }
Exemplo n.º 5
0
 public PanelOption(FindOption findOption, int iOptionNameWidth, int iCompareNameWidth)
     : base()
 {
     m_findOption = findOption;
     //			 m_valueType1 = findOption.ValueType1;
     //			m_valueType2 = findOption.ValueType2;
     CreateControls(findOption, iOptionNameWidth, iCompareNameWidth);
     AssignValuePopup();
     SetTabIndex();
     SetControlPosition();
     SetButtonList();
     AttachControlEvent();
 }
Exemplo n.º 6
0
 public int Add(FindOption value)
 {
     return(List.Add(value));
 }
Exemplo n.º 7
0
        private void CreateControls(FindOption findOption, int iOptionNameWidth, int iCompareNameWidth)
        {
            // Check Box
            m_chkBox = CreateCheckBox(findOption);
            // Label Name
            m_lblOptionName = CreateLabelName(findOption, iOptionNameWidth);
            if (findOption.FindOperators.Count > 0)
            {
                // create combo box operator
                m_cboOperators = CreateComboBoxOperator(findOption, iCompareNameWidth);
                // create input value1
                findOption.ValueType1.SetValue(findOption.SelectedValue1);
                m_inputValue1 = findOption.ValueType1.ControlObject;

                // create button list value 1
                m_btnListValue1           = new Button();
                m_btnListValue1.FlatStyle = FlatStyle.System;
                m_btnListValue1.Size      = new Size(m_inputValue1.Height, m_inputValue1.Height);
                m_btnListValue1.Text      = "...";

                m_lblTo = null;

                // If FindOperator is contain "between", so I have to create one InputValue
                if (findOption.FindOperators.Contains(FindOperator.Between))
                {
                    // create to label
                    m_lblTo = new Label();
                    //Fix bug by Wirachai T., Raktai C. 2007/06/07
                    //m_lblTo.FlatStyle = FlatStyle.System;
                    m_lblTo.FlatStyle = FlatStyle.Standard;
                    m_lblTo.Text      = "to";
                    m_lblTo.TextAlign = ContentAlignment.MiddleLeft;
                    m_lblTo.Width     = 20;
                    // create input value 2
                    findOption.ValueType2.SetValue(findOption.SelectedValue2);
                    m_inputValue2 = findOption.ValueType2.ControlObject;

                    // create button list value 2
                    m_btnListValue2           = new Button();
                    m_btnListValue2.FlatStyle = FlatStyle.Standard;
                    m_btnListValue2.Size      = new Size(m_inputValue2.Height, m_inputValue2.Height);
                    m_btnListValue2.Text      = "...";
                }
                // add control to me
                if (findOption.FindOperators.Contains(FindOperator.Between))
                {
                    //Modify By Wirachai T. 2007/07/12
                    //this.Controls.Add(m_btnListValue2);
                    //
                    this.Controls.Add(m_inputValue2);
                    this.Controls.Add(m_lblTo);
                    EnabledControl(findOption.EditValueAble, m_btnListValue2, m_inputValue2);
                }

                this.Controls.Add(m_inputValue1);
                this.Controls.Add(m_cboOperators);
                EnabledControl(findOption.EditValueAble, m_btnListValue1, m_inputValue1);
            }
            this.Controls.Add(m_lblOptionName);
            this.Controls.Add(m_chkBox);

            // set control disabled, if EditCheckAble is false
            m_chkBox.Enabled = findOption.EditCheckAble;
        }