Exemplo n.º 1
0
 void CheckEditUse_CheckedChanged(object sender, EventArgs e)
 {
     m_Condition.Enabled = m_EditUse.Checked;
     m_Operator.Enabled  = m_EditUse.Checked;
     m_EditValue.Enabled = m_EditUse.Checked;
     ConditionModule.UpdateConditionQuery();
 }
Exemplo n.º 2
0
 void m_btnRemove_Click(object sender, EventArgs e)
 {
     Group.LayoutGroup.BeginUpdate();
     Group.Conditions.Remove(this);
     Group.LayoutGroup.Remove(m_ConditionGroupLayout);
     m_ConditionGroupLayout.Clear();
     Dispose();
     Group.LayoutGroup.EndUpdate();
     ConditionModule.UpdateConditionQuery();
 }
Exemplo n.º 3
0
 public void CreateFixedCondition(ModuleFieldInfo fieldInfo)
 {
     try
     {
         SearchLayout.SuspendLayout();
         var newCondition = new UISearchCondition(ModuleInfo, this);
         newCondition.SetCondition(fieldInfo);
         SearchLayout.ResumeLayout();
         ConditionModule.UpdateConditionQuery();
     }
     catch (Exception ex)
     {
         ParentModule.ShowError(ex);
     }
 }
Exemplo n.º 4
0
 void EditValue_EditValueChanged(object sender, EventArgs e)
 {
     ConditionModule.UpdateConditionQuery();
 }
Exemplo n.º 5
0
        public UISearchCondition(ModuleInfo moduleInfo, UISearchGroup group)
        {
            Group        = group;
            m_ModuleInfo = moduleInfo;
            Group.Conditions.Add(this);
            ParentModule = group.ParentModule;

            // NewGroup
            m_ConditionGroupLayout = group.LayoutGroup.AddGroup();
            m_ConditionGroupLayout.GroupBordersVisible = false;

            // CheckEdit Use
            m_EditUse = new CheckEdit {
                TabStop = false, Text = ""
            };
            // -> Layout
            m_EditUseLayoutItem                     = m_ConditionGroupLayout.AddItem("", m_EditUse);
            m_EditUseLayoutItem.TextVisible         = false;
            m_EditUseLayoutItem.SizeConstraintsType = SizeConstraintsType.Custom;
            m_EditUseLayoutItem.MaxSize             =
                m_EditUseLayoutItem.MinSize         = new Size(24, 22);
            m_EditUse.CheckedChanged               += CheckEditUse_CheckedChanged;

            // Condition ComboBox
            m_Condition = new ImageComboBoxEdit {
                TabStop = false
            };
#if DEBUG
            var button = new EditorButton(ButtonPredefines.Up);
            button.Tag = "DEBUG_EDIT";
            m_Condition.Properties.Buttons.Add(button);
            m_Condition.ButtonClick += delegate(object sender, ButtonPressedEventArgs e)
            {
                var fieldInfo = m_Condition.EditValue as ModuleFieldInfo;
                if (e.Button == button)
                {
                    var ucModule = MainProcess.CreateModuleInstance("02905", "MED");
                    ucModule["P01"] = fieldInfo.ModuleID;
                    ucModule["C01"] = fieldInfo.FieldID;
                    ucModule.ShowDialogModule(ParentModule);
                }
            };
#endif
            m_Condition.EditValueChanged += cboCondition_EditValueChanged;
            // -> Layout
            m_ConditionLayoutItem                     = m_ConditionGroupLayout.AddItem("", m_Condition, m_EditUseLayoutItem, InsertType.Right);
            m_ConditionLayoutItem.TextVisible         = false;
            m_ConditionLayoutItem.SizeConstraintsType = SizeConstraintsType.Custom;
            m_ConditionLayoutItem.MinSize             =
                m_ConditionLayoutItem.MaxSize         = new Size(320, 22);

            // Operator ComboBox
            // -> Layout
            m_OperatorLayoutItem = m_ConditionGroupLayout.AddItem(m_ConditionLayoutItem, InsertType.Right);

            // Editor Value
            // -> Layout
            m_EditValueLayoutItem = m_ConditionGroupLayout.AddItem(m_OperatorLayoutItem, InsertType.Right);

            // Button Remove
            m_RemoveButton = new SimpleButton
            {
                TabStop = false
            };
            ParentModule.Language.FormatButton(m_RemoveButton, "btnRemoveCondition");

            m_RemoveButton.Click += m_btnRemove_Click;
            // -> Layout
            m_RemoveButtonLayoutItem                     = m_ConditionGroupLayout.AddItem("", m_RemoveButton, m_EditValueLayoutItem, InsertType.Right);
            m_RemoveButtonLayoutItem.TextVisible         = false;
            m_RemoveButtonLayoutItem.SizeConstraintsType = SizeConstraintsType.Custom;
            m_RemoveButtonLayoutItem.MinSize             =
                m_RemoveButtonLayoutItem.MaxSize         = new Size(100, 22);

            group.LayoutGroup.Add(m_ConditionGroupLayout);

            InitializeConditionComboBox();
            ConditionModule.UpdateConditionQuery();
            m_EditUse.Checked = true;
        }
Exemplo n.º 6
0
 void DeleteGroupCondition_Click(object sender, EventArgs e)
 {
     ParentGroup.Groups.Remove(this);
     Dispose();
     ConditionModule.UpdateConditionQuery();
 }