private void CreateControls(IList<QueryGroupItem> groupItems)
        {
            this.layoutControlContainer.BeginUpdate();
            try
            {
                this.layoutControlGroupMain.Clear();
                foreach (var groupItem in groupItems)
                {
                    var combo = new CheckedComboBoxEdit {Name = "checkedCombo" + groupItems.IndexOf(groupItem)};
                    combo.Properties.SelectAllItemVisible = true;
                    combo.Properties.SelectAllItemCaption = "Выбрать все";
                    combo.Properties.DropDownRows = 10;
                    combo.Properties.DisplayMember = "Key";
                    combo.Properties.ValueMember = "Value";
                    combo.Properties.DataSource = groupItem.QueryDictionary.ToList();
                    EventHandler popupHandler = null;
                    popupHandler = (sender, args) =>
                    {
                        var popupContainer = (PopupContainerForm) ((IPopupControl) sender).PopupWindow;
                        _listBoxQueries = popupContainer.Controls[3].Controls[0] as CheckedListBoxControl;

                        if (_listBoxQueries == null) 
                            return;
                        _listBoxQueries.ItemCheck += (o, eventArgs) =>
                        {
                            combo.Text = string.Join("; ",
                                _listBoxQueries.CheckedIndices.OfType<int>().Select(t => _listBoxQueries.GetItemText(t)));
                            ListBoxQueriesOnItemCheck(o, eventArgs);
                        };

                        combo.Popup -= popupHandler;
                    };
                    combo.Popup += popupHandler;

                    combo.Closed += (sender, args) =>
                    {
                        combo.Text = string.Join("; ",
                            _listBoxQueries.CheckedIndices.OfType<int>().Select(t => _listBoxQueries.GetItemText(t)));
                    };
                    var layoutItem = new LayoutControlItem()
                    {
                        Text = groupItem.Head,
                        TextLocation = Locations.Top,
                        Control = combo
                    };
                    layoutItem.AppearanceItemCaption.Font = new Font("Segoe UI", 9);
                    this.layoutControlGroupMain.Add(layoutItem);
                }
                if (_queryListOthers.Any())
                {
                    var checkAllBox = new CheckEdit
                    {
                        CheckState = CheckState.Unchecked,
                        Text = "Выбрать все"
                    };
                    checkAllBox.Properties.AllowGrayed = true;
                    checkAllBox.CheckedChanged += (sender, args) =>
                    {
                        if (checkAllBox.Checked)
                        {
                            _listBoxOtherQueries.CheckAll();
                        }
                        else
                        {
                            _listBoxOtherQueries.UnCheckAll();
                        }
                    };
                    _listBoxOtherQueries = new CheckedListBoxControl
                    {
                        DisplayMember = "title",
                        ValueMember = null,
                        DataSource = _queryListOthers,
                        Name = "listBoxOtherQueries",
                        CheckOnClick = true,
                        AutoSizeInLayoutControl = true
                        //MinimumSize = new Size(0, 200)
                    };
                    
                    _listBoxOtherQueries.ItemCheck += (sender, args) =>
                    {
                        if (_listBoxOtherQueries.CheckedItemsCount < _listBoxOtherQueries.ItemCount)
                            checkAllBox.CheckState = CheckState.Indeterminate;
                        else if (_listBoxOtherQueries.CheckedItemsCount == 0)
                            checkAllBox.CheckState = CheckState.Unchecked;
                        else
                            checkAllBox.CheckState = CheckState.Checked;
                            
                        ListBoxQueriesOnItemCheck(sender, args);
                    };

                    var layoutItem = new LayoutControlItem()
                    {
                        Text = "Остальные запросы",
                        TextLocation = Locations.Top,
                        Control = _listBoxOtherQueries
                    };
                    layoutItem.AppearanceItemCaption.Font = new Font("Segoe UI", 9);
                    this.layoutControlGroupMain.Add(layoutItem);
                    this.layoutControlGroupMain.AddItem(new LayoutControlItem()
                    {
                        TextVisible = false,
                        Control = checkAllBox
                    });
                    
                }
            }
            finally
            {
                this.layoutControlContainer.EndUpdate();
            }
        }
        public void AddResultItem(string text)
        {
            Form formMain = ClientEnvironment.MainForm;

            if(formMain.InvokeRequired)
            {
                formMain.BeginInvoke(new AddStringResultDelegate(AddResultItem), text);
                return;
            }

            if (text == null)
            {
                throw new ArgumentNullException("text");
            }

            layoutControlWarnings.BeginUpdate();

            LabelControl label = new LabelControl();
            label.Text = text;
            label.Appearance.ImageList = imageCollection32;
            label.Appearance.ImageIndex = 0;
            label.Appearance.ImageAlign = ContentAlignment.MiddleLeft;
            label.Appearance.Options.UseImage = true;
            label.ImageAlignToText = ImageAlignToText.LeftCenter;
            LayoutControlItem item = new LayoutControlItem(layoutControlWarnings, label);
            item.TextVisible = false;
            item.SizeConstraintsType = SizeConstraintsType.Custom;
            item.MinSize = new Size(layoutControlWarnings.Width - 32, 40);
            item.MaxSize = new Size(layoutControlWarnings.Width, 40);
            layoutControlWarnings.AddItem(item);

            layoutControlWarnings.EndUpdate();
        }
Example #3
0
        /// <summary>
        /// Bind dynamic controls inside layout control
        /// </summary>
        public void BindControls()
        {
            #region Initialize
            if (Questionnaire == null)
                MessageBox.Show("Questionnaire must be bind with JSON first.", "Seminar Component");
            var answerOpt = Questionnaire.Form.Settings.AnswerOptions[0] as ISeminar;
            if (SeminarScheduleDataSource == null) {
                if (answerOpt != null) {
                    if (answerOpt.SeminarSchedule != null && answerOpt.SeminarSchedule.ScheduleValues.Count > 0)
                        SeminarScheduleDataSource = answerOpt.SeminarSchedule.ScheduleValues;
                    else {
                        MessageBox.Show("\"SeminarScheduleDataSource\" property must be set first.", "Seminar Component");
                        return;
                    }
                } else {
                    MessageBox.Show("\"SeminarScheduleDataSource\" property must be set first.", "Seminar Component");
                    return;
                }

            }
            #endregion

            this.layoutControlGroupQuestion1.Clear();
            Settings oSettings = Questionnaire.Form.Settings;

            // layoutControlGroupQuestion1
            this.layoutControlGroupQuestion1.Name = "layoutControlGroupQuestion" + Guid.NewGuid().ToString();
            this.layoutControlGroupQuestion1.AppearanceGroup.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
            this.layoutControlGroupQuestion1.AppearanceGroup.GradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
            this.layoutControlGroupQuestion1.AppearanceGroup.Options.UseFont = true;
            this.layoutControlGroupQuestion1.ExpandButtonVisible = true;
            //this.layoutControlGroupQuestion1.Location = new System.Drawing.Point(0, 0);
            this.layoutControlGroupQuestion1.Padding = new DevExpress.XtraLayout.Utils.Padding(10, 10, 10, 10);
            this.layoutControlGroupQuestion1.ShowInCustomizationForm = false;
            this.layoutControlGroupQuestion1.Text = oSettings.Label + " " + oSettings.QuestionText;
            this.layoutControlGroupQuestion1.BeginUpdate();

            IList<AnswerOption> answeroptionList = Questionnaire.Form.Settings.AnswerOptions;
            ISeminar answeroption = null;
            int iAnswerOptions = answeroptionList.Count;
            System.Drawing.Size newSize;
            int selectedIndex = 0;
            int idx = 0;
            for (int x = 0; x < iAnswerOptions; ++x) {
                answeroption = answeroptionList[x] as ISeminar;

                #region Seminar List
                // layoutControlItem1
                this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
                //lookUpEdit1
                this.lookUpEdit1 = new LookUpEdit();
                this.lookUpEdit1.Name = "lookUpEdit" + Guid.NewGuid().ToString();
                this.lookUpEdit1.Properties.NullText = "";
                this.lookUpEdit1.Properties.DisplayMember = "Name";
                this.lookUpEdit1.Properties.ValueMember = "Id";
                this.lookUpEdit1.Properties.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo("Name", "Seminars"));
                this.lookUpEdit1.Properties.ShowFooter = false;
                this.lookUpEdit1.Properties.ShowHeader = false;
                this.lookUpEdit1.ItemIndex = -1;
                this.lookUpEdit1.Tag = new SeminarData() {
                    PositionIndex = "IndexPosition" + x,
                    ControlContainer = layoutControlItem1
                };
                this.lookUpEdit1.Size = new System.Drawing.Size(155, 20);
                this.lookUpEdit1.StyleController = this.StyleController;
                this.lookUpEdit1.EditValueChanged += new EventHandler(lookUpEdit1_SelectedIndexChanged);
                this.lookUpEdit1.Click += new EventHandler(layoutControlGroupQuestion1_Click);
                this.lookUpEdit1.Properties.DataSource = SeminarScheduleDataSource;

                if (answeroption.SeminarSchedule != null && !string.IsNullOrEmpty(answeroption.SeminarSchedule.SelectedValue)) {
                    this.lookUpEdit1.EditValue = answeroption.SeminarSchedule.SelectedValue;
                } else {
                    selectedIndex = -1;
                }
                this.lookUpEdit1.ItemIndex = selectedIndex;

                // layoutControlItem1
                this.layoutControlItem1.Name = "layoutControlItem" + Guid.NewGuid().ToString();
                this.layoutControlItem1.Control = this.lookUpEdit1;
                int hgt = 28;
                if (answeroption.SeminarSchedule != null && !string.IsNullOrEmpty(answeroption.SeminarSchedule.TextPrefix)) {
                    this.layoutControlItem1.Text = answeroption.SeminarSchedule.TextPrefix;
                    hgt += 20;
                } else {
                    this.layoutControlItem1.TextVisible = false;
                }
                this.layoutControlItem1.TextLocation = DevExpress.Utils.Locations.Top;
                this.layoutControlItem1.TextSize = new System.Drawing.Size(108, 13);
                this.layoutControlItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
                this.layoutControlItem1.MaxSize = new System.Drawing.Size(0, hgt);
                this.layoutControlItem1.MinSize = new System.Drawing.Size(0, hgt);
                this.layoutControlItem1.Size = new System.Drawing.Size(50, 28);
                this.layoutControlItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click);
                this.layoutControlGroupQuestion1.AddItem(this.layoutControlItem1);

                #endregion

                #region Customer Attendies
                //create our gridcontrol
                //
                // gridColumn1
                //
                this.gridColumn1 = new DevExpress.XtraGrid.Columns.GridColumn();
                this.gridColumn1.Caption = "Attending";
                this.gridColumn1.ColumnEdit = this.repositoryItemCheckEdit1;
                this.gridColumn1.FieldName = "Attending";
                this.gridColumn1.Name = "gridColumn" + Guid.NewGuid().ToString();
                this.gridColumn1.Visible = true;
                this.gridColumn1.VisibleIndex = 0;
                this.gridColumn1.Width = 57;
                //
                // repositoryItemCheckEdit1
                //
                this.repositoryItemCheckEdit1 = new DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit();
                this.repositoryItemCheckEdit1.AutoHeight = false;
                this.repositoryItemCheckEdit1.Name = "repositoryItemCheckEdit" + Guid.NewGuid().ToString();
                //
                // gridColumn2
                //
                this.gridColumn2 = new DevExpress.XtraGrid.Columns.GridColumn();
                this.gridColumn2.Caption = "Name";
                this.gridColumn2.FieldName = "Name";
                this.gridColumn2.Name = "gridColumn" + Guid.NewGuid().ToString();
                this.gridColumn2.Visible = true;
                this.gridColumn2.OptionsColumn.AllowEdit = false;
                this.gridColumn2.VisibleIndex = 1;
                this.gridColumn2.Width = 66;
                //
                // gridColumn3
                //
                this.gridColumn3 = new DevExpress.XtraGrid.Columns.GridColumn();
                this.gridColumn3.Caption = "Address";
                this.gridColumn3.FieldName = "Address";
                this.gridColumn3.Name = "gridColumn" + Guid.NewGuid().ToString();
                this.gridColumn3.Visible = true;
                this.gridColumn3.OptionsColumn.AllowEdit = false;
                this.gridColumn3.VisibleIndex = 2;
                this.gridColumn3.Width = 66;
                //
                // gridColumn4
                //
                this.gridColumn4 = new DevExpress.XtraGrid.Columns.GridColumn();
                this.gridColumn4.Caption = "City";
                this.gridColumn4.FieldName = "City";
                this.gridColumn4.Name = "gridColumn" + Guid.NewGuid().ToString();
                this.gridColumn4.Visible = true;
                this.gridColumn4.OptionsColumn.AllowEdit = false;
                this.gridColumn4.VisibleIndex = 3;
                this.gridColumn4.Width = 66;
                //
                // gridColumn5
                //
                this.gridColumn5 = new DevExpress.XtraGrid.Columns.GridColumn();
                this.gridColumn5.Caption = "Telephone";
                this.gridColumn5.FieldName = "Telephone";
                this.gridColumn5.Name = "gridColumn" + Guid.NewGuid().ToString();
                this.gridColumn5.Visible = true;
                this.gridColumn5.OptionsColumn.AllowEdit = false;
                this.gridColumn5.VisibleIndex = 4;
                this.gridColumn5.Width = 66;
                //
                // gridColumn6
                //
                this.gridColumn6 = new DevExpress.XtraGrid.Columns.GridColumn();
                this.gridColumn6.Caption = "Email";
                this.gridColumn6.FieldName = "Email";
                this.gridColumn6.Name = "gridColumn" + Guid.NewGuid().ToString();
                this.gridColumn6.Visible = true;
                this.gridColumn6.OptionsColumn.AllowEdit = false;
                this.gridColumn6.VisibleIndex = 5;
                this.gridColumn6.Width = 70;

                //
                // gridColumn7
                //
                this.gridColumn7 = new DevExpress.XtraGrid.Columns.GridColumn();
                this.gridColumn7.Caption = "AccountID";
                this.gridColumn7.FieldName = "AccountID";
                this.gridColumn7.Name = "gridColumn" + Guid.NewGuid().ToString();
                this.gridColumn7.Visible = false;
                //
                // gridColumn8
                //
                this.gridColumn8 = new DevExpress.XtraGrid.Columns.GridColumn();
                this.gridColumn8.Caption = "ContactID";
                this.gridColumn8.FieldName = "ContactID";
                this.gridColumn8.Name = "gridColumn" + Guid.NewGuid().ToString();
                this.gridColumn8.Visible = false;

                //
                // gridView1
                //
                this.gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView();
                this.gridView1.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
                this.gridColumn1,
                this.gridColumn2,
                this.gridColumn3,
                this.gridColumn4,
                this.gridColumn5,
                this.gridColumn6,
                this.gridColumn7,
                this.gridColumn8});
                this.gridView1.GridControl = this.gridControl1;
                this.gridView1.Name = "gridView" + Guid.NewGuid().ToString();
                this.gridView1.OptionsFind.AlwaysVisible = true;
                this.gridView1.OptionsSelection.EnableAppearanceFocusedCell = false;
                this.gridView1.OptionsView.ShowGroupPanel = false;
                this.gridView1.OptionsView.ColumnAutoWidth = false;
                this.gridView1.CellValueChanging += new DevExpress.XtraGrid.Views.Base.CellValueChangedEventHandler(gridView1_CellValueChanging);
                //
                // gridControl1
                //
                this.gridControl1 = new DevExpress.XtraGrid.GridControl();
                this.gridControl1.LookAndFeel.UseDefaultLookAndFeel = false;
                this.gridControl1.MainView = this.gridView1;
                this.gridControl1.Name = "gridControl" + Guid.NewGuid().ToString();
                this.gridControl1.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
                this.repositoryItemCheckEdit1});
                this.gridControl1.Size = new System.Drawing.Size(412, 74);
                this.gridControl1.TabIndex = 11;
                this.gridControl1.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
                this.gridView1});
                BindAttendiesDatasource();
                //
                // layoutControlItem2
                //
                this.layoutControlItem2 = new LayoutControlItem();
                this.layoutControlItem2.Control = this.gridControl1;
                this.layoutControlItem2.Name = "layoutControlItem" + Guid.NewGuid().ToString();
                this.layoutControlItem2.Text = answeroption.AttendiesLabel;
                this.layoutControlItem2.TextLocation = DevExpress.Utils.Locations.Top;
                this.layoutControlItem2.TextSize = new System.Drawing.Size(108, 13);
                this.layoutControlItem2.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
                this.layoutControlItem2.MaxSize = new System.Drawing.Size(0, 200);
                this.layoutControlItem2.MinSize = new System.Drawing.Size(0, 200);
                this.layoutControlItem2.Size = new System.Drawing.Size(200, 200);
                this.layoutControlGroupQuestion1.AddItem(this.layoutControlItem2);
                //
                // simpleButton1
                //
                this.simpleButton1 = new SimpleButton();
                this.simpleButton1.Name = "simpleButton" + Guid.NewGuid().ToString();
                this.simpleButton1.Size = new System.Drawing.Size(130, 22);
                this.simpleButton1.StyleController = this.StyleController;
                this.simpleButton1.Text = answeroption.AddContactButtonLabel;
                this.simpleButton1.Click += new EventHandler(simpleButton1_Click);

                // layoutControlItem2
                this.layoutControlItem2 = new LayoutControlItem();
                this.layoutControlItem2.Name = "layoutControlItem" + Guid.NewGuid().ToString();
                this.layoutControlItem2.Control = this.simpleButton1;
                this.layoutControlItem2.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
                this.layoutControlItem2.MaxSize = new System.Drawing.Size(150, 24);
                this.layoutControlItem2.MinSize = new System.Drawing.Size(80, 24);
                this.layoutControlItem2.Size = new System.Drawing.Size(80, 24);
                this.layoutControlItem2.TextVisible = false;
                this.layoutControlItem2.Click += new EventHandler(layoutControlGroupQuestion1_Click);
                this.layoutControlGroupQuestion1.AddItem(this.layoutControlItem2);

                //
                // simpleButton1
                //
                this.simpleButton1 = new SimpleButton();
                this.simpleButton1.Name = "simpleButton" + Guid.NewGuid().ToString();
                this.simpleButton1.Size = new System.Drawing.Size(130, 22);
                this.simpleButton1.StyleController = this.StyleController;
                this.simpleButton1.Text = "Refresh";
                this.simpleButton1.Click += new EventHandler(simpleButton1Refresh_Click);

                // layoutControlItem1
                this.layoutControlItem1 = new LayoutControlItem();
                this.layoutControlItem1.Name = "layoutControlItem" + Guid.NewGuid().ToString();
                this.layoutControlItem1.Control = this.simpleButton1;
                this.layoutControlItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
                this.layoutControlItem1.MaxSize = new System.Drawing.Size(80, 24);
                this.layoutControlItem1.MinSize = new System.Drawing.Size(80, 24);
                this.layoutControlItem1.Size = new System.Drawing.Size(80, 24);
                this.layoutControlItem1.TextVisible = false;
                this.layoutControlItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click);
                this.layoutControlGroupQuestion1.AddItem(this.layoutControlItem1, this.layoutControlItem2, DevExpress.XtraLayout.Utils.InsertType.Right);

                // emptySpaceItem1
                this.emptySpaceItem1 = new EmptySpaceItem();
                this.emptySpaceItem1.Name = "emptySpaceItem" + Guid.NewGuid().ToString();
                this.emptySpaceItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
                this.emptySpaceItem1.MaxSize = new System.Drawing.Size(0, 20);
                this.emptySpaceItem1.MinSize = new System.Drawing.Size(0, 20);
                this.emptySpaceItem1.Size = new System.Drawing.Size(200, 20);
                this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
                this.emptySpaceItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click);
                this.layoutControlGroupQuestion1.AddItem(this.emptySpaceItem1, this.layoutControlItem1, DevExpress.XtraLayout.Utils.InsertType.Right);
                #endregion

                #region Other Choices
                idx = 0;

                EmptySpaceItem esitem = new EmptySpaceItem();
                esitem.Size = new Size(100, 20);
                this.layoutControlGroupQuestion1.AddItem(esitem);
                foreach (OtherChoice oChoice in answeroption.OtherChoices) {
                    if (oChoice.Enabled) {
                        if (!string.IsNullOrEmpty(oChoice.TextPrefix)) {
                            // simpleLabelItem1
                            this.simpleLabelItem1 = new DevExpress.XtraLayout.SimpleLabelItem();

                            this.simpleLabelItem1.Name = "simpleLabelItem" + Guid.NewGuid().ToString();
                            //this.simpleLabelItem1.ShowInCustomizationForm = false;
                            //this.simpleLabelItem1.AppearanceItemCaption.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
                            this.simpleLabelItem1.Text = oChoice.TextPrefix;
                            //newSize = new System.Drawing.Size(100, 20);
                            newSize = new System.Drawing.Size(20, 20);
                            this.simpleLabelItem1.SizeConstraintsType = SizeConstraintsType.Custom;
                            this.simpleLabelItem1.MaxSize = new Size(0, 0);
                            this.simpleLabelItem1.MinSize = newSize;
                            this.simpleLabelItem1.Size = newSize;
                            this.simpleLabelItem1.AppearanceItemCaption.BackColor = System.Drawing.Color.Transparent;
                            this.simpleLabelItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click);
                            this.layoutControlGroupQuestion1.AddItem(this.simpleLabelItem1);
                        } else {
                            this.simpleLabelItem1 = null;
                        }
                        // layoutControlItem1
                        this.layoutControlItem1 = new LayoutControlItem();
                        //add textEdit1 to layout
                        this.memoEdit1 = new MemoEdit();
                        this.memoEdit1.Tag = new SeminarData() {
                            ParentPositionIndex = "IndexPosition" + x.ToString(),
                            PositionIndex = "IndexPosition" + idx.ToString(),
                            ControlContainer = layoutControlItem1
                        };
                        this.memoEdit1.Name = "textEdit" + Guid.NewGuid().ToString();
                        this.memoEdit1.Properties.ScrollBars = System.Windows.Forms.ScrollBars.None;
                        this.memoEdit1.StyleController = this.StyleController;

                        memoEdit1.TextChanged += new EventHandler(memoEdit1_TextChanged);
                        memoEdit1.Click += new EventHandler(layoutControlGroupQuestion1_Click);
                        if (string.IsNullOrEmpty(oChoice.InputValue)) {
                            if (!string.IsNullOrEmpty(oChoice.DefaultInputValue)) {
                                this.memoEdit1.Text = oChoice.DefaultInputValue.Trim();
                                memoEdit1_TextChanged(this.memoEdit1, null);
                            }
                        } else {
                            this.memoEdit1.Text = oChoice.InputValue.Trim();
                            memoEdit1_TextChanged(this.memoEdit1, null);
                        }
                        this.layoutControlItem1.Name = "layoutControlItem" + Guid.NewGuid().ToString();
                        this.layoutControlItem1.Control = this.memoEdit1;
                        //int width = 0, height = 100;
                        //if (!string.IsNullOrEmpty(oChoice.TextboxMaxWidth)) {
                        //    int.TryParse(oChoice.TextboxMaxWidth, out width);
                        //}
                        //if (!string.IsNullOrEmpty(oChoice.TextboxMaxHeight)) {
                        //    int.TryParse(oChoice.TextboxMaxHeight, out height);
                        //}

                        //newSize = new System.Drawing.Size(width, height);
                        //this.layoutControlItem1.Size = new Size(200, 50);
                        //this.layoutControlItem1.MaxSize = new Size(400, 50);
                        //this.layoutControlItem1.MinSize = new Size(300, 50);
                        this.layoutControlItem1.SizeConstraintsType = SizeConstraintsType.Custom;
                        this.layoutControlItem1.MinSize = new Size(0, 60);
                        //this.layoutControlItem1.Text = oChoice.TextPrefix;
                        this.layoutControlItem1.TextVisible = false;
                        this.layoutControlItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click);
                        //if (this.simpleLabelItem1 != null) {
                        //    this.layoutControlGroupQuestion1.AddItem(this.layoutControlItem1,this.simpleLabelItem1, DevExpress.XtraLayout.Utils.InsertType.Right);
                        //} else {
                        this.layoutControlGroupQuestion1.AddItem(this.layoutControlItem1);
                        //}
                        idx++;
                    }
                }
                #endregion
            }

            #region Footer
            string prioText = oSettings.Priority;
            if (oSettings.CustomerOwnership && oSettings.BVOwnership) {
                prioText += "(Cust+BV)";
            } else if (oSettings.CustomerOwnership) {
                prioText += "(Cust)";
            } else if (oSettings.BVOwnership) {
                prioText += "(BV)";
            }
            if (oSettings.PlotDoneStatus.Trim().ToLower() == "done") {
                prioText += " Done";
            }

            // simpleLabelItem1 status
            this.emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem();
            this.emptySpaceItem1.Name = "simpleLabelItem" + Guid.NewGuid().ToString();
            this.emptySpaceItem1.AppearanceItemCaption.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
            this.emptySpaceItem1.AppearanceItemCaption.Options.UseTextOptions = true;
            this.emptySpaceItem1.ShowInCustomizationForm = false;
            this.emptySpaceItem1.SizeConstraintsType = SizeConstraintsType.Custom;
            this.emptySpaceItem1.Text = prioText;
            this.emptySpaceItem1.TextVisible = true;
            this.emptySpaceItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click);
            this.layoutControlGroupQuestion1.AddItem(this.emptySpaceItem1);

            if (!string.IsNullOrEmpty(oSettings.QuestionHelp)) {
                this.emptySpaceItem2 = new DevExpress.XtraLayout.EmptySpaceItem();
                this.emptySpaceItem2.Name = "simpleLabelItem" + Guid.NewGuid().ToString();
                this.emptySpaceItem2.AppearanceItemCaption.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
                this.emptySpaceItem2.AppearanceItemCaption.Options.UseTextOptions = true;
                this.emptySpaceItem2.ShowInCustomizationForm = false;
                this.emptySpaceItem2.Text = "Help";
                this.emptySpaceItem2.OptionsToolTip.ToolTip = oSettings.QuestionHelp.Trim();

                //apply tooltip controller from parent
                //if (this.ToolTipController != null && this.ToolTipController.DefaultController != null) {
                //    this.emptySpaceItem2.OptionsToolTip.ToolTipController = ToolTipController.DefaultController;
                //}

                this.emptySpaceItem2.TextVisible = true;
                this.emptySpaceItem2.Size = new Size(50, 20);
                this.emptySpaceItem2.MaxSize = new Size(50, 20);
                this.emptySpaceItem2.MinSize = new Size(50, 20);
                this.emptySpaceItem2.SizeConstraintsType = SizeConstraintsType.Custom;
                this.emptySpaceItem2.Click += new EventHandler(layoutControlGroupQuestion1_Click);
                this.emptySpaceItem2.AppearanceItemCaption.TextOptions.HAlignment = HorzAlignment.Far;
                this.layoutControlGroupQuestion1.AddItem(this.emptySpaceItem2, this.emptySpaceItem1, DevExpress.XtraLayout.Utils.InsertType.Right);
            }
            #endregion

            this.layoutControlGroupQuestion1.Click += new EventHandler(layoutControlGroupQuestion1_Click);
            this.layoutControlGroupQuestion1.EndUpdate();
            Image bg = BGImage(this);
            if (bg != null) {
                this.layoutControlGroupQuestion1.BackgroundImage = bg;
                this.layoutControlGroupQuestion1.BackgroundImageVisible = true;
            }
            this.ControlGroup = this.layoutControlGroupQuestion1;
            this.ControlGroup.Tag = this;
        }
Example #4
0
        public UISearchGroup(ucModule parentModule, LayoutControlGroup parentLayoutGroup)
        {
            ParentModule      = parentModule;
            ModuleInfo        = parentModule.ModuleInfo;
            ParentLayoutGroup = parentLayoutGroup;
            SearchLayout      = (LayoutControl)parentLayoutGroup.Owner;

            Groups     = new List <UISearchGroup>();
            Conditions = new List <UISearchCondition>();

            LayoutGroup = new LayoutControlGroup();

            SearchLayout.BeginUpdate();
            parentLayoutGroup.BeginUpdate();

            m_EditUse = new CheckEdit();
            // GetFields: ModID = ModuleTypeID, Group = SQL_EXPRESSION
            var fieldSqlLogic =
                FieldUtils.GetModuleFields(
                    ModuleInfo.ModuleType,
                    CODES.DEFMODFLD.FLDGROUP.SQL_EXPRESSION
                    )[0];

            //
            m_SQLLogic = (ImageComboBoxEdit)parentModule.CreateControl(fieldSqlLogic);
            parentModule.SetControlListSource(m_SQLLogic);
            parentModule.SetControlDefaultValue(m_SQLLogic);

            m_AddGroup     = new SimpleButton();
            m_AddCondition = new SimpleButton();
            m_DeleteGroup  = new SimpleButton();

            SearchLayout.Controls.AddRange(new Control[] { m_EditUse, m_SQLLogic, m_AddGroup, m_AddCondition, m_DeleteGroup });

            (m_EditUseLayoutItem = LayoutGroup.AddItem("Use Condition", m_EditUse)).BeginInit();
            (m_MainSeparator = (SimpleSeparator)LayoutGroup.AddItem(new SimpleSeparator(), m_EditUseLayoutItem, InsertType.Bottom)).BeginInit();
            (m_SQLLogicLayoutItem = LayoutGroup.AddItem("Group Type", m_SQLLogic, m_EditUseLayoutItem, InsertType.Right)).BeginInit();
            (m_SQLLogicEmptySpace = (EmptySpaceItem)LayoutGroup.AddItem(new EmptySpaceItem(LayoutGroup), m_SQLLogicLayoutItem, InsertType.Right)).BeginInit();
            (m_DeleteGroupLayoutItem = LayoutGroup.AddItem("Delete Group", m_DeleteGroup, m_SQLLogicEmptySpace, InsertType.Right)).BeginInit();
            (m_AddGroupLayoutItem = LayoutGroup.AddItem("Add Group", m_AddGroup, m_DeleteGroupLayoutItem, InsertType.Right)).BeginInit();
            (m_AddConditionLayoutItem = LayoutGroup.AddItem("Add Condition", m_AddCondition, m_AddGroupLayoutItem, InsertType.Right)).BeginInit();

            // m_chkEditUse
            m_EditUse.Text              = "";
            m_EditUse.Checked           = true;
            m_EditUse.EditValueChanged += CheckEditUse_CheckedChanged;

            // m_btnDeleteGroup
            parentModule.Language.FormatButton(m_DeleteGroup, "btnDeleteGroupCondition");
            m_DeleteGroup.Click += DeleteGroupCondition_Click;

            // m_btnAddGroup
            parentModule.Language.FormatButton(m_AddGroup, "btnAddGroupCondition");
            m_AddGroup.Click += AddGroupCondition_Click;

            // m_btnAddCondition
            parentModule.Language.FormatButton(m_AddCondition, "btnAddCondition");
            m_AddCondition.Click += AddConditionButton_Click;

            // LayoutGroup
            LayoutGroup.Padding      = new DevExpress.XtraLayout.Utils.Padding(9, 2, 2, 2);
            LayoutGroup.TextLocation = DevExpress.Utils.Locations.Left;
            LayoutGroup.Text         = " ";

            // m_layout_chkEditUse
            m_EditUseLayoutItem.TextVisible             = false;
            m_EditUseLayoutItem.SizeConstraintsType     = SizeConstraintsType.Custom;
            m_EditUseLayoutItem.ControlAlignment        = ContentAlignment.MiddleCenter;
            m_EditUseLayoutItem.FillControlToClientArea = false;
            m_EditUseLayoutItem.MinSize     =
                m_EditUseLayoutItem.MaxSize = new Size(20, 24);

            // m_layout_cboSQLLogic
            m_SQLLogicLayoutItem.TextVisible            = false;
            m_SQLLogicLayoutItem.SizeConstraintsType    = SizeConstraintsType.Custom;
            m_SQLLogicLayoutItem.ControlAlignment       = ContentAlignment.MiddleCenter;
            m_EditUseLayoutItem.FillControlToClientArea = false;
            m_SQLLogicLayoutItem.MinSize     =
                m_SQLLogicLayoutItem.MaxSize = new Size(240, 24);

            // m_layout_btnDeleteGroup
            m_DeleteGroupLayoutItem.TextVisible         = false;
            m_DeleteGroupLayoutItem.SizeConstraintsType = SizeConstraintsType.Custom;
            m_DeleteGroupLayoutItem.ControlAlignment    = ContentAlignment.MiddleCenter;
            m_EditUseLayoutItem.FillControlToClientArea = false;
            m_DeleteGroupLayoutItem.MinSize             =
                m_DeleteGroupLayoutItem.MaxSize         = new Size(140, 24);

            // m_layout_cboSQLLogic
            m_AddGroupLayoutItem.TextVisible            = false;
            m_AddGroupLayoutItem.SizeConstraintsType    = SizeConstraintsType.Custom;
            m_AddGroupLayoutItem.ControlAlignment       = ContentAlignment.MiddleCenter;
            m_EditUseLayoutItem.FillControlToClientArea = false;
            m_AddGroupLayoutItem.MinSize     =
                m_AddGroupLayoutItem.MaxSize = new Size(140, 24);

            // m_layout_cboSQLLogic
            m_AddConditionLayoutItem.TextVisible         = false;
            m_AddConditionLayoutItem.SizeConstraintsType = SizeConstraintsType.Custom;
            m_AddConditionLayoutItem.ControlAlignment    = ContentAlignment.MiddleCenter;
            m_EditUseLayoutItem.FillControlToClientArea  = false;
            m_AddConditionLayoutItem.MinSize             =
                m_AddConditionLayoutItem.MaxSize         = new Size(110, 24);

            m_MainSeparator.FillControlToClientArea = false;
            m_MainSeparator.SizeConstraintsType     = SizeConstraintsType.Default;

            m_EditUseLayoutItem.EndInit();
            m_SQLLogicLayoutItem.EndInit();
            m_SQLLogicEmptySpace.EndInit();
            m_DeleteGroupLayoutItem.EndInit();
            m_AddGroupLayoutItem.EndInit();
            m_AddConditionLayoutItem.EndInit();
            m_MainSeparator.EndInit();

            parentLayoutGroup.Add(LayoutGroup);

            if (ConditionModule.ConditionLayoutGroup == parentLayoutGroup)
            {
                parentLayoutGroup.AddItem(new EmptySpaceItem(), LayoutGroup, InsertType.Bottom);
                m_DeleteGroupLayoutItem.Visibility = LayoutVisibility.Never;
            }

            parentLayoutGroup.EndUpdate();
            SearchLayout.EndUpdate();
        }
Example #5
0
 private void InitializeComponent()
 {
     this.layoutControl1      = new LayoutControl();
     this.lstBox              = new ListBoxControl();
     this.labelControl1       = new LabelControl();
     this.btnCancle           = new SimpleButton();
     this.btnOk               = new SimpleButton();
     this.layoutControlGroup1 = new LayoutControlGroup();
     this.layoutControlItem3  = new LayoutControlItem();
     this.layoutControlItem4  = new LayoutControlItem();
     this.emptySpaceItem1     = new EmptySpaceItem();
     this.emptySpaceItem2     = new EmptySpaceItem();
     this.emptySpaceItem3     = new EmptySpaceItem();
     this.layoutControlItem5  = new LayoutControlItem();
     this.layoutControlItem6  = new LayoutControlItem();
     ((System.ComponentModel.ISupportInitialize) this.layoutControl1).BeginInit();
     this.layoutControl1.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize) this.lstBox).BeginInit();
     ((System.ComponentModel.ISupportInitialize) this.layoutControlGroup1).BeginInit();
     ((System.ComponentModel.ISupportInitialize) this.layoutControlItem3).BeginInit();
     ((System.ComponentModel.ISupportInitialize) this.layoutControlItem4).BeginInit();
     ((System.ComponentModel.ISupportInitialize) this.emptySpaceItem1).BeginInit();
     ((System.ComponentModel.ISupportInitialize) this.emptySpaceItem2).BeginInit();
     ((System.ComponentModel.ISupportInitialize) this.emptySpaceItem3).BeginInit();
     ((System.ComponentModel.ISupportInitialize) this.layoutControlItem5).BeginInit();
     ((System.ComponentModel.ISupportInitialize) this.layoutControlItem6).BeginInit();
     base.SuspendLayout();
     this.layoutControl1.Controls.Add(this.lstBox);
     this.layoutControl1.Controls.Add(this.labelControl1);
     this.layoutControl1.Controls.Add(this.btnCancle);
     this.layoutControl1.Controls.Add(this.btnOk);
     this.layoutControl1.Dock                    = System.Windows.Forms.DockStyle.Fill;
     this.layoutControl1.Location                = new System.Drawing.Point(0, 0);
     this.layoutControl1.Name                    = "layoutControl1";
     this.layoutControl1.Root                    = this.layoutControlGroup1;
     this.layoutControl1.Size                    = new System.Drawing.Size(286, 340);
     this.layoutControl1.TabIndex                = 0;
     this.layoutControl1.Text                    = "layoutControl1";
     this.lstBox.Appearance.ForeColor            = System.Drawing.Color.FromArgb(192, 192, 255);
     this.lstBox.Appearance.Options.UseForeColor = true;
     this.lstBox.Location                    = new System.Drawing.Point(12, 30);
     this.lstBox.Name                        = "lstBox";
     this.lstBox.Size                        = new System.Drawing.Size(262, 272);
     this.lstBox.StyleController             = this.layoutControl1;
     this.lstBox.TabIndex                    = 9;
     this.labelControl1.Appearance.ForeColor = System.Drawing.Color.Red;
     this.labelControl1.Location             = new System.Drawing.Point(12, 12);
     this.labelControl1.Name                 = "labelControl1";
     this.labelControl1.Size                 = new System.Drawing.Size(252, 14);
     this.labelControl1.StyleController      = this.layoutControl1;
     this.labelControl1.TabIndex             = 8;
     this.labelControl1.Text                 = "提示:模型合并不支持撤销操作,请小心使用!";
     this.btnCancle.DialogResult             = System.Windows.Forms.DialogResult.Cancel;
     this.btnCancle.Location                 = new System.Drawing.Point(176, 306);
     this.btnCancle.Name                     = "btnCancle";
     this.btnCancle.Size                     = new System.Drawing.Size(64, 22);
     this.btnCancle.StyleController          = this.layoutControl1;
     this.btnCancle.TabIndex                 = 7;
     this.btnCancle.Text                     = "取消";
     this.btnOk.DialogResult                 = System.Windows.Forms.DialogResult.OK;
     this.btnOk.Location                     = new System.Drawing.Point(46, 306);
     this.btnOk.Name            = "btnOk";
     this.btnOk.Size            = new System.Drawing.Size(64, 22);
     this.btnOk.StyleController = this.layoutControl1;
     this.btnOk.TabIndex        = 6;
     this.btnOk.Text            = "确定";
     this.btnOk.Click          += new System.EventHandler(this.btnOk_Click);
     this.layoutControlGroup1.CustomizationFormText       = "layoutControlGroup1";
     this.layoutControlGroup1.EnableIndentsWithoutBorders = DefaultBoolean.True;
     this.layoutControlGroup1.GroupBordersVisible         = false;
     this.layoutControlGroup1.Items.AddRange(new BaseLayoutItem[]
     {
         this.layoutControlItem3,
         this.layoutControlItem4,
         this.emptySpaceItem1,
         this.emptySpaceItem2,
         this.emptySpaceItem3,
         this.layoutControlItem5,
         this.layoutControlItem6
     });
     this.layoutControlGroup1.Location             = new System.Drawing.Point(0, 0);
     this.layoutControlGroup1.Name                 = "layoutControlGroup1";
     this.layoutControlGroup1.Size                 = new System.Drawing.Size(286, 340);
     this.layoutControlGroup1.Text                 = "layoutControlGroup1";
     this.layoutControlGroup1.TextVisible          = false;
     this.layoutControlItem3.Control               = this.btnOk;
     this.layoutControlItem3.CustomizationFormText = "layoutControlItem3";
     this.layoutControlItem3.Location              = new System.Drawing.Point(34, 294);
     this.layoutControlItem3.Name     = "layoutControlItem3";
     this.layoutControlItem3.Size     = new System.Drawing.Size(68, 26);
     this.layoutControlItem3.Text     = "layoutControlItem3";
     this.layoutControlItem3.TextSize = new System.Drawing.Size(0, 0);
     this.layoutControlItem3.TextToControlDistance = 0;
     this.layoutControlItem3.TextVisible           = false;
     this.layoutControlItem4.Control = this.btnCancle;
     this.layoutControlItem4.CustomizationFormText = "layoutControlItem4";
     this.layoutControlItem4.Location = new System.Drawing.Point(164, 294);
     this.layoutControlItem4.Name     = "layoutControlItem4";
     this.layoutControlItem4.Size     = new System.Drawing.Size(68, 26);
     this.layoutControlItem4.Text     = "layoutControlItem4";
     this.layoutControlItem4.TextSize = new System.Drawing.Size(0, 0);
     this.layoutControlItem4.TextToControlDistance = 0;
     this.layoutControlItem4.TextVisible           = false;
     this.emptySpaceItem1.AllowHotTrack            = false;
     this.emptySpaceItem1.CustomizationFormText    = "emptySpaceItem1";
     this.emptySpaceItem1.Location                 = new System.Drawing.Point(0, 294);
     this.emptySpaceItem1.Name                     = "emptySpaceItem1";
     this.emptySpaceItem1.Size                     = new System.Drawing.Size(34, 26);
     this.emptySpaceItem1.Text                     = "emptySpaceItem1";
     this.emptySpaceItem1.TextSize                 = new System.Drawing.Size(0, 0);
     this.emptySpaceItem2.AllowHotTrack            = false;
     this.emptySpaceItem2.CustomizationFormText    = "emptySpaceItem2";
     this.emptySpaceItem2.Location                 = new System.Drawing.Point(232, 294);
     this.emptySpaceItem2.Name                     = "emptySpaceItem2";
     this.emptySpaceItem2.Size                     = new System.Drawing.Size(34, 26);
     this.emptySpaceItem2.Text                     = "emptySpaceItem2";
     this.emptySpaceItem2.TextSize                 = new System.Drawing.Size(0, 0);
     this.emptySpaceItem3.AllowHotTrack            = false;
     this.emptySpaceItem3.CustomizationFormText    = "emptySpaceItem3";
     this.emptySpaceItem3.Location                 = new System.Drawing.Point(102, 294);
     this.emptySpaceItem3.Name                     = "emptySpaceItem3";
     this.emptySpaceItem3.Size                     = new System.Drawing.Size(62, 26);
     this.emptySpaceItem3.Text                     = "emptySpaceItem3";
     this.emptySpaceItem3.TextSize                 = new System.Drawing.Size(0, 0);
     this.layoutControlItem5.Control               = this.labelControl1;
     this.layoutControlItem5.CustomizationFormText = "layoutControlItem5";
     this.layoutControlItem5.Location              = new System.Drawing.Point(0, 0);
     this.layoutControlItem5.Name                  = "layoutControlItem5";
     this.layoutControlItem5.Size                  = new System.Drawing.Size(266, 18);
     this.layoutControlItem5.Text                  = "layoutControlItem5";
     this.layoutControlItem5.TextSize              = new System.Drawing.Size(0, 0);
     this.layoutControlItem5.TextToControlDistance = 0;
     this.layoutControlItem5.TextVisible           = false;
     this.layoutControlItem6.Control               = this.lstBox;
     this.layoutControlItem6.CustomizationFormText = "layoutControlItem6";
     this.layoutControlItem6.Location              = new System.Drawing.Point(0, 18);
     this.layoutControlItem6.Name                  = "layoutControlItem6";
     this.layoutControlItem6.Size                  = new System.Drawing.Size(266, 276);
     this.layoutControlItem6.Text                  = "layoutControlItem6";
     this.layoutControlItem6.TextSize              = new System.Drawing.Size(0, 0);
     this.layoutControlItem6.TextToControlDistance = 0;
     this.layoutControlItem6.TextVisible           = false;
     base.AutoScaleDimensions = new System.Drawing.SizeF(7f, 14f);
     base.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     base.ClientSize          = new System.Drawing.Size(286, 340);
     base.Controls.Add(this.layoutControl1);
     base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
     base.Name            = "MergeDlg";
     base.ShowInTaskbar   = false;
     base.StartPosition   = System.Windows.Forms.FormStartPosition.CenterScreen;
     this.Text            = "模型合并";
     ((System.ComponentModel.ISupportInitialize) this.layoutControl1).EndInit();
     this.layoutControl1.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize) this.lstBox).EndInit();
     ((System.ComponentModel.ISupportInitialize) this.layoutControlGroup1).EndInit();
     ((System.ComponentModel.ISupportInitialize) this.layoutControlItem3).EndInit();
     ((System.ComponentModel.ISupportInitialize) this.layoutControlItem4).EndInit();
     ((System.ComponentModel.ISupportInitialize) this.emptySpaceItem1).EndInit();
     ((System.ComponentModel.ISupportInitialize) this.emptySpaceItem2).EndInit();
     ((System.ComponentModel.ISupportInitialize) this.emptySpaceItem3).EndInit();
     ((System.ComponentModel.ISupportInitialize) this.layoutControlItem5).EndInit();
     ((System.ComponentModel.ISupportInitialize) this.layoutControlItem6).EndInit();
     base.ResumeLayout(false);
 }
Example #6
0
        private void SonrakiControlFocus(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter && sender is BaseEdit && layoutControlGroup2 != null)
            {
                var baseEdit = (BaseEdit)sender;
                var tabIndex = baseEdit.TabIndex;

                bool selectNextGroup = false;
                int  groupIndex      = -1;

                foreach (var groupItem in layoutControlGroup2.Items)
                {
                    if (groupItem is LayoutControlGroup)
                    {
                        groupIndex++;

                        var subLayoutControlGroup = (LayoutControlGroup)groupItem;

                        foreach (LayoutControlItem subLayoutControlItem in subLayoutControlGroup.Items)
                        {
                            if (subLayoutControlItem.Control.Name == baseEdit.Name)
                            {
                                var yeniSubTabIndex = tabIndex + 1 < subLayoutControlGroup.Items.Count
                                    ? tabIndex + 1
                                    : 0;

                                if (yeniSubTabIndex > 0)
                                {
                                    var nextSubLayoutControlItem =
                                        subLayoutControlGroup.Items[yeniSubTabIndex] as LayoutControlItem;
                                    if (nextSubLayoutControlItem != null)
                                    {
                                        nextSubLayoutControlItem.Control.Focus();
                                    }
                                }
                                else
                                {
                                    selectNextGroup = true;
                                    break;
                                }
                            }
                        }

                        if (selectNextGroup)
                        {
                            break;
                        }
                    }
                }

                if (selectNextGroup && layoutControlGroup2.Items.Count > groupIndex + 1 &&
                    layoutControlGroup2.Items[groupIndex + 1] is LayoutControlGroup &&
                    (layoutControlGroup2.Items[groupIndex + 1] as LayoutControlGroup).Items.Count > 0)
                {
                    ((layoutControlGroup2.Items[groupIndex + 1] as LayoutControlGroup).Items[0] as LayoutControlItem)
                    .Control.Focus();
                }
                if (groupIndex < 0)
                {
                    var yeniTabIndex = tabIndex + 1 < layoutControlGroup2.Items.Count ? tabIndex + 1 : 0;

                    LayoutControlItem nextLayoutControlItem = null;

                    foreach (LayoutControlItem layoutItem in layoutControlGroup2.Items)
                    {
                        if (layoutItem is EmptySpaceItem)
                        {
                            continue;
                        }
                        if (layoutItem.Control.TabIndex >= yeniTabIndex &&
                            (nextLayoutControlItem == null ||
                             (layoutItem.Control.TabIndex < nextLayoutControlItem.Control.TabIndex)))
                        {
                            nextLayoutControlItem = layoutItem;
                        }

                        if (layoutItem.Control.TabIndex == yeniTabIndex)
                        {
                            break;
                        }
                    }

                    if (nextLayoutControlItem != null)
                    {
                        nextLayoutControlItem.Control.Focus();
                    }
                }
            }
        }
 private void initializeLocalization(LayoutControlItem layoutItem, string caption)
 {
     layoutItem.TextVisible  = false;
     layoutItem.Control.Text = caption;
 }
        private void InitializeComponent()
        {
            this.components = new Container();
            ComponentResourceManager manager = new ComponentResourceManager(typeof(ФормаДинамическойТаблицы));

            this.layoutMain                  = new LayoutControl();
            this.simpleButton_сохранить      = new SimpleButton();
            this.labelControl_заголовок      = new LabelControl();
            this.simpleButton_отмена         = new SimpleButton();
            this.simpleButton_применить      = new SimpleButton();
            this.layoutMainGroup             = new LayoutControlGroup();
            this.layoutControlItem_отмена    = new LayoutControlItem();
            this.emptySpaceItem_bottom       = new EmptySpaceItem();
            this.layoutControlItem_применить = new LayoutControlItem();
            this.emptySpaceItem_top          = new EmptySpaceItem();
            this.layoutControlItem_заголовок = new LayoutControlItem();
            this.layoutControlItem_сохранить = new LayoutControlItem();
            this.barManager1                 = new BarManager(this.components);
            this.bar1                 = new Bar();
            this.bar2                 = new Bar();
            this.barButtonItem1       = new BarButtonItem();
            this.bar3                 = new Bar();
            this.barDockControlTop    = new BarDockControl();
            this.barDockControlBottom = new BarDockControl();
            this.barDockControlLeft   = new BarDockControl();
            this.barDockControlRight  = new BarDockControl();
            this.layoutMain.BeginInit();
            this.layoutMain.SuspendLayout();
            this.layoutMainGroup.BeginInit();
            this.layoutControlItem_отмена.BeginInit();
            this.emptySpaceItem_bottom.BeginInit();
            this.layoutControlItem_применить.BeginInit();
            this.emptySpaceItem_top.BeginInit();
            this.layoutControlItem_заголовок.BeginInit();
            this.layoutControlItem_сохранить.BeginInit();
            this.barManager1.BeginInit();
            base.SuspendLayout();
            this.layoutMain.Appearance.DisabledLayoutGroupCaption.ForeColor            = SystemColors.GrayText;
            this.layoutMain.Appearance.DisabledLayoutGroupCaption.Options.UseForeColor = true;
            this.layoutMain.Appearance.DisabledLayoutItem.ForeColor            = SystemColors.GrayText;
            this.layoutMain.Appearance.DisabledLayoutItem.Options.UseForeColor = true;
            this.layoutMain.Controls.Add(this.simpleButton_сохранить);
            this.layoutMain.Controls.Add(this.labelControl_заголовок);
            this.layoutMain.Controls.Add(this.simpleButton_отмена);
            this.layoutMain.Controls.Add(this.simpleButton_применить);
            this.layoutMain.Dock                                   = DockStyle.Fill;
            this.layoutMain.Location                               = new Point(0, 0x33);
            this.layoutMain.Name                                   = "layoutMain";
            this.layoutMain.Root                                   = this.layoutMainGroup;
            this.layoutMain.Size                                   = new Size(0x23f, 0x17f);
            this.layoutMain.TabIndex                               = 0;
            this.layoutMain.Text                                   = "layoutControl1";
            this.layoutMain.KeyUp                                 += new KeyEventHandler(this.layoutMain_KeyUp);
            this.simpleButton_сохранить.Location                   = new Point(260, 0x1f);
            this.simpleButton_сохранить.Name                       = "simpleButton_сохранить";
            this.simpleButton_сохранить.Size                       = new Size(0x67, 0x16);
            this.simpleButton_сохранить.StyleController            = this.layoutMain;
            this.simpleButton_сохранить.TabIndex                   = 8;
            this.simpleButton_сохранить.Text                       = "Сохранить форму";
            this.labelControl_заголовок.Appearance.Font            = new Font("Tahoma", 8.25f, FontStyle.Bold);
            this.labelControl_заголовок.Appearance.Options.UseFont = true;
            this.labelControl_заголовок.Location                   = new Point(7, 7);
            this.labelControl_заголовок.Name                       = "labelControl_заголовок";
            this.labelControl_заголовок.Size                       = new Size(0x3e, 13);
            this.labelControl_заголовок.StyleController            = this.layoutMain;
            this.labelControl_заголовок.TabIndex                   = 7;
            this.labelControl_заголовок.Text                       = "Заголовок";
            this.simpleButton_отмена.DialogResult                  = DialogResult.Cancel;
            this.simpleButton_отмена.Location                      = new Point(0x1dd, 0x1f);
            this.simpleButton_отмена.Name                          = "simpleButton_отмена";
            this.simpleButton_отмена.Size                          = new Size(0x5c, 0x16);
            this.simpleButton_отмена.StyleController               = this.layoutMain;
            this.simpleButton_отмена.TabIndex                      = 5;
            this.simpleButton_отмена.Text                          = "Отмена";
            this.simpleButton_отмена.KeyUp                        += new KeyEventHandler(this.simpleButton_отмена_KeyUp);
            this.simpleButton_применить.Location                   = new Point(0x176, 0x1f);
            this.simpleButton_применить.Name                       = "simpleButton_применить";
            this.simpleButton_применить.Size                       = new Size(0x5c, 0x16);
            this.simpleButton_применить.StyleController            = this.layoutMain;
            this.simpleButton_применить.TabIndex                   = 6;
            this.simpleButton_применить.Text                       = "Применить";
            this.simpleButton_применить.Click                     += new EventHandler(this.simpleButton_применить_Click);
            this.simpleButton_применить.KeyUp                     += new KeyEventHandler(this.simpleButton_применить_KeyUp);
            this.layoutMainGroup.CustomizationFormText             = "layoutControlGroup1";
            this.layoutMainGroup.Items.AddRange(new BaseLayoutItem[] { this.layoutControlItem_отмена, this.emptySpaceItem_bottom, this.layoutControlItem_применить, this.emptySpaceItem_top, this.layoutControlItem_заголовок, this.layoutControlItem_сохранить });
            this.layoutMainGroup.Location         = new Point(0, 0);
            this.layoutMainGroup.Name             = "layoutMainGroup";
            this.layoutMainGroup.Size             = new Size(0x23f, 0x17f);
            this.layoutMainGroup.Spacing          = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
            this.layoutMainGroup.Text             = "layoutMainGroup";
            this.layoutMainGroup.TextVisible      = false;
            this.layoutControlItem_отмена.Control = this.simpleButton_отмена;
            this.layoutControlItem_отмена.CustomizationFormText = "layoutControlItem_отмена";
            this.layoutControlItem_отмена.Location              = new Point(470, 0x18);
            this.layoutControlItem_отмена.MaxSize               = new Size(0x67, 0x21);
            this.layoutControlItem_отмена.MinSize               = new Size(0x67, 0x21);
            this.layoutControlItem_отмена.Name                  = "layoutControlItem_отмена";
            this.layoutControlItem_отмена.Size                  = new Size(0x67, 0x165);
            this.layoutControlItem_отмена.SizeConstraintsType   = SizeConstraintsType.Custom;
            this.layoutControlItem_отмена.Text                  = "layoutControlItem_отмена";
            this.layoutControlItem_отмена.TextLocation          = Locations.Left;
            this.layoutControlItem_отмена.TextSize              = new Size(0, 0);
            this.layoutControlItem_отмена.TextToControlDistance = 0;
            this.layoutControlItem_отмена.TextVisible           = false;
            this.emptySpaceItem_bottom.CustomizationFormText    = "emptySpaceItem_bottom";
            this.emptySpaceItem_bottom.Location                 = new Point(0, 0x18);
            this.emptySpaceItem_bottom.Name          = "emptySpaceItem_bottom";
            this.emptySpaceItem_bottom.Size          = new Size(0xfd, 0x165);
            this.emptySpaceItem_bottom.Text          = "emptySpaceItem_bottom";
            this.emptySpaceItem_bottom.TextSize      = new Size(0, 0);
            this.layoutControlItem_применить.Control = this.simpleButton_применить;
            this.layoutControlItem_применить.CustomizationFormText = "layoutControlItem_применить";
            this.layoutControlItem_применить.Location              = new Point(0x16f, 0x18);
            this.layoutControlItem_применить.MaxSize               = new Size(0x67, 0x21);
            this.layoutControlItem_применить.MinSize               = new Size(0x67, 0x21);
            this.layoutControlItem_применить.Name                  = "layoutControlItem_применить";
            this.layoutControlItem_применить.Size                  = new Size(0x67, 0x165);
            this.layoutControlItem_применить.SizeConstraintsType   = SizeConstraintsType.Custom;
            this.layoutControlItem_применить.Text                  = "layoutControlItem_применить";
            this.layoutControlItem_применить.TextLocation          = Locations.Left;
            this.layoutControlItem_применить.TextSize              = new Size(0, 0);
            this.layoutControlItem_применить.TextToControlDistance = 0;
            this.layoutControlItem_применить.TextVisible           = false;
            this.emptySpaceItem_top.CustomizationFormText          = "Субтаблица";
            this.emptySpaceItem_top.Location         = new Point(0x49, 0);
            this.emptySpaceItem_top.Name             = "emptySpaceItem_top";
            this.emptySpaceItem_top.Size             = new Size(500, 0x18);
            this.emptySpaceItem_top.Text             = "Субтаблица";
            this.emptySpaceItem_top.TextSize         = new Size(0, 0);
            this.layoutControlItem_заголовок.Control = this.labelControl_заголовок;
            this.layoutControlItem_заголовок.CustomizationFormText = "layoutControlItem_заголовок";
            this.layoutControlItem_заголовок.Location              = new Point(0, 0);
            this.layoutControlItem_заголовок.Name                  = "layoutControlItem_заголовок";
            this.layoutControlItem_заголовок.Size                  = new Size(0x49, 0x18);
            this.layoutControlItem_заголовок.Text                  = "layoutControlItem_заголовок";
            this.layoutControlItem_заголовок.TextLocation          = Locations.Left;
            this.layoutControlItem_заголовок.TextSize              = new Size(0, 0);
            this.layoutControlItem_заголовок.TextToControlDistance = 0;
            this.layoutControlItem_заголовок.TextVisible           = false;
            this.layoutControlItem_сохранить.Control               = this.simpleButton_сохранить;
            this.layoutControlItem_сохранить.CustomizationFormText = "layoutControlItem1";
            this.layoutControlItem_сохранить.Location              = new Point(0xfd, 0x18);
            this.layoutControlItem_сохранить.MaxSize               = new Size(0x72, 0x21);
            this.layoutControlItem_сохранить.MinSize               = new Size(0x72, 0x21);
            this.layoutControlItem_сохранить.Name                  = "layoutControlItem_сохранить";
            this.layoutControlItem_сохранить.Size                  = new Size(0x72, 0x165);
            this.layoutControlItem_сохранить.SizeConstraintsType   = SizeConstraintsType.Custom;
            this.layoutControlItem_сохранить.Text                  = "layoutControlItem_Сохранить";
            this.layoutControlItem_сохранить.TextLocation          = Locations.Left;
            this.layoutControlItem_сохранить.TextSize              = new Size(0, 0);
            this.layoutControlItem_сохранить.TextToControlDistance = 0;
            this.layoutControlItem_сохранить.TextVisible           = false;
            this.barManager1.AllowCustomization     = false;
            this.barManager1.AllowShowToolbarsPopup = false;
            this.barManager1.Bars.AddRange(new Bar[] { this.bar1, this.bar2, this.bar3 });
            this.barManager1.DockControls.Add(this.barDockControlTop);
            this.barManager1.DockControls.Add(this.barDockControlBottom);
            this.barManager1.DockControls.Add(this.barDockControlLeft);
            this.barManager1.DockControls.Add(this.barDockControlRight);
            this.barManager1.Form = this;
            this.barManager1.Items.AddRange(new BarItem[] { this.barButtonItem1 });
            this.barManager1.MainMenu  = this.bar2;
            this.barManager1.MaxItemId = 1;
            this.barManager1.ShowScreenTipsInToolbars = false;
            this.barManager1.StatusBar = this.bar3;
            this.bar1.BarName          = "Tools";
            this.bar1.DockCol          = 0;
            this.bar1.DockRow          = 1;
            this.bar1.DockStyle        = BarDockStyle.Top;
            this.bar1.Text             = "Tools";
            this.bar1.Visible          = false;
            this.bar2.BarName          = "MainMenu";
            this.bar2.DockCol          = 0;
            this.bar2.DockRow          = 0;
            this.bar2.DockStyle        = BarDockStyle.Top;
            this.bar2.LinksPersistInfo.AddRange(new LinkPersistInfo[] { new LinkPersistInfo(this.barButtonItem1) });
            this.bar2.OptionsBar.AllowQuickCustomization = false;
            this.bar2.OptionsBar.DisableCustomization    = true;
            this.bar2.OptionsBar.DrawDragBorder          = false;
            this.bar2.OptionsBar.UseWholeRow             = true;
            this.bar2.Text = "MainMenu";
            this.barButtonItem1.Caption    = "Справка";
            this.barButtonItem1.Glyph      = (Image)manager.GetObject("barButtonItem1.Glyph");
            this.barButtonItem1.Id         = 0;
            this.barButtonItem1.Name       = "barButtonItem1";
            this.barButtonItem1.PaintStyle = BarItemPaintStyle.CaptionGlyph;
            this.barButtonItem1.ItemClick += new ItemClickEventHandler(this.barButtonItem1_ItemClick);
            this.bar3.BarName      = "Status bar";
            this.bar3.CanDockStyle = BarCanDockStyle.Bottom;
            this.bar3.DockCol      = 0;
            this.bar3.DockRow      = 0;
            this.bar3.DockStyle    = BarDockStyle.Bottom;
            this.bar3.OptionsBar.AllowQuickCustomization = false;
            this.bar3.OptionsBar.DrawDragBorder          = false;
            this.bar3.OptionsBar.UseWholeRow             = true;
            this.bar3.Text    = "Status bar";
            this.bar3.Visible = false;
            base.CancelButton = this.simpleButton_отмена;
            base.ClientSize   = new Size(0x23f, 0x1c8);
            base.Controls.Add(this.layoutMain);
            base.Controls.Add(this.barDockControlLeft);
            base.Controls.Add(this.barDockControlRight);
            base.Controls.Add(this.barDockControlBottom);
            base.Controls.Add(this.barDockControlTop);
            base.Icon         = (Icon)manager.GetObject("$this.Icon");
            base.Name         = "ФормаДинамическойТаблицы";
            base.KeyUp       += new KeyEventHandler(this.ФормаДинамическойТаблицы_KeyUp);
            base.FormClosing += new FormClosingEventHandler(this.ФормаДинамическойТаблицы_FormClosing);
            this.layoutMain.EndInit();
            this.layoutMain.ResumeLayout(false);
            this.layoutMainGroup.EndInit();
            this.layoutControlItem_отмена.EndInit();
            this.emptySpaceItem_bottom.EndInit();
            this.layoutControlItem_применить.EndInit();
            this.emptySpaceItem_top.EndInit();
            this.layoutControlItem_заголовок.EndInit();
            this.layoutControlItem_сохранить.EndInit();
            this.barManager1.EndInit();
            base.ResumeLayout(false);
        }
Example #9
0
 private void InitializeComponent()
 {
     this.layoutControl1      = new DevExpress.XtraLayout.LayoutControl();
     this.cancelButton        = new DevExpress.XtraEditors.SimpleButton();
     this.rootLayout          = new DevExpress.XtraLayout.LayoutControl();
     this.Root                = new DevExpress.XtraLayout.LayoutControlGroup();
     this.saveButton          = new DevExpress.XtraEditors.SimpleButton();
     this.layoutControlGroup1 = new DevExpress.XtraLayout.LayoutControlGroup();
     this.layoutControlItem2  = new DevExpress.XtraLayout.LayoutControlItem();
     this.emptySpaceItem1     = new DevExpress.XtraLayout.EmptySpaceItem();
     this.layoutControlItem1  = new DevExpress.XtraLayout.LayoutControlItem();
     this.layoutControlItem3  = new DevExpress.XtraLayout.LayoutControlItem();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
     this.layoutControl1.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.rootLayout)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.Root)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).BeginInit();
     this.SuspendLayout();
     //
     // layoutControl1
     //
     this.layoutControl1.Controls.Add(this.cancelButton);
     this.layoutControl1.Controls.Add(this.rootLayout);
     this.layoutControl1.Controls.Add(this.saveButton);
     this.layoutControl1.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.layoutControl1.Location = new System.Drawing.Point(0, 0);
     this.layoutControl1.Name     = "layoutControl1";
     this.layoutControl1.Root     = this.layoutControlGroup1;
     this.layoutControl1.Size     = new System.Drawing.Size(800, 600);
     this.layoutControl1.TabIndex = 0;
     this.layoutControl1.Text     = "layoutControl1";
     //
     // cancelButton
     //
     this.cancelButton.Image           = global::SCOUT.WinForms.Properties.Resources.cancel;
     this.cancelButton.Location        = new System.Drawing.Point(356, 563);
     this.cancelButton.Name            = "cancelButton";
     this.cancelButton.Size            = new System.Drawing.Size(221, 22);
     this.cancelButton.StyleController = this.layoutControl1;
     this.cancelButton.TabIndex        = 6;
     this.cancelButton.Text            = "Cancel";
     //
     // rootLayout
     //
     this.rootLayout.Location = new System.Drawing.Point(12, 12);
     this.rootLayout.Name     = "rootLayout";
     this.rootLayout.Root     = this.Root;
     this.rootLayout.Size     = new System.Drawing.Size(776, 544);
     this.rootLayout.TabIndex = 5;
     this.rootLayout.Text     = "layoutControl2";
     //
     // Root
     //
     this.Root.CustomizationFormText       = "Root";
     this.Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
     this.Root.GroupBordersVisible         = false;
     this.Root.Location    = new System.Drawing.Point(0, 0);
     this.Root.Name        = "Root";
     this.Root.Padding     = new DevExpress.XtraLayout.Utils.Padding(2, 2, 2, 2);
     this.Root.Size        = new System.Drawing.Size(776, 544);
     this.Root.Spacing     = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
     this.Root.Text        = "Root";
     this.Root.TextVisible = false;
     //
     // saveButton
     //
     this.saveButton.Image           = global::SCOUT.WinForms.Properties.Resources.disk;
     this.saveButton.Location        = new System.Drawing.Point(587, 563);
     this.saveButton.Name            = "saveButton";
     this.saveButton.Size            = new System.Drawing.Size(198, 22);
     this.saveButton.StyleController = this.layoutControl1;
     this.saveButton.TabIndex        = 4;
     this.saveButton.Text            = "Save";
     //
     // layoutControlGroup1
     //
     this.layoutControlGroup1.CustomizationFormText       = "layoutControlGroup1";
     this.layoutControlGroup1.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
     this.layoutControlGroup1.GroupBordersVisible         = false;
     this.layoutControlGroup1.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
         this.layoutControlItem2,
         this.emptySpaceItem1,
         this.layoutControlItem1,
         this.layoutControlItem3
     });
     this.layoutControlGroup1.Location    = new System.Drawing.Point(0, 0);
     this.layoutControlGroup1.Name        = "layoutControlGroup1";
     this.layoutControlGroup1.Size        = new System.Drawing.Size(800, 600);
     this.layoutControlGroup1.Spacing     = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
     this.layoutControlGroup1.Text        = "layoutControlGroup1";
     this.layoutControlGroup1.TextVisible = false;
     //
     // layoutControlItem2
     //
     this.layoutControlItem2.Control = this.rootLayout;
     this.layoutControlItem2.CustomizationFormText = "layoutControlItem2";
     this.layoutControlItem2.Location = new System.Drawing.Point(0, 0);
     this.layoutControlItem2.Name     = "layoutControlItem2";
     this.layoutControlItem2.Size     = new System.Drawing.Size(780, 548);
     this.layoutControlItem2.Text     = "layoutControlItem2";
     this.layoutControlItem2.TextSize = new System.Drawing.Size(0, 0);
     this.layoutControlItem2.TextToControlDistance = 0;
     this.layoutControlItem2.TextVisible           = false;
     //
     // emptySpaceItem1
     //
     this.emptySpaceItem1.CustomizationFormText = "emptySpaceItem1";
     this.emptySpaceItem1.Location = new System.Drawing.Point(0, 548);
     this.emptySpaceItem1.Name     = "emptySpaceItem1";
     this.emptySpaceItem1.Size     = new System.Drawing.Size(341, 32);
     this.emptySpaceItem1.Text     = "emptySpaceItem1";
     this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
     //
     // layoutControlItem1
     //
     this.layoutControlItem1.Control = this.saveButton;
     this.layoutControlItem1.CustomizationFormText = "layoutControlItem1";
     this.layoutControlItem1.Location = new System.Drawing.Point(572, 548);
     this.layoutControlItem1.Name     = "layoutControlItem1";
     this.layoutControlItem1.Padding  = new DevExpress.XtraLayout.Utils.Padding(5, 5, 5, 5);
     this.layoutControlItem1.Size     = new System.Drawing.Size(208, 32);
     this.layoutControlItem1.Text     = "layoutControlItem1";
     this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0);
     this.layoutControlItem1.TextToControlDistance = 0;
     this.layoutControlItem1.TextVisible           = false;
     //
     // layoutControlItem3
     //
     this.layoutControlItem3.Control = this.cancelButton;
     this.layoutControlItem3.CustomizationFormText = "layoutControlItem3";
     this.layoutControlItem3.Location = new System.Drawing.Point(341, 548);
     this.layoutControlItem3.Name     = "layoutControlItem3";
     this.layoutControlItem3.Padding  = new DevExpress.XtraLayout.Utils.Padding(5, 5, 5, 5);
     this.layoutControlItem3.Size     = new System.Drawing.Size(231, 32);
     this.layoutControlItem3.Text     = "layoutControlItem3";
     this.layoutControlItem3.TextSize = new System.Drawing.Size(0, 0);
     this.layoutControlItem3.TextToControlDistance = 0;
     this.layoutControlItem3.TextVisible           = false;
     //
     // PersistentBaseControl
     //
     this.Controls.Add(this.layoutControl1);
     this.Name = "PersistentBaseControl";
     this.Size = new System.Drawing.Size(800, 600);
     ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit();
     this.layoutControl1.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.rootLayout)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.Root)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).EndInit();
     this.ResumeLayout(false);
 }
        public void InitListColumns(GridView View)
        {
            layoutControl2.OptionsView.DrawItemBorders = false;
            if (TypeChoice != TypeChoiceGridColumnsControl.DESTINATION)
            {
                layoutControl2.Controls.Clear();

                int y = 0;
                const int heigh = 23;
                foreach (GridColumn col in View.Columns)
                {
                    SimpleButton sb = new SimpleButton();
                    sb.Location = new System.Drawing.Point(3, 3);
                    sb.Name = "sb_" + col.FieldName;
                    sb.Size = new System.Drawing.Size(196, 25);
                    sb.StyleController = this.layoutControl2;

                    sb.TabIndex = 4;
                    sb.Text = col.Caption;

                    LayoutControlItem lci = new LayoutControlItem();
                    lci.SizeConstraintsType = SizeConstraintsType.Default;
                    lci.CustomizationFormText = string.IsNullOrEmpty(col.CustomizationCaption) ? col.Caption : col.CustomizationCaption;
                    lci.Location = new System.Drawing.Point(0, y);
                    lci.Name = "lci_" + col.FieldName;
                    lci.Size = new System.Drawing.Size(layoutControl2.Width, heigh);

                    lci.Text = col.Caption;
                    lci.TextSize = new System.Drawing.Size(0, 0);
                    lci.MaxSize = new Size(layoutControl2.Width, heigh);
                    lci.MinSize = lci.MaxSize;
                    lci.FillControlToClientArea = true;
                    lci.Control = sb;
                    lci.TextVisible = false;
                    layoutControl2.Controls.Add(sb);
                    y += heigh;
                    layoutControlGroup.Items.AddRange(new[] { lci });
                }
                IniEnvent();
            }
        }
Example #11
0
            private void Initialize()
            {
                /**
                 * if ui is needed, we will just leave this method.
                 * we will just use the grid control default of this module (gcReport)
                 */
                if (m_CallingEnvironment == eCallingEnvironment.BrightSales_SendEmail || m_IsWebPortalCall)
                    return;

                this.layoutControl = new LayoutControl();
                this.layoutControl.Name = "layoutControl" + Guid.NewGuid().ToString();
                this.layoutControl.Dock = DockStyle.Fill;
                this.Controls.Add(layoutControl);

                this.layoutControlGroup1 = new LayoutControlGroup();
                this.layoutControlGroup1.Name = "layoutControlGroup" + Guid.NewGuid().ToString();
                this.layoutControlGroup1.Text = this.Text;
                this.layoutControlGroup1.Padding = new DevExpress.XtraLayout.Utils.Padding(10, 10, 10, 10);
                this.layoutControlGroup1.ShowInCustomizationForm = false;

                this.emptySpaceItemLoading = new EmptySpaceItem();
                this.emptySpaceItemLoading.Text = "Loading view display. Please wait...";
                this.emptySpaceItemLoading.AppearanceItemCaption.Font = new Font("Arial", 10f, FontStyle.Bold);
                this.emptySpaceItemLoading.AppearanceItemCaption.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
                this.emptySpaceItemLoading.TextVisible = true;
                this.emptySpaceItemLoading.Size = new Size(100, 20);
                this.emptySpaceItemLoading.MaxSize = new Size(100, 20);
                this.emptySpaceItemLoading.MinSize = new Size(100, 20);
                this.emptySpaceItemLoading.SizeConstraintsType = SizeConstraintsType.Custom;
                this.layoutControlGroup1.AddItem(emptySpaceItemLoading);

                /**
                 * grid control and grid view.
                 */
                this.gridControl1 = new GridControl();
                this.gridView1 = new GridView();

                this.gridControl1.Name = "gridControl" + Guid.NewGuid().ToString();
                this.gridControl1.MainView = this.gridView1;
                this.gridControl1.ViewCollection.AddRange(new BaseView[] { this.gridView1 });

                this.gridView1.Name = "gridView" + Guid.NewGuid().ToString();
                this.gridView1.GridControl = this.gridControl1;
                this.gridView1.OptionsFind.AlwaysVisible = false;
                this.gridView1.OptionsSelection.EnableAppearanceFocusedCell = false;
                this.gridView1.OptionsBehavior.AutoPopulateColumns = true;
                this.gridView1.OptionsSelection.MultiSelect = false;
                this.gridView1.OptionsView.ShowGroupPanel = false;
                this.gridView1.OptionsView.ColumnAutoWidth = false;
                this.gridView1.OptionsBehavior.Editable = false;
                this.gridView1.PopupMenuShowing += new DevExpress.XtraGrid.Views.Grid.PopupMenuShowingEventHandler(gridView1_PopupMenuShowing);
                this.gridView1.ColumnFilterChanged += new EventHandler(gridView1_ColumnFilterChanged);
                this.gridView1.DragObjectDrop += gridView1_DragObjectDrop;

                this.labelControl1 = new LabelControl();
                this.labelControl1.Name = "labelControl" + Guid.NewGuid().ToString();
                this.labelControl1.Text = "Records: 0";
                this.labelControl1.Size = new System.Drawing.Size(120, 22);

                this.layoutControl.BeginUpdate();
                this.layoutControlItem1 = new LayoutControlItem();
                this.layoutControlItem1.Name = "layoutControlItem" + Guid.NewGuid().ToString();
                this.layoutControlItem1.Control = gridControl1;
                this.layoutControlItem1.TextVisible = false;
                this.layoutControlGroup1.AddItem(this.layoutControlItem1);

                this.emptySpaceItem1 = new EmptySpaceItem();
                this.layoutControlGroup1.AddItem(emptySpaceItem1);

                /**
                 * [@jeff 06.18.2012]: https://brightvision.jira.com/browse/PLATFORM-1462
                 * added label to display the current grid record count.
                 */
                this.layoutControlItem5 = new LayoutControlItem();
                this.layoutControlItem5.Name = "layoutControlItem" + Guid.NewGuid().ToString();
                this.layoutControlItem5.Control = labelControl1;
                this.layoutControlItem5.SizeConstraintsType = SizeConstraintsType.Custom;
                this.layoutControlItem5.MaxSize = new Size(130, 30);
                this.layoutControlItem5.MinSize = new Size(80, 24);
                this.layoutControlItem5.Size = new Size(this.labelControl1.Width + 8, this.labelControl1.Height + 8);
                this.layoutControlItem5.TextVisible = false;
                this.layoutControlItem5.ShowInCustomizationForm = false;
                this.layoutControlItem5.Padding = new DevExpress.XtraLayout.Utils.Padding(5, 3, 3, 5);
                this.layoutControlGroup1.AddItem(layoutControlItem5, emptySpaceItem1, DevExpress.XtraLayout.Utils.InsertType.Left);

                /**
                 * show report.
                 */
                this.btnShowReport = new SimpleButton();
                this.btnShowReport.Name = "simpleButton" + Guid.NewGuid().ToString();
                this.btnShowReport.Text = "Show Report";
                this.btnShowReport.Size = new System.Drawing.Size(90, 22);
                this.btnShowReport.Enabled = false;
                this.btnShowReport.Click += new EventHandler(btnShowReport_Click);

                this.layoutControlItem4 = new LayoutControlItem();
                this.layoutControlItem4.Name = "layoutControlItem" + Guid.NewGuid().ToString();
                this.layoutControlItem4.Control = btnShowReport;
                this.layoutControlItem4.SizeConstraintsType = SizeConstraintsType.Custom;
                this.layoutControlItem4.MaxSize = new Size(100, 30);
                this.layoutControlItem4.MinSize = new Size(80, 24);
                this.layoutControlItem4.Size = new Size(this.btnShowReport.Width + 8, this.btnShowReport.Height + 8);
                this.layoutControlItem4.TextVisible = false;
                this.layoutControlItem4.ShowInCustomizationForm = false;
                this.layoutControlItem4.Padding = new DevExpress.XtraLayout.Utils.Padding(5, 3, 3, 5);
                this.layoutControlGroup1.AddItem(layoutControlItem4, emptySpaceItem1, DevExpress.XtraLayout.Utils.InsertType.Left);

                /**
                 * Save As Account Per PDF.
                 */
                this.btnSaveReportPerPdf = new SimpleButton();
                this.btnSaveReportPerPdf.Name = "simpleButton" + Guid.NewGuid().ToString();
                this.btnSaveReportPerPdf.Text = "Save Account Per PDF";
                this.btnSaveReportPerPdf.Size = new System.Drawing.Size(170, 22);
                this.btnSaveReportPerPdf.Enabled = false;
                this.btnSaveReportPerPdf.Click += new EventHandler(btnSaveReportPerPdf_Click);

                this.layoutControlItem7 = new LayoutControlItem();
                this.layoutControlItem7.Name = "layoutControlItem" + Guid.NewGuid().ToString();
                this.layoutControlItem7.Control = btnSaveReportPerPdf;
                this.layoutControlItem7.SizeConstraintsType = SizeConstraintsType.Custom;
                this.layoutControlItem7.MaxSize = new Size(180, 30);
                this.layoutControlItem7.MinSize = new Size(80, 24);
                this.layoutControlItem7.Size = new Size(this.btnSaveReportPerPdf.Width + 8, this.btnSaveReportPerPdf.Height + 8);
                this.layoutControlItem7.TextVisible = false;
                this.layoutControlItem7.ShowInCustomizationForm = false;
                this.layoutControlItem7.Padding = new DevExpress.XtraLayout.Utils.Padding(5, 3, 3, 5);
                this.layoutControlGroup1.AddItem(layoutControlItem7, emptySpaceItem1, DevExpress.XtraLayout.Utils.InsertType.Left);

                /**
                 * hide (Save As Account Per PDF) button
                 * if not called by bright manager application.
                 */
                //if (m_CallingEnvironment != eCallingEnvironment.BrightManager_ViewDisplay)
                //    layoutControlItem7.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;

                this.layoutControl.Root = layoutControlGroup1;
                this.layoutControl.Root.GroupBordersVisible = false;
                this.layoutControl.EndUpdate();
                this.Tag = this;
            }
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmTrialXtraLayoutControl));
     this.defaultLookAndFeel1 = new DevExpress.LookAndFeel.DefaultLookAndFeel(this.components);
     this.imageCollection1 = new DevExpress.Utils.ImageCollection(this.components);
     this.splitContainerControl1 = new DevExpress.XtraEditors.SplitContainerControl();
     this.checkEdit1 = new DevExpress.XtraEditors.CheckEdit();
     this.filename = new DevExpress.XtraEditors.TextEdit();
     this.btnSave = new DevExpress.XtraEditors.SimpleButton();
     this.btnLoad = new DevExpress.XtraEditors.SimpleButton();
     this.labelControl2 = new DevExpress.XtraEditors.LabelControl();
     this.labelControl1 = new DevExpress.XtraEditors.LabelControl();
     this.dsFile = new DevExpress.XtraEditors.ComboBoxEdit();
     this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
     this.userCtrl_DieuKienLoc1 = new XtralayoutControl.chautv.UserCtrl_DieuKienLoc();
     this.NgaySinh = new DevExpress.XtraEditors.DateEdit();
     this.NgheNghiep = new DevExpress.XtraEditors.ComboBoxEdit();
     this.TenNuoc = new DevExpress.XtraEditors.ComboBoxEdit();
     this.NoiSinh = new DevExpress.XtraEditors.TextEdit();
     this.txt_HoTen = new DevExpress.XtraEditors.TextEdit();
     this.dataNavigator1 = new DevExpress.XtraEditors.DataNavigator();
     this.ThongTinThem = new DevExpress.XtraEditors.MemoEdit();
     this.pictureEditHinhAnh = new DevExpress.XtraEditors.PictureEdit();
     this.layoutControlGroup1 = new DevExpress.XtraLayout.LayoutControlGroup();
     this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
     this.splitterItem1 = new DevExpress.XtraLayout.SplitterItem();
     this.splitterItem2 = new DevExpress.XtraLayout.SplitterItem();
     this.emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem();
     this.layoutControlItem11 = new DevExpress.XtraLayout.LayoutControlItem();
     this.emptySpaceItem2 = new DevExpress.XtraLayout.EmptySpaceItem();
     this.layoutControlItem7 = new DevExpress.XtraLayout.LayoutControlItem();
     this.layoutControlItem4 = new DevExpress.XtraLayout.LayoutControlItem();
     this.emptySpaceItem3 = new DevExpress.XtraLayout.EmptySpaceItem();
     this.layoutControlItem8 = new DevExpress.XtraLayout.LayoutControlItem();
     this.emptySpaceItem4 = new DevExpress.XtraLayout.EmptySpaceItem();
     this.layoutControlItem6 = new DevExpress.XtraLayout.LayoutControlItem();
     this.layoutControlGroup2 = new DevExpress.XtraLayout.LayoutControlGroup();
     this.layoutControlItem9 = new DevExpress.XtraLayout.LayoutControlItem();
     this.layoutControlItem5 = new DevExpress.XtraLayout.LayoutControlItem();
     this.layoutControlGroup3 = new DevExpress.XtraLayout.LayoutControlGroup();
     this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem();
     this.xtraUserControlLayout1 = new pl.fw.layout.test.XtraUserControlLayout();
     ((System.ComponentModel.ISupportInitialize)(this.imageCollection1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.splitContainerControl1)).BeginInit();
     this.splitContainerControl1.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.checkEdit1.Properties)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.filename.Properties)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.dsFile.Properties)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
     this.layoutControl1.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.NgaySinh.Properties.VistaTimeProperties)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.NgaySinh.Properties)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.NgheNghiep.Properties)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.TenNuoc.Properties)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.NoiSinh.Properties)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.txt_HoTen.Properties)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.ThongTinThem.Properties)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.pictureEditHinhAnh.Properties)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.splitterItem1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.splitterItem2)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem11)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem2)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem7)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem3)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem8)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem4)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem6)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup2)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem9)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup3)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit();
     this.SuspendLayout();
     //
     // defaultLookAndFeel1
     //
     this.defaultLookAndFeel1.LookAndFeel.SkinName = "Money Twins";
     //
     // imageCollection1
     //
     this.imageCollection1.ImageStream = ((DevExpress.Utils.ImageCollectionStreamer)(resources.GetObject("imageCollection1.ImageStream")));
     //
     // splitContainerControl1
     //
     this.splitContainerControl1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowOnly;
     this.splitContainerControl1.Dock = System.Windows.Forms.DockStyle.Bottom;
     this.splitContainerControl1.Horizontal = false;
     this.splitContainerControl1.Location = new System.Drawing.Point(0, 176);
     this.splitContainerControl1.Name = "splitContainerControl1";
     this.splitContainerControl1.Panel1.Controls.Add(this.checkEdit1);
     this.splitContainerControl1.Panel1.Controls.Add(this.filename);
     this.splitContainerControl1.Panel1.Controls.Add(this.btnSave);
     this.splitContainerControl1.Panel1.Controls.Add(this.btnLoad);
     this.splitContainerControl1.Panel1.Controls.Add(this.labelControl2);
     this.splitContainerControl1.Panel1.Controls.Add(this.labelControl1);
     this.splitContainerControl1.Panel1.Controls.Add(this.dsFile);
     this.splitContainerControl1.Panel1.Text = "Panel1";
     this.splitContainerControl1.Panel2.Controls.Add(this.layoutControl1);
     this.splitContainerControl1.Panel2.Text = "Panel2";
     this.splitContainerControl1.Size = new System.Drawing.Size(827, 451);
     this.splitContainerControl1.SplitterPosition = 92;
     this.splitContainerControl1.TabIndex = 0;
     this.splitContainerControl1.Text = "splitContainerControl1";
     //
     // checkEdit1
     //
     this.checkEdit1.Location = new System.Drawing.Point(26, 64);
     this.checkEdit1.Name = "checkEdit1";
     this.checkEdit1.Properties.Caption = "Thiết kế";
     this.checkEdit1.Size = new System.Drawing.Size(75, 18);
     this.checkEdit1.TabIndex = 5;
     this.checkEdit1.CheckedChanged += new System.EventHandler(this.checkEdit1_CheckedChanged);
     //
     // filename
     //
     this.filename.Location = new System.Drawing.Point(373, 37);
     this.filename.Name = "filename";
     this.filename.Size = new System.Drawing.Size(108, 20);
     this.filename.TabIndex = 4;
     //
     // btnSave
     //
     this.btnSave.Location = new System.Drawing.Point(487, 34);
     this.btnSave.Name = "btnSave";
     this.btnSave.Size = new System.Drawing.Size(61, 24);
     this.btnSave.TabIndex = 3;
     this.btnSave.Text = "Save";
     this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
     //
     // btnLoad
     //
     this.btnLoad.Location = new System.Drawing.Point(238, 34);
     this.btnLoad.Name = "btnLoad";
     this.btnLoad.Size = new System.Drawing.Size(61, 23);
     this.btnLoad.TabIndex = 2;
     this.btnLoad.Text = "Load";
     this.btnLoad.Click += new System.EventHandler(this.btnLoad_Click);
     //
     // labelControl2
     //
     this.labelControl2.Location = new System.Drawing.Point(309, 41);
     this.labelControl2.Name = "labelControl2";
     this.labelControl2.Size = new System.Drawing.Size(52, 13);
     this.labelControl2.TabIndex = 1;
     this.labelControl2.Text = "File name :";
     //
     // labelControl1
     //
     this.labelControl1.Location = new System.Drawing.Point(28, 40);
     this.labelControl1.Name = "labelControl1";
     this.labelControl1.Size = new System.Drawing.Size(47, 13);
     this.labelControl1.TabIndex = 1;
     this.labelControl1.Text = "Load file :";
     //
     // dsFile
     //
     this.dsFile.Location = new System.Drawing.Point(81, 36);
     this.dsFile.Name = "dsFile";
     this.dsFile.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
     new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
     this.dsFile.Size = new System.Drawing.Size(151, 20);
     this.dsFile.TabIndex = 0;
     //
     // layoutControl1
     //
     this.layoutControl1.Controls.Add(this.userCtrl_DieuKienLoc1);
     this.layoutControl1.Controls.Add(this.NgaySinh);
     this.layoutControl1.Controls.Add(this.NgheNghiep);
     this.layoutControl1.Controls.Add(this.TenNuoc);
     this.layoutControl1.Controls.Add(this.NoiSinh);
     this.layoutControl1.Controls.Add(this.txt_HoTen);
     this.layoutControl1.Controls.Add(this.dataNavigator1);
     this.layoutControl1.Controls.Add(this.ThongTinThem);
     this.layoutControl1.Controls.Add(this.pictureEditHinhAnh);
     this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
     this.layoutControl1.Location = new System.Drawing.Point(0, 0);
     this.layoutControl1.Name = "layoutControl1";
     this.layoutControl1.OptionsCustomizationForm.ShowPropertyGrid = true;
     this.layoutControl1.Root = this.layoutControlGroup1;
     this.layoutControl1.Size = new System.Drawing.Size(821, 347);
     this.layoutControl1.TabIndex = 2;
     this.layoutControl1.Text = "layoutControl1";
     //
     // userCtrl_DieuKienLoc1
     //
     this.userCtrl_DieuKienLoc1.Location = new System.Drawing.Point(11, 29);
     this.userCtrl_DieuKienLoc1.Name = "userCtrl_DieuKienLoc1";
     this.userCtrl_DieuKienLoc1.Size = new System.Drawing.Size(800, 66);
     this.userCtrl_DieuKienLoc1.TabIndex = 21;
     //
     // NgaySinh
     //
     this.NgaySinh.EditValue = null;
     this.NgaySinh.Location = new System.Drawing.Point(404, 140);
     this.NgaySinh.Name = "NgaySinh";
     this.NgaySinh.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
     new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
     this.NgaySinh.Properties.VistaTimeProperties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
     new DevExpress.XtraEditors.Controls.EditorButton()});
     this.NgaySinh.Size = new System.Drawing.Size(274, 20);
     this.NgaySinh.StyleController = this.layoutControl1;
     this.NgaySinh.TabIndex = 20;
     //
     // NgheNghiep
     //
     this.NgheNghiep.Location = new System.Drawing.Point(404, 233);
     this.NgheNghiep.Name = "NgheNghiep";
     this.NgheNghiep.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
     new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
     this.NgheNghiep.Size = new System.Drawing.Size(274, 20);
     this.NgheNghiep.StyleController = this.layoutControl1;
     this.NgheNghiep.TabIndex = 19;
     //
     // TenNuoc
     //
     this.TenNuoc.Location = new System.Drawing.Point(404, 202);
     this.TenNuoc.Name = "TenNuoc";
     this.TenNuoc.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
     new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
     this.TenNuoc.Size = new System.Drawing.Size(274, 20);
     this.TenNuoc.StyleController = this.layoutControl1;
     this.TenNuoc.TabIndex = 18;
     //
     // NoiSinh
     //
     this.NoiSinh.Location = new System.Drawing.Point(404, 171);
     this.NoiSinh.Name = "NoiSinh";
     this.NoiSinh.Size = new System.Drawing.Size(410, 20);
     this.NoiSinh.StyleController = this.layoutControl1;
     this.NoiSinh.TabIndex = 17;
     //
     // txt_HoTen
     //
     this.txt_HoTen.Location = new System.Drawing.Point(404, 109);
     this.txt_HoTen.Name = "txt_HoTen";
     this.txt_HoTen.Size = new System.Drawing.Size(410, 20);
     this.txt_HoTen.StyleController = this.layoutControl1;
     this.txt_HoTen.TabIndex = 15;
     //
     // dataNavigator1
     //
     this.dataNavigator1.Location = new System.Drawing.Point(371, 321);
     this.dataNavigator1.Name = "dataNavigator1";
     this.dataNavigator1.Size = new System.Drawing.Size(443, 19);
     this.dataNavigator1.StyleController = this.layoutControl1;
     this.dataNavigator1.TabIndex = 14;
     this.dataNavigator1.Text = "dataNavigator1";
     //
     // ThongTinThem
     //
     this.ThongTinThem.Location = new System.Drawing.Point(11, 291);
     this.ThongTinThem.Name = "ThongTinThem";
     this.ThongTinThem.Size = new System.Drawing.Size(800, 16);
     this.ThongTinThem.StyleController = this.layoutControl1;
     this.ThongTinThem.TabIndex = 12;
     //
     // pictureEditHinhAnh
     //
     this.pictureEditHinhAnh.Location = new System.Drawing.Point(8, 109);
     this.pictureEditHinhAnh.Name = "pictureEditHinhAnh";
     this.pictureEditHinhAnh.Properties.SizeMode = DevExpress.XtraEditors.Controls.PictureSizeMode.Zoom;
     this.pictureEditHinhAnh.Size = new System.Drawing.Size(299, 144);
     this.pictureEditHinhAnh.StyleController = this.layoutControl1;
     this.pictureEditHinhAnh.TabIndex = 4;
     //
     // layoutControlGroup1
     //
     this.layoutControlGroup1.CustomizationFormText = "layoutControlGroup1";
     this.layoutControlGroup1.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
     this.layoutControlItem1,
     this.splitterItem1,
     this.splitterItem2,
     this.emptySpaceItem1,
     this.layoutControlItem11,
     this.emptySpaceItem2,
     this.layoutControlItem7,
     this.layoutControlItem4,
     this.emptySpaceItem3,
     this.layoutControlItem8,
     this.emptySpaceItem4,
     this.layoutControlItem6,
     this.layoutControlGroup2,
     this.layoutControlItem5,
     this.layoutControlGroup3});
     this.layoutControlGroup1.Location = new System.Drawing.Point(0, 0);
     this.layoutControlGroup1.Name = "layoutControlGroup1";
     this.layoutControlGroup1.Size = new System.Drawing.Size(821, 347);
     this.layoutControlGroup1.Spacing = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
     this.layoutControlGroup1.Text = "layoutControlGroup1";
     this.layoutControlGroup1.TextVisible = false;
     //
     // layoutControlItem1
     //
     this.layoutControlItem1.Control = this.pictureEditHinhAnh;
     this.layoutControlItem1.CustomizationFormText = "layoutControlItem1";
     this.layoutControlItem1.Location = new System.Drawing.Point(0, 101);
     this.layoutControlItem1.Name = "layoutControlItem1";
     this.layoutControlItem1.Size = new System.Drawing.Size(310, 155);
     this.layoutControlItem1.Text = "layoutControlItem1";
     this.layoutControlItem1.TextLocation = DevExpress.Utils.Locations.Left;
     this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0);
     this.layoutControlItem1.TextToControlDistance = 0;
     this.layoutControlItem1.TextVisible = false;
     //
     // splitterItem1
     //
     this.splitterItem1.CustomizationFormText = "splitterItem1";
     this.splitterItem1.Location = new System.Drawing.Point(310, 101);
     this.splitterItem1.Name = "splitterItem1";
     this.splitterItem1.Size = new System.Drawing.Size(6, 155);
     //
     // splitterItem2
     //
     this.splitterItem2.CustomizationFormText = "splitterItem2";
     this.splitterItem2.Location = new System.Drawing.Point(0, 256);
     this.splitterItem2.Name = "splitterItem2";
     this.splitterItem2.Size = new System.Drawing.Size(817, 6);
     //
     // emptySpaceItem1
     //
     this.emptySpaceItem1.CustomizationFormText = "emptySpaceItem1";
     this.emptySpaceItem1.Location = new System.Drawing.Point(681, 225);
     this.emptySpaceItem1.Name = "emptySpaceItem1";
     this.emptySpaceItem1.Size = new System.Drawing.Size(136, 31);
     this.emptySpaceItem1.Text = "emptySpaceItem1";
     this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
     //
     // layoutControlItem11
     //
     this.layoutControlItem11.Control = this.dataNavigator1;
     this.layoutControlItem11.CustomizationFormText = "layoutControlItem11";
     this.layoutControlItem11.Location = new System.Drawing.Point(363, 313);
     this.layoutControlItem11.Name = "layoutControlItem11";
     this.layoutControlItem11.Size = new System.Drawing.Size(454, 30);
     this.layoutControlItem11.Text = "layoutControlItem11";
     this.layoutControlItem11.TextLocation = DevExpress.Utils.Locations.Left;
     this.layoutControlItem11.TextSize = new System.Drawing.Size(0, 0);
     this.layoutControlItem11.TextToControlDistance = 0;
     this.layoutControlItem11.TextVisible = false;
     //
     // emptySpaceItem2
     //
     this.emptySpaceItem2.CustomizationFormText = "emptySpaceItem2";
     this.emptySpaceItem2.Location = new System.Drawing.Point(0, 313);
     this.emptySpaceItem2.Name = "emptySpaceItem2";
     this.emptySpaceItem2.Size = new System.Drawing.Size(363, 30);
     this.emptySpaceItem2.Text = "emptySpaceItem2";
     this.emptySpaceItem2.TextSize = new System.Drawing.Size(0, 0);
     //
     // layoutControlItem7
     //
     this.layoutControlItem7.AppearanceItemCaption.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.layoutControlItem7.AppearanceItemCaption.Options.UseFont = true;
     this.layoutControlItem7.AppearanceItemCaption.Options.UseTextOptions = true;
     this.layoutControlItem7.AppearanceItemCaption.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
     this.layoutControlItem7.Control = this.NgheNghiep;
     this.layoutControlItem7.CustomizationFormText = "Job :";
     this.layoutControlItem7.Location = new System.Drawing.Point(316, 225);
     this.layoutControlItem7.Name = "layoutControlItem7";
     this.layoutControlItem7.Size = new System.Drawing.Size(365, 31);
     this.layoutControlItem7.Text = "Nghề nghiệp :";
     this.layoutControlItem7.TextLocation = DevExpress.Utils.Locations.Left;
     this.layoutControlItem7.TextSize = new System.Drawing.Size(75, 20);
     //
     // layoutControlItem4
     //
     this.layoutControlItem4.AppearanceItemCaption.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.layoutControlItem4.AppearanceItemCaption.Options.UseFont = true;
     this.layoutControlItem4.AppearanceItemCaption.Options.UseTextOptions = true;
     this.layoutControlItem4.AppearanceItemCaption.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
     this.layoutControlItem4.Control = this.NoiSinh;
     this.layoutControlItem4.CustomizationFormText = "Place birthday :";
     this.layoutControlItem4.Location = new System.Drawing.Point(316, 163);
     this.layoutControlItem4.Name = "layoutControlItem4";
     this.layoutControlItem4.Size = new System.Drawing.Size(501, 31);
     this.layoutControlItem4.Text = "Nơi sinh :";
     this.layoutControlItem4.TextLocation = DevExpress.Utils.Locations.Left;
     this.layoutControlItem4.TextSize = new System.Drawing.Size(75, 20);
     //
     // emptySpaceItem3
     //
     this.emptySpaceItem3.CustomizationFormText = "emptySpaceItem3";
     this.emptySpaceItem3.Location = new System.Drawing.Point(681, 132);
     this.emptySpaceItem3.Name = "emptySpaceItem3";
     this.emptySpaceItem3.Size = new System.Drawing.Size(136, 31);
     this.emptySpaceItem3.Text = "emptySpaceItem3";
     this.emptySpaceItem3.TextSize = new System.Drawing.Size(0, 0);
     //
     // layoutControlItem8
     //
     this.layoutControlItem8.AppearanceItemCaption.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.layoutControlItem8.AppearanceItemCaption.Options.UseFont = true;
     this.layoutControlItem8.AppearanceItemCaption.Options.UseTextOptions = true;
     this.layoutControlItem8.AppearanceItemCaption.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
     this.layoutControlItem8.Control = this.NgaySinh;
     this.layoutControlItem8.CustomizationFormText = "layoutControlItem8";
     this.layoutControlItem8.Location = new System.Drawing.Point(316, 132);
     this.layoutControlItem8.Name = "layoutControlItem8";
     this.layoutControlItem8.Size = new System.Drawing.Size(365, 31);
     this.layoutControlItem8.Text = "Ngày sinh :";
     this.layoutControlItem8.TextLocation = DevExpress.Utils.Locations.Left;
     this.layoutControlItem8.TextSize = new System.Drawing.Size(75, 20);
     //
     // emptySpaceItem4
     //
     this.emptySpaceItem4.CustomizationFormText = "emptySpaceItem4";
     this.emptySpaceItem4.Location = new System.Drawing.Point(681, 194);
     this.emptySpaceItem4.Name = "emptySpaceItem4";
     this.emptySpaceItem4.Size = new System.Drawing.Size(136, 31);
     this.emptySpaceItem4.Text = "emptySpaceItem4";
     this.emptySpaceItem4.TextSize = new System.Drawing.Size(0, 0);
     //
     // layoutControlItem6
     //
     this.layoutControlItem6.AppearanceItemCaption.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.layoutControlItem6.AppearanceItemCaption.Options.UseFont = true;
     this.layoutControlItem6.AppearanceItemCaption.Options.UseTextOptions = true;
     this.layoutControlItem6.AppearanceItemCaption.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
     this.layoutControlItem6.Control = this.TenNuoc;
     this.layoutControlItem6.CustomizationFormText = "Country :";
     this.layoutControlItem6.Location = new System.Drawing.Point(316, 194);
     this.layoutControlItem6.Name = "layoutControlItem6";
     this.layoutControlItem6.Size = new System.Drawing.Size(365, 31);
     this.layoutControlItem6.Text = "Tên nước :";
     this.layoutControlItem6.TextLocation = DevExpress.Utils.Locations.Left;
     this.layoutControlItem6.TextSize = new System.Drawing.Size(75, 20);
     //
     // layoutControlGroup2
     //
     this.layoutControlGroup2.AppearanceGroup.Font = new System.Drawing.Font("Tahoma", 8.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.layoutControlGroup2.AppearanceGroup.Options.UseFont = true;
     this.layoutControlGroup2.AppearanceItemCaption.Font = new System.Drawing.Font("Tahoma", 8.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.layoutControlGroup2.AppearanceItemCaption.Options.UseFont = true;
     this.layoutControlGroup2.CustomizationFormText = "Thông tin thêm";
     this.layoutControlGroup2.ExpandButtonVisible = true;
     this.layoutControlGroup2.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
     this.layoutControlItem9});
     this.layoutControlGroup2.Location = new System.Drawing.Point(0, 262);
     this.layoutControlGroup2.Name = "layoutControlGroup2";
     this.layoutControlGroup2.Size = new System.Drawing.Size(817, 51);
     this.layoutControlGroup2.Text = "Thông tin thêm";
     //
     // layoutControlItem9
     //
     this.layoutControlItem9.AppearanceItemCaption.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
     this.layoutControlItem9.AppearanceItemCaption.Options.UseFont = true;
     this.layoutControlItem9.Control = this.ThongTinThem;
     this.layoutControlItem9.CustomizationFormText = "The Plot:";
     this.layoutControlItem9.Location = new System.Drawing.Point(0, 0);
     this.layoutControlItem9.Name = "layoutControlItem9";
     this.layoutControlItem9.Size = new System.Drawing.Size(811, 27);
     this.layoutControlItem9.Text = "The Plot:";
     this.layoutControlItem9.TextAlignMode = DevExpress.XtraLayout.TextAlignModeItem.AutoSize;
     this.layoutControlItem9.TextLocation = DevExpress.Utils.Locations.Top;
     this.layoutControlItem9.TextSize = new System.Drawing.Size(0, 0);
     this.layoutControlItem9.TextToControlDistance = 0;
     this.layoutControlItem9.TextVisible = false;
     //
     // layoutControlItem5
     //
     this.layoutControlItem5.AppearanceItemCaption.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.layoutControlItem5.AppearanceItemCaption.Options.UseFont = true;
     this.layoutControlItem5.AppearanceItemCaption.Options.UseTextOptions = true;
     this.layoutControlItem5.AppearanceItemCaption.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
     this.layoutControlItem5.Control = this.txt_HoTen;
     this.layoutControlItem5.CustomizationFormText = "Name :";
     this.layoutControlItem5.ImageAlignment = System.Drawing.ContentAlignment.MiddleRight;
     this.layoutControlItem5.Location = new System.Drawing.Point(316, 101);
     this.layoutControlItem5.Name = "layoutControlItem5";
     this.layoutControlItem5.Size = new System.Drawing.Size(501, 31);
     this.layoutControlItem5.Text = "Họ và tên :";
     this.layoutControlItem5.TextLocation = DevExpress.Utils.Locations.Left;
     this.layoutControlItem5.TextSize = new System.Drawing.Size(75, 20);
     //
     // layoutControlGroup3
     //
     this.layoutControlGroup3.CustomizationFormText = "Điều kiện lọc";
     this.layoutControlGroup3.ExpandButtonVisible = true;
     this.layoutControlGroup3.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
     this.layoutControlItem2});
     this.layoutControlGroup3.Location = new System.Drawing.Point(0, 0);
     this.layoutControlGroup3.Name = "layoutControlGroup3";
     this.layoutControlGroup3.Size = new System.Drawing.Size(817, 101);
     this.layoutControlGroup3.Text = "Điều kiện lọc";
     //
     // layoutControlItem2
     //
     this.layoutControlItem2.Control = this.userCtrl_DieuKienLoc1;
     this.layoutControlItem2.CustomizationFormText = "layoutControlItem2";
     this.layoutControlItem2.Location = new System.Drawing.Point(0, 0);
     this.layoutControlItem2.Name = "layoutControlItem2";
     this.layoutControlItem2.Size = new System.Drawing.Size(811, 77);
     this.layoutControlItem2.Text = "layoutControlItem2";
     this.layoutControlItem2.TextLocation = DevExpress.Utils.Locations.Left;
     this.layoutControlItem2.TextSize = new System.Drawing.Size(0, 0);
     this.layoutControlItem2.TextToControlDistance = 0;
     this.layoutControlItem2.TextVisible = false;
     //
     // xtraUserControlLayout1
     //
     this.xtraUserControlLayout1.Location = new System.Drawing.Point(14, 58);
     this.xtraUserControlLayout1.Name = "xtraUserControlLayout1";
     this.xtraUserControlLayout1.Size = new System.Drawing.Size(350, 93);
     this.xtraUserControlLayout1.TabIndex = 1;
     //
     // frmTrialXtraLayoutControl
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize = new System.Drawing.Size(827, 627);
     this.Controls.Add(this.xtraUserControlLayout1);
     this.Controls.Add(this.splitContainerControl1);
     this.Name = "frmTrialXtraLayoutControl";
     this.Text = "Demo Xtralayout";
     this.Load += new System.EventHandler(this.frmDemoXtralayout2_Load_1);
     ((System.ComponentModel.ISupportInitialize)(this.imageCollection1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.splitContainerControl1)).EndInit();
     this.splitContainerControl1.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.checkEdit1.Properties)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.filename.Properties)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.dsFile.Properties)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit();
     this.layoutControl1.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.NgaySinh.Properties.VistaTimeProperties)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.NgaySinh.Properties)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.NgheNghiep.Properties)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.TenNuoc.Properties)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.NoiSinh.Properties)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.txt_HoTen.Properties)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.ThongTinThem.Properties)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.pictureEditHinhAnh.Properties)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.splitterItem1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.splitterItem2)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem11)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem2)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem7)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem3)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem8)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem4)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem6)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup2)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem9)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup3)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit();
     this.ResumeLayout(false);
 }
Example #13
0
        private void FillSteps(IEnumerable<Step> steps)
        {
            layoutMain.BeginUpdate();
            try
            {

                var list = steps as List<Step> ?? steps.ToList();
                var groups = new List<BaseLayoutItem>
                                 {
                                     layoutStateDescription
                                 };
                foreach (var step in list.OrderBy(g => g.OrdNum))
                {
                    var baseItem = groups.Last();
                    var insertType = InsertType.Bottom;
                    if (list.Count>6)
                    {
                        if (((list.IndexOf(step) + 1) % 2) == 0)
                        {
                            insertType = InsertType.Right;
                        }
                        else if (baseItem != groups.First())
                        {
                            baseItem = groups[groups.IndexOf(baseItem) - 1];
                        }
                    }
                    var group = layoutMain.Root.AddGroup(step.ActionName, baseItem, insertType);
                    if (insertType == InsertType.Bottom)
                        group.Width = layoutStateDescription.Width;
                    group.Tag = step;
                    group.Padding = new Padding {All = 5};
                    var itemDelivered = group.AddItem("Передали");
                    itemDelivered.TextLocation = Locations.Top;
                    itemDelivered.Tag = "Delivered";
                    var txtDelivered = new DateEdit();
                    txtDelivered.Properties.AllowNullInput = DefaultBoolean.True;
                    itemDelivered.Control = txtDelivered;
                    txtDelivered.EditValue = step.Delivered;

                    var itemReceived = new LayoutControlItem
                                           {
                                               Text = Resources.received,
                                               TextLocation = Locations.Top,
                                               Tag = "Received"
                                           };
                    group.AddItem(itemReceived, itemDelivered, InsertType.Right);
                    var txtReceived = new DateEdit();
                    txtReceived.Properties.AllowNullInput = DefaultBoolean.True;
                    itemReceived.Control = txtReceived;
                    txtReceived.EditValue = step.Received;
                   groups.Add(group);
                }
                layoutMain.BestFit();
                int heigh = layoutMain.Root.MinSize.Height < 640 ? layoutMain.Root.MinSize.Height + 140 : 640;
                ClientSize = new Size(ClientSize.Width, heigh);
            }
            finally
            {
                layoutMain.EndUpdate();
                new CustomFocusHelper(layoutMain).FocusFirstEditableControl();
                StartPosition = FormStartPosition.Manual;
                Top = (Screen.PrimaryScreen.Bounds.Height - Height) / 2;
                Left = (Screen.PrimaryScreen.Bounds.Width - Width) / 2;
            }
        }
        private void layoutControl2_DragOver(object sender, DragEventArgs e)
        {
            if (e.Data != null)
            {
                dragItem = e.Data.GetData(typeof(LayoutControlItem)) as LayoutControlItem;
                dragItem.Width = this.layoutControl2.Width;

                UpdateDragHelper(new Point(e.X, e.Y));

                e.Effect = DragDropEffects.Copy;

                if (dragItem.Owner != this.layoutControl2)
                {
                    dragItem.Owner.Parent.Cursor = Cursors.Default;
                    if (TypeChoice == TypeChoiceGridColumnsControl.SOURCE)
                        Cursor = new Cursor(Properties.Resources.delete.Handle);
                    else if (TypeChoice == TypeChoiceGridColumnsControl.DESTINATION) Cursor = new Cursor(Properties.Resources.copy.Handle);
                }
                else
                    Cursor = new Cursor(Properties.Resources.move.Handle);

            }
        }
 void c_MouseDown(object sender, MouseEventArgs e)
 {
     SimpleButton s = sender as SimpleButton;
     s.Font = new Font(s.Font, FontStyle.Regular);
     LayoutControl lo = ((SimpleButton)sender).Parent as LayoutControl;
     foreach (LayoutControlItem ctr in lo.Root.Items)
     {
         if (ctr.Name.Replace("lci_", "sb_") == s.Name)
         {
             dropItem = ctr;
             return;
         }
     }
 }
Example #16
0
        //public static void MakeLayoutContol2(LayoutControlGroup layoutControlGroup, string _valString)
        //{
        //    List<DataThreeVo> resultList = new MyDatabaseConnect01().connection3(_valString);
        //    layoutControlGroup.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
        //    layoutControlGroup.GroupBordersVisible = false;
        //    layoutControlGroup.LayoutMode = DevExpress.XtraLayout.Utils.LayoutMode.Table;
        //    layoutControlGroup.Location = new Point(0, 0);
        //    layoutControlGroup.Name = "layoutControlGroup";

        //    for (int x = 0; x < 11; x++)
        //    {
        //        layoutControlGroup.OptionsTableLayoutGroup.ColumnDefinitions.Add(new ColumnDefinition() { Width = 120D, SizeType = SizeType.Absolute });

        //    }
        //    layoutControlGroup.OptionsTableLayoutGroup.ColumnDefinitions.Add(new ColumnDefinition() { Width = 2D, SizeType = SizeType.Absolute });

        //    for (int x = 0; x < (resultList.Count + 1) / 6; x++)
        //    {
        //        layoutControlGroup.OptionsTableLayoutGroup.RowDefinitions.Add(new RowDefinition() { Height = 200D, SizeType = SizeType.Absolute });
        //    }

        //    layoutControlGroup.Size = new Size(3000, 2000);
        //    layoutControlGroup.TextVisible = false;


        //    LayoutControlItem controlItem;
        //    MyUserControl02 userControl;
        //    int _rowIndex = 0;
        //    for (int x = 0; x < resultList.Count; x++)
        //    {
        //        controlItem = new LayoutControlItem() { TextVisible = false };
        //        if ((x + 1) % 6 == 0)
        //        {
        //            _rowIndex += 1;
        //        }
        //        controlItem.OptionsTableLayoutItem.RowIndex = _rowIndex;

        //        if ((x + 1) % 6 == 1)
        //        {
        //            controlItem.OptionsTableLayoutItem.ColumnIndex = 0;
        //        }
        //        else if ((x + 1) % 6 == 2)
        //        {
        //            controlItem.OptionsTableLayoutItem.ColumnIndex = 1;
        //        }
        //        else if ((x + 1) % 6 == 3)
        //        {
        //            controlItem.OptionsTableLayoutItem.ColumnIndex = 2;
        //        }
        //        else if ((x + 1) % 6 == 4)
        //        {
        //            controlItem.OptionsTableLayoutItem.ColumnIndex = 3;

        //        }
        //        else if ((x + 1) % 6 == 5)
        //        {
        //            controlItem.OptionsTableLayoutItem.ColumnIndex = 4;

        //        }
        //        else if ((x + 1) % 6 == 0)
        //        {
        //            controlItem.OptionsTableLayoutItem.ColumnIndex = 5;
        //            controlItem.OptionsTableLayoutItem.RowIndex = _rowIndex - 1;

        //        }
        //        userControl = new MyUserControl02(resultList[x].EQP_DESC.ToString(), resultList[x].EQP_ID.ToString(), "", "");
        //        controlItem.Control = userControl;
        //        layoutControlGroup.Items.AddRange(new BaseLayoutItem[] { controlItem });
        //    }
        //}
        public static void MakeLayoutContol(LayoutControlGroup layoutControlGroup, string _valString)
        {
            List <MyDatabaseConnect01.DataFourVo> resultList = new MyDatabaseConnect01().connection6(_valString);

            layoutControlGroup.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
            layoutControlGroup.GroupBordersVisible         = false;
            layoutControlGroup.LayoutMode = DevExpress.XtraLayout.Utils.LayoutMode.Table;
            layoutControlGroup.Location   = new Point(0, 0);
            layoutControlGroup.Name       = "layoutControlGroup";

            layoutControlGroup.OptionsTableLayoutGroup.ColumnDefinitions.Add(new ColumnDefinition()
            {
                Width = 100D, SizeType = SizeType.Percent
            });

            for (int x = 0; x < resultList.Count + 1; x++)
            {
                layoutControlGroup.OptionsTableLayoutGroup.RowDefinitions.Add(new RowDefinition()
                {
                    Height = 100D, SizeType = SizeType.Absolute
                });
            }

            layoutControlGroup.Size        = new Size(796, 620);
            layoutControlGroup.TextVisible = false;


            LayoutControlItem controlItem;
            MyUserControl01   userControl;

            for (int x = 0; x < resultList.Count; x++)
            {
                controlItem = new LayoutControlItem()
                {
                    TextVisible = false
                };
                controlItem.OptionsTableLayoutItem.RowIndex = x;
                //// Run 초록
                //if (resultList[x].STATE.ToString() == "Run")
                //{
                //    userControl = new MyUserControl01(resultList[x].EQP_DESC.ToString() + (x + 1), Color.FromArgb(0x3E, 0x70, 0x38), 40 + new Random().Next(-20, 40) + " %", "00:23:20", 5 + new Random().Next(-3, 3) + " %", 10 + new Random().Next(-5, 5));
                //    controlItem.Control = userControl;
                //}
                //else if (resultList[x].STATE.ToString() == "Idle" || resultList[x].STATE.ToString() == "Ready")
                //{
                //    userControl = new MyUserControl01(resultList[x].EQP_DESC.ToString() + (x + 1), Color.DarkGray, 40 + new Random().Next(-20, 40) + " %", "00:23:20", 5 + new Random().Next(-3, 3) + " %", 10 + new Random().Next(-5, 5));

                //    controlItem.Control = userControl;
                //}
                //else if (resultList[x].STATE.ToString() == "Down")
                //{
                //    userControl = new MyUserControl01(resultList[x].EQP_DESC.ToString() + (x + 1), Color.OrangeRed, 40 + new Random().Next(-20, 40) + " %", "00:23:20", 5 + new Random().Next(-3, 3) + " %", 10 + new Random().Next(-5, 5));

                //    controlItem.Control = userControl;
                //}
                //else if (resultList[x].STATE.ToString() == "SetUp")
                //{
                //    userControl = new MyUserControl01(resultList[x].EQP_DESC.ToString() + (x + 1), Color.FromArgb(0x00, 0x73, 0xC4), 40 + new Random().Next(-20, 40) + " %", "00:23:20", 5 + new Random().Next(-3, 3) + " %", 10 + new Random().Next(-5, 5));
                //    controlItem.Control = userControl;
                //}
                userControl         = new MyUserControl01(resultList[x].EQP_ID.ToString(), Color.FromArgb(0x00, 0x73, 0xC4), 40 + new Random().Next(-20, 40) + " %", "00:23:20", 5 + new Random().Next(-3, 3) + " %", 100 + new Random().Next(-5, 5));
                controlItem.Control = userControl;
                layoutControlGroup.Items.AddRange(new BaseLayoutItem[] { controlItem });
            }
        }
Example #17
0
 public static void ChangeCaptionLayoutControlItem(string parent_name, string language, LayoutControlItem layout_control_item)
 {
     layout_control_item.Text = CaptionEngine.GetControlCaption(parent_name, layout_control_item.Name, BaseConstant.CONTROL_TEXT, language);
 }
Example #18
0
 private void InitializeComponent()
 {
     this.components          = (IContainer) new Container();
     this.atButtonsPanel1     = new atButtonsPanel();
     this.bsError             = new BindingSource(this.components);
     this.txtName             = new TextEdit();
     this.layoutControl1      = new LayoutControl();
     this.pictureEdit1        = new PictureEdit();
     this.memMessage3         = new MemoEdit();
     this.memMessage2         = new MemoEdit();
     this.memMessage1         = new MemoEdit();
     this.chkSave             = new CheckEdit();
     this.cboShowType         = new ComboBoxEdit();
     this.buttonEditErrorType = new ButtonEdit();
     this.txtCode             = new TextEdit();
     this.memComment          = new MemoEdit();
     this.layoutControlGroup1 = new LayoutControlGroup();
     this.layoutControlItem1  = new LayoutControlItem();
     this.layoutControlItem2  = new LayoutControlItem();
     this.layoutControlItem3  = new LayoutControlItem();
     this.layoutControlItem4  = new LayoutControlItem();
     this.layoutControlItem5  = new LayoutControlItem();
     this.layoutControlItem6  = new LayoutControlItem();
     this.layoutControlItem7  = new LayoutControlItem();
     this.layoutControlItem8  = new LayoutControlItem();
     this.layoutControlItem9  = new LayoutControlItem();
     this.layoutControlItem10 = new LayoutControlItem();
     this.atButtonsPanel1.BeginInit();
     ((ISupportInitialize)this.bsError).BeginInit();
     this.txtName.Properties.BeginInit();
     this.layoutControl1.BeginInit();
     this.layoutControl1.SuspendLayout();
     this.pictureEdit1.Properties.BeginInit();
     this.memMessage3.Properties.BeginInit();
     this.memMessage2.Properties.BeginInit();
     this.memMessage1.Properties.BeginInit();
     this.chkSave.Properties.BeginInit();
     this.cboShowType.Properties.BeginInit();
     this.buttonEditErrorType.Properties.BeginInit();
     this.txtCode.Properties.BeginInit();
     this.memComment.Properties.BeginInit();
     this.layoutControlGroup1.BeginInit();
     this.layoutControlItem1.BeginInit();
     this.layoutControlItem2.BeginInit();
     this.layoutControlItem3.BeginInit();
     this.layoutControlItem4.BeginInit();
     this.layoutControlItem5.BeginInit();
     this.layoutControlItem6.BeginInit();
     this.layoutControlItem7.BeginInit();
     this.layoutControlItem8.BeginInit();
     this.layoutControlItem9.BeginInit();
     this.layoutControlItem10.BeginInit();
     this.SuspendLayout();
     this.atButtonsPanel1.AcceptButton                = atButtonsPanel.bpButtons.None;
     this.atButtonsPanel1.CancelButton                = atButtonsPanel.bpButtons.None;
     this.atButtonsPanel1.CancelButtonText            = "";
     this.atButtonsPanel1.CancelButtonUseCancelSelect = true;
     this.atButtonsPanel1.CancelButtonVisible         = true;
     this.atButtonsPanel1.CloseButtonText             = "";
     this.atButtonsPanel1.CloseButtonUseCancelSelect  = false;
     this.atButtonsPanel1.CloseButtonVisible          = false;
     this.atButtonsPanel1.DataMember                 = (string)null;
     this.atButtonsPanel1.DataSource                 = (DataSet)null;
     this.atButtonsPanel1.Dock                       = DockStyle.Bottom;
     this.atButtonsPanel1.EnabledCancelButton        = true;
     this.atButtonsPanel1.EnabledCloseButton         = true;
     this.atButtonsPanel1.EnabledPrintButton         = true;
     this.atButtonsPanel1.EnabledRefreshButton       = true;
     this.atButtonsPanel1.EnabledSaveButton          = true;
     this.atButtonsPanel1.EnabledScriptButton        = true;
     this.atButtonsPanel1.IdDocAppearance            = 0;
     this.atButtonsPanel1.Location                   = new Point(0, 324);
     this.atButtonsPanel1.Name                       = "atButtonsPanel1";
     this.atButtonsPanel1.PrintButtonText            = "";
     this.atButtonsPanel1.PrintButtonVisible         = false;
     this.atButtonsPanel1.ProcessedIsDialog          = false;
     this.atButtonsPanel1.RefreshButtonText          = "Обновить";
     this.atButtonsPanel1.RefreshButtonUseSelectItem = true;
     this.atButtonsPanel1.RefreshButtonVisible       = true;
     this.atButtonsPanel1.SaveButtonText             = "Выбрать";
     this.atButtonsPanel1.SaveButtonUseSelectItem    = true;
     this.atButtonsPanel1.SaveButtonVisible          = true;
     this.atButtonsPanel1.ScriptButtonText           = "";
     this.atButtonsPanel1.ScriptButtonVisible        = false;
     this.atButtonsPanel1.Size                       = new Size(800, 33);
     this.atButtonsPanel1.TabIndex                   = 0;
     this.atButtonsPanel1.TextCancelButton           = "Отменить";
     this.atButtonsPanel1.TextCloseButton            = "Закрыть";
     this.atButtonsPanel1.TextPrintButton            = "Печать...";
     this.atButtonsPanel1.TextRefreshButton          = "Обновить";
     this.atButtonsPanel1.TextSaveButton             = "Применить";
     this.atButtonsPanel1.TextScriptButton           = "Скрипты...";
     this.atButtonsPanel1.VisibleCancelButton        = true;
     this.atButtonsPanel1.VisibleCloseButton         = true;
     this.atButtonsPanel1.VisiblePrintButton         = false;
     this.atButtonsPanel1.VisibleRefreshButton       = false;
     this.atButtonsPanel1.VisibleSaveButton          = true;
     this.atButtonsPanel1.VisibleScriptButton        = false;
     this.atButtonsPanel1.WidthPrintButton           = 75;
     this.bsError.DataSource = (object)typeof(ds_error.errorRow);
     this.txtName.DataBindings.Add(new Binding("EditValue", (object)this.bsError, "name", true));
     this.txtName.Location = new Point(225, 7);
     this.txtName.Name     = "txtName";
     this.txtName.Properties.BorderStyle = BorderStyles.Simple;
     this.txtName.Size            = new Size(271, 20);
     this.txtName.StyleController = (IStyleController)this.layoutControl1;
     this.txtName.TabIndex        = 1;
     this.layoutControl1.Controls.Add((Control)this.pictureEdit1);
     this.layoutControl1.Controls.Add((Control)this.memMessage3);
     this.layoutControl1.Controls.Add((Control)this.memMessage2);
     this.layoutControl1.Controls.Add((Control)this.memMessage1);
     this.layoutControl1.Controls.Add((Control)this.chkSave);
     this.layoutControl1.Controls.Add((Control)this.cboShowType);
     this.layoutControl1.Controls.Add((Control)this.buttonEditErrorType);
     this.layoutControl1.Controls.Add((Control)this.txtCode);
     this.layoutControl1.Controls.Add((Control)this.txtName);
     this.layoutControl1.Controls.Add((Control)this.memComment);
     this.layoutControl1.Dock     = DockStyle.Fill;
     this.layoutControl1.Location = new Point(0, 0);
     this.layoutControl1.Name     = "layoutControl1";
     this.layoutControl1.Root     = this.layoutControlGroup1;
     this.layoutControl1.Size     = new Size(800, 324);
     this.layoutControl1.TabIndex = 2;
     this.layoutControl1.Text     = "layoutControl1";
     this.pictureEdit1.DataBindings.Add(new Binding("EditValue", (object)this.bsError, "unpack_picture", true));
     this.pictureEdit1.Location = new Point(507, 32);
     this.pictureEdit1.Name     = "pictureEdit1";
     this.pictureEdit1.Properties.BorderStyle      = BorderStyles.Simple;
     this.pictureEdit1.Properties.PictureStoreMode = PictureStoreMode.ByteArray;
     this.pictureEdit1.Properties.SizeMode         = PictureSizeMode.Zoom;
     this.pictureEdit1.Size            = new Size(287, 286);
     this.pictureEdit1.StyleController = (IStyleController)this.layoutControl1;
     this.pictureEdit1.TabIndex        = 11;
     this.memMessage3.DataBindings.Add(new Binding("EditValue", (object)this.bsError, "message3", true));
     this.memMessage3.Location = new Point(85, 259);
     this.memMessage3.Name     = "memMessage3";
     this.memMessage3.Properties.BorderStyle = BorderStyles.Simple;
     this.memMessage3.Size            = new Size(411, 59);
     this.memMessage3.StyleController = (IStyleController)this.layoutControl1;
     this.memMessage3.TabIndex        = 10;
     this.memMessage2.DataBindings.Add(new Binding("EditValue", (object)this.bsError, "message2", true));
     this.memMessage2.Location = new Point(85, 189);
     this.memMessage2.Name     = "memMessage2";
     this.memMessage2.Properties.BorderStyle = BorderStyles.Simple;
     this.memMessage2.Size            = new Size(411, 59);
     this.memMessage2.StyleController = (IStyleController)this.layoutControl1;
     this.memMessage2.TabIndex        = 9;
     this.memMessage1.DataBindings.Add(new Binding("EditValue", (object)this.bsError, "message1", true));
     this.memMessage1.Location = new Point(85, 119);
     this.memMessage1.Name     = "memMessage1";
     this.memMessage1.Properties.BorderStyle = BorderStyles.Simple;
     this.memMessage1.Size            = new Size(411, 59);
     this.memMessage1.StyleController = (IStyleController)this.layoutControl1;
     this.memMessage1.TabIndex        = 8;
     this.chkSave.DataBindings.Add(new Binding("EditValue", (object)this.bsError, "issave", true));
     this.chkSave.Location                  = new Point(394, 38);
     this.chkSave.Name                      = "chkSave";
     this.chkSave.Properties.Caption        = "Сохранять";
     this.chkSave.Properties.GlyphAlignment = HorzAlignment.Far;
     this.chkSave.Size                      = new Size(102, 19);
     this.chkSave.StyleController           = (IStyleController)this.layoutControl1;
     this.chkSave.TabIndex                  = 7;
     this.cboShowType.DataBindings.Add(new Binding("EditValue", (object)this.bsError, "showtype_name", true));
     this.cboShowType.Location = new Point(304, 38);
     this.cboShowType.Name     = "cboShowType";
     this.cboShowType.Properties.BorderStyle = BorderStyles.Simple;
     this.cboShowType.Properties.Buttons.AddRange(new EditorButton[1]
     {
         new EditorButton(ButtonPredefines.Combo)
     });
     this.cboShowType.Properties.Items.AddRange(new object[4]
     {
         (object)"Не отображать",
         (object)"Сообщение 1",
         (object)"Сообщение 2",
         (object)"Сообщение 3"
     });
     this.cboShowType.Properties.TextEditStyle = TextEditStyles.DisableTextEditor;
     this.cboShowType.Size                  = new Size(79, 20);
     this.cboShowType.StyleController       = (IStyleController)this.layoutControl1;
     this.cboShowType.TabIndex              = 6;
     this.cboShowType.SelectedIndexChanged += new EventHandler(this.cboShowType_SelectedIndexChanged);
     this.buttonEditErrorType.DataBindings.Add(new Binding("EditValue", (object)this.bsError, "errortype_name", true));
     this.buttonEditErrorType.Location = new Point(32, 38);
     this.buttonEditErrorType.Name     = "buttonEditErrorType";
     this.buttonEditErrorType.Properties.BorderStyle = BorderStyles.Simple;
     this.buttonEditErrorType.Properties.Buttons.AddRange(new EditorButton[2]
     {
         new EditorButton(ButtonPredefines.Minus),
         new EditorButton()
     });
     this.buttonEditErrorType.Properties.TextEditStyle = TextEditStyles.DisableTextEditor;
     this.buttonEditErrorType.Size            = new Size(186, 20);
     this.buttonEditErrorType.StyleController = (IStyleController)this.layoutControl1;
     this.buttonEditErrorType.TabIndex        = 5;
     this.buttonEditErrorType.ButtonClick    += new ButtonPressedEventHandler(this.buttonEditErrorType_ButtonClick);
     this.txtCode.DataBindings.Add(new Binding("EditValue", (object)this.bsError, "code", true));
     this.txtCode.Location = new Point(32, 7);
     this.txtCode.Name     = "txtCode";
     this.txtCode.Properties.BorderStyle = BorderStyles.Simple;
     this.txtCode.Size            = new Size(104, 20);
     this.txtCode.StyleController = (IStyleController)this.layoutControl1;
     this.txtCode.TabIndex        = 4;
     this.memComment.DataBindings.Add(new Binding("EditValue", (object)this.bsError, "comment", true));
     this.memComment.Location = new Point(85, 69);
     this.memComment.Name     = "memComment";
     this.memComment.Properties.BorderStyle = BorderStyles.Simple;
     this.memComment.Size            = new Size(411, 39);
     this.memComment.StyleController = (IStyleController)this.layoutControl1;
     this.memComment.TabIndex        = 3;
     this.layoutControlGroup1.CustomizationFormText = "layoutControlGroup1";
     this.layoutControlGroup1.Items.AddRange(new BaseLayoutItem[10]
     {
         (BaseLayoutItem)this.layoutControlItem1,
         (BaseLayoutItem)this.layoutControlItem2,
         (BaseLayoutItem)this.layoutControlItem3,
         (BaseLayoutItem)this.layoutControlItem4,
         (BaseLayoutItem)this.layoutControlItem5,
         (BaseLayoutItem)this.layoutControlItem6,
         (BaseLayoutItem)this.layoutControlItem7,
         (BaseLayoutItem)this.layoutControlItem8,
         (BaseLayoutItem)this.layoutControlItem9,
         (BaseLayoutItem)this.layoutControlItem10
     });
     this.layoutControlGroup1.Location             = new Point(0, 0);
     this.layoutControlGroup1.Name                 = "layoutControlGroup1";
     this.layoutControlGroup1.Size                 = new Size(800, 324);
     this.layoutControlGroup1.Spacing              = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
     this.layoutControlGroup1.Text                 = "layoutControlGroup1";
     this.layoutControlGroup1.TextVisible          = false;
     this.layoutControlItem1.Control               = (Control)this.txtName;
     this.layoutControlItem1.CustomizationFormText = "Наименование";
     this.layoutControlItem1.Location              = new Point(140, 0);
     this.layoutControlItem1.Name                   = "layoutControlItem1";
     this.layoutControlItem1.Size                   = new Size(360, 31);
     this.layoutControlItem1.Text                   = "Наименование";
     this.layoutControlItem1.TextAlignMode          = TextAlignModeItem.AutoSize;
     this.layoutControlItem1.TextLocation           = Locations.Left;
     this.layoutControlItem1.TextSize               = new Size(73, 20);
     this.layoutControlItem2.Control                = (Control)this.memComment;
     this.layoutControlItem2.CustomizationFormText  = "Комментарий";
     this.layoutControlItem2.Location               = new Point(0, 62);
     this.layoutControlItem2.Name                   = "layoutControlItem2";
     this.layoutControlItem2.Size                   = new Size(500, 50);
     this.layoutControlItem2.Text                   = "Комментарий";
     this.layoutControlItem2.TextAlignMode          = TextAlignModeItem.CustomSize;
     this.layoutControlItem2.TextLocation           = Locations.Left;
     this.layoutControlItem2.TextSize               = new Size(73, 20);
     this.layoutControlItem3.Control                = (Control)this.txtCode;
     this.layoutControlItem3.CustomizationFormText  = "Код";
     this.layoutControlItem3.Location               = new Point(0, 0);
     this.layoutControlItem3.Name                   = "layoutControlItem3";
     this.layoutControlItem3.Size                   = new Size(140, 31);
     this.layoutControlItem3.Text                   = "Код";
     this.layoutControlItem3.TextAlignMode          = TextAlignModeItem.AutoSize;
     this.layoutControlItem3.TextLocation           = Locations.Left;
     this.layoutControlItem3.TextSize               = new Size(20, 20);
     this.layoutControlItem4.Control                = (Control)this.buttonEditErrorType;
     this.layoutControlItem4.CustomizationFormText  = "Тип";
     this.layoutControlItem4.Location               = new Point(0, 31);
     this.layoutControlItem4.Name                   = "layoutControlItem4";
     this.layoutControlItem4.Size                   = new Size(222, 31);
     this.layoutControlItem4.Text                   = "Тип";
     this.layoutControlItem4.TextAlignMode          = TextAlignModeItem.CustomSize;
     this.layoutControlItem4.TextLocation           = Locations.Left;
     this.layoutControlItem4.TextSize               = new Size(20, 20);
     this.layoutControlItem5.Control                = (Control)this.cboShowType;
     this.layoutControlItem5.CustomizationFormText  = "Отображение";
     this.layoutControlItem5.Location               = new Point(222, 31);
     this.layoutControlItem5.Name                   = "layoutControlItem5";
     this.layoutControlItem5.Size                   = new Size(165, 31);
     this.layoutControlItem5.Text                   = "Отображение";
     this.layoutControlItem5.TextAlignMode          = TextAlignModeItem.AutoSize;
     this.layoutControlItem5.TextLocation           = Locations.Left;
     this.layoutControlItem5.TextSize               = new Size(70, 20);
     this.layoutControlItem6.Control                = (Control)this.chkSave;
     this.layoutControlItem6.CustomizationFormText  = "layoutControlItem6";
     this.layoutControlItem6.Location               = new Point(387, 31);
     this.layoutControlItem6.Name                   = "layoutControlItem6";
     this.layoutControlItem6.Size                   = new Size(113, 31);
     this.layoutControlItem6.Text                   = "layoutControlItem6";
     this.layoutControlItem6.TextLocation           = Locations.Left;
     this.layoutControlItem6.TextSize               = new Size(0, 0);
     this.layoutControlItem6.TextToControlDistance  = 0;
     this.layoutControlItem6.TextVisible            = false;
     this.layoutControlItem7.Control                = (Control)this.memMessage1;
     this.layoutControlItem7.CustomizationFormText  = "Сообщение 1";
     this.layoutControlItem7.Location               = new Point(0, 112);
     this.layoutControlItem7.Name                   = "layoutControlItem7";
     this.layoutControlItem7.Size                   = new Size(500, 70);
     this.layoutControlItem7.Text                   = "Сообщение 1";
     this.layoutControlItem7.TextAlignMode          = TextAlignModeItem.CustomSize;
     this.layoutControlItem7.TextLocation           = Locations.Left;
     this.layoutControlItem7.TextSize               = new Size(73, 20);
     this.layoutControlItem8.Control                = (Control)this.memMessage2;
     this.layoutControlItem8.CustomizationFormText  = "Сообщение 2";
     this.layoutControlItem8.Location               = new Point(0, 182);
     this.layoutControlItem8.Name                   = "layoutControlItem8";
     this.layoutControlItem8.Size                   = new Size(500, 70);
     this.layoutControlItem8.Text                   = "Сообщение 2";
     this.layoutControlItem8.TextAlignMode          = TextAlignModeItem.CustomSize;
     this.layoutControlItem8.TextLocation           = Locations.Left;
     this.layoutControlItem8.TextSize               = new Size(73, 20);
     this.layoutControlItem9.Control                = (Control)this.memMessage3;
     this.layoutControlItem9.CustomizationFormText  = "Сообщение 2";
     this.layoutControlItem9.Location               = new Point(0, 252);
     this.layoutControlItem9.Name                   = "layoutControlItem9";
     this.layoutControlItem9.Size                   = new Size(500, 70);
     this.layoutControlItem9.Text                   = "Сообщение 2";
     this.layoutControlItem9.TextAlignMode          = TextAlignModeItem.CustomSize;
     this.layoutControlItem9.TextLocation           = Locations.Left;
     this.layoutControlItem9.TextSize               = new Size(73, 20);
     this.layoutControlItem10.Control               = (Control)this.pictureEdit1;
     this.layoutControlItem10.CustomizationFormText = "Иллюстрация";
     this.layoutControlItem10.Location              = new Point(500, 0);
     this.layoutControlItem10.Name                  = "layoutControlItem10";
     this.layoutControlItem10.Size                  = new Size(298, 322);
     this.layoutControlItem10.Text                  = "Иллюстрация";
     this.layoutControlItem10.TextLocation          = Locations.Top;
     this.layoutControlItem10.TextSize              = new Size(69, 20);
     this.AutoScaleDimensions = new SizeF(6f, 13f);
     this.AutoScaleMode       = AutoScaleMode.Font;
     this.Controls.Add((Control)this.layoutControl1);
     this.Controls.Add((Control)this.atButtonsPanel1);
     this.MinimumSize  = new Size(800, 357);
     this.Name         = "ErrorEditForm";
     this.Size         = new Size(800, 357);
     this.Text         = "ErrorEditForm";
     this.FormClosing += new FormClosing(this.ErrorEditForm_FormClosing);
     this.atButtonsPanel1.EndInit();
     ((ISupportInitialize)this.bsError).EndInit();
     this.txtName.Properties.EndInit();
     this.layoutControl1.EndInit();
     this.layoutControl1.ResumeLayout(false);
     this.pictureEdit1.Properties.EndInit();
     this.memMessage3.Properties.EndInit();
     this.memMessage2.Properties.EndInit();
     this.memMessage1.Properties.EndInit();
     this.chkSave.Properties.EndInit();
     this.cboShowType.Properties.EndInit();
     this.buttonEditErrorType.Properties.EndInit();
     this.txtCode.Properties.EndInit();
     this.memComment.Properties.EndInit();
     this.layoutControlGroup1.EndInit();
     this.layoutControlItem1.EndInit();
     this.layoutControlItem2.EndInit();
     this.layoutControlItem3.EndInit();
     this.layoutControlItem4.EndInit();
     this.layoutControlItem5.EndInit();
     this.layoutControlItem6.EndInit();
     this.layoutControlItem7.EndInit();
     this.layoutControlItem8.EndInit();
     this.layoutControlItem9.EndInit();
     this.layoutControlItem10.EndInit();
     this.ResumeLayout(false);
 }
Example #19
0
 public static void ChangeCaptionLayoutControlItem(string parent_name, string language, LayoutControlItem[] layout_control_items)
 {
     foreach (LayoutControlItem layout_control_item in layout_control_items)
         ChangeCaptionLayoutControlItem(parent_name, language, layout_control_item);
 }
Example #20
0
        public void CreateViewItems(DetailView view, List <ConfigurationStatic> configurations)
        {
            view.CreateControls();
            var layoutControl = (DevExpress.XtraLayout.LayoutControl)view.Control;
            var mainGroup     = new TabbedControlGroup()
            {
                TextVisible = false
            };

            layoutControl.AddItem(mainGroup);

            var groups = new List <LayoutControlGroup>();

            foreach (var configurationStatic in configurations)
            {
                var item = new LayoutControlItem()
                {
                    Name = configurationStatic.ParameterName, OptionsToolTip = new BaseLayoutItemOptionsToolTip()
                    {
                        ToolTip = configurationStatic.Description
                    }
                };
                var group = groups.FirstOrDefault(x => x.Name == configurationStatic.GroupName);
                if (group == null)
                {
                    group = new LayoutControlGroup()
                    {
                        Name = configurationStatic.GroupName, DefaultLayoutType = LayoutType.Vertical
                    };
                    groups.Add(group);
                    mainGroup.AddTabPage(group);
                }
                var type = configurationStatic.ParameterType;
                switch (type)
                {
                case ConfigurationStatic.ParameterTypeEnum.String:
                    item.Control = new StringEdit(250)
                    {
                        Dock = DockStyle.Fill, EditValue = configurationStatic.ParameterValue, ToolTip = configurationStatic.Description
                    }; break;

                case ConfigurationStatic.ParameterTypeEnum.Int:
                    item.Control = new IntegerEdit()
                    {
                        Dock = DockStyle.Fill, EditValue = Convert.ToInt32(configurationStatic.ParameterValue), ToolTip = configurationStatic.Description
                    }; break;

                case ConfigurationStatic.ParameterTypeEnum.Decimal:
                    item.Control = new DecimalEdit()
                    {
                        Dock = DockStyle.Fill, EditValue = Convert.ToDecimal(configurationStatic.ParameterValue), ToolTip = configurationStatic.Description
                    }; break;

                case ConfigurationStatic.ParameterTypeEnum.Bool:
                    item.Control = new BooleanEdit()
                    {
                        Dock = DockStyle.Fill, EditValue = Convert.ToBoolean(configurationStatic.ParameterValue), ToolTip = configurationStatic.Description, Text = string.Empty
                    }; break;
                }

                (item.Control as BaseEdit).EditValueChanged += (s, e) => ConfigurationStaticController_EditValueChanged(s, e, configurationStatic);
                group.AddItem(item);
            }
            mainGroup.SelectedTabPageIndex = 0;
        }
Example #21
0
        public void AddEvent()
        {
            //AnThongTin();
            gvDiemDanh = (data.FrmMain.Controls.Find("wDiemDanh", true)[0] as GridControl).MainView as GridView;
            //Fix: Khi duyệt/bỏ duyệt, cập nhật thông tin người duyệt vào tab MTDK
            gvNgayNghi = (data.FrmMain.Controls.Find("TLNgayNghiLop", true)[0] as GridControl).MainView as GridView;
            gvMTDK     = (data.FrmMain.Controls.Find("MTDK", true)[0] as GridControl).MainView as GridView;
            tcMain     = data.FrmMain.Controls.Find("tcMain", true)[0] as XtraTabControl;
            lcMain     = data.FrmMain.Controls.Find("lcMain", true)[0] as LayoutControl;
            dateNgayBD = data.FrmMain.Controls.Find("NgayBDKhoa", true)[0] as DateEdit;
            dateNgayKT = data.FrmMain.Controls.Find("NgayKTKhoa", true)[0] as DateEdit;

            data.FrmMain.Shown      += new EventHandler(FrmMain_Shown);
            gvDiemDanh.RowCellStyle += new RowCellStyleEventHandler(gv_RowCellStyle);
            gvMTDK.CellValueChanged += new DevExpress.XtraGrid.Views.Base.CellValueChangedEventHandler(gvMTDK_CellValueChanged);
            gvMTDK.OptionsView.NewItemRowPosition    = NewItemRowPosition.None; //không cho thêm mới
            gvMTDK.ActiveFilterString                = "IsNghiHoc = 0 and IsBL = 0";
            gvMTDK.Columns["IsNghiHoc"].VisibleIndex = -1;
            gvMTDK.Columns["NgayNghi"].VisibleIndex  = -1;
            gvMTDK.Columns["IsBL"].VisibleIndex      = -1;
            gvMTDK.Columns["NgayBL"].VisibleIndex    = -1;
            RepositoryItemCheckEdit riDuyet = gvMTDK.GridControl.RepositoryItems["Duyet"] as RepositoryItemCheckEdit;

            riDuyet.EditValueChanging += new DevExpress.XtraEditors.Controls.ChangingEventHandler(riDuyet_EditValueChanging);
            // Tao nut diem danh
            //SimpleButton btnDiemDanh = new SimpleButton();
            //btnDiemDanh.Name = "btnDiemDanh";
            //btnDiemDanh.Text = "Điểm danh";
            //LayoutControlItem lci = lcMain.AddItem("", btnDiemDanh);
            //lci.Name = "cusDiemDanh";
            //btnDiemDanh.Click += new EventHandler(btnDiemDanh_Click);

            //Tạo nút Ẩn hiện học viên nghỉ học
            SimpleButton btnAnHienHVNghiHoc = new SimpleButton();

            btnAnHienHVNghiHoc.Name = "btnAnHienHV";
            btnAnHienHVNghiHoc.Text = "Hiện học viên đã nghỉ";
            btnAnHienHVNghiHoc.Tag  = "HIEN";
            LayoutControlItem lci2 = lcMain.AddItem("", btnAnHienHVNghiHoc);

            lci2.Name = "cusAnHienHV";
            btnAnHienHVNghiHoc.Click += new EventHandler(btnAnHienHVNghiHoc_Click);

            // Nút tính ngày kết thúc
            SimpleButton btnNgayKT = new SimpleButton();

            btnNgayKT.Name = "btnNgayKT";   //phai co name cua control
            btnNgayKT.Text = "Tính ngày KT";
            LayoutControlItem lci3 = lcMain.AddItem("", btnNgayKT);

            lci3.Name        = "cusNgayKT"; //phai co name cua item, bat buoc phai co "cus" phai truoc
            btnNgayKT.Click += new EventHandler(btnNgayKT_Click);

            // Tao spinedit
            //SpinEdit sThang = new SpinEdit();
            //sThang.Name = "sThang";
            //sThang.Text = "Chọn tháng";
            //LayoutControlItem lci1 = lcMain.AddItem("", sThang);
            //lci1.Name = "cusThang";
            //sThang.ValueChanged += new EventHandler(sThang_ValueChanged);

            //data.BsMain.PositionChanged += new EventHandler(BsMain_PositionChanged);

            data.BsMain.DataSourceChanged += new EventHandler(BsMain_DataSourceChanged);
            BsMain_DataSourceChanged(data.BsMain, new EventArgs());
        }
 private void adjustLayoutItemSize(LayoutControlItem layoutControlItem, IResizableView view, int height)
 {
     layoutControlItem.AdjustControlHeight(height);
     view.Repaint();
 }
Example #23
0
        public void AddEvent()
        {
            tableName = _data.DrTableMaster["TableName"].ToString();
            List <string> lstTB = new List <string>(new string[] { "MTBaoGia", "MTDonHang", "MTLSX" });
            List <string> lstSo = new List <string>(new string[] { "SoBG", "SoDH", "SoDH" });

            if (!lstTB.Contains(tableName))
            {
                return;
            }
            deNgayCT = _data.FrmMain.Controls.Find("NgayCT", true)[0] as DateEdit;
            lcMain   = _data.FrmMain.Controls.Find("lcMain", true)[0] as LayoutControl;
            if (tableName == "MTDonHang")
            {
                SimpleButton btnKho = new SimpleButton();
                btnKho.Name = "btnKho";
                btnKho.Text = "Lấy khổ";
                LayoutControlItem lci = lcMain.AddItem("", btnKho);
                lci.Name      = "cusKho";
                btnKho.Click += new EventHandler(btnKho_Click);
            }
            gvMain = (_data.FrmMain.Controls.Find("gcMain", true)[0] as GridControl).MainView as GridView;
            gvMain.OptionsBehavior.Editable = false;

            gvMain.BeforeLeaveRow    += new DevExpress.XtraGrid.Views.Base.RowAllowEventHandler(gvMain_BeforeLeaveRow);
            gvMain.FocusedRowChanged += new DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventHandler(gvMain_FocusedRowChanged);
            gluKH = _data.FrmMain.Controls.Find("MaKH", true)[0] as GridLookUpEdit;
            if (tableName == "MTBaoGia")
            {
                gluKH.EditValueChanged += new EventHandler(gluKH_EditValueChanged);
                LayoutControlItem lciDH = lcMain.Items.FindByName("lciTaoDH") as LayoutControlItem;
                lciDH.AppearanceItemCaption.ForeColor            = Color.Red;
                lciDH.AppearanceItemCaption.Options.UseForeColor = true;
            }
            ceKCT = _data.FrmMain.Controls.Find("KCT", true)[0] as CheckEdit;
            if (tableName == "MTDonHang")
            {
                ceXa = _data.FrmMain.Controls.Find("isXa", true)[0] as CheckEdit;
                ceCL = _data.FrmMain.Controls.Find("isCL", true)[0] as CheckEdit;
                CalcEdit ceDT = _data.FrmMain.Controls.Find("DienTich", true)[0] as CalcEdit;
                ceDT.Enter             += new EventHandler(ceDT_Enter);
                ceXX                    = _data.FrmMain.Controls.Find("XaX", true)[0] as CalcEdit;
                ceXX.Enter             += new EventHandler(ceXX_Enter);
                ceXX.EditValueChanged  += new EventHandler(ceXX_EditValueChanged);
                seDaoX                  = _data.FrmMain.Controls.Find("DaoX", true)[0] as SpinEdit;
                seDaoX.Enter           += new EventHandler(seDao_Enter);
                seDaoCL                 = _data.FrmMain.Controls.Find("DaoCL", true)[0] as SpinEdit;
                ceDCL                   = _data.FrmMain.Controls.Find("DaiCL", true)[0] as CalcEdit;
                ceDCL.Enter            += new EventHandler(ceDCL_Enter);
                ceRCL                   = _data.FrmMain.Controls.Find("RongCL", true)[0] as CalcEdit;
                ceRCL.Enter            += new EventHandler(ceDCL_Enter);
                ceRCL.EditValueChanged += new EventHandler(ceRCL_EditValueChanged);
                ceCCL                   = _data.FrmMain.Controls.Find("CaoCL", true)[0] as CalcEdit;
                ceCCL.Enter            += new EventHandler(ceDCL_Enter);
                ceCCL.EditValueChanged += new EventHandler(ceCCL_EditValueChanged);
                SpinEdit seLCL = _data.FrmMain.Controls.Find("LopCL", true)[0] as SpinEdit;
                seLCL.Enter += new EventHandler(seLCL_Enter);
            }
            CalcEdit ceGB = _data.FrmMain.Controls.Find("GiaBan", true)[0] as CalcEdit;

            ceGB.Enter += new EventHandler(ceGB_Enter);
            CalcEdit ceKTT = _data.FrmMain.Controls.Find("KhoTT", true)[0] as CalcEdit;

            ceKTT.Enter += new EventHandler(ceKTT_Enter);
            CalcEdit ceDao = _data.FrmMain.Controls.Find("Dao", true)[0] as CalcEdit;

            ceDao.Enter              += new EventHandler(ceDao_Enter);
            cbeLoaiThung              = _data.FrmMain.Controls.Find("LoaiThung", true)[0] as ComboBoxEdit;
            cbeLoai                   = _data.FrmMain.Controls.Find("Loai", true)[0] as ComboBoxEdit;
            cbeLoai.EditValueChanged += new EventHandler(cbeLoai_EditValueChanged);
            CalcEdit ceDai = _data.FrmMain.Controls.Find("Dai", true)[0] as CalcEdit;

            ceRong = _data.FrmMain.Controls.Find("Rong", true)[0] as CalcEdit;

            ceLop = _data.FrmMain.Controls.Find("Lop", true)[0] as SpinEdit;
            ceLop.EditValueChanged += new EventHandler(ceLop_EditValueChanged);

            if (tableName == "MTDonHang" || tableName == "MTLSX")
            {
                gluTHS        = _data.FrmMain.Controls.Find("THS", true)[0] as GridLookUpEdit;
                gluTHS.Popup += new EventHandler(gluTHS_Popup);
            }

            GridLookUpEdit gluMat = _data.FrmMain.Controls.Find("Mat_Giay", true)[0] as GridLookUpEdit;
            GridLookUpEdit gluSB  = _data.FrmMain.Controls.Find("SB_Giay", true)[0] as GridLookUpEdit;
            GridLookUpEdit gluMB  = _data.FrmMain.Controls.Find("MB_Giay", true)[0] as GridLookUpEdit;
            GridLookUpEdit gluSC  = _data.FrmMain.Controls.Find("SC_Giay", true)[0] as GridLookUpEdit;
            GridLookUpEdit gluMC  = _data.FrmMain.Controls.Find("MC_Giay", true)[0] as GridLookUpEdit;
            GridLookUpEdit gluSE  = _data.FrmMain.Controls.Find("SE_Giay", true)[0] as GridLookUpEdit;
            GridLookUpEdit gluME  = _data.FrmMain.Controls.Find("ME_Giay", true)[0] as GridLookUpEdit;

            lstGiay.AddRange(new GridLookUpEdit[] { gluMat, gluSB, gluMB, gluSC, gluMC, gluSE, gluME });
            SetDMGiay();
            foreach (GridLookUpEdit glu in lstGiay)
            {
                glu.Popup   += new EventHandler(gluGiay_Popup);
                glu.KeyDown += new KeyEventHandler(glu_KeyDown);
                glu.CloseUp += new DevExpress.XtraEditors.Controls.CloseUpEventHandler(glu_CloseUp);
            }

            if (tableName == "MTDonHang" || tableName == "MTLSX")
            {
                ceDai.Enter  += new EventHandler(ceDai_Enter);
                ceRong.Enter += new EventHandler(ceRong_Enter);
                gvMain.OptionsView.EnableAppearanceEvenRow = false;
                gvMain.OptionsView.EnableAppearanceOddRow  = false;
                gvMain.Appearance.FocusedRow.BackColor     = Color.Transparent;
                gvMain.RowStyle += new RowStyleEventHandler(gvMain_RowStyle);
            }

            if (tableName == "MTDonHang")
            {
                ceRong.EditValueChanged += new EventHandler(ceRong_EditValueChanged);
                ceRong.Leave            += new EventHandler(ceRong_Leave);
            }
            gvMain.ShownEditor += new EventHandler(gvMain_ShownEditor);

            _data.BsMain.DataSourceChanged += new EventHandler(BsMain_DataSourceChanged);
            BsMain_DataSourceChanged(_data.BsMain, new EventArgs());
        }
Example #24
0
 public static void ChangeCaptionLayoutControlItem(string parent_name, string language, LayoutControlItem layout_control_item)
 {
     layout_control_item.Text = CaptionEngine.GetControlCaption(parent_name, layout_control_item.Name, BaseConstant.CONTROL_TEXT, language);
 }
Example #25
0
        private void InitializeComponent()
        {
            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject1 = new DevExpress.Utils.SerializableAppearanceObject();
            this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
            this.simpleButtonCancel = new DevExpress.XtraEditors.SimpleButton();
            this.simpleButtonSave = new DevExpress.XtraEditors.SimpleButton();
            this.gridControlHistory = new DevExpress.XtraGrid.GridControl();
            this.gridViewHistory = new DevExpress.XtraGrid.Views.Grid.GridView();
            this.gridColumnId = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridColumnComment = new DevExpress.XtraGrid.Columns.GridColumn();
            this.repositoryItemMemoEdit1 = new DevExpress.XtraEditors.Repository.RepositoryItemMemoEdit();
            this.repositoryItemMemoEdit2 = new DevExpress.XtraEditors.Repository.RepositoryItemMemoEdit();
            this.gridColumnCreationDate = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridColumnUser = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridColumnCustomerContact = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridColumnDelete = new DevExpress.XtraGrid.Columns.GridColumn();
            this.repositoryItemButtonEdit1 = new DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit();
            this.repositoryItemButtonEdit2 = new DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit();
            this.memoEdit1 = new DevExpress.XtraEditors.MemoEdit();
            this.layoutControlGroupQuestion1 = new DevExpress.XtraLayout.LayoutControlGroup();
            this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
            this.layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem();
            this.layoutControlItem4 = new DevExpress.XtraLayout.LayoutControlItem();
            this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem();
            this.layoutControlItemHeader = new DevExpress.XtraLayout.LayoutControlItem();
            this.layoutControlItemHeader.Name = "layoutControlItemHeader"+Guid.NewGuid().ToString();
            this.layoutControlItemPrefix = new DevExpress.XtraLayout.LayoutControlItem();
            this.emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem();

            //
            // layoutControlGroupQuestion1
            //
            this.layoutControlGroupQuestion1.CustomizationFormText = "Root";
            this.layoutControlGroupQuestion1.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
            this.layoutControlGroupQuestion1.AppearanceGroup.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
            this.layoutControlGroupQuestion1.AppearanceGroup.GradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
            this.layoutControlGroupQuestion1.AppearanceGroup.Options.UseFont = true;
            this.layoutControlGroupQuestion1.ExpandButtonVisible = false;
            this.layoutControlGroupQuestion1.GroupBordersVisible = true;
            this.layoutControlGroupQuestion1.TextVisible = false;
            //this.layoutControlGroupQuestion1.Location = new System.Drawing.Point(0, 0);
            this.layoutControlGroupQuestion1.Padding = new DevExpress.XtraLayout.Utils.Padding(1, 1, 1, 1);
            this.layoutControlGroupQuestion1.ShowInCustomizationForm = false;
            //this.layoutControlGroupQuestion1.Text = oSettings.Label + " " + oSettings.QuestionText;
            this.layoutControlGroupQuestion1.BeginUpdate();

            #region Prefix
            lprefix = new Label();
            lprefix.Name = "lprefix";
            lprefix.Text = "";
            lprefix.Visible = false;
            this.layoutControlItemPrefix.Location = new System.Drawing.Point(0, 0);
            this.layoutControlItemPrefix.Name = "layoutControlItemPrefix1";
            this.layoutControlItemPrefix.Control = lprefix;
            this.layoutControlItemPrefix.ShowInCustomizationForm = false;
            this.layoutControlItemPrefix.TextVisible = false;
            this.layoutControlItemPrefix.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
            this.layoutControlItemPrefix.MinSize = new Size(0, 10);
            this.layoutControlItemPrefix.MaxSize = new Size(0, 10);
            this.layoutControlItemPrefix.SizeConstraintsType = SizeConstraintsType.Custom;
            this.layoutControlItemPrefix.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
            #endregion

            #region Footer
               //bool isCustomerOwned = false;
            //bool isBrightvisionOwned = false;
            //if (oSettings.CustomerOwnership && oSettings.BVOwnership)
            //    isCustomerOwnershipOnly = true;

            //ctlFooter = new Footer() {
            //    IsAccountLevel = oSettings.DataBindings.account_level,
            //    IsCustomerOwnershipOnly = isCustomerOwnershipOnly,
            //    HelpText = oSettings.QuestionHelp,
            //    LanguageCode = oSettings.DataBindings.language_code
            //};
            Settings oSettings = Questionnaire.Form.Settings;
            ctlFooter = new Footer() {
                IsAccountLevel = oSettings.DataBindings.account_level,
                IsCustomerOwned = oSettings.CustomerOwnership,
                IsBrightvisionOwned = oSettings.BVOwnership,
                HelpText = oSettings.QuestionHelp,
                LanguageCode = oSettings.DataBindings.language_code,
                QuestionText = oSettings.Label + " " + oSettings.QuestionText
            };

            ctlFooter.InitializeFooter();
            ctlFooter.Dock = DockStyle.Fill;
            ctlFooter.Height = 20;
            this.layoutControlItemHeader.Control = ctlFooter;
            this.layoutControlItemHeader.ShowInCustomizationForm = false;
            this.layoutControlItemHeader.TextVisible = false;
            this.layoutControlItemHeader.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
            this.layoutControlItemHeader.MinSize = new Size(0, 24);
            this.layoutControlItemHeader.MaxSize = new Size(0, 24);
            this.layoutControlItemHeader.Click += new EventHandler(layoutControlGroupQuestion1_Click);
            this.layoutControlItemHeader.SizeConstraintsType = SizeConstraintsType.Default;
               #endregion
             //
            // layoutControl1
            //

            this.layoutControl1.Controls.Add(this.ctlFooter);
            this.layoutControl1.Controls.Add(this.simpleButtonCancel);
            this.layoutControl1.Controls.Add(this.simpleButtonSave);
            this.layoutControl1.Controls.Add(this.gridControlHistory);
            this.layoutControl1.Controls.Add(this.memoEdit1);
            this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.layoutControl1.Location = new System.Drawing.Point(0, 0);
            this.layoutControl1.Name = "layoutControl1";
            this.layoutControl1.Root = this.layoutControlGroupQuestion1;
            //this.layoutControl1.Size = new System.Drawing.Size(539, 216);
            this.layoutControl1.TabIndex = 2;
            this.layoutControl1.Text = "layoutControl1";
            //
            // simpleButtonCancel
            //
            this.simpleButtonCancel.Image = global::BrightVision.DQControl.Properties.Resources.cancel_16x16;
            this.simpleButtonCancel.Location = new System.Drawing.Point(498, 41);
            this.simpleButtonCancel.Margin = new System.Windows.Forms.Padding(1);
            this.simpleButtonCancel.Name = "simpleButtonCancel";
            this.simpleButtonCancel.MinimumSize = new System.Drawing.Size(22, 22);
            this.simpleButtonCancel.MaximumSize = new System.Drawing.Size(22, 22);
            this.simpleButtonCancel.ImageLocation = ImageLocation.MiddleCenter;
            this.simpleButtonCancel.StyleController = this.layoutControl1;
            this.simpleButtonCancel.TabIndex = 7;
            this.simpleButtonCancel.ToolTip = "Cancel";
            this.simpleButtonCancel.Click += new EventHandler(simpleButtonCancel_Click);
            //
            // simpleButtonSave
            //
            this.simpleButtonSave.Image = global::BrightVision.DQControl.Properties.Resources.save_16x16;
            this.simpleButtonSave.Location = new System.Drawing.Point(498, 7);
            this.simpleButtonSave.Margin = new System.Windows.Forms.Padding(1);
            this.simpleButtonSave.Name = "simpleButtonSave";
            this.simpleButtonSave.MinimumSize = new System.Drawing.Size(22, 22);
            this.simpleButtonSave.MaximumSize = new System.Drawing.Size(22, 22);
            this.simpleButtonSave.ImageLocation = ImageLocation.MiddleCenter;
            this.simpleButtonSave.StyleController = this.layoutControl1;

            this.simpleButtonSave.TabIndex = 6;
            this.simpleButtonSave.Click += new EventHandler(simpleButtonSave_Click);
            this.simpleButtonSave.ToolTip = "Save";
            //
            // gridControl1
            //
            this.gridControlHistory.Location = new System.Drawing.Point(7, 75);
            this.gridControlHistory.MainView = this.gridViewHistory;
            this.gridControlHistory.Name = "gridControlHistory";
            this.gridControlHistory.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
            this.repositoryItemButtonEdit1,
            this.repositoryItemMemoEdit1,
            this.repositoryItemMemoEdit2,
            this.repositoryItemButtonEdit2});
            this.gridControlHistory.MinimumSize = new System.Drawing.Size(0, 150);
            this.gridControlHistory.MaximumSize = new System.Drawing.Size(0, 150);
            this.gridControlHistory.Size = new Size(0, 150);

            this.gridControlHistory.TabIndex = 4;
            this.gridControlHistory.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
            this.gridViewHistory});

            //
            // gridView1
            //
            this.gridViewHistory.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
            this.gridColumnId,
            this.gridColumnComment,
            this.gridColumnCreationDate,
            this.gridColumnUser,
            this.gridColumnCustomerContact,
            this.gridColumnDelete});
            this.gridViewHistory.GridControl = this.gridControlHistory;
            this.gridViewHistory.Name = "gridViewHistory";
            this.gridViewHistory.OptionsSelection.EnableAppearanceFocusedCell = false;
            this.gridViewHistory.OptionsView.RowAutoHeight = true;
            this.gridViewHistory.OptionsView.ShowGroupPanel = false;
            this.gridViewHistory.OptionsBehavior.ReadOnly = true;

            //this.gridViewHistory.VertScrollVisibility = DevExpress.XtraGrid.Views.Base.ScrollVisibility.Always;
            this.gridViewHistory.CustomRowCellEdit += new DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventHandler(gridViewHistory_CustomRowCellEdit);
            //
            //gridcolumn id
            //
            this.gridColumnId.Caption = "Id";
            this.gridColumnId.FieldName = "id";
            this.gridColumnId.Name = "gridColumnId";
            this.gridColumnId.Visible = false;

            //
            // gridColumn1
            //
            this.gridColumnComment.Caption = "Comment";
            this.gridColumnComment.ColumnEdit = this.repositoryItemMemoEdit1;
            this.gridColumnComment.FieldName = "Comment";
            this.gridColumnComment.Name = "gridColumnComment";
            this.gridColumnComment.Visible = true;
            this.gridColumnComment.VisibleIndex = 0;
            this.gridColumnComment.Width = 200;
            this.gridColumnComment.MaxWidth = 0;
            this.gridColumnComment.MinWidth = 0;
            this.gridColumnComment.ColumnEdit.EditValueChanged += new EventHandler(ColumnEdit_EditValueChanged);
            //
            // repositoryItemMemoEdit1
            //
            this.repositoryItemMemoEdit1.Name = "repositoryItemMemoEdit1";
            this.repositoryItemMemoEdit1.ReadOnly = false;
            this.repositoryItemMemoEdit2.Name = "repositoryItemMemoEdit2";
            this.repositoryItemMemoEdit2.ReadOnly = true;
            //
            // gridColumn2
            //
            this.gridColumnCreationDate.Caption = "Date";
            this.gridColumnCreationDate.FieldName = "CreationDate";
            this.gridColumnCreationDate.Name = "gridColumnCreationDate";
            this.gridColumnCreationDate.Visible = true;
            this.gridColumnCreationDate.VisibleIndex = 1;
            this.gridColumnCreationDate.Width = 50;
            this.gridColumnCreationDate.MaxWidth = 0;
            this.gridColumnCreationDate.MinWidth = 0;
            this.gridColumnCreationDate.DisplayFormat.FormatType = FormatType.Custom;
            this.gridColumnCreationDate.DisplayFormat.Format = new DateCustomFormatter();
            this.gridColumnCreationDate.DisplayFormat.FormatString = "yyyy-MM-dd HH:mm";
            this.gridColumnCreationDate.OptionsColumn.ReadOnly = true;
            //
            // gridColumn3
            //
            this.gridColumnUser.Caption = "User";
            this.gridColumnUser.FieldName = "User";
            this.gridColumnUser.Name = "gridColumnUser";
            this.gridColumnUser.Visible = true;
            this.gridColumnUser.VisibleIndex = 2;
            this.gridColumnUser.Width = 70;
            this.gridColumnUser.MaxWidth = 0;
            this.gridColumnUser.MinWidth = 0;
            this.gridColumnUser.OptionsColumn.ReadOnly = true;
            //
            // gridColumn4
            //
            this.gridColumnCustomerContact.Caption = "Contact";
            this.gridColumnCustomerContact.FieldName = "CustomerContact";
            this.gridColumnCustomerContact.Name = "gridColumnCustomerContact";
            this.gridColumnCustomerContact.Visible = true;
            this.gridColumnCustomerContact.VisibleIndex = 3;
            this.gridColumnCustomerContact.Width = 70;
            this.gridColumnCustomerContact.MaxWidth = 0;
            this.gridColumnCustomerContact.MinWidth = 0;

            this.gridColumnCustomerContact.OptionsColumn.ReadOnly = true;
            //
            // gridColumn5
            //
            this.gridColumnDelete.Caption = "";
            this.gridColumnDelete.ColumnEdit = this.repositoryItemButtonEdit1;
            this.gridColumnDelete.FieldName = "";
            this.gridColumnDelete.MaxWidth = 30;
            this.gridColumnDelete.Name = "gridColumnDelete";
            this.gridColumnDelete.Visible = true;
            this.gridColumnDelete.VisibleIndex = 4;
            this.gridColumnDelete.Width = 30;

            this.gridColumnDelete.OptionsColumn.ReadOnly = true;
            //
            // repositoryItemButtonEdit1
            //
            Image img = ((System.Drawing.Image)(global::BrightVision.DQControl.Properties.Resources.cancel_16x16));
            var btn = new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "", -1, true, true, false, DevExpress.XtraEditors.ImageLocation.MiddleCenter, img, null, null, "Delete");

            this.repositoryItemButtonEdit1.Buttons.Add(btn);
            this.repositoryItemButtonEdit1.Name = "repositoryItemButtonEdit1";
            this.repositoryItemButtonEdit1.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.HideTextEditor;
            //this.repositoryItemButtonEdit1.ButtonClick += new DevExpress.XtraEditors.Controls.ButtonPressedEventHandler(repositoryItemButtonDelete_ButtonClick);
            this.repositoryItemButtonEdit1.Click += new EventHandler(repositoryItemButtonDelete_Click);
            //btn.Appearance.Image = img;

            this.repositoryItemButtonEdit2.Buttons.Add(btn);
            this.repositoryItemButtonEdit2.Name = "repositoryItemButtonEdit1";
            this.repositoryItemButtonEdit2.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.HideTextEditor;
            this.repositoryItemButtonEdit2.ReadOnly = true;
            //
            // memoEdit1
            //
            this.memoEdit1.Location = new System.Drawing.Point(7, 7);
            this.memoEdit1.Name = "memoEdit1";
            //this.memoEdit1.MinimumSize = new Size(100, 52);
            //this.memoEdit1.MaximumSize = new Size(0,0);
            this.memoEdit1.StyleController = this.layoutControl1;
            this.memoEdit1.TabIndex = 8;
            this.memoEdit1.Properties.ScrollBars = ScrollBars.None;
            this.memoEdit1.TextChanged += new EventHandler(memoEdit1_TextChanged);

            //
            // emptySpaceItem1
            //
            this.emptySpaceItem1.AllowHotTrack = false;
            this.emptySpaceItem1.CustomizationFormText = "emptySpaceItem1";
            this.emptySpaceItem1.Location = new System.Drawing.Point(383, 52);
            this.emptySpaceItem1.Name = "emptySpaceItem1";
            this.emptySpaceItem1.Size = new System.Drawing.Size(22, 212);
            this.emptySpaceItem1.Text = "emptySpaceItem1";
            this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
            //
            //gridControl
            //
            this.layoutControlItem1.Control = this.gridControlHistory;
            this.layoutControlItem1.CustomizationFormText = "layoutControlItem1";
            this.layoutControlItem1.Location = new System.Drawing.Point(0, 68);
            //this.layoutControlItem1.MinSize = new System.Drawing.Size(0, 100);
            //this.layoutControlItem1.MaxSize = new System.Drawing.Size(0, 200);
            this.Size = new Size(0, 150);
            this.layoutControlItem1.Name = "layoutControlItem1";
            this.layoutControlItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.SupportHorzAlignment;
            this.layoutControlItem1.ControlAlignment = ContentAlignment.BottomCenter;
            //this.layoutControlItem1.Size = new Size(0, 150);
            this.layoutControlItem1.Text = "layoutControlItem1";
            this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0);
            this.layoutControlItem1.TextToControlDistance = 0;
            this.layoutControlItem1.TextVisible = false;
             //
            // layoutControlItem3
            //
            this.layoutControlItem3.Control = this.simpleButtonSave;
            this.layoutControlItem3.CustomizationFormText = "layoutControlItem3";
            this.layoutControlItem3.Location = new System.Drawing.Point(491, 0);
            this.layoutControlItem3.MaxSize = new System.Drawing.Size(22, 22);
            this.layoutControlItem3.MinSize = new System.Drawing.Size(22, 22);
            this.layoutControlItem3.Padding = new DevExpress.XtraLayout.Utils.Padding(1);
            this.layoutControlItem3.Name = "layoutControlItem3";
            this.layoutControlItem3.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Default;
            this.layoutControlItem3.Text = "layoutControlItem3";
            this.layoutControlItem3.TextSize = new System.Drawing.Size(0, 0);
            this.layoutControlItem3.TextToControlDistance = 0;
            this.layoutControlItem3.TextVisible = false;
            //
            // layoutControlItem4
            //
            this.layoutControlItem4.Control = this.simpleButtonCancel;
            this.layoutControlItem4.CustomizationFormText = "layoutControlItem4";
            this.layoutControlItem4.Location = new System.Drawing.Point(491, 34);
            this.layoutControlItem4.MaxSize = new System.Drawing.Size(22, 102);
            this.layoutControlItem4.MinSize = new System.Drawing.Size(22, 22);
            this.layoutControlItem4.Size = new Size(22, 102);
            this.layoutControlItem4.Padding = new DevExpress.XtraLayout.Utils.Padding(1);

            this.layoutControlItem4.Name = "layoutControlItem4";
            this.layoutControlItem4.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Default;
            this.layoutControlItem4.Text = "layoutControlItem4";
            this.layoutControlItem4.TextSize = new System.Drawing.Size(0, 0);
            this.layoutControlItem4.TextToControlDistance = 0;
            this.layoutControlItem4.TextVisible = false;
            //
            // layoutControlItem2
            //
            this.layoutControlItem2.Control = this.memoEdit1;
            this.layoutControlItem2.CustomizationFormText = "layoutControlItem2";
            this.layoutControlItem2.Location = new System.Drawing.Point(0, 0);
            this.layoutControlItem2.Name = "layoutControlItem2";
            this.layoutControlItem2.Text = "layoutControlItem2";
            this.layoutControlItem2.TextSize = new System.Drawing.Size(0, 0);
            this.layoutControlItem1.MinSize = new Size(0, 24);
            this.layoutControlItem1.MaxSize = new Size(0, 24);
            this.layoutControlItem2.TextToControlDistance = 0;
            this.layoutControlItem2.TextVisible = false;
            this.layoutControlItem2.SizeConstraintsType = SizeConstraintsType.SupportHorzAlignment;
            //
            // testinglayout
            //
            this.layoutControlGroupQuestion1.AddItem(this.layoutControlItemHeader);
            this.layoutControlGroupQuestion1.AddItem(this.layoutControlItemPrefix);
            this.layoutControlGroupQuestion1.AddItem(this.layoutControlItem2);
            this.layoutControlGroupQuestion1.AddItem(this.layoutControlItem3, this.layoutControlItem2, DevExpress.XtraLayout.Utils.InsertType.Right);
            this.layoutControlGroupQuestion1.AddItem(this.layoutControlItem4, this.layoutControlItem3, DevExpress.XtraLayout.Utils.InsertType.Bottom);
            this.layoutControlGroupQuestion1.AddItem(this.layoutControlItem1);

            this.layoutControlGroupQuestion1.Click += new EventHandler(layoutControlGroupQuestion1_Click);

            this.layoutControlGroupQuestion1.EndUpdate();
        }
Example #26
0
 private void InitializeComponent()
 {
     this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
     this.btnCancel      = new DevExpress.XtraEditors.SimpleButton();
     this.propertyDescriptionControl1 = new DevExpress.XtraVerticalGrid.PropertyDescriptionControl();
     this.propertyGridControl1        = new DevExpress.XtraVerticalGrid.PropertyGridControl();
     this.txtDuration         = new DevExpress.XtraEditors.Repository.RepositoryItemSpinEdit();
     this.txtComment          = new DevExpress.XtraEditors.Repository.RepositoryItemMemoEdit();
     this.txtName             = new DevExpress.XtraEditors.Repository.RepositoryItemTextEdit();
     this.row                 = new DevExpress.XtraVerticalGrid.Rows.EditorRow();
     this.r_name              = new DevExpress.XtraVerticalGrid.Rows.EditorRow();
     this.r_comment           = new DevExpress.XtraVerticalGrid.Rows.EditorRow();
     this.r_duration          = new DevExpress.XtraVerticalGrid.Rows.EditorRow();
     this.row11               = new DevExpress.XtraVerticalGrid.Rows.EditorRow();
     this.r_x                 = new DevExpress.XtraVerticalGrid.Rows.EditorRow();
     this.r_y                 = new DevExpress.XtraVerticalGrid.Rows.EditorRow();
     this.r_z                 = new DevExpress.XtraVerticalGrid.Rows.EditorRow();
     this.r_heading           = new DevExpress.XtraVerticalGrid.Rows.EditorRow();
     this.r_tilt              = new DevExpress.XtraVerticalGrid.Rows.EditorRow();
     this.r_roll              = new DevExpress.XtraVerticalGrid.Rows.EditorRow();
     this.btnOK               = new DevExpress.XtraEditors.SimpleButton();
     this.layoutControlGroup1 = new DevExpress.XtraLayout.LayoutControlGroup();
     this.layoutControlItem3  = new DevExpress.XtraLayout.LayoutControlItem();
     this.layoutControlItem1  = new DevExpress.XtraLayout.LayoutControlItem();
     this.layoutControlItem2  = new DevExpress.XtraLayout.LayoutControlItem();
     this.emptySpaceItem1     = new DevExpress.XtraLayout.EmptySpaceItem();
     this.layoutControlItem4  = new DevExpress.XtraLayout.LayoutControlItem();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
     this.layoutControl1.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.propertyGridControl1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.txtDuration)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.txtComment)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.txtName)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).BeginInit();
     this.SuspendLayout();
     //
     // layoutControl1
     //
     this.layoutControl1.Controls.Add(this.btnCancel);
     this.layoutControl1.Controls.Add(this.propertyDescriptionControl1);
     this.layoutControl1.Controls.Add(this.propertyGridControl1);
     this.layoutControl1.Controls.Add(this.btnOK);
     this.layoutControl1.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.layoutControl1.Location = new System.Drawing.Point(0, 0);
     this.layoutControl1.Name     = "layoutControl1";
     this.layoutControl1.OptionsCustomizationForm.DesignTimeCustomizationFormPositionAndSize = new System.Drawing.Rectangle(601, 110, 250, 350);
     this.layoutControl1.Root     = this.layoutControlGroup1;
     this.layoutControl1.Size     = new System.Drawing.Size(312, 374);
     this.layoutControl1.TabIndex = 0;
     this.layoutControl1.Text     = "layoutControl1";
     //
     // btnCancel
     //
     this.btnCancel.DialogResult    = System.Windows.Forms.DialogResult.Cancel;
     this.btnCancel.Location        = new System.Drawing.Point(161, 350);
     this.btnCancel.Name            = "btnCancel";
     this.btnCancel.Size            = new System.Drawing.Size(149, 22);
     this.btnCancel.StyleController = this.layoutControl1;
     this.btnCancel.TabIndex        = 3;
     this.btnCancel.Text            = "取消";
     this.btnCancel.Click          += new System.EventHandler(this.btnCancel_Click);
     //
     // propertyDescriptionControl1
     //
     this.propertyDescriptionControl1.Location     = new System.Drawing.Point(2, 282);
     this.propertyDescriptionControl1.Name         = "propertyDescriptionControl1";
     this.propertyDescriptionControl1.PropertyGrid = this.propertyGridControl1;
     this.propertyDescriptionControl1.Size         = new System.Drawing.Size(308, 64);
     this.propertyDescriptionControl1.TabIndex     = 1;
     this.propertyDescriptionControl1.TabStop      = false;
     //
     // propertyGridControl1
     //
     this.propertyGridControl1.Location = new System.Drawing.Point(2, 2);
     this.propertyGridControl1.Name     = "propertyGridControl1";
     this.propertyGridControl1.OptionsBehavior.ResizeHeaderPanel           = false;
     this.propertyGridControl1.OptionsBehavior.ResizeRowHeaders            = false;
     this.propertyGridControl1.OptionsBehavior.ResizeRowValues             = false;
     this.propertyGridControl1.OptionsBehavior.UseDefaultEditorsCollection = false;
     this.propertyGridControl1.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
         this.txtDuration,
         this.txtComment,
         this.txtName
     });
     this.propertyGridControl1.Rows.AddRange(new DevExpress.XtraVerticalGrid.Rows.BaseRow[] {
         this.row,
         this.row11
     });
     this.propertyGridControl1.ShowButtonMode = DevExpress.XtraVerticalGrid.ShowButtonModeEnum.ShowAlways;
     this.propertyGridControl1.Size           = new System.Drawing.Size(308, 265);
     this.propertyGridControl1.TabIndex       = 0;
     //
     // txtDuration
     //
     this.txtDuration.AutoHeight = false;
     this.txtDuration.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
         new DevExpress.XtraEditors.Controls.EditorButton()
     });
     this.txtDuration.MaxValue = new decimal(new int[] {
         65535,
         0,
         0,
         0
     });
     this.txtDuration.MinValue = new decimal(new int[] {
         1,
         0,
         0,
         0
     });
     this.txtDuration.Name = "txtDuration";
     //
     // txtComment
     //
     this.txtComment.MaxLength = 256;
     this.txtComment.Name      = "txtComment";
     //
     // txtName
     //
     this.txtName.AutoHeight = false;
     this.txtName.MaxLength  = 100;
     this.txtName.Name       = "txtName";
     //
     // row
     //
     this.row.ChildRows.AddRange(new DevExpress.XtraVerticalGrid.Rows.BaseRow[] {
         this.r_name,
         this.r_comment,
         this.r_duration
     });
     this.row.Name = "row";
     this.row.Properties.Caption   = "编辑";
     this.row.Properties.FieldName = "Property1";
     this.row.Properties.ReadOnly  = true;
     //
     // r_name
     //
     this.r_name.Name = "r_name";
     this.r_name.Properties.Caption   = "名称";
     this.r_name.Properties.FieldName = "Name";
     this.r_name.Properties.RowEdit   = this.txtName;
     //
     // r_comment
     //
     this.r_comment.Height               = 70;
     this.r_comment.Name                 = "r_comment";
     this.r_comment.Properties.Caption   = "说明";
     this.r_comment.Properties.FieldName = "Comment";
     this.r_comment.Properties.RowEdit   = this.txtComment;
     //
     // r_duration
     //
     this.r_duration.Name = "r_duration";
     this.r_duration.Properties.Caption   = "播放间隔(秒)";
     this.r_duration.Properties.FieldName = "Duration";
     this.r_duration.Properties.RowEdit   = this.txtDuration;
     //
     // row11
     //
     this.row11.ChildRows.AddRange(new DevExpress.XtraVerticalGrid.Rows.BaseRow[] {
         this.r_x,
         this.r_y,
         this.r_z,
         this.r_heading,
         this.r_tilt,
         this.r_roll
     });
     this.row11.Name = "row11";
     this.row11.Properties.Caption   = "相机位置";
     this.row11.Properties.FieldName = "Property2";
     this.row11.Properties.ReadOnly  = true;
     //
     // r_x
     //
     this.r_x.Name = "r_x";
     this.r_x.Properties.Caption   = "X";
     this.r_x.Properties.FieldName = "X";
     this.r_x.Properties.ReadOnly  = true;
     //
     // r_y
     //
     this.r_y.Name = "r_y";
     this.r_y.Properties.Caption   = "Y";
     this.r_y.Properties.FieldName = "Y";
     this.r_y.Properties.ReadOnly  = true;
     //
     // r_z
     //
     this.r_z.Name = "r_z";
     this.r_z.Properties.Caption   = "Z";
     this.r_z.Properties.FieldName = "Z";
     this.r_z.Properties.ReadOnly  = true;
     //
     // r_heading
     //
     this.r_heading.Name = "r_heading";
     this.r_heading.Properties.Caption   = "Heading";
     this.r_heading.Properties.FieldName = "Heading";
     this.r_heading.Properties.ReadOnly  = true;
     //
     // r_tilt
     //
     this.r_tilt.Name = "r_tilt";
     this.r_tilt.Properties.Caption   = "Tilt";
     this.r_tilt.Properties.FieldName = "Tilt";
     this.r_tilt.Properties.ReadOnly  = true;
     //
     // r_roll
     //
     this.r_roll.Name = "r_roll";
     this.r_roll.Properties.Caption   = "Roll";
     this.r_roll.Properties.FieldName = "Roll";
     this.r_roll.Properties.ReadOnly  = true;
     //
     // btnOK
     //
     this.btnOK.DialogResult    = System.Windows.Forms.DialogResult.OK;
     this.btnOK.Location        = new System.Drawing.Point(2, 350);
     this.btnOK.Name            = "btnOK";
     this.btnOK.Size            = new System.Drawing.Size(155, 22);
     this.btnOK.StyleController = this.layoutControl1;
     this.btnOK.TabIndex        = 2;
     this.btnOK.Text            = "确定";
     this.btnOK.Click          += new System.EventHandler(this.btnOK_Click);
     //
     // layoutControlGroup1
     //
     this.layoutControlGroup1.CustomizationFormText       = "layoutControlGroup1";
     this.layoutControlGroup1.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
     this.layoutControlGroup1.GroupBordersVisible         = false;
     this.layoutControlGroup1.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
         this.layoutControlItem3,
         this.layoutControlItem1,
         this.layoutControlItem2,
         this.emptySpaceItem1,
         this.layoutControlItem4
     });
     this.layoutControlGroup1.Location    = new System.Drawing.Point(0, 0);
     this.layoutControlGroup1.Name        = "layoutControlGroup1";
     this.layoutControlGroup1.Padding     = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
     this.layoutControlGroup1.Size        = new System.Drawing.Size(312, 374);
     this.layoutControlGroup1.Text        = "layoutControlGroup1";
     this.layoutControlGroup1.TextVisible = false;
     //
     // layoutControlItem3
     //
     this.layoutControlItem3.Control = this.btnOK;
     this.layoutControlItem3.CustomizationFormText = "layoutControlItem3";
     this.layoutControlItem3.Location = new System.Drawing.Point(0, 348);
     this.layoutControlItem3.Name     = "layoutControlItem3";
     this.layoutControlItem3.Size     = new System.Drawing.Size(159, 26);
     this.layoutControlItem3.Text     = "layoutControlItem3";
     this.layoutControlItem3.TextSize = new System.Drawing.Size(0, 0);
     this.layoutControlItem3.TextToControlDistance = 0;
     this.layoutControlItem3.TextVisible           = false;
     //
     // layoutControlItem1
     //
     this.layoutControlItem1.Control = this.propertyGridControl1;
     this.layoutControlItem1.CustomizationFormText = "layoutControlItem1";
     this.layoutControlItem1.Location = new System.Drawing.Point(0, 0);
     this.layoutControlItem1.Name     = "layoutControlItem1";
     this.layoutControlItem1.Size     = new System.Drawing.Size(312, 269);
     this.layoutControlItem1.Text     = "layoutControlItem1";
     this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0);
     this.layoutControlItem1.TextToControlDistance = 0;
     this.layoutControlItem1.TextVisible           = false;
     //
     // layoutControlItem2
     //
     this.layoutControlItem2.Control = this.propertyDescriptionControl1;
     this.layoutControlItem2.CustomizationFormText = "layoutControlItem2";
     this.layoutControlItem2.Location = new System.Drawing.Point(0, 280);
     this.layoutControlItem2.Name     = "layoutControlItem2";
     this.layoutControlItem2.Size     = new System.Drawing.Size(312, 68);
     this.layoutControlItem2.Text     = "layoutControlItem2";
     this.layoutControlItem2.TextSize = new System.Drawing.Size(0, 0);
     this.layoutControlItem2.TextToControlDistance = 0;
     this.layoutControlItem2.TextVisible           = false;
     //
     // emptySpaceItem1
     //
     this.emptySpaceItem1.AllowHotTrack         = false;
     this.emptySpaceItem1.CustomizationFormText = "emptySpaceItem1";
     this.emptySpaceItem1.Location = new System.Drawing.Point(0, 269);
     this.emptySpaceItem1.Name     = "emptySpaceItem1";
     this.emptySpaceItem1.Size     = new System.Drawing.Size(312, 11);
     this.emptySpaceItem1.Text     = "emptySpaceItem1";
     this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
     //
     // layoutControlItem4
     //
     this.layoutControlItem4.Control = this.btnCancel;
     this.layoutControlItem4.CustomizationFormText = "layoutControlItem4";
     this.layoutControlItem4.Location = new System.Drawing.Point(159, 348);
     this.layoutControlItem4.Name     = "layoutControlItem4";
     this.layoutControlItem4.Size     = new System.Drawing.Size(153, 26);
     this.layoutControlItem4.Text     = "layoutControlItem4";
     this.layoutControlItem4.TextSize = new System.Drawing.Size(0, 0);
     this.layoutControlItem4.TextToControlDistance = 0;
     this.layoutControlItem4.TextVisible           = false;
     //
     // FormEditLocation
     //
     this.AcceptButton        = this.btnOK;
     this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     this.CancelButton        = this.btnCancel;
     this.ClientSize          = new System.Drawing.Size(312, 374);
     this.Controls.Add(this.layoutControl1);
     this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
     this.MaximizeBox     = false;
     this.Name            = "FormEditLocation";
     this.SizeGripStyle   = System.Windows.Forms.SizeGripStyle.Hide;
     this.StartPosition   = System.Windows.Forms.FormStartPosition.CenterParent;
     this.Text            = "特定场景属性";
     ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit();
     this.layoutControl1.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.propertyGridControl1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.txtDuration)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.txtComment)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.txtName)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).EndInit();
     this.ResumeLayout(false);
 }
        public void AddResultItem(string text, UserControl details)
        {
            Form formMain = ClientEnvironment.MainForm;

            if(formMain.InvokeRequired)
            {
                formMain.BeginInvoke(new AddDetailedResultDelegate(AddResultItem), text, details);
                return;
            }

            if (text == null)
            {
                throw new ArgumentNullException("text");
            }

            if (details == null)
            {
                throw new ArgumentNullException("details");
            }

            layoutControlWarnings.BeginUpdate();

            LayoutControlItem item = new LayoutControlItem();
            item.Control = details;
            item.TextVisible = false;
            item.Size = details.Size;
            item.SizeConstraintsType = SizeConstraintsType.Custom;
            item.MaxSize = new Size(layoutControlWarnings.Width, details.Height);
            item.MinSize = new Size(layoutControlWarnings.Width - 32, details.Height);

            LayoutGroup group = new LayoutControlGroup();
            group.TextVisible = true;
            group.Text = text;
            group.AppearanceGroup.Options.UseTextOptions = true;
            group.AppearanceGroup.TextOptions.WordWrap = WordWrap.Wrap;
            group.ExpandButtonVisible = true;
            group.ExpandButtonLocation = GroupElementLocation.AfterText;
            group.Expanded = false;

            //			group.GroupBordersVisible = false;
            group.CaptionImageIndex = 0;

            layoutControlGroupRoot.AddItem(group);
            group.AddItem(item);

            layoutControlWarnings.EndUpdate();
        }
Example #28
0
        public void BindControls()
        {
            if (Questionnaire == null)
                MessageBox.Show("Questionnaire must be bind with JSON first.", "Textbox Component");

            m_DynamicControls = new List<DynamicControl>();

            #region Layout Control Group Initialize
            isLoaded = false;
            this.layoutControlGroupQuestion1.Clear();
            Settings oSettings = Questionnaire.Form.Settings;

            // layoutControlGroupQuestion1
            this.layoutControlGroupQuestion1.Name = "layoutControlGroupQuestion" + Guid.NewGuid().ToString();
            this.layoutControlGroupQuestion1.AppearanceGroup.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
            this.layoutControlGroupQuestion1.AppearanceGroup.GradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
            this.layoutControlGroupQuestion1.AppearanceGroup.Options.UseFont = true;
            this.layoutControlGroupQuestion1.ExpandButtonVisible = false;
            this.layoutControlGroupQuestion1.GroupBordersVisible = true;
            this.layoutControlGroupQuestion1.TextVisible = false;
            this.layoutControlGroupQuestion1.Padding = new DevExpress.XtraLayout.Utils.Padding(1, 1, 1, 1);
            this.layoutControlGroupQuestion1.ShowInCustomizationForm = false;
            //this.layoutControlGroupQuestion1.Text = oSettings.Label + " " + oSettings.QuestionText;
            this.layoutControlGroupQuestion1.BeginUpdate();

            #endregion

            #region Footer
            this.layoutControlItem1 = new LayoutControlItem();
            this.layoutControlItem1.Name = "layoutControlItem" + Guid.NewGuid().ToString();

            //bool isCustomerOwnershipOnly = false;
            //if (oSettings.CustomerOwnership && oSettings.BVOwnership)
            //    isCustomerOwnershipOnly = true;

            //ctlFooter = new Footer() {
            //   IsAccountLevel = oSettings.DataBindings.account_level,
            //   IsCustomerOwnershipOnly = isCustomerOwnershipOnly,
            //   HelpText = oSettings.QuestionHelp,
            //   LanguageCode = oSettings.DataBindings.language_code
            //};

            ctlFooter = new Footer() {
                IsAccountLevel = oSettings.DataBindings.account_level,
                IsCustomerOwned = oSettings.CustomerOwnership,
                IsBrightvisionOwned = oSettings.BVOwnership,
                HelpText = oSettings.QuestionHelp,
                LanguageCode = oSettings.DataBindings.language_code,
                QuestionText = oSettings.Label + " " + oSettings.QuestionText
            };

            ctlFooter.InitializeFooter();
            ctlFooter.Dock = DockStyle.Fill;
            ctlFooter.Height = 20;

            this.layoutControlItem1.Control = ctlFooter;
            this.layoutControlItem1.ShowInCustomizationForm = false;
            this.layoutControlItem1.TextVisible = false;
            this.layoutControlItem1.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
            this.layoutControlItem1.MinSize = new Size(0, 24);
            this.layoutControlItem1.MaxSize = new Size(0, 24);
            this.layoutControlItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click);
            this.layoutControlItem1.SizeConstraintsType = SizeConstraintsType.Custom;
            this.layoutControlGroupQuestion1.AddItem(this.layoutControlItem1);
            #endregion

            #region Answer Option Binding
            IList<AnswerOption> answeroptionList = Questionnaire.Form.Settings.AnswerOptions;
            ITextbox answeroption = null;
            int iAnswerOptions = answeroptionList.Count;
            //System.Drawing.Size newSize;
            for (int x = 0; x < iAnswerOptions; ++x) {
                answeroption = answeroptionList[x] as ITextbox;
                // layoutControlItem1
                this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
                //add textEdit1 to layout
                this.memoEdit1 = new MemoEdit();
                this.memoEdit1.Tag = new TextboxData() {
                    PositionIndex = "IndexPosition" + x,
                    ControlContainer = layoutControlItem1,
                    Required = answeroption.Required,
                    HasValue = !string.IsNullOrWhiteSpace(answeroption.DefaultInputValue) ? true : false,
                    AnswerOption = answeroption
                };
                this.memoEdit1.Name = "textEdit" + Guid.NewGuid().ToString();
                this.memoEdit1.Properties.ScrollBars = ScrollBars.None;
                this.memoEdit1.StyleController = this.StyleController;
                //set value

                string _DefaultValue = string.Empty;
                if (answeroption.DefaultInputValue != null) {
                    _DefaultValue = answeroption.DefaultInputValue.Trim();
                    this.memoEdit1.Text = answeroption.DefaultInputValue.Trim();
                    answeroption.InputValue = answeroption.DefaultInputValue.Trim();
                }

                m_DynamicControls.Add(new DynamicControl() {
                    DefaultValue = _DefaultValue
                });

                memoEdit1.TextChanged += new EventHandler(textEdit1_TextChanged);
                memoEdit1.Resize += new EventHandler(memoEdit1_Resize);
                memoEdit1.Click += new EventHandler(layoutControlGroupQuestion1_Click);

                this.layoutControlItem1.Name = "layoutControlItem" + Guid.NewGuid().ToString();
                this.layoutControlItem1.Control = this.memoEdit1;
                //int width = 1000, height = 1000;
                //if (!string.IsNullOrEmpty(answeroption.TextboxMaxWidth)) {
                //    int.TryParse(answeroption.TextboxMaxWidth, out width);
                //}
                //if (!string.IsNullOrEmpty(answeroption.TextboxMaxHeight)) {
                //    int.TryParse(answeroption.TextboxMaxHeight, out height);
                //}
                if (!string.IsNullOrEmpty(answeroption.TextPrefix)) {
                    this.layoutControlItem1.Text = answeroption.TextPrefix;
                    this.layoutControlItem1.TextVisible = true;
                    this.layoutControlItem1.TextLocation = DevExpress.Utils.Locations.Top;
                    this.layoutControlItem1.MinSize = new Size(0, 41);
                    this.layoutControlItem1.MaxSize = new Size(0, 41);
                } else {
                    this.layoutControlItem1.TextVisible = false;
                    this.layoutControlItem1.MinSize = new Size(0, 24);
                    this.layoutControlItem1.MaxSize = new Size(0, 24);
                }
                //newSize = new System.Drawing.Size(width, height);
                this.layoutControlItem1.SizeConstraintsType = SizeConstraintsType.Custom;
                this.layoutControlItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click);
                this.layoutControlGroupQuestion1.AddItem(this.layoutControlItem1);
            }
            //string prioText = oSettings.Priority;
            //if (oSettings.CustomerOwnership && oSettings.BVOwnership) {
            //    prioText += "(Cust+BV)";
            //} else if (oSettings.CustomerOwnership) {
            //    prioText += "(Cust)";
            //} else if (oSettings.BVOwnership) {
            //    prioText += "(BV)";
            //}
            //if (oSettings.PlotDoneStatus.Trim().ToLower() == "done") {
            //    prioText += " Done";
            //}

            //// simpleLabelItem1 status
            //this.emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem();
            //this.emptySpaceItem1.Name = "simpleLabelItem" + Guid.NewGuid().ToString();
            //this.emptySpaceItem1.AppearanceItemCaption.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
            //this.emptySpaceItem1.AppearanceItemCaption.Options.UseTextOptions = true;
            //this.emptySpaceItem1.ShowInCustomizationForm = false;
            //this.emptySpaceItem1.Text = prioText;
            //this.emptySpaceItem1.TextVisible = true;
            //this.emptySpaceItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click);
            //this.emptySpaceItem1.SizeConstraintsType = SizeConstraintsType.Custom;
            //this.layoutControlGroupQuestion1.AddItem(this.emptySpaceItem1);

            //if (!string.IsNullOrEmpty(oSettings.QuestionHelp)) {
            //    this.emptySpaceItem2 = new DevExpress.XtraLayout.EmptySpaceItem();
            //    this.emptySpaceItem2.Name = "simpleLabelItem" + Guid.NewGuid().ToString();
            //    this.emptySpaceItem2.AppearanceItemCaption.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
            //    this.emptySpaceItem2.AppearanceItemCaption.Options.UseTextOptions = true;
            //    this.emptySpaceItem2.ShowInCustomizationForm = false;
            //    this.emptySpaceItem2.Text = "Help";
            //    this.emptySpaceItem2.OptionsToolTip.ToolTip = oSettings.QuestionHelp.Trim();

            //    //apply tooltip controller from parent
            //    //if (this.ToolTipController != null && this.ToolTipController.DefaultController != null) {
            //    //    this.emptySpaceItem2.OptionsToolTip.ToolTipController = ToolTipController.DefaultController;
            //    //}

            //    this.emptySpaceItem2.TextVisible = true;
            //    this.emptySpaceItem2.Size = new Size(50, 20);
            //    this.emptySpaceItem2.MaxSize = new Size(50, 20);
            //    this.emptySpaceItem2.MinSize = new Size(50, 20);
            //    this.emptySpaceItem2.SizeConstraintsType = SizeConstraintsType.Custom;
            //    this.emptySpaceItem2.Click += new EventHandler(layoutControlGroupQuestion1_Click);
            //    this.emptySpaceItem2.AppearanceItemCaption.TextOptions.HAlignment = HorzAlignment.Far;
            //    this.layoutControlGroupQuestion1.AddItem(this.emptySpaceItem2, this.emptySpaceItem1, DevExpress.XtraLayout.Utils.InsertType.Right);
            //}
            #endregion

            this.layoutControlGroupQuestion1.Click += new EventHandler(layoutControlGroupQuestion1_Click);
            this.layoutControlGroupQuestion1.EndUpdate();

            Image bg = BGImage(this);
            if (bg != null) {
                this.layoutControlGroupQuestion1.BackgroundImage = bg;
                this.layoutControlGroupQuestion1.BackgroundImageVisible = true;
            }
            if (this.memoEdit1 != null)
                BackColor = this.memoEdit1.BackColor;

            this.ControlGroup = this.layoutControlGroupQuestion1;
            this.ControlGroup.Tag = this;
            isLoaded = true;
        }
 private void updateToolTip(LayoutControlItem layoutControlItem, UxParameterDTOEdit parameterDTOEdit, string toolTip)
 {
     layoutControlItem.OptionsToolTip.ToolTip = toolTip;
     parameterDTOEdit.ToolTip = toolTip;
 }
Example #30
0
        private void AddButton([NotNull] Annotation annotation)
        {
            Image  image;
            string tooltip;
            int    index;

            if (annotation is TopicToBeClarified topicToBeClarified)
            {
                index = _right.RootGroup.Items.OfType <LayoutControlItem>().Count(x => x.Control is Button);
                image = topicToBeClarified.Answered
                    ? Properties.Resources.speech_balloon_answer_big
                    : Properties.Resources.speech_balloon_question_big;
                tooltip = $"<b>{(topicToBeClarified.Answered ? "Question Answered" : "Needs Clarification")}</b><br/>{topicToBeClarified.Text?.Replace("\n", "<br/>")}";
            }
            else if (annotation is Highlight highlight)
            {
                index   = _right.RootGroup.Items.OfType <LayoutControlItem>().Count(x => x.Control is Button);
                image   = Properties.Resources.marker_big;
                tooltip = $"<b>Highlight</b><br/>{highlight.Text?.Replace("\n", "<br/>")}";
            }
            else if (annotation is ReviewNote reviewNote)
            {
                index   = -1;
                image   = null;
                tooltip = null;
            }
            else
            {
                index   = 0;
                image   = Properties.Resources.note_text_big;
                tooltip = null;
            }

            if (index >= 0)
            {
                var button = new Button()
                {
                    Image = new Bitmap(image, (int)(32 * Dpi.Factor.Width),
                                       (int)(32 * Dpi.Factor.Height)),
                    Enabled        = true,
                    FlatStyle      = FlatStyle.Flat,
                    FlatAppearance = { BorderSize = 0 },
                    Tag            = annotation
                };
                button.Click += AnnotationButtonClick;
                var item = new LayoutControlItem()
                {
                    Text        = string.Empty,
                    TextVisible = false,
                    Control     = button,
                    Height      = (int)(54 * Dpi.Factor.Height),
                    HeightType  = eLayoutSizeType.Absolute,
                    Width       = (int)(54 * Dpi.Factor.Width),
                    WidthType   = eLayoutSizeType.Absolute
                };
                if (tooltip != null)
                {
                    _superTooltip.SetSuperTooltip(button, new SuperTooltipInfo()
                    {
                        HeaderVisible = false,
                        BodyText      = tooltip,
                        FooterVisible = false
                    });
                }

                _right.Controls.Add(button);
                _right.RootGroup.Items.Insert(index, item);
            }
        }
Example #31
0
        public ArticulosUserControl()
        {
            InitializeComponent();
            this.Dock             = DockStyle.Fill;
            this.HandleDestroyed += handleDestroyed;
            if (File.Exists("Layouts\\Articulos\\gridViewArticulos.xml"))
            {
                gridViewArticulos.RestoreLayoutFromXml("Layouts\\Articulos\\gridViewArticulos.xml");
            }
            if (File.Exists("Layouts\\Articulos\\layout.xml"))
            {
                layoutControl1.RestoreLayoutFromXml("Layouts\\Articulos\\layout.xml");
            }
            RegistryKey reg = Registry.CurrentUser.OpenSubKey("\\SOFTWARE\\Rajotero\\Articulos", true);

            if (reg == null)
            {
                reg = Registry.CurrentUser.CreateSubKey("SOFTWARE\\Rajotero\\Articulos");
            }
            if (reg != null)
            {
                radioGroupRajotero.SelectedIndex   = (int)reg.GetValue("Rajotero", 0);
                radioGroupEscandallo.SelectedIndex = (int)reg.GetValue("Escandallo", 0);
                radioGroupActivos.SelectedIndex    = (int)reg.GetValue("Activo", 0);
                textEditPalabras.Text = (string)reg.GetValue("Palabras", "");
                textEditDelEnvio.Text = (string)reg.GetValue("Envio", "");
            }
            if (File.Exists("Layouts\\Articulos\\gridViewCompras.xml"))
            {
                gridViewCompras.RestoreLayoutFromXml("Layouts\\Articulos\\gridViewCompras.xml");
            }



            MyEntityModel.ApplicationDbContextSql dbContext = new MyEntityModel.ApplicationDbContextSql();
            dbContext.TipoArticulos.Load();
            repositoryItemLookUpEditTipoArticulo1.DataSource    = dbContext.TipoArticulos.Local.ToBindingList();
            repositoryItemLookUpEditTipoArticulo1.DisplayMember = "Nombre";
            repositoryItemLookUpEditTipoArticulo1.ValueMember   = "TipoArticuloID";

            FechaActualizacionTotalesArticulo();


            GridColumn colStock = new GridColumn();

            colStock.FieldName   = "Stock";
            colStock.Caption     = "Stock";
            colStock.UnboundType = DevExpress.Data.UnboundColumnType.Decimal;
            gridViewArticulos.Columns.Add(colStock);
            colStock.VisibleIndex = 0;

            colUnidadesRecibidas.FieldName   = "UnidadesRecibidas";
            colUnidadesRecibidas.Caption     = "UnidadesRecibidas";
            colUnidadesRecibidas.UnboundType = DevExpress.Data.UnboundColumnType.Decimal;
            gridViewArticulos.Columns.Add(colUnidadesRecibidas);
            colUnidadesRecibidas.VisibleIndex = 0;
            LoadSource();
            // Prevent the focused cell from being highlighted.
            gridViewArticulos.OptionsSelection.EnableAppearanceFocusedCell = false;
            // Draw a dotted focus rectangle around the entire row.
            gridViewArticulos.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus;

            CredencialesEbay credenciales = new CredencialesEbay();

            foreach (string cuenta in credenciales.Cuentas)
            {
                LayoutControlItem item1 = layoutControlCuentas.Root.AddItem();
                item1.Name = "Ebay " + cuenta;
                item1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
                item1.MaxSize             = new Size(205, 30);
                ComboBoxEdit comboBoxEdit1 = new DevExpress.XtraEditors.ComboBoxEdit();
                comboBoxEdit1.Name = "Ebay " + cuenta;
                comboBoxEdit1.Properties.Items.AddRange(new object[] {
                    "Todos",
                    "Publicados",
                    "Sin publicar"
                });
                comboBoxEdit1.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;
                comboBoxEdit1.Properties.PopupFormSize = new Size(50, comboBoxEdit1.Properties.PopupFormSize.Height);
                comboBoxEdit1.Size          = new Size(50, comboBoxEdit1.Properties.PopupFormSize.Height);
                comboBoxEdit1.SelectedIndex = (int)reg.GetValue(comboBoxEdit1.Name, 0);
                item1.Control = comboBoxEdit1;
            }
            foreach (string cuenta in Global.CuentasAmazon)
            {
                LayoutControlItem item1 = layoutControlCuentas.Root.AddItem();
                item1.Name = "Amazon " + cuenta;
                item1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
                item1.MaxSize             = new Size(205, 30);
                ComboBoxEdit comboBoxEdit1 = new DevExpress.XtraEditors.ComboBoxEdit();
                comboBoxEdit1.Name = "Amazon " + cuenta;
                comboBoxEdit1.Properties.Items.AddRange(new object[] {
                    "Todos",
                    "Publicados",
                    "Sin publicar"
                });
                comboBoxEdit1.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;
                comboBoxEdit1.Properties.PopupFormSize = new Size(50, comboBoxEdit1.Properties.PopupFormSize.Height);
                comboBoxEdit1.Size          = new Size(50, comboBoxEdit1.Properties.PopupFormSize.Height);
                comboBoxEdit1.SelectedIndex = (int)reg.GetValue(comboBoxEdit1.Name, 0);
                item1.Control = comboBoxEdit1;
            }
        }
Example #32
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;
        }
Example #33
0
        public void AddEvent()
        {
            LayoutControl lcMain = _data.FrmMain.Controls.Find("lcMain", true)[0] as LayoutControl;

            peHinh1 = _data.FrmMain.Controls.Find("Hinh1", true)[0] as PictureEdit;
            gluMau1 = _data.FrmMain.Controls.Find("Mau1", true)[0] as GridLookUpEdit;
            peHinh2 = _data.FrmMain.Controls.Find("Hinh2", true)[0] as PictureEdit;
            gluMau2 = _data.FrmMain.Controls.Find("Mau2", true)[0] as GridLookUpEdit;
            peHinh3 = _data.FrmMain.Controls.Find("Hinh3", true)[0] as PictureEdit;
            gluMau3 = _data.FrmMain.Controls.Find("Mau3", true)[0] as GridLookUpEdit;
            peHinh4 = _data.FrmMain.Controls.Find("Hinh4", true)[0] as PictureEdit;
            gluMau4 = _data.FrmMain.Controls.Find("Mau4", true)[0] as GridLookUpEdit;
            peHinh5 = _data.FrmMain.Controls.Find("Hinh5", true)[0] as PictureEdit;
            gluMau5 = _data.FrmMain.Controls.Find("Mau5", true)[0] as GridLookUpEdit;
            peHinh6 = _data.FrmMain.Controls.Find("Hinh6", true)[0] as PictureEdit;
            gluMau6 = _data.FrmMain.Controls.Find("Mau6", true)[0] as GridLookUpEdit;
            gluMaKH = _data.FrmMain.Controls.Find("MaKH", true)[0] as GridLookUpEdit;
            peHinh1.Properties.NullText = peHinh2.Properties.NullText = peHinh3.Properties.NullText
                                                                            = peHinh4.Properties.NullText = peHinh5.Properties.NullText = peHinh6.Properties.NullText = " ";
            peHinh1.Properties.ShowMenu = peHinh2.Properties.ShowMenu = peHinh3.Properties.ShowMenu
                                                                            = peHinh4.Properties.ShowMenu = peHinh5.Properties.ShowMenu = peHinh6.Properties.ShowMenu = false;

            gluMaKH.CloseUp += new DevExpress.XtraEditors.Controls.CloseUpEventHandler(gluMaKH_CloseUp);
            gluMau1.CloseUp += new DevExpress.XtraEditors.Controls.CloseUpEventHandler(gluMau1_CloseUp);
            gluMau2.CloseUp += new DevExpress.XtraEditors.Controls.CloseUpEventHandler(gluMau2_CloseUp);
            gluMau3.CloseUp += new DevExpress.XtraEditors.Controls.CloseUpEventHandler(gluMau3_CloseUp);
            gluMau4.CloseUp += new DevExpress.XtraEditors.Controls.CloseUpEventHandler(gluMau4_CloseUp);
            gluMau5.CloseUp += new DevExpress.XtraEditors.Controls.CloseUpEventHandler(gluMau5_CloseUp);
            gluMau6.CloseUp += new DevExpress.XtraEditors.Controls.CloseUpEventHandler(gluMau6_CloseUp);

            //thêm nút Nạp file hình
            SimpleButton btnNapFile = new SimpleButton();

            btnNapFile.Name = "btnNapFile";
            btnNapFile.Text = "Nạp hình ảnh";
            LayoutControlItem lci1 = lcMain.AddItem("", btnNapFile);

            lci1.Name         = "cusNapFile";
            btnNapFile.Click += new EventHandler(btnNapFile_Click);

            //thêm nút Xem file hình
            btnXemFile      = new SimpleButton();
            btnXemFile.Name = "btnXemFile";
            btnXemFile.Text = "Xem hình ảnh";
            LayoutControlItem lci2 = lcMain.AddItem("", btnXemFile);

            lci2.Name         = "cusXemFile";
            btnXemFile.Click += new EventHandler(btnXemFile_Click);

            //custom control cho hình ảnh
            peHinhZoom.Name = "peHinhZoom";
            LayoutControlItem lci = lcMain.AddItem("", peHinhZoom);

            lci.Name = "cusHinhZoom";
            peHinhZoom.Properties.ShowMenu   = false;
            peHinhZoom.Properties.Scrollable = true;
            peHinhZoom.DataBindings.Add("EditValue", _data.BsMain, "HinhAnh", true, DataSourceUpdateMode.OnValidation);
            peHinhZoom.EditValueChanged     += new EventHandler(peHinhZoom_EditValueChanged);
            peHinhZoom.Properties.MouseDown += new MouseEventHandler(Properties_MouseDown);
            peHinhZoom.Properties.MouseMove += new MouseEventHandler(Properties_MouseMove);
            peHinhZoom.Properties.MouseUp   += new MouseEventHandler(Properties_MouseUp);
        }
 protected override void AdjustLayoutItemSize(LayoutControlItem layoutControlItem, IResizableView view, int height)
 {
     base.AdjustLayoutItemSize(layoutControlItem, view, height);
     HeightChanged(this, new ViewResizedEventArgs(OptimalHeight));
 }
Example #35
0
 protected override void AdjustLayoutItemSize(LayoutControlItem layoutControlItem, IResizableView view, int height)
 {
     base.AdjustLayoutItemSize(layoutControlItem, view, height);
     raiseHeightChangedEvent();
 }
        private void createEditors(int rowIndex, bool applyToAllButton)
        {
            var layoutControl = new LayoutControl();

            Controls.Add(layoutControl);
            layoutControl.Dock = DockStyle.Fill;
            layoutControl.AllowCustomization = false;

            foreach (MetaDataColumn col in _data.Columns)
            {
                LayoutControlItem colItem = layoutControl.Root.AddItem();
                colItem.Name        = col.DisplayName.FormatForLabel();
                colItem.ControlName = col.DisplayName;
                BaseEdit editor;

                if (col.DataType == typeof(string))
                {
                    if (col.ListOfValues != null && col.ListOfValues.Count > 0)
                    {
                        if (col.IsListOfValuesFixed)
                        {
                            editor = new ImageComboBoxEdit();
                            var cb             = editor as ImageComboBoxEdit;
                            var imageListSmall = getImageList(col.ListOfImages, IconSizes.Size16x16);
                            var imageListLarge = getImageList(col.ListOfImages, IconSizes.Size32x32);
                            cb.Properties.SmallImages = imageListSmall;
                            cb.Properties.LargeImages = imageListLarge;
                            foreach (var s in col.ListOfValues)
                            {
                                cb.Properties.Items.Add(new ImageComboBoxItem(s.Value, s.Key, getImageIndex(imageListLarge, s.Key)));
                            }
                            cb.Properties.AutoComplete   = true;
                            cb.Properties.AllowNullInput = col.Required ? DefaultBoolean.False : DefaultBoolean.True;
                            setEditorProperties(cb.Properties, col);
                            cb.Properties.CloseUpKey = new KeyShortcut(Keys.Enter);
                            cb.SelectedValueChanged += onSelectedValueChanged;
                        }
                        else
                        {
                            editor = new MRUEdit();
                            var cb = editor as MRUEdit;
                            foreach (var s in col.ListOfValues)
                            {
                                cb.Properties.Items.Add(s.Value);
                            }
                            cb.Properties.AutoComplete   = true;
                            cb.Properties.AllowNullInput = col.Required ? DefaultBoolean.False : DefaultBoolean.True;
                            setEditorProperties(cb.Properties, col);
                            cb.Properties.CloseUpKey          = new KeyShortcut(Keys.Enter);
                            cb.SelectedValueChanged          += onSelectedValueChanged;
                            cb.Properties.AllowRemoveMRUItems = false;
                        }
                    }
                    else
                    {
                        if (col.MaxLength > TEXT_LENGTH_FOR_MEMO_EDITOR)
                        {
                            editor = new MemoExEdit();
                            var me = editor as MemoExEdit;
                            me.Properties.AllowNullInput = col.Required ? DefaultBoolean.False : DefaultBoolean.True;
                            me.Properties.MaxLength      = maxLengthFor(col);
                            setEditorProperties(me.Properties, col);
                            me.Properties.CloseUpKey = new KeyShortcut(Keys.Enter);
                        }
                        else
                        {
                            editor = new TextEdit();
                            var te = editor as TextEdit;
                            te.Properties.AllowNullInput = col.Required ? DefaultBoolean.False : DefaultBoolean.True;
                            te.Properties.MaxLength      = maxLengthFor(col);
                            setEditorProperties(te.Properties, col);
                        }
                    }
                }
                else if (col.DataType == typeof(DateTime))
                {
                    editor = new DateEdit();
                    var de = editor as DateEdit;
                    de.Properties.ShowClear = !col.Required;
                    setEditorProperties(de.Properties, col);
                    de.Properties.CloseUpKey = new KeyShortcut(Keys.Enter);
                }

                else if (col.DataType == typeof(bool))
                {
                    editor = new CheckEdit();
                    var ce = editor as CheckEdit;
                    ce.Properties.Caption        = col.DisplayName;
                    ce.Properties.GlyphAlignment = HorzAlignment.Far;
                    ce.Properties.NullStyle      = StyleIndeterminate.Inactive;
                    ce.Properties.AllowGrayed    = !col.Required;
                    setEditorProperties(ce.Properties, col);
                }
                else if (col.DataType == typeof(double))
                {
                    editor = new TextEdit();
                    var te = editor as TextEdit;
                    te.Properties.AllowNullInput = col.Required ? DefaultBoolean.False : DefaultBoolean.True;
                    // te.Properties.MaxLength = col.MaxLength;
                    setEditorProperties(te.Properties, col);
                    te.Properties.Mask.MaskType = MaskType.RegEx;
                    te.Properties.Mask.EditMask = RegularExpression.Numeric;
                }
                else if (col.DataType == typeof(int))
                {
                    editor = new SpinEdit();
                    var se = editor as SpinEdit;
                    if (col.MinValue != null)
                    {
                        if (col.MinValueAllowed)
                        {
                            se.Properties.MinValue = (decimal)col.MinValue;
                        }
                        else
                        {
                            se.Properties.MinValue = (decimal)col.MinValue + 1;
                        }
                    }
                    if (col.MaxValue != null)
                    {
                        if (col.MaxValueAllowed)
                        {
                            se.Properties.MaxValue = (decimal)col.MaxValue;
                        }
                        else
                        {
                            se.Properties.MaxValue = (decimal)col.MaxValue - 1;
                        }
                    }
                    se.Properties.AllowNullInput = col.Required ? DefaultBoolean.False : DefaultBoolean.True;
                    setEditorProperties(se.Properties, col);
                }
                else
                {
                    editor = new TextEdit();
                    var te = editor as TextEdit;
                    te.Properties.AllowNullInput = col.Required ? DefaultBoolean.False : DefaultBoolean.True;
                    te.Properties.MaxLength      = col.MaxLength;
                    setEditorProperties(te.Properties, col);
                }

                if (col.Required)
                {
                    editor.BackColor = Color.LightYellow;
                }
                editor.Validating       += onEditorValidating;
                editor.TextChanged      += OnEditorTextChanged;
                editor.EditValueChanged += OnEditorTextChanged;
                editor.Validated        += onEditorValidated;

                editor.ToolTipController = new ToolTipController();
                editor.SuperTip          = new SuperToolTip();
                editor.SuperTip.Items.AddTitle(col.DisplayName);
                editor.SuperTip.Items.Add(col.Description);

                //add information about ranges to the tool tip
                if (col.MinValue != null || col.MaxValue != null)
                {
                    var lowerBound = col.MinValue == null ? INFINITY_SIGN : (col.MinValueAllowed) ? "[" : "]";
                    var lowerValue = col.MinValue == null ? String.Empty : col.MinValue.ToString();
                    var upperValue = col.MaxValue == null ? String.Empty : col.MaxValue.ToString();
                    var upperBound = col.MaxValue == null ? INFINITY_SIGN : (col.MaxValueAllowed) ? "]" : "[";
                    var text       = $"Valid values must be within range {lowerBound}{lowerValue};{upperValue}{upperBound}.";
                    editor.SuperTip.Items.Add(text);
                }

                editor.Name = col.ColumnName;
                editor.DataBindings.Add(new Binding("EditValue", _data, col.ColumnName));
                editor.DataBindings.DefaultDataSourceUpdateMode = DataSourceUpdateMode.OnPropertyChanged;
                if (shouldSetDefaultValue(col))
                {
                    editor.EditValue = col.DefaultValue;
                }

                colItem.Control = editor;

                var btnColItem = layoutControl.Root.AddItem();
                btnColItem.Move(colItem, InsertType.Right);
                var button = createThisMetaDataValueApplyToAllButton(editor);

                button.Enabled = !col.IsColumnUsedForGrouping;

                btnColItem.Control = button;

                btnColItem.TextVisible = false;
            }

            // bind to given row index
            if (_data.Rows.Count > 0 && rowIndex >= 0 && rowIndex < _data.Rows.Count)
            {
                BindingContext[_data].Position = rowIndex;
            }

            if (!applyToAllButton)
            {
                return;
            }
            _copyButton = new UxSimpleButton();
            var copyItem = layoutControl.Root.AddItem();

            copyItem.Control     = _copyButton;
            _copyButton.Name     = "btnApplyToAll";
            _copyButton.Text     = Captions.Importer.ApplyToAll;
            _copyButton.ToolTip  = Captions.Importer.ApplyToAll;
            _copyButton.Image    = ApplicationIcons.ApplyAll;
            _copyButton.Enabled  = IsDataValid;
            _copyButton.Click   += onCopyButtonClick;
            copyItem.TextVisible = false;
        }
 private void ФормаДинамическойТаблицы_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (((this.Таблица.ВариантОткрытия == ВариантОткрытияФормы.Чтение) || (this.Таблица.ВариантОткрытия == ВариантОткрытияФормы.СводнаяФормаБезРедактирования)) || ((this.Таблица.ЭкраннаяФорма == null) || ((this.Таблица.ЭкраннаяФорма.ежимРаботы != ежимРаботыЭкраннойФормы.Просмотр) && (this.Таблица.ЭкраннаяФорма.ежимРаботы != ежимРаботыЭкраннойФормы.ПредварительныйПросмотр))))
     {
         base.DialogResult = DialogResult.Cancel;
     }
     else
     {
         bool flag = false;
         this.simpleButton_применить.Focus();
         if (base.DialogResult == DialogResult.OK)
         {
             flag = true;
         }
         else if (this.Таблица.ЗначенияИзменились)
         {
             if (base.DialogResult != DialogResult.OK)
             {
                 езультатДиалога диалога = Сообщение.Показать("Вы желаете сохранить изменения?", "Сохранение формы...", КнопкиСообщения.ДаНетОтмена);
                 if (диалога == езультатДиалога.Отмена)
                 {
                     e.Cancel = true;
                     return;
                 }
                 if ((диалога == езультатДиалога.Нет) && this.Таблица.ЭкраннаяФорма.ОтчетнаяФорма.ОбработатьСобытие_ЗакрытияСубтаблицыСОтказомОтСохранения(this.Таблица.КодТаблицы))
                 {
                     e.Cancel = true;
                     return;
                 }
                 if (диалога == езультатДиалога.Да)
                 {
                     flag = true;
                 }
             }
             else
             {
                 flag = true;
             }
         }
         if (flag)
         {
             if (!this.СохранитьДинамическуюТаблицу())
             {
                 base.DialogResult = DialogResult.None;
                 e.Cancel          = true;
                 return;
             }
             base.DialogResult = DialogResult.OK;
         }
     }
     if (!Приложение.Параметры.ПараметрЗадан("РежимТестировщика"))
     {
         this.Таблица.СохранениеНастроек(base.GetType(), this.Таблица.Заголовок);
     }
     this.layoutMainGroup.BeginUpdate();
     this.таблицаItem.Control = null;
     this.layoutMainGroup.Remove(this.таблицаItem);
     this.layoutMainGroup.EndUpdate();
     this.layoutMain.Controls.Remove(this.Таблица);
     if (this.Таблица.азмещатьНаЗакладке)
     {
         this.Таблица.Parent = this.начальныйРодительТаблицы;
         if (this.начальныйРодительТаблицы != null)
         {
             this.Таблица.Dock = DockStyle.Fill;
         }
     }
     this.Таблица     = null;
     this.таблицаItem = null;
 }
Example #38
0
        public void BindControls()
        {
            if (Questionnaire == null)
                MessageBox.Show("Questionnaire must be bind with JSON first.", "MultipleChoice Component");

            isLoaded = false;
            this.layoutControlGroupQuestion1.Clear();
            Settings oSettings = Questionnaire.Form.Settings;
            m_DynamicControls = new List<DynamicControl>();

            // layoutControlGroupQuestion1
            this.layoutControlGroupQuestion1.Name = "layoutControlGroupQuestion" + Guid.NewGuid().ToString();
            this.layoutControlGroupQuestion1.AppearanceGroup.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
            this.layoutControlGroupQuestion1.AppearanceGroup.GradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
            this.layoutControlGroupQuestion1.AppearanceGroup.Options.UseFont = true;
            this.layoutControlGroupQuestion1.ExpandButtonVisible = false;
            this.layoutControlGroupQuestion1.GroupBordersVisible = true;
            this.layoutControlGroupQuestion1.TextVisible = false;
            this.layoutControlGroupQuestion1.Padding = new DevExpress.XtraLayout.Utils.Padding(1, 1,1, 1);
            this.layoutControlGroupQuestion1.ShowInCustomizationForm = false;
            //this.layoutControlGroupQuestion1.Size = new System.Drawing.Size(417, 64);
            //this.layoutControlGroupQuestion1.Text = oSettings.Label + " " + oSettings.QuestionText;
            this.layoutControlGroupQuestion1.BeginUpdate();

            #region Footer
            this.layoutControlItem1 = new LayoutControlItem();
            this.layoutControlItem1.Name = "layoutControlItem" + Guid.NewGuid().ToString();

            //bool isCustomerOwnershipOnly = false;
            //if (oSettings.CustomerOwnership && oSettings.BVOwnership)
            //    isCustomerOwnershipOnly = true;

            //ctlFooter = new Footer() {
            //    IsAccountLevel = oSettings.DataBindings.account_level,
            //    IsCustomerOwnershipOnly = isCustomerOwnershipOnly,
            //    HelpText = oSettings.QuestionHelp,
            //    LanguageCode = oSettings.DataBindings.language_code
            //};

            ctlFooter = new Footer() {
                IsAccountLevel = oSettings.DataBindings.account_level,
                IsCustomerOwned = oSettings.CustomerOwnership,
                IsBrightvisionOwned = oSettings.BVOwnership,
                HelpText = oSettings.QuestionHelp,
                LanguageCode = oSettings.DataBindings.language_code,
                QuestionText = oSettings.Label + " " + oSettings.QuestionText
            };

            ctlFooter.InitializeFooter();
            ctlFooter.Dock = DockStyle.Fill;
            ctlFooter.Height = 20;
            this.layoutControlItem1.Control = ctlFooter;
            this.layoutControlItem1.ShowInCustomizationForm = false;
            this.layoutControlItem1.TextVisible = false;
            this.layoutControlItem1.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
            this.layoutControlItem1.MinSize = new Size(0, 24);
            this.layoutControlItem1.MaxSize = new Size(0, 24);
            this.layoutControlItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click);
            this.layoutControlItem1.SizeConstraintsType = SizeConstraintsType.Custom;
            this.layoutControlGroupQuestion1.AddItem(this.layoutControlItem1);
            #endregion

            IList<AnswerOption> answeroptionList = Questionnaire.Form.Settings.AnswerOptions;
            IMultipleChoice answeroption = null;
            List<MultipleChoiceValue> mcvalueList = null;
            int iAnswerOptions = answeroptionList.Count;
            int numCols = 1;
            int numRows = 1;
            LayoutControlItem refColItem = null, prevItem = null, lastItem = null;
            List<LayoutControlItem> listItems = null;
            int idx = 0;
            int refColItemWidth = 0;
            for (int x = 0; x < iAnswerOptions; ++x) {
                answeroption = answeroptionList[x] as IMultipleChoice;
                simpleLabelItemValidation = new SimpleLabelItem();
                simpleLabelItemValidation.AppearanceItemCaption.BackColor = Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))));
                simpleLabelItemValidation.Name = Guid.NewGuid().ToString();
                simpleLabelItemValidation.TextAlignMode = TextAlignModeItem.CustomSize;
                simpleLabelItemValidation.TextSize = new Size(212, 15);
                simpleLabelItemValidation.Text = "  Please check at least one item below.";
                simpleLabelItemValidation.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
                this.layoutControlGroupQuestion1.AddItem(simpleLabelItemValidation);

                mcvalueList = answeroption.MultipleChoiceValues;
                numCols = answeroption.MultipleChoiceColumns;
                numRows = Convert.ToInt16(Math.Ceiling(Convert.ToDouble(mcvalueList.Count) / Convert.ToDouble(numCols)));
                listItems = new List<LayoutControlItem>();
                for (int i = 1; i <= numCols; ++i) {
                    for (int q = 1; q <= numRows && idx < mcvalueList.Count ; ++q) {
                        if (i > 1 && q == 1) {
                            lastItem = refColItem;
                        }
                        if (q == 1) {
                            refColItem = new LayoutControlItem();
                            refColItem.Padding = new DevExpress.XtraLayout.Utils.Padding(0);
                            refColItem.Spacing = new DevExpress.XtraLayout.Utils.Padding(0);
                            //add checkedit
                            this.checkEdit1 = new CheckEdit();
                            this.checkEdit1.Tag = new MultiplechoiceData() {
                                ParentPositionIndex = "IndexPosition" + x.ToString(),
                                PositionIndex = "IndexPosition" + idx,
                                ControlContainer = refColItem
                            };
                            this.checkEdit1.Text = mcvalueList[idx].TextPrefix;
                            this.checkEdit1.Checked = mcvalueList[idx].Checked;
                            this.checkEdit1.Name = "checkEdit" + Guid.NewGuid().ToString();
                            //this.checkEdit1.StyleController = this.StyleController;
                            this.checkEdit1.AutoSizeInLayoutControl = true;
                            checkEdit1.CheckedChanged += new EventHandler(checkEdit1_CheckedChanged);

                            m_DynamicControls.Add(new DynamicControl() {
                                Control = this.checkEdit1,
                                Name = this.checkEdit1.Name,
                                DefaultValue = this.checkEdit1.Checked,
                                TextPrefix = this.checkEdit1.Text
                            });

                            refColItem.Name = "layoutControlItem" + Guid.NewGuid().ToString();
                            refColItem.Control = this.checkEdit1;
                            refColItem.TextVisible = false;
                            refColItem.MinSize = new Size(0, 17);
                            refColItem.MaxSize = new Size(0, 17);
                            refColItem.SizeConstraintsType = SizeConstraintsType.Custom;
                            refColItem.Click += new EventHandler(layoutControlGroupQuestion1_Click);
                            refColItem.AllowAutoAlignment = true;

                            if (refColItemWidth < this.checkEdit1.Width) refColItemWidth = this.checkEdit1.Width;

                            if (i > 1) {
                                layoutControlGroupQuestion1.AddItem(refColItem, lastItem, DevExpress.XtraLayout.Utils.InsertType.Right);
                            } else {
                                layoutControlGroupQuestion1.AddItem(refColItem);
                            }
                            listItems.Add(refColItem);
                        }
                        else {
                            this.layoutControlItem1 = new LayoutControlItem();
                            this.layoutControlItem1.Padding = new DevExpress.XtraLayout.Utils.Padding(0);
                            this.layoutControlItem1.Spacing = new DevExpress.XtraLayout.Utils.Padding(0);
                            //add checkedit
                            this.checkEdit1 = new CheckEdit();
                            this.checkEdit1.Tag = new MultiplechoiceData() {
                                ParentPositionIndex = "IndexPosition" + x.ToString(),
                                PositionIndex = "IndexPosition" + idx,
                                ControlContainer = layoutControlItem1
                            };

                            this.checkEdit1.Text = mcvalueList[idx].TextPrefix;
                            this.checkEdit1.Checked = mcvalueList[idx].Checked;
                            this.checkEdit1.Name = "checkEdit" + Guid.NewGuid().ToString();
                            this.checkEdit1.StyleController = this.StyleController;
                            checkEdit1.CheckedChanged += new EventHandler(checkEdit1_CheckedChanged);

                            m_DynamicControls.Add(new DynamicControl() {
                                Control = this.checkEdit1,
                                Name = this.checkEdit1.Name,
                                DefaultValue = this.checkEdit1.Checked,
                                TextPrefix = this.checkEdit1.Text
                            });

                            this.layoutControlItem1.Name = "layoutControlItem" + Guid.NewGuid().ToString();
                            this.layoutControlItem1.Control = this.checkEdit1;
                            this.layoutControlItem1.TextVisible = false;
                            this.layoutControlItem1.MinSize = new Size(0, 17);
                            this.layoutControlItem1.MaxSize = new Size(0, 17);
                            this.layoutControlItem1.SizeConstraintsType = SizeConstraintsType.Custom;
                            this.layoutControlItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click);

                            if (q > 1 && i==1) {
                                this.layoutControlGroupQuestion1.AddItem(this.layoutControlItem1);
                            } else {
                                if ((idx-numRows) >= 0) {
                                    this.layoutControlGroupQuestion1.AddItem(this.layoutControlItem1, listItems[idx - numRows], DevExpress.XtraLayout.Utils.InsertType.Right);
                                }
                            }
                            listItems.Add(this.layoutControlItem1);
                            prevItem = this.layoutControlItem1;
                        }
                        idx++;
                    }
                }
                idx = 0;

                //EmptySpaceItem esitem = new EmptySpaceItem();
                //esitem.Size = new Size(100,20);
                //this.layoutControlGroupQuestion1.AddItem(esitem);
                foreach (OtherChoice oChoice in answeroption.OtherChoices) {
                    if (oChoice.Enabled) {
                        //if (!string.IsNullOrEmpty(oChoice.TextPrefix)) {
                        //    // simpleLabelItem1
                        //    this.simpleLabelItem1 = new DevExpress.XtraLayout.SimpleLabelItem();

                        //    this.simpleLabelItem1.Name = "simpleLabelItem" + Guid.NewGuid().ToString();
                        //    //this.simpleLabelItem1.ShowInCustomizationForm = false;
                        //    //this.simpleLabelItem1.AppearanceItemCaption.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
                        //    this.simpleLabelItem1.Text = oChoice.TextPrefix;
                        //    //newSize = new System.Drawing.Size(100, 20);
                        //    newSize = new System.Drawing.Size(20, 20);
                        //    this.simpleLabelItem1.SizeConstraintsType = SizeConstraintsType.Custom;
                        //    this.simpleLabelItem1.MaxSize = newSize;
                        //    this.simpleLabelItem1.MinSize = newSize;
                        //    this.simpleLabelItem1.Size = newSize;
                        //    this.simpleLabelItem1.AppearanceItemCaption.BackColor = System.Drawing.Color.Transparent;
                        //    this.simpleLabelItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click);
                        //    this.layoutControlGroupQuestion1.AddItem(this.simpleLabelItem1);
                        //} else {
                        //    this.simpleLabelItem1 = null;
                        //}
                        // layoutControlItem1
                        this.layoutControlItem1 = new LayoutControlItem();
                        //add textEdit1 to layout
                        this.memoEdit1 = new MemoEdit();
                        this.memoEdit1.Tag = new MultiplechoiceData() {
                            ParentPositionIndex = "IndexPosition" + x.ToString(),
                            PositionIndex = "IndexPosition" + idx.ToString(),
                            ControlContainer = layoutControlItem1,
                            Required = oChoice.Required,
                            HasValue = !string.IsNullOrWhiteSpace(oChoice.DefaultInputValue) ? true : false,
                            ChoiceOption = oChoice
                        };
                        this.memoEdit1.Name = "textEdit" + Guid.NewGuid().ToString();
                        this.memoEdit1.Properties.ScrollBars = ScrollBars.None;
                        this.memoEdit1.StyleController = this.StyleController;
                        //set value
                        string _DefaultValue = string.Empty;
                        if (oChoice.DefaultInputValue != null) {
                            _DefaultValue = oChoice.DefaultInputValue.Trim();
                            this.memoEdit1.Text = oChoice.DefaultInputValue.Trim();
                            oChoice.InputValue = oChoice.DefaultInputValue.Trim();
                        }

                        m_DynamicControls.Add(new DynamicControl() {
                            Control = this.memoEdit1,
                            Name = this.memoEdit1.Name,
                            DefaultTextValue = _DefaultValue,
                            TextPrefix = oChoice.TextPrefix
                        });

                        memoEdit1.TextChanged += new EventHandler(textEdit1_TextChanged);
                        memoEdit1.Resize += new EventHandler(memoEdit1_Resize);
                        memoEdit1.Click += new EventHandler(layoutControlGroupQuestion1_Click);

                        this.layoutControlItem1.Name = "layoutControlItem" + Guid.NewGuid().ToString();
                        this.layoutControlItem1.Control = this.memoEdit1;
                        if (!string.IsNullOrEmpty(oChoice.TextPrefix)) {
                            this.layoutControlItem1.Text = oChoice.TextPrefix;
                            this.layoutControlItem1.TextVisible = true;
                            this.layoutControlItem1.TextLocation = DevExpress.Utils.Locations.Top;
                            this.layoutControlItem1.MaxSize = new Size(0, 41);
                            this.layoutControlItem1.MinSize = new Size(0, 41);
                        } else {
                            this.layoutControlItem1.TextVisible = false;
                            this.layoutControlItem1.MaxSize = new Size(0, 24);
                            this.layoutControlItem1.MinSize = new Size(0, 24);
                        }
                        this.layoutControlItem1.SizeConstraintsType = SizeConstraintsType.Custom;
                        this.layoutControlItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click);
                        this.layoutControlGroupQuestion1.AddItem(this.layoutControlItem1);
                        idx++;
                    }
                }

            }

            //string prioText = oSettings.Priority;
            //if (oSettings.CustomerOwnership && oSettings.BVOwnership) {
            //    prioText += "(Cust+BV)";
            //} else if (oSettings.CustomerOwnership) {
            //    prioText += "(Cust)";
            //} else if (oSettings.BVOwnership) {
            //    prioText += "(BV)";
            //}
            //if (oSettings.PlotDoneStatus.Trim().ToLower() == "done") {
            //    prioText += " Done";
            //}

            // simpleLabelItem1
            //this.simpleLabelItem1 = new DevExpress.XtraLayout.SimpleLabelItem();
            //this.simpleLabelItem1.Name = "simpleLabelItem" + Guid.NewGuid().ToString();
            //this.simpleLabelItem1.AppearanceItemCaption.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
            //this.simpleLabelItem1.AppearanceItemCaption.Options.UseTextOptions = true;
            //this.simpleLabelItem1.ShowInCustomizationForm = false;
            //this.simpleLabelItem1.Text = prioText;
            //this.simpleLabelItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click);
            //this.layoutControlGroupQuestion1.AddItem(this.simpleLabelItem1);

            //if (!string.IsNullOrEmpty(oSettings.QuestionHelp)) {
            //    // LabelControl1 help
            //    this.labelControl1 = new DevExpress.XtraEditors.LabelControl();
            //    this.labelControl1.Name = "labelControl" + Guid.NewGuid().ToString();
            //    this.labelControl1.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
            //    this.labelControl1.Appearance.Options.UseTextOptions = true;
            //    this.labelControl1.Text = "Help";
            //    this.labelControl1.ToolTip = oSettings.QuestionHelp.Trim();

            //    //apply tooltip controller from parent
            //    if (this.ToolTipController != null && this.ToolTipController.DefaultController != null) {
            //        this.labelControl1.ToolTipController = ToolTipController.DefaultController;
            //    }
            //    this.labelControl1.Click += new EventHandler(layoutControlGroupQuestion1_Click);

            //    //layoutControlItem1
            //    this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
            //    this.layoutControlItem1.Name = "layoutControlItem" + Guid.NewGuid().ToString();
            //    this.layoutControlItem1.Control = this.labelControl1;
            //    this.layoutControlItem1.TextVisible = false;
            //    this.layoutControlItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click);
            //    this.layoutControlGroupQuestion1.AddItem(this.layoutControlItem1, this.simpleLabelItem1, DevExpress.XtraLayout.Utils.InsertType.Right);
            //}

            this.layoutControlGroupQuestion1.Click += new EventHandler(layoutControlGroupQuestion1_Click);

            /*
             * https://brightvision.jira.com/browse/PLATFORM-2440
             */
            for (int i = 0; i < this.layoutControlGroupQuestion1.Items.Count; i++)
            {
                ((LayoutControlItem)this.layoutControlGroupQuestion1.Items[i]).ControlMinSize = new Size(refColItemWidth, 17);
            }

            this.layoutControlGroupQuestion1.EndUpdate();

            Image bg = BGImage(this);
            if (bg != null) {
                this.layoutControlGroupQuestion1.BackgroundImage = bg;
                this.layoutControlGroupQuestion1.BackgroundImageVisible = true;
            }
            if (this.memoEdit1 != null)
                this.BackColor = this.memoEdit1.BackColor;

            this.ControlGroup = this.layoutControlGroupQuestion1;
            this.ControlGroup.Tag = this;
            isLoaded = true;
        }
Example #39
0
        public void BindControls()
        {
            if (Questionnaire == null) {
                BrightVision.Common.UI.NotificationDialog.Information("Drop Box", "Questionnaire must be initialized with Json first.");
                return;
            }

            isLoaded = false;
            this.layoutControlGroupQuestion1.Clear();
            Settings oSettings = Questionnaire.Form.Settings;
            m_DynamicControls = new List<DynamicControl>();

            this.layoutControlGroupQuestion1.Name = "layoutControlGroupQuestion" + Guid.NewGuid().ToString();
            this.layoutControlGroupQuestion1.AppearanceGroup.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
            this.layoutControlGroupQuestion1.AppearanceGroup.GradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
            this.layoutControlGroupQuestion1.AppearanceGroup.Options.UseFont = true;
            this.layoutControlGroupQuestion1.ExpandButtonVisible = false;
            this.layoutControlGroupQuestion1.GroupBordersVisible = true;
            this.layoutControlGroupQuestion1.TextVisible = false;
            //this.layoutControlGroupQuestion1.Location = new System.Drawing.Point(0, 0);
            this.layoutControlGroupQuestion1.Padding = new DevExpress.XtraLayout.Utils.Padding(1, 1, 1, 1);
            this.layoutControlGroupQuestion1.ShowInCustomizationForm = false;
            //this.layoutControlGroupQuestion1.Text = oSettings.Label + " " + oSettings.QuestionText;
            this.layoutControlGroupQuestion1.BeginUpdate();

            #region Footer
            this.layoutControlItem1 = new LayoutControlItem();
            this.layoutControlItem1.Name = "layoutControlItem" + Guid.NewGuid().ToString();

            //bool isCustomerOwned = false;
            //bool isBrightvisionOwned = false;
            //if (oSettings.CustomerOwnership && oSettings.BVOwnership)
            //    isCustomerOwnershipOnly = true;

            //ctlFooter = new Footer() {
            //    IsAccountLevel = oSettings.DataBindings.account_level,
            //    IsCustomerOwnershipOnly = isCustomerOwnershipOnly,
            //    HelpText = oSettings.QuestionHelp,
            //    LanguageCode = oSettings.DataBindings.language_code
            //};

            ctlFooter = new Footer() {
                IsAccountLevel = oSettings.DataBindings.account_level,
                IsCustomerOwned = oSettings.CustomerOwnership,
                IsBrightvisionOwned = oSettings.BVOwnership,
                HelpText = oSettings.QuestionHelp,
                LanguageCode = oSettings.DataBindings.language_code,
                QuestionText = String.Format("{0} {1}", oSettings.Label, oSettings.QuestionText)
            };

            ctlFooter.InitializeFooter();
            ctlFooter.Dock = DockStyle.Fill;
            ctlFooter.Height = 20;
            this.layoutControlItem1.Control = ctlFooter;
            this.layoutControlItem1.ShowInCustomizationForm = false;
            this.layoutControlItem1.TextVisible = false;
            this.layoutControlItem1.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
            this.layoutControlItem1.MinSize = new Size(0, 24);
            this.layoutControlItem1.MaxSize = new Size(0, 24);
            this.layoutControlItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click);
            this.layoutControlItem1.SizeConstraintsType = SizeConstraintsType.Custom;
            this.layoutControlGroupQuestion1.AddItem(this.layoutControlItem1);
            #endregion

            IList<AnswerOption> answeroptionList = Questionnaire.Form.Settings.AnswerOptions;
            IDropbox answeroption = null;
            int iAnswerOptions = answeroptionList.Count;
            System.Drawing.Size newSize;
            int selectedIndex = 0;
            for (int x = 0; x < iAnswerOptions; ++x) {
                answeroption = answeroptionList[x] as IDropbox;
                // simpleLabelItem1
                this.simpleLabelItem1 = new DevExpress.XtraLayout.SimpleLabelItem();
                this.simpleLabelItem1.Name = "simpleLabelItem" + Guid.NewGuid().ToString();
                this.simpleLabelItem1.ShowInCustomizationForm = false;
                this.simpleLabelItem1.AppearanceItemCaption.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
                this.simpleLabelItem1.Text = answeroption.TextPrefix;
                //this.simpleLabelItem1.SizeConstraintsType = SizeConstraintsType.Custom;
                //this.simpleLabelItem1.MaxSize = new System.Drawing.Size(0, 10);
                //this.simpleLabelItem1.MinSize = new System.Drawing.Size(5, 10);
                //this.simpleLabelItem1.Size = new System.Drawing.Size(5, 10);
                this.simpleLabelItem1.AppearanceItemCaption.BackColor = System.Drawing.Color.Transparent;
                this.simpleLabelItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click);
                this.layoutControlGroupQuestion1.AddItem(this.simpleLabelItem1);

                // layoutControlItem1
                this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
                // comboBox1
                this.comboBoxEdit1 = new ComboBoxEdit();
                this.comboBoxEdit1.Tag = new DropboxData() {
                    PositionIndex = "IndexPosition" + x,
                    ControlContainer = layoutControlItem1,
                    Required = answeroption.SelectionValueRequired,
                    HasValue = !string.IsNullOrWhiteSpace(answeroption.DefaultSelectionValue) ? true : false
                };
                this.comboBoxEdit1.Name = "comboBox" + Guid.NewGuid().ToString();
                this.comboBoxEdit1.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;
                this.comboBoxEdit1.SelectedIndexChanged += new EventHandler(comboBoxEdit1_SelectedIndexChanged);
                this.comboBoxEdit1.Click += new EventHandler(layoutControlGroupQuestion1_Click);
                List<string> dropboxvalues = answeroption.DropBoxValues;
                var colItems = this.comboBoxEdit1.Properties.Items;
                dropboxvalues.ForEach(delegate(string value) {
                    colItems.Add(value);
                });

                if (answeroption.DefaultSelectionValue != null) {
                    selectedIndex = dropboxvalues.IndexOf(answeroption.DefaultSelectionValue.Trim());
                    answeroption.SelectionValue = answeroption.DefaultSelectionValue.Trim();
                }

                m_DynamicControls.Add(new DynamicControl() {
                    Control = this.comboBoxEdit1,
                    Name = this.comboBoxEdit1.Name,
                    DefaultValue = selectedIndex.ToString(),
                    TextPrefix = answeroption.TextPrefix
                });

                this.comboBoxEdit1.SelectedIndex = selectedIndex;
                this.layoutControlItem1.Name = "layoutControlItem" + Guid.NewGuid().ToString();
                this.layoutControlItem1.Control = this.comboBoxEdit1;
                //this.layoutControlItem1.MinSize = new Size(150, 24);
                //this.layoutControlItem1.MaxSize = new Size(250, 24);

                //if (!string.IsNullOrEmpty(answeroption.DropboxMaxWidth)) {
                //    newSize = new System.Drawing.Size(int.Parse(answeroption.DropboxMaxWidth), 24);
                //    this.layoutControlItem1.Size = newSize;
                //} else {
                //    this.layoutControlItem1.Size = new Size(80, 24);
                //}
                if (answeroption.SelectionValueIfOtherVisible) {
                    this.layoutControlItem1.SizeConstraintsType = SizeConstraintsType.Custom;
                    this.layoutControlItem1.MaxSize = new Size(150, 24);
                    this.layoutControlItem1.MinSize = new Size(80, 24);
                }
                //else {
                //    this.layoutControlItem1.MaxSize = new Size(0, 24);
                //    this.layoutControlItem1.MinSize = new Size(0, 24);
                //}
                //if (!string.IsNullOrEmpty(answeroption.TextPrefix)) {
                //    this.layoutControlItem1.Text = answeroption.TextPrefix;
                //    this.layoutControlItem1.TextVisible = true;
                //    this.layoutControlItem1.AppearanceItemCaption.TextOptions.HAlignment = HorzAlignment.Far;
                //} else {
                //    this.layoutControlItem1.TextVisible = false;
                //}
                this.layoutControlItem1.TextVisible = false;
                this.layoutControlItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click);
                this.layoutControlGroupQuestion1.AddItem(this.layoutControlItem1, this.simpleLabelItem1, DevExpress.XtraLayout.Utils.InsertType.Right);

                if (answeroption.SelectionValueIfOtherVisible) {
                    // layoutControlItem2
                    this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem();
                    //add textEdit1 to layout
                    this.textEdit1 = new TextEdit();
                    this.textEdit1.Tag = new DropboxData() {
                        PositionIndex = "IndexPosition" + x,
                        ControlContainer = layoutControlItem2,
                        Required = answeroption.SelectionValueIfOtherRequired,
                        HasValue = (!string.IsNullOrWhiteSpace(answeroption.DefaultSelectionValueIfOther) ? true : false)
                    };
                    this.textEdit1.Name = "textEdit" + Guid.NewGuid().ToString();
                    this.textEdit1.StyleController = this.StyleController;
                    textEdit1.TextChanged += new EventHandler(textEdit1_TextChanged);
                    textEdit1.Click += new EventHandler(layoutControlGroupQuestion1_Click);
                    //if (!string.IsNullOrEmpty(answeroption.DefaultSelectionValueIfOther)) {
                    //    this.textEdit1.Text = answeroption.DefaultSelectionValueIfOther.Trim();
                    //}else if (!string.IsNullOrEmpty(answeroption.SelectionValueIfOther)) {
                    //    this.textEdit1.Text = answeroption.SelectionValueIfOther.Trim();
                    //}

                    string _DefaultValue = string.Empty;
                    if (answeroption.DefaultSelectionValueIfOther != null) {
                        _DefaultValue = answeroption.DefaultSelectionValueIfOther.Trim();
                        this.textEdit1.Text = answeroption.DefaultSelectionValueIfOther.Trim();
                        answeroption.SelectionValueIfOther = this.textEdit1.Text;
                    }

                    m_DynamicControls.Add(new DynamicControl() {
                        Control = this.textEdit1,
                        Name = this.textEdit1.Name,
                        DefaultValue = _DefaultValue,
                        TextPrefix = answeroption.TextPrefix
                    });

                    this.layoutControlItem2.SizeConstraintsType = SizeConstraintsType.Custom;
                    newSize = new System.Drawing.Size(350, 24);
                    this.layoutControlItem2.Size = newSize;
                    this.layoutControlItem2.MaxSize = new Size(350, 24);
                    this.layoutControlItem2.MinSize = new Size(150, 24);

                    //this.layoutControlItem2.SizeConstraintsType = SizeConstraintsType.Custom;
                    //this.layoutControlItem2.MaxSize = new Size(250, 24);
                    this.layoutControlItem2.Control = this.textEdit1;
                    this.layoutControlItem2.Name = "layoutControlItem" + Guid.NewGuid().ToString();
                    this.layoutControlItem2.TextToControlDistance = 0;
                    this.layoutControlItem2.TextVisible = false;
                    this.layoutControlItem2.Click += new EventHandler(layoutControlGroupQuestion1_Click);
                    this.layoutControlGroupQuestion1.AddItem(this.layoutControlItem2, this.layoutControlItem1, DevExpress.XtraLayout.Utils.InsertType.Right);
                }
            }

            //string prioText = oSettings.Priority;
            //if (oSettings.CustomerOwnership && oSettings.BVOwnership) {
            //    prioText += "(Cust+BV)";
            //} else if (oSettings.CustomerOwnership) {
            //    prioText += "(Cust)";
            //} else if (oSettings.BVOwnership) {
            //    prioText += "(BV)";
            //}
            //if (oSettings.PlotDoneStatus.Trim().ToLower() == "done") {
            //    prioText += " Done";
            //}

            //// simpleLabelItem1 status
            //this.emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem();
            //this.emptySpaceItem1.Name = "simpleLabelItem" + Guid.NewGuid().ToString();
            //this.emptySpaceItem1.AppearanceItemCaption.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
            //this.emptySpaceItem1.AppearanceItemCaption.Options.UseTextOptions = true;
            //this.emptySpaceItem1.ShowInCustomizationForm = false;
            //this.emptySpaceItem1.SizeConstraintsType = SizeConstraintsType.Custom;
            //this.emptySpaceItem1.Text = prioText;
            //this.emptySpaceItem1.TextVisible = true;
            //this.emptySpaceItem1.Size = new Size(10, 20);
            //this.emptySpaceItem1.MaxSize = new Size(0, 20);
            //this.emptySpaceItem1.MinSize = new Size(0, 20);
            //this.emptySpaceItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click);
            //this.layoutControlGroupQuestion1.AddItem(this.emptySpaceItem1);

            //if (!string.IsNullOrEmpty(oSettings.QuestionHelp)) {
            //    this.emptySpaceItem2 = new DevExpress.XtraLayout.EmptySpaceItem();
            //    this.emptySpaceItem2.Name = "simpleLabelItem" + Guid.NewGuid().ToString();
            //    this.emptySpaceItem2.AppearanceItemCaption.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
            //    this.emptySpaceItem2.AppearanceItemCaption.Options.UseTextOptions = true;
            //    this.emptySpaceItem2.ShowInCustomizationForm = false;
            //    this.emptySpaceItem2.Text = "Help";
            //    this.emptySpaceItem2.OptionsToolTip.ToolTip = oSettings.QuestionHelp.Trim();

            //    //apply tooltip controller from parent
            //    //if (this.ToolTipController != null && this.ToolTipController.DefaultController != null) {
            //    //    this.emptySpaceItem2.OptionsToolTip.ToolTipController = ToolTipController.DefaultController;
            //    //}

            //    this.emptySpaceItem2.TextVisible = true;
            //    this.emptySpaceItem2.Size = new Size(50, 20);
            //    this.emptySpaceItem2.MaxSize = new Size(50, 20);
            //    this.emptySpaceItem2.MinSize = new Size(50, 20);
            //    this.emptySpaceItem2.SizeConstraintsType = SizeConstraintsType.Custom;
            //    this.emptySpaceItem2.Click += new EventHandler(layoutControlGroupQuestion1_Click);
            //    this.emptySpaceItem2.AppearanceItemCaption.TextOptions.HAlignment = HorzAlignment.Far;
            //    this.layoutControlGroupQuestion1.AddItem(this.emptySpaceItem2, this.emptySpaceItem1, DevExpress.XtraLayout.Utils.InsertType.Right);
            //}

            this.layoutControlGroupQuestion1.Click += new EventHandler(layoutControlGroupQuestion1_Click);
            this.layoutControlGroupQuestion1.EndUpdate();
            Image bg = BGImage(this);
            if (bg != null) {
                this.layoutControlGroupQuestion1.BackgroundImage = bg;
                this.layoutControlGroupQuestion1.BackgroundImageVisible = true;
            }
            if (this.textEdit1 != null)
                BackColor = this.textEdit1.BackColor;

            this.ControlGroup = this.layoutControlGroupQuestion1;
            this.ControlGroup.Tag = this;
            isLoaded = true;
        }
Example #40
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AdminTool));
     this.tlControls = new CommonTreeList();
     this.tlcType = new CommonTreeListColumn();
     this.tlcText = new CommonTreeListColumn();
     this.lueForms = new DevExpress.XtraEditors.LookUpEdit();
     this.bsForms = new System.Windows.Forms.BindingSource(this.components);
     this.lcAdmin = new DevExpress.XtraLayout.LayoutControl();
     this.pgFilter = new FilterPropertyGrid();
     this.lueRoles = new DevExpress.XtraEditors.LookUpEdit();
     this.lcgAdmin = new DevExpress.XtraLayout.LayoutControlGroup();
     this.lciForm = new DevExpress.XtraLayout.LayoutControlItem();
     this.lciTree = new DevExpress.XtraLayout.LayoutControlItem();
     this.lciRole = new DevExpress.XtraLayout.LayoutControlItem();
     this.lciProperty = new DevExpress.XtraLayout.LayoutControlItem();
     this.splitterItem1 = new DevExpress.XtraLayout.SplitterItem();
     this.rcAdmin = new DevExpress.XtraBars.Ribbon.RibbonControl();
     this.bbiDefault = new DevExpress.XtraBars.BarButtonItem();
     this.bbiRestore = new DevExpress.XtraBars.BarButtonItem();
     this.bbiSave = new DevExpress.XtraBars.BarButtonItem();
     this.rpMain = new DevExpress.XtraBars.Ribbon.RibbonPage();
     this.rpgSettings = new DevExpress.XtraBars.Ribbon.RibbonPageGroup();
     this.toolTip = new DevExpress.Utils.ToolTipController(this.components);
     this.pmControls = new DevExpress.XtraBars.PopupMenu(this.components);
     this.bbiExpand = new DevExpress.XtraBars.BarButtonItem();
     ((System.ComponentModel.ISupportInitialize)(this.tlControls)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.lueForms.Properties)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.bsForms)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.lcAdmin)).BeginInit();
     this.lcAdmin.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.lueRoles.Properties)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.lcgAdmin)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.lciForm)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.lciTree)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.lciRole)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.lciProperty)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.splitterItem1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.rcAdmin)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.pmControls)).BeginInit();
     this.SuspendLayout();
     //
     // tlControls
     //
     this.tlControls.Columns.AddRange(new DevExpress.XtraTreeList.Columns.TreeListColumn[] {
     this.tlcType,
     this.tlcText});
     this.tlControls.KeyFieldName = "Name";
     this.tlControls.Location = new System.Drawing.Point(7, 85);
     this.tlControls.Name = "tlControls";
     this.tlControls.OptionsBehavior.Editable = false;
     this.tlControls.OptionsView.ShowAutoFilterRow = true;
     this.tlControls.ParentFieldName = "Parent";
     this.tlControls.Size = new System.Drawing.Size(377, 397);
     this.tlControls.TabIndex = 2;
     this.tlControls.FocusedNodeChanged += new DevExpress.XtraTreeList.FocusedNodeChangedEventHandler(this.ControlsFocusedNodeChanged);
     this.tlControls.PopupMenuShowing += new DevExpress.XtraTreeList.PopupMenuShowingEventHandler(this.ControlsPopupMenuShowing);
     //
     // tlcType
     //
     this.tlcType.Caption = "Тип элемента";
     this.tlcType.FieldName = "Type";
     this.tlcType.Name = "tlcType";
     this.tlcType.OptionsColumn.AllowEdit = false;
     this.tlcType.OptionsFilter.AutoFilterCondition = DevExpress.XtraTreeList.Columns.AutoFilterCondition.Contains;
     this.tlcType.Visible = true;
     this.tlcType.VisibleIndex = 0;
     this.tlcType.Width = 190;
     //
     // tlcText
     //
     this.tlcText.Caption = "Текст элемента";
     this.tlcText.FieldName = "Caption";
     this.tlcText.Name = "tlcText";
     this.tlcText.OptionsColumn.AllowEdit = false;
     this.tlcText.OptionsFilter.AutoFilterCondition = DevExpress.XtraTreeList.Columns.AutoFilterCondition.Contains;
     this.tlcText.Visible = true;
     this.tlcText.VisibleIndex = 1;
     this.tlcText.Width = 113;
     //
     // lueForms
     //
     this.lueForms.Location = new System.Drawing.Point(94, 17);
     this.lueForms.MaximumSize = new System.Drawing.Size(0, 20);
     this.lueForms.Name = "lueForms";
     this.lueForms.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
     new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
     this.lueForms.Properties.Columns.AddRange(new DevExpress.XtraEditors.Controls.LookUpColumnInfo[] {
     new DevExpress.XtraEditors.Controls.LookUpColumnInfo("Value", "Заголовок формы", 20, DevExpress.Utils.FormatType.None, "", true, DevExpress.Utils.HorzAlignment.Default, DevExpress.Data.ColumnSortOrder.Ascending)});
     this.lueForms.Properties.DataSource = this.bsForms;
     this.lueForms.Properties.DisplayMember = "Value";
     this.lueForms.Properties.DropDownRows = 10;
     this.lueForms.Properties.NullText = "";
     this.lueForms.Properties.ValueMember = "Key";
     this.lueForms.Size = new System.Drawing.Size(290, 20);
     this.lueForms.StyleController = this.lcAdmin;
     this.lueForms.TabIndex = 4;
     this.lueForms.EditValueChanged += new System.EventHandler(this.FormsEditValueChanged);
     //
     // bsForms
     //
     this.bsForms.DataSource = typeof(System.Collections.Generic.KeyValuePair<string, string>);
     //
     // lcAdmin
     //
     this.lcAdmin.Controls.Add(this.pgFilter);
     this.lcAdmin.Controls.Add(this.tlControls);
     this.lcAdmin.Controls.Add(this.lueForms);
     this.lcAdmin.Controls.Add(this.lueRoles);
     this.lcAdmin.Dock = System.Windows.Forms.DockStyle.Fill;
     this.lcAdmin.Location = new System.Drawing.Point(0, 96);
     this.lcAdmin.Name = "lcAdmin";
     this.lcAdmin.OptionsCustomizationForm.DesignTimeCustomizationFormPositionAndSize = new System.Drawing.Rectangle(655, 271, 250, 350);
     this.lcAdmin.Root = this.lcgAdmin;
     this.lcAdmin.Size = new System.Drawing.Size(391, 692);
     this.lcAdmin.TabIndex = 1;
     this.lcAdmin.Text = "lcAdmin";
     //
     // pgFilter
     //
     this.pgFilter.Location = new System.Drawing.Point(7, 491);
     this.pgFilter.Name = "pgFilter";
     this.pgFilter.PropertySort = System.Windows.Forms.PropertySort.Alphabetical;
     this.pgFilter.Size = new System.Drawing.Size(377, 194);
     this.pgFilter.TabIndex = 0;
     this.pgFilter.ToolbarVisible = false;
     this.pgFilter.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.FilterPropertyValueChanged);
     //
     // lueRoles
     //
     this.lueRoles.Location = new System.Drawing.Point(94, 51);
     this.lueRoles.MaximumSize = new System.Drawing.Size(0, 20);
     this.lueRoles.Name = "lueRoles";
     this.lueRoles.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
     new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
     this.lueRoles.Properties.Columns.AddRange(new DevExpress.XtraEditors.Controls.LookUpColumnInfo[] {
     new DevExpress.XtraEditors.Controls.LookUpColumnInfo("Name", "Name", 20, DevExpress.Utils.FormatType.None, "", true, DevExpress.Utils.HorzAlignment.Default, DevExpress.Data.ColumnSortOrder.Ascending)});
     this.lueRoles.Properties.DisplayMember = "Name";
     this.lueRoles.Properties.DropDownRows = 10;
     this.lueRoles.Properties.ImmediatePopup = true;
     this.lueRoles.Properties.NullText = "";
     this.lueRoles.Properties.NullValuePrompt = "Выберите роль для настройки";
     this.lueRoles.Properties.PopupSizeable = false;
     this.lueRoles.Properties.ShowHeader = false;
     this.lueRoles.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.Standard;
     this.lueRoles.Properties.ValueMember = "Id";
     this.lueRoles.Size = new System.Drawing.Size(290, 20);
     this.lueRoles.StyleController = this.lcAdmin;
     this.lueRoles.TabIndex = 0;
     this.lueRoles.EditValueChanged += new System.EventHandler(this.RolesEditValueChanged);
     //
     // lcgAdmin
     //
     this.lcgAdmin.CustomizationFormText = "Root";
     this.lcgAdmin.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
     this.lcgAdmin.GroupBordersVisible = false;
     this.lcgAdmin.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
     this.lciForm,
     this.lciTree,
     this.lciRole,
     this.lciProperty,
     this.splitterItem1});
     this.lcgAdmin.Location = new System.Drawing.Point(0, 0);
     this.lcgAdmin.Name = "Root";
     this.lcgAdmin.Padding = new DevExpress.XtraLayout.Utils.Padding(5, 5, 5, 5);
     this.lcgAdmin.Size = new System.Drawing.Size(391, 692);
     this.lcgAdmin.Text = "Root";
     this.lcgAdmin.TextVisible = false;
     //
     // lciForm
     //
     this.lciForm.Control = this.lueForms;
     this.lciForm.CustomizationFormText = "Активная форма";
     this.lciForm.Location = new System.Drawing.Point(0, 0);
     this.lciForm.Name = "lciForm";
     this.lciForm.Size = new System.Drawing.Size(381, 34);
     this.lciForm.Spacing = new DevExpress.XtraLayout.Utils.Padding(0, 0, 10, 0);
     this.lciForm.Text = "Активная форма";
     this.lciForm.TextSize = new System.Drawing.Size(84, 13);
     //
     // lciTree
     //
     this.lciTree.Control = this.tlControls;
     this.lciTree.CustomizationFormText = "lciTree";
     this.lciTree.Location = new System.Drawing.Point(0, 68);
     this.lciTree.Name = "lciTree";
     this.lciTree.Size = new System.Drawing.Size(381, 411);
     this.lciTree.Spacing = new DevExpress.XtraLayout.Utils.Padding(0, 0, 10, 0);
     this.lciTree.Text = "lciTree";
     this.lciTree.TextSize = new System.Drawing.Size(0, 0);
     this.lciTree.TextToControlDistance = 0;
     this.lciTree.TextVisible = false;
     //
     // lciRole
     //
     this.lciRole.Control = this.lueRoles;
     this.lciRole.CustomizationFormText = "Активная роль";
     this.lciRole.Location = new System.Drawing.Point(0, 34);
     this.lciRole.Name = "lciRole";
     this.lciRole.Size = new System.Drawing.Size(381, 34);
     this.lciRole.Spacing = new DevExpress.XtraLayout.Utils.Padding(0, 0, 10, 0);
     this.lciRole.Text = "Активная роль";
     this.lciRole.TextSize = new System.Drawing.Size(84, 13);
     //
     // lciProperty
     //
     this.lciProperty.Control = this.pgFilter;
     this.lciProperty.CustomizationFormText = "lciProperty";
     this.lciProperty.Location = new System.Drawing.Point(0, 484);
     this.lciProperty.Name = "lciProperty";
     this.lciProperty.Size = new System.Drawing.Size(381, 198);
     this.lciProperty.Text = "lciProperty";
     this.lciProperty.TextSize = new System.Drawing.Size(0, 0);
     this.lciProperty.TextToControlDistance = 0;
     this.lciProperty.TextVisible = false;
     //
     // splitterItem1
     //
     this.splitterItem1.AllowHotTrack = true;
     this.splitterItem1.CustomizationFormText = "splitterItem1";
     this.splitterItem1.Location = new System.Drawing.Point(0, 479);
     this.splitterItem1.Name = "splitterItem1";
     this.splitterItem1.Size = new System.Drawing.Size(381, 5);
     //
     // rcAdmin
     //
     this.rcAdmin.ExpandCollapseItem.Id = 0;
     this.rcAdmin.Items.AddRange(new DevExpress.XtraBars.BarItem[] {
     this.rcAdmin.ExpandCollapseItem,
     this.bbiDefault,
     this.bbiRestore,
     this.bbiSave,
     this.bbiExpand});
     this.rcAdmin.Location = new System.Drawing.Point(0, 0);
     this.rcAdmin.MaxItemId = 7;
     this.rcAdmin.Name = "rcAdmin";
     this.rcAdmin.Pages.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPage[] {
     this.rpMain});
     this.rcAdmin.ShowApplicationButton = DevExpress.Utils.DefaultBoolean.False;
     this.rcAdmin.ShowCategoryInCaption = false;
     this.rcAdmin.ShowExpandCollapseButton = DevExpress.Utils.DefaultBoolean.False;
     this.rcAdmin.ShowFullScreenButton = DevExpress.Utils.DefaultBoolean.False;
     this.rcAdmin.ShowPageHeadersMode = DevExpress.XtraBars.Ribbon.ShowPageHeadersMode.Hide;
     this.rcAdmin.ShowToolbarCustomizeItem = false;
     this.rcAdmin.Size = new System.Drawing.Size(391, 96);
     this.rcAdmin.Toolbar.ShowCustomizeItem = false;
     this.rcAdmin.ToolbarLocation = DevExpress.XtraBars.Ribbon.RibbonQuickAccessToolbarLocation.Hidden;
     //
     // bbiDefault
     //
     this.bbiDefault.Caption = "По умолчанию";
     this.bbiDefault.CategoryGuid = new System.Guid("6ffddb2b-9015-4d97-a4c1-91613e0ef537");
     this.bbiDefault.Enabled = false;
     this.bbiDefault.Hint = "Вернуть настройки элементов интерфеса для выбранной формы к изначальным";
     this.bbiDefault.Id = 3;
     this.bbiDefault.LargeGlyph = ((System.Drawing.Image)(resources.GetObject("bbiDefault.LargeGlyph")));
     this.bbiDefault.Name = "bbiDefault";
     this.bbiDefault.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.DefaultItemClick);
     //
     // bbiRestore
     //
     this.bbiRestore.Caption = "Последние сохранённые";
     this.bbiRestore.CategoryGuid = new System.Guid("6ffddb2b-9015-4d97-a4c1-91613e0ef537");
     this.bbiRestore.Enabled = false;
     this.bbiRestore.Hint = "Вернуть настройки элементов интерфеса для выбранной формы к последним сохранённым" +
     "";
     this.bbiRestore.Id = 4;
     this.bbiRestore.LargeGlyph = ((System.Drawing.Image)(resources.GetObject("bbiRestore.LargeGlyph")));
     this.bbiRestore.Name = "bbiRestore";
     this.bbiRestore.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.RestoreItemClick);
     //
     // bbiSave
     //
     this.bbiSave.Caption = "Сохранить";
     this.bbiSave.CategoryGuid = new System.Guid("6ffddb2b-9015-4d97-a4c1-91613e0ef537");
     this.bbiSave.Enabled = false;
     this.bbiSave.Glyph = ((System.Drawing.Image)(resources.GetObject("bbiSave.Glyph")));
     this.bbiSave.Hint = "Сохранить текущие настройки для выбранной формы и роли ";
     this.bbiSave.Id = 5;
     this.bbiSave.LargeGlyph = ((System.Drawing.Image)(resources.GetObject("bbiSave.LargeGlyph")));
     this.bbiSave.Name = "bbiSave";
     this.bbiSave.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.SaveItemClick);
     //
     // rpMain
     //
     this.rpMain.Groups.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPageGroup[] {
     this.rpgSettings});
     this.rpMain.Name = "rpMain";
     this.rpMain.Text = "Администрирование";
     //
     // rpgSettings
     //
     this.rpgSettings.Glyph = ((System.Drawing.Image)(resources.GetObject("rpgSettings.Glyph")));
     this.rpgSettings.ItemLinks.Add(this.bbiDefault);
     this.rpgSettings.ItemLinks.Add(this.bbiRestore);
     this.rpgSettings.ItemLinks.Add(this.bbiSave);
     this.rpgSettings.Name = "rpgSettings";
     this.rpgSettings.Text = "Настройки";
     //
     // toolTip
     //
     this.toolTip.Rounded = true;
     this.toolTip.ShowBeak = true;
     this.toolTip.ToolTipLocation = DevExpress.Utils.ToolTipLocation.LeftCenter;
     //
     // pmControls
     //
     this.pmControls.ItemLinks.Add(this.bbiExpand);
     this.pmControls.Name = "pmControls";
     this.pmControls.Ribbon = this.rcAdmin;
     //
     // bbiExpand
     //
     this.bbiExpand.Caption = "Развернуть всё";
     this.bbiExpand.Glyph = ((System.Drawing.Image)(resources.GetObject("bbiExpand.Glyph")));
     this.bbiExpand.Id = 6;
     this.bbiExpand.Name = "bbiExpand";
     this.bbiExpand.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.ExpandButtonClick);
     //
     // AdminTool
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize = new System.Drawing.Size(391, 788);
     this.Controls.Add(this.lcAdmin);
     this.Controls.Add(this.rcAdmin);
     this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.Name = "AdminTool";
     this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
     this.Text = "Настройка интерфейса";
     this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.AdminToolFormClosed);
     this.Load += new System.EventHandler(this.AdminToolLoad);
     this.Shown += new System.EventHandler(this.AdminToolShown);
     ((System.ComponentModel.ISupportInitialize)(this.tlControls)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.lueForms.Properties)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.bsForms)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.lcAdmin)).EndInit();
     this.lcAdmin.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.lueRoles.Properties)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.lcgAdmin)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.lciForm)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.lciTree)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.lciRole)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.lciProperty)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.splitterItem1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.rcAdmin)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.pmControls)).EndInit();
     this.ResumeLayout(false);
     this.PerformLayout();
 }
        private void ObjectSpace_ObjectChanged(object sender, ObjectChangedEventArgs e)
        {
            if (e.PropertyName == nameof(ReportExecution.DoSoReport))
            {
                var layoutControl = View.Control as LayoutControl;
                var group         = layoutControl.Items.OfType <LayoutControlGroup>().FirstOrDefault(x => x.CustomizationFormText == "Parameters");
                //View.CreateControls();

                var items = group.Items;
                //group.Dispose();
                while (group.Items.Any())
                {
                    var item = group.Items.FirstOrDefault() as LayoutControlItem;
                    if (item != null)
                    {
                        item.Control?.Hide();
                        item.Control?.Dispose();
                        group.Remove(item);
                    }
                }

                ViewCurrentObject?.SpreadsheetControl?.Dispose();

                if (ViewCurrentObject.DoSoReport != null)
                {
                    var report = ViewCurrentObject.DoSoReport;
                    var xml    = report.Xml;
                    ViewCurrentObject.SpreadsheetControl = new SpreadsheetControl();
                    using (var ms = new MemoryStream(Convert.FromBase64String(xml)))
                        ViewCurrentObject.SpreadsheetControl.LoadDocument(ms, DocumentFormat.OpenXml);

                    var ds = ViewCurrentObject.SpreadsheetControl.Document.MailMergeDataSource as DevExpress.DataAccess.Sql.SqlDataSource;
                    if (ds == null)
                    {
                        return;
                    }

                    var parameters = ds.Queries.SelectMany(x => x.Parameters);


                    foreach (var parameter in parameters)
                    {
                        var item = new LayoutControlItem()
                        {
                            Name = parameter.Name, OptionsToolTip = new BaseLayoutItemOptionsToolTip()
                            {
                                ToolTip = parameter.Name
                            }
                        };


                        var type = parameter.Type;

                        if (type == typeof(int))
                        {
                            item.Control = new IntegerEdit()
                            {
                                Dock = DockStyle.Fill, EditValue = Convert.ToInt32(parameter.Value), ToolTip = parameter.Name
                            }
                        }
                        ;
                        if (type == typeof(string))
                        {
                            item.Control = new StringEdit()
                            {
                                Dock = DockStyle.Fill, EditValue = Convert.ToInt32(parameter.Value), ToolTip = parameter.Name
                            }
                        }
                        ;
                        if (type == typeof(decimal))
                        {
                            item.Control = new DecimalEdit()
                            {
                                Dock = DockStyle.Fill, EditValue = Convert.ToInt32(parameter.Value), ToolTip = parameter.Name
                            }
                        }
                        ;
                        if (type == typeof(DateTime))
                        {
                            item.Control = new DateTimeEdit()
                            {
                                Dock = DockStyle.Fill, EditValue = Convert.ToInt32(parameter.Value), ToolTip = parameter.Name
                            }
                        }
                        ;

                        //item.Control = new StringEdit(250) { Dock = DockStyle.Fill, EditValue = parameter.Value, ToolTip = parameter.Name }; break;
                        (item.Control as DevExpress.XtraEditors.BaseEdit).EditValueChanged += (ss, ee) =>
                        {
                            var value = (ss as DevExpress.XtraEditors.BaseEdit).EditValue;
                            if (ss is IntegerEdit)
                            {
                                parameter.Value = Convert.ToInt32(value);
                            }
                            if (ss is StringEdit)
                            {
                                parameter.Value = value.ToString();
                            }
                            if (ss is DecimalEdit)
                            {
                                parameter.Value = Convert.ToDecimal(value);
                            }
                            if (ss is DateTimeEdit)
                            {
                                parameter.Value = Convert.ToDateTime(value);
                            }
                        };// ReportExecutionViewController_EditValueChanged(ss, ee, parameter as QueryParameter);

                        group.AddItem(item);
                    }
                }
                var defaultItem = new EmptySpaceItem();
                group.AddItem(defaultItem);
            }
        }
Example #42
0
        //private void OnKeyPress(object sender, KeyPressEventArgs e)
        //{
        //    if (e.KeyChar == (char)Keys.Enter)
        //    {
        //        SendKeys.Send("{tab}");
        //    }
        //}

        public Control AddInputControl(InputItem ii, string controlName)
        {
            LayoutControlItem lci = null;

            string ctlName      = controlName;
            object defaultValue = GetDefaultValue(ii);



            switch (ii.ControlType.ToUpper())
            {
            case QueryConstDefine.Cbx:
                ComboBox cbx = new ComboBox();
                cbx.Name = ctlName;

                //cbx.KeyPress += OnKeyPress;

                //从数据源加载数据
                DataTable dtData = GetDataForm(ii);
                if (dtData != null)
                {
                    if (dtData.Columns.Count > 1)
                    {
                        if (dtData.Columns.IndexOf("数据值") >= 0)
                        {
                            cbx.ValueMember = "数据值";
                        }
                        else
                        {
                            cbx.ValueMember = dtData.Columns[0].ColumnName;
                        }

                        if (dtData.Columns.IndexOf("数据描述") >= 0)
                        {
                            cbx.DisplayMember = "数据描述";
                        }
                        else
                        {
                            cbx.ValueMember = dtData.Columns[1].ColumnName;
                        }
                    }
                    else
                    {
                        cbx.DisplayMember = dtData.Columns[0].ColumnName;
                        cbx.ValueMember   = dtData.Columns[0].ColumnName;
                    }

                    cbx.DataSource = dtData;
                }

                lci = lcDemo.Root.AddItem(ctlName, cbx);
                lci.ShowInCustomizationForm = false;
                lci.Text = ii.Name;


                if (defaultValue != null)
                {
                    //设置默认值
                    int selIndex = cbx.Items.IndexOf(defaultValue);
                    if (selIndex < 0)
                    {
                        selIndex = cbx.FindString(Convert.ToString(defaultValue));
                    }

                    if (selIndex >= 0)
                    {
                        cbx.SelectedIndex = selIndex;
                    }
                    else
                    {
                        cbx.Text = ii.DefaultValue;
                    }
                }
                else
                {
                    cbx.SelectedIndex = cbx.Items.Count - 1;
                }


                return(cbx);

            case QueryConstDefine.Txt:
                TextBox tb = new TextBox();
                tb.Name = ctlName;
                tb.Text = Convert.ToString(defaultValue);    //设置默认值

                //tb.KeyPress += OnKeyPress;

                lci = lcDemo.Root.AddItem(ctlName, tb);
                lci.ShowInCustomizationForm = false;
                lci.Text = ii.Name;

                return(tb);

            case QueryConstDefine.Dtp:
                DateTimePicker dtp = new DateTimePicker();
                dtp.Name = ctlName;

                //dtp.KeyPress += OnKeyPress;

                try
                {
                    if (defaultValue != null)
                    {
                        //设置默认值
                        dtp.Value = Convert.ToDateTime(defaultValue);
                    }
                }
                catch
                { }

                lci = lcDemo.Root.AddItem(ctlName, dtp);
                lci.ShowInCustomizationForm = false;
                lci.Text = ii.Name;

                return(dtp);

            default:
                return(null);
            }
        }
        public void HighlightTabs(LayoutItemContainer group)
        {
            try
            {
                group.BeginUpdate();

                LayoutGroup layoutGroup = group as LayoutGroup;
                if (layoutGroup != null && layoutGroup.IsInTabbedGroup)
                {
                    bool isBold = false;
                    foreach (BaseLayoutItem item in layoutGroup.Items)
                    {
                        LayoutControlItem layoutControlItem = item as LayoutControlItem;
                        if (layoutControlItem == null)
                        {
                            continue;
                        }

                        int index = layoutGroup.Text.IndexOf('(');
                        if (index != -1)
                        {
                            if (layoutGroup.Text.EndsWith(")"))
                            {
                                layoutGroup.Text = layoutGroup.Text.Substring(0, index - 1);
                            }
                        }

                        if (HighlightOptions.ShowCountsInTabs)
                        {
                            PropertyEditor propertyEditor = FindPropertyEditor(layoutControlItem);
                            object         currentvalue   = null;
                            if (propertyEditor != null && propertyEditor.Control != null)
                            {
                                currentvalue = propertyEditor.ControlValue;
                            }
                            else if (propertyEditor != null)
                            {
                                currentvalue = propertyEditor.MemberInfo.GetValue(propertyEditor.CurrentObject);
                            }

                            ICollection collection = currentvalue as ICollection;
                            if (collection != null)
                            {
                                int count = collection.Count;
                                isBold = count > 0 && HighlightOptions.BoldTabsWithCounts;

                                if (count != 0)
                                {
                                    layoutGroup.Text = String.Format("{1} ({0})", count, layoutGroup.Text);
                                }
                            }
                            else
                            {
                                isBold = currentvalue != null && !String.IsNullOrEmpty(currentvalue.ToString()) && HighlightOptions.BoldTabsWithCounts;
                            }
                            if (isBold)
                            {
                                break;
                            }
                        }
                    }

                    Font font = layoutGroup.AppearanceTabPage.Header.Font;

                    layoutGroup.AppearanceTabPage.Header.Font           = new Font(font, isBold ? FontStyle.Bold : FontStyle.Regular);
                    layoutGroup.AppearanceTabPage.HeaderHotTracked.Font = new Font(font, isBold ? FontStyle.Bold : FontStyle.Regular);
                }

                IEnumerable items;
                if (group is TabbedGroup)
                {
                    items = ((TabbedGroup)group).TabPages;
                }
                else
                {
                    items = ((LayoutGroup)group).Items;
                }

                foreach (BaseLayoutItem item in items)
                {
                    if (item is LayoutItemContainer)
                    {
                        HighlightTabs((LayoutItemContainer)item);
                    }
                }
            }
            finally
            {
                group.EndUpdate();
            }
        }
Example #44
0
        /*
         * https://brightvision.jira.com/browse/PLATFORM-3015
         */
        public void BindControls()
        {
            #region Initialization
            if (Questionnaire == null)
                MessageBox.Show("Questionnaire must be bind with JSON first.", "Schedule Component");

            var answerOpt = Questionnaire.Form.Settings.AnswerOptions[0] as ISchedule;

            //if (CalendarDataSource == null) {
            //    if (answerOpt != null) {
            //        if (answerOpt.CalendarOption != null && answerOpt.CalendarOption.CalendarValues.Count > 0)
            //            CalendarDataSource = answerOpt.CalendarOption.CalendarValues;
            //        else {
            //            MessageBox.Show("\"CalendarDataSource\" property must be set first.","Schedule Component");
            //            return;
            //        }
            //    } else {
            //        MessageBox.Show("\"CalendarDataSource\" property must be set first.", "Schedule Component");
            //        return;
            //    }
            //}

            #endregion

            isLoaded = false;
            this.layoutControlGroupQuestion1.Clear();
            Settings oSettings = Questionnaire.Form.Settings;

            // layoutControlGroupQuestion1
            this.layoutControlGroupQuestion1.Name = "layoutControlGroupQuestion" + Guid.NewGuid().ToString();
            this.layoutControlGroupQuestion1.AppearanceGroup.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
            this.layoutControlGroupQuestion1.AppearanceGroup.GradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
            this.layoutControlGroupQuestion1.AppearanceGroup.Options.UseFont = true;
            this.layoutControlGroupQuestion1.ExpandButtonVisible = false;
            this.layoutControlGroupQuestion1.GroupBordersVisible = true;
            this.layoutControlGroupQuestion1.TextVisible = false;
            this.layoutControlGroupQuestion1.Padding = new DevExpress.XtraLayout.Utils.Padding(1, 1, 1, 1);
            this.layoutControlGroupQuestion1.ShowInCustomizationForm = false;
            //this.layoutControlGroupQuestion1.Text = oSettings.Label + " " + oSettings.QuestionText;
            this.layoutControlGroupQuestion1.BeginUpdate();

            #region Footer
            this.lciFooter = new LayoutControlItem();
            this.lciFooter.Name = "layoutControlItem" + Guid.NewGuid().ToString();

            //bool isCustomerOwnershipOnly = false;
            //if (oSettings.CustomerOwnership && oSettings.BVOwnership)
            //    isCustomerOwnershipOnly = true;

            //ctlFooter = new Footer() {
            //    IsAccountLevel = oSettings.DataBindings.account_level,
            //    IsCustomerOwnershipOnly = isCustomerOwnershipOnly,
            //    HelpText = oSettings.QuestionHelp,
            //    LanguageCode = oSettings.DataBindings.language_code
            //};

            ctlFooter = new Footer()
            {
                IsAccountLevel = oSettings.DataBindings.account_level,
                IsCustomerOwned = oSettings.CustomerOwnership,
                IsBrightvisionOwned = oSettings.BVOwnership,
                HelpText = oSettings.QuestionHelp,
                LanguageCode = oSettings.DataBindings.language_code,
                QuestionText = oSettings.Label + " " + oSettings.QuestionText
            };

            ctlFooter.InitializeFooter();
            ctlFooter.Dock = DockStyle.Fill;
            ctlFooter.Height = 20;
            this.lciFooter.Control = ctlFooter;
            this.lciFooter.ShowInCustomizationForm = false;
            this.lciFooter.TextVisible = false;
            this.lciFooter.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
            this.lciFooter.MinSize = new Size(0, 24);
            this.lciFooter.MaxSize = new Size(0, 24);
            this.lciFooter.Click += new EventHandler(layoutControlGroupQuestion1_Click);
            this.lciFooter.SizeConstraintsType = SizeConstraintsType.Custom;
            this.layoutControlGroupQuestion1.AddItem(this.lciFooter);
            #endregion

            IList<AnswerOption> answeroptionList = Questionnaire.Form.Settings.AnswerOptions;
            ISchedule answeroption = null;
            int iAnswerOptions = answeroptionList.Count;
            //System.Drawing.Size newSize;
            int idx = 0;
            ScheduleSalesPerson oSalesPerson;
            for (int x = 0; x < iAnswerOptions; ++x)
            {
                answeroption = answeroptionList[x] as ISchedule;

                LayoutControlItem lciScheduleDetails = new LayoutControlItem();
                this.lblScheduleDetails = new Label();
                this.lblScheduleDetails.Text = "";
                lciScheduleDetails.Control = this.lblScheduleDetails;
                lciScheduleDetails.TextVisible = false;
                this.layoutControlGroupQuestion1.AddItem(lciScheduleDetails);

                #region Sales Person
                // layoutControlItem1
                this.lciSalesPerson = new LayoutControlItem();
                //lookUpEdit1
                this.lookUpEdit1 = new LookUpEdit();
                this.lookUpEdit1.Name = "SalesPerson_lookUpEdit" + Guid.NewGuid().ToString();
                this.lookUpEdit1.Properties.NullText = "";
                //this.lookUpEdit1.Properties.DisplayMember = "Name";
                //this.lookUpEdit1.Properties.ValueMember = "Id";
                this.lookUpEdit1.Properties.DisplayMember = "resource_name";
                this.lookUpEdit1.Properties.ValueMember = "resource_id";
                //this.lookUpEdit1.Properties.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo("Name", "SalesPerson"));
                this.lookUpEdit1.Properties.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo("resource_name", "SalesPerson"));
                this.lookUpEdit1.Properties.ShowFooter = false;
                this.lookUpEdit1.Properties.ShowHeader = false;
                this.lookUpEdit1.Properties.ReadOnly = true;
                this.lookUpEdit1.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;

                oSalesPerson = answeroption.ScheduleSalesPerson;
                if (oSalesPerson != null)
                {
                    if (oSalesPerson.SalesPersonSelectedValue != null)
                    {
                        this.lookUpEdit1.Properties.DataSource = new List<SalesPerson> { oSalesPerson.SalesPersonSelectedValue };
                        this.lookUpEdit1.EditValue = oSalesPerson.SalesPersonSelectedValue.Id;
                    }
                }

                this.lookUpEdit1.Tag = new ScheduleData()
                {
                    Name = "SalesPerson",
                    PositionIndex = "IndexPosition" + x,
                    ControlContainer = lciSalesPerson
                };
                this.lookUpEdit1.Size = new System.Drawing.Size(155, 20);
                this.lookUpEdit1.StyleController = this.StyleController;
                //this.lookUpEdit1.EditValueChanged += new EventHandler(lookUpEdit1_SelectedIndexChanged);
                this.lookUpEdit1.Click += new EventHandler(layoutControlGroupQuestion1_Click);

                // lciSalesPerson
                this.lciSalesPerson.Name = "layoutControlItem" + Guid.NewGuid().ToString();
                this.lciSalesPerson.Control = this.lookUpEdit1;
                if (oSalesPerson != null && !string.IsNullOrEmpty(oSalesPerson.TextPrefix))
                {
                    this.lciSalesPerson.Text = oSalesPerson.TextPrefix.Trim();

                }
                else
                {
                    this.lciSalesPerson.Text = "Sales Person:";
                }
                this.lciSalesPerson.TextLocation = DevExpress.Utils.Locations.Top;
                this.lciSalesPerson.TextSize = new System.Drawing.Size(108, 13);
                this.lciSalesPerson.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
                this.lciSalesPerson.MaxSize = new System.Drawing.Size(160, 20);
                this.lciSalesPerson.MinSize = new System.Drawing.Size(160, 20);
                this.lciSalesPerson.Size = new System.Drawing.Size(50, 20);
                this.lciSalesPerson.ShowInCustomizationForm = false;
                this.lciSalesPerson.Click += new EventHandler(layoutControlGroupQuestion1_Click);
                //this.layoutControlGroupQuestion1.AddItem(this.lciSalesPerson);

                #endregion

                #region Schedule Type
                // emptySpaceItem1
                this.emptySpaceItem1 = new EmptySpaceItem();
                this.emptySpaceItem1.Name = "emptySpaceItem" + Guid.NewGuid().ToString();
                this.emptySpaceItem1.Size = new System.Drawing.Size(25, 20);
                this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
                this.emptySpaceItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
                this.emptySpaceItem1.MaxSize = new System.Drawing.Size(0, 20);
                this.emptySpaceItem1.MinSize = new System.Drawing.Size(0, 20);
                this.emptySpaceItem1.ShowInCustomizationForm = false;
                this.emptySpaceItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click);

                //
                // comboBoxEdit1
                this.lciScheduleType = new DevExpress.XtraLayout.LayoutControlItem();
                this.comboBoxEdit1 = new ComboBoxEdit();
                this.comboBoxEdit1.Tag = new ScheduleData()
                {
                    Name = "ScheduleType",
                    PositionIndex = "IndexPosition" + x,
                    ControlContainer = lciScheduleType
                };

                this.comboBoxEdit1.Size = new System.Drawing.Size(50, 20);
                this.comboBoxEdit1.Name = "ScheduleType_comboBoxEdit" + Guid.NewGuid().ToString();
                this.comboBoxEdit1.Properties.ReadOnly = true;
                this.comboBoxEdit1.StyleController = this.StyleController;
                this.comboBoxEdit1.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;
                this.comboBoxEdit1.SelectedIndexChanged += new EventHandler(comboBoxEdit1_SelectedIndexChanged);
                this.comboBoxEdit1.Click += new EventHandler(layoutControlGroupQuestion1_Click);
                if (answeroption.ScheduleType == null)
                {
                    answeroption.ScheduleType = new ScheduleType();
                }
                if (answeroption.ScheduleType.ScheduleTypeSelectedValue == null)
                {
                    answeroption.ScheduleType.ScheduleTypeSelectedValue = "";
                }
                answeroption.ScheduleType.ScheduleTypeValues = new List<string> { "Seminar", "Webinar", "Meeting" };

                answeroption.ScheduleType.ScheduleTypeValues.ForEach(delegate(string strValue)
                {
                    this.comboBoxEdit1.Properties.Items.Add(strValue);
                });

                // lciScheduleType
                this.lciScheduleType.Name = "layoutControlItem" + Guid.NewGuid().ToString();
                //this.layoutControlItem2.AppearanceItemCaption.Options.UseTextOptions = true;
                //this.layoutControlItem2.AppearanceItemCaption.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
                this.lciScheduleType.Control = this.comboBoxEdit1;
                this.lciScheduleType.TextLocation = DevExpress.Utils.Locations.Top;
                this.lciScheduleType.TextSize = new System.Drawing.Size(60, 13);
                if (!string.IsNullOrEmpty(answeroption.ScheduleType.TextPrefix))
                {
                    this.lciScheduleType.Text = answeroption.ScheduleType.TextPrefix;
                }
                else
                {
                    this.lciScheduleType.Text = "Schedule Type:";
                }

                this.lciScheduleType.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
                this.lciScheduleType.MaxSize = new System.Drawing.Size(160, 24);
                this.lciScheduleType.MinSize = new System.Drawing.Size(160, 24);
                this.lciScheduleType.Size = new System.Drawing.Size(160, 24);
                this.lciScheduleType.ShowInCustomizationForm = false;
                this.lciScheduleType.Click += new EventHandler(layoutControlGroupQuestion1_Click);

                this.lciSalesPerson.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.OnlyInCustomization;
                this.lciScheduleType.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.OnlyInCustomization;
                this.emptySpaceItem1.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.OnlyInCustomization;

                this.layoutControlGroupQuestion1.AddItem(this.lciScheduleType);
                this.layoutControlGroupQuestion1.AddItem(this.emptySpaceItem1, this.lciScheduleType, DevExpress.XtraLayout.Utils.InsertType.Right);
                this.layoutControlGroupQuestion1.AddItem(this.lciSalesPerson, this.emptySpaceItem1, DevExpress.XtraLayout.Utils.InsertType.Right);

                // emptySpaceItem1
                this.emptySpaceItem1 = new EmptySpaceItem();
                this.emptySpaceItem1.Name = "emptySpaceItem" + Guid.NewGuid().ToString();
                this.emptySpaceItem1.Size = new System.Drawing.Size(1, 15);
                this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
                this.emptySpaceItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
                this.emptySpaceItem1.MaxSize = new System.Drawing.Size(0, 15);
                this.emptySpaceItem1.MinSize = new System.Drawing.Size(0, 15);
                this.emptySpaceItem1.ShowInCustomizationForm = false;
                this.emptySpaceItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click);
                //this.layoutControlGroupQuestion1.AddItem(this.emptySpaceItem1);
                #endregion

                #region List of Schedules Available
                // lciListOfSchedule
                this.lciListOfScheduleDropDown = new DevExpress.XtraLayout.LayoutControlItem();
                //lookUpEdit1
                this.lookUpEdit2 = new LookUpEdit();
                this.lookUpEdit2.Name = "lookUpEdit" + Guid.NewGuid().ToString();
                this.lookUpEdit2.Properties.NullText = "";
                this.lookUpEdit2.Properties.DisplayMember = "title";
                this.lookUpEdit2.Properties.ValueMember = "id";
                this.lookUpEdit2.Properties.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo("title", "List of Bookings"));
                comboBoxEdit1_SelectedIndexChanged(this.comboBoxEdit1, null);
                this.lookUpEdit2.Properties.ShowFooter = true;
                this.lookUpEdit2.Properties.ShowHeader = false;
                this.lookUpEdit2.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;

                this.lookUpEdit2.Tag = new ScheduleData()
                {
                    Name = "ListOfBookingsAvailable",
                    PositionIndex = "IndexPosition" + x,
                    ControlContainer = lciListOfScheduleDropDown,
                    Required = answeroption.ListOfBookingsAvailableRequired,
                    HasValue = answeroption.ScheduleValue != null && !string.IsNullOrEmpty(answeroption.ScheduleValue.ScheduleId) ? true : false
                };
                this.lookUpEdit2.Size = new System.Drawing.Size(155, 20);
                this.lookUpEdit2.StyleController = this.StyleController;
                //load answer values
                if (answeroption.ScheduleType != null)
                {
                    if (answeroption.ScheduleValue != null)
                    {
                        if (!string.IsNullOrEmpty(answeroption.ScheduleValue.ScheduleId))
                        {
                            int schedid = int.Parse(answeroption.ScheduleValue.ScheduleId);

                            lookUpEdit2.EditValue = schedid;
                            //if (answeroption.ScheduleType.ScheduleTypeSelectedValue.ToLower() == "meeting") {
                            //    CreateMeeting.Enabled = true;
                            //}
                        }
                    }
                }
                //this.lookUpEdit2.EditValueChanged += new EventHandler(lookUpEdit2_EditValueChanged);
                this.lookUpEdit2.Click += new EventHandler(layoutControlGroupQuestion1_Click);

                this.comboBoxEdit1.EditValue = answeroption.ScheduleType.ScheduleTypeSelectedValue;

                // layoutControlItem1
                this.lciListOfScheduleDropDown.Name = "layoutControlItem" + Guid.NewGuid().ToString();
                this.lciListOfScheduleDropDown.Control = this.lookUpEdit2;

                if (!string.IsNullOrEmpty(answeroption.ListOfBookingsAvailableLabel))
                {
                    this.lciListOfScheduleDropDown.Text = answeroption.ListOfBookingsAvailableLabel.Trim();
                }
                else
                {
                    this.lciListOfScheduleDropDown.Text = "List of Schedules Available:";
                }
                this.lciListOfScheduleDropDown.TextLocation = DevExpress.Utils.Locations.Top;
                this.lciListOfScheduleDropDown.ShowInCustomizationForm = false;
                this.lciListOfScheduleDropDown.Click += new EventHandler(layoutControlGroupQuestion1_Click);

                this.lciListOfScheduleDropDown.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.OnlyInCustomization;
                this.layoutControlGroupQuestion1.AddItem(this.lciListOfScheduleDropDown);
                //
                // simpleButton1
                //
                this.PreviewBooking = new SimpleButton();
                //this.PreviewBooking.Name = "PreviewDetails_simpleButton" + Guid.NewGuid().ToString();
                this.PreviewBooking.Name = "PreviewBooking";
                this.PreviewBooking.Size = new System.Drawing.Size(130, 22);
                this.PreviewBooking.StyleController = this.StyleController;
                if (!string.IsNullOrEmpty(answeroption.ViewDetailSummaryButtonLabel))
                    this.PreviewBooking.Text = answeroption.ViewDetailSummaryButtonLabel;
                else
                    this.PreviewBooking.Text = "Preview Details";

                this.PreviewBooking.Click += new EventHandler(viewDetailSummary_Click);
                this.PreviewBooking.Enabled = false;

                // lciListOfSchedulePreviewButton
                this.lciListOfSchedulePreviewButton = new LayoutControlItem();
                this.lciListOfSchedulePreviewButton.Name = "layoutControlItem" + Guid.NewGuid().ToString();
                this.lciListOfSchedulePreviewButton.Control = this.PreviewBooking;
                this.lciListOfSchedulePreviewButton.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
                this.lciListOfSchedulePreviewButton.MaxSize = new System.Drawing.Size(100, 24);
                this.lciListOfSchedulePreviewButton.MinSize = new System.Drawing.Size(80, 24);
                this.lciListOfSchedulePreviewButton.Size = new System.Drawing.Size(80, 24);
                this.lciListOfSchedulePreviewButton.TextVisible = false;
                this.lciListOfSchedulePreviewButton.ShowInCustomizationForm = false;
                this.lciListOfSchedulePreviewButton.Click += new EventHandler(layoutControlGroupQuestion1_Click);
                this.layoutControlGroupQuestion1.AddItem(this.lciListOfSchedulePreviewButton);

                //
                // simpleButton1
                //
                this.CreateMeeting = new SimpleButton();
                //this.CreateMeeting.Name = "CreateMeeting_simpleButton" + Guid.NewGuid().ToString();
                this.CreateMeeting.Name = "CreateMeeting";
                this.CreateMeeting.Size = new System.Drawing.Size(130, 22);
                this.CreateMeeting.StyleController = this.StyleController;
                if (!string.IsNullOrEmpty(answeroption.CreateMeetingButtonLabel))
                {
                    if (answeroption.CreateMeetingButtonLabel.Trim().ToLower() == "create meeting")
                    {
                        this.CreateMeeting.Text = "Create/Edit Meeting";
                    }
                    else
                    {
                        this.CreateMeeting.Text = answeroption.CreateMeetingButtonLabel;
                    }
                }
                else
                {
                    this.CreateMeeting.Text = "Create/Edit Meeting";
                }
                this.CreateMeeting.Click += new EventHandler(createMeeting_Click);
                this.CreateMeeting.Enabled = false;

                // layoutControlItem1
                this.lciListOfScheduleCreateEditButton = new LayoutControlItem();
                if (answeroption.ScheduleType != null && answeroption.ScheduleType.ScheduleTypeSelectedValue == "Meeting")
                {
                    //lookUpEdit2.Properties.ReadOnly = true;
                    this.CreateMeeting.Tag = "HasMeeting";
                }
                else
                    this.lciListOfScheduleCreateEditButton.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
                //this.lciListOfScheduleCreateEditButton.Name = "layoutControlItem" + Guid.NewGuid().ToString();
                this.lciListOfScheduleCreateEditButton.Name = "lciListOfScheduleCreateEditButton";
                this.lciListOfScheduleCreateEditButton.Control = this.CreateMeeting;
                this.lciListOfScheduleCreateEditButton.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
                this.lciListOfScheduleCreateEditButton.MaxSize = new System.Drawing.Size(115, 24);
                this.lciListOfScheduleCreateEditButton.MinSize = new System.Drawing.Size(115, 24);
                this.lciListOfScheduleCreateEditButton.Size = new System.Drawing.Size(115, 24);
                this.lciListOfScheduleCreateEditButton.TextVisible = false;
                this.lciListOfScheduleCreateEditButton.ShowInCustomizationForm = false;
                this.lciListOfScheduleCreateEditButton.Click += new EventHandler(layoutControlGroupQuestion1_Click);
                this.layoutControlGroupQuestion1.AddItem(this.lciListOfScheduleCreateEditButton, this.lciListOfSchedulePreviewButton, DevExpress.XtraLayout.Utils.InsertType.Right);
                //
                // simpleButton1
                //
                this.DeleteMeeting = new SimpleButton();
                //this.DeleteMeeting.Name = "DeleteMeeting_simpleButton" + Guid.NewGuid().ToString();
                this.DeleteMeeting.Name = "DeleteMeeting";
                this.DeleteMeeting.Size = new System.Drawing.Size(130, 22);
                this.DeleteMeeting.StyleController = this.StyleController;
                this.DeleteMeeting.Text = "Delete Meeting";
                this.DeleteMeeting.Click += new EventHandler(deleteMeeting_Click);
                this.DeleteMeeting.Enabled = false;

                // lciListOfScheduleDeleteButton
                this.lciListOfScheduleDeleteButton = new LayoutControlItem();
                if (answeroption.ScheduleType != null && answeroption.ScheduleType.ScheduleTypeSelectedValue == "Meeting")
                {
                    this.DeleteMeeting.Tag = "HasMeeting";
                    //lookUpEdit2.Properties.ReadOnly = true;
                    var lueData = lookUpEdit2.Tag as ScheduleData;
                    lueData.IsMeeting = true;
                }
                else
                    this.lciListOfScheduleDeleteButton.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
                this.lciListOfScheduleDeleteButton.Name = "layoutControlItem" + Guid.NewGuid().ToString();
                this.lciListOfScheduleDeleteButton.Control = this.DeleteMeeting;
                this.lciListOfScheduleDeleteButton.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
                this.lciListOfScheduleDeleteButton.MaxSize = new System.Drawing.Size(100, 24);
                this.lciListOfScheduleDeleteButton.MinSize = new System.Drawing.Size(80, 24);
                this.lciListOfScheduleDeleteButton.Size = new System.Drawing.Size(80, 24);
                this.lciListOfScheduleDeleteButton.TextVisible = false;
                this.lciListOfScheduleDeleteButton.ShowInCustomizationForm = false;
                this.lciListOfScheduleDeleteButton.Click += new EventHandler(layoutControlGroupQuestion1_Click);
                this.layoutControlGroupQuestion1.AddItem(this.lciListOfScheduleDeleteButton, this.lciListOfScheduleCreateEditButton, DevExpress.XtraLayout.Utils.InsertType.Right);

                ////load answer values
                //if (answeroption.ScheduleType != null) {
                //    if (answeroption.ScheduleValue != null) {
                //        if (!string.IsNullOrEmpty(answeroption.ScheduleValue.ScheduleId)) {
                //            int schedid = int.Parse(answeroption.ScheduleValue.ScheduleId);

                //            lookUpEdit2.EditValue = schedid;
                //            //if (answeroption.ScheduleType.ScheduleTypeSelectedValue.ToLower() == "meeting") {
                //            //    CreateMeeting.Enabled = true;
                //            //}
                //        }
                //    }
                //}

                // emptySpaceItem1
                this.emptySpaceItem1 = new EmptySpaceItem();
                this.emptySpaceItem1.Name = "emptySpaceItem" + Guid.NewGuid().ToString();
                this.emptySpaceItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
                this.emptySpaceItem1.MaxSize = new System.Drawing.Size(0, 20);
                this.emptySpaceItem1.MinSize = new System.Drawing.Size(0, 20);
                this.emptySpaceItem1.Size = new System.Drawing.Size(200, 20);
                this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
                this.emptySpaceItem1.ShowInCustomizationForm = false;
                this.emptySpaceItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click);
                this.layoutControlGroupQuestion1.AddItem(this.emptySpaceItem1, this.lciListOfScheduleDeleteButton, DevExpress.XtraLayout.Utils.InsertType.Right);
                #endregion

                #region Customer Attendies

                #region Grid
                simpleLabelItemValidation = new SimpleLabelItem();
                simpleLabelItemValidation.AppearanceItemCaption.BackColor = Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))));
                simpleLabelItemValidation.Name = Guid.NewGuid().ToString();
                simpleLabelItemValidation.TextAlignMode = TextAlignModeItem.CustomSize;
                simpleLabelItemValidation.TextSize = new Size(212, 20);
                simpleLabelItemValidation.Text = "  Please add at least one contact attendie.";
                simpleLabelItemValidation.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
                this.layoutControlGroupQuestion1.AddItem(simpleLabelItemValidation);

                //create our gridcontrol
                //
                // gridColumn1
                //
                this.gridColumn1 = new DevExpress.XtraGrid.Columns.GridColumn();
                this.gridColumn1.Caption = "Name";
                this.gridColumn1.FieldName = "Name";
                this.gridColumn1.Name = "gridColumn" + Guid.NewGuid().ToString();
                this.gridColumn1.Visible = true;
                this.gridColumn1.OptionsColumn.AllowEdit = false;
                this.gridColumn1.VisibleIndex = 0;
                this.gridColumn1.Width = 66;
                //
                // gridColumn2
                //
                this.gridColumn2 = new DevExpress.XtraGrid.Columns.GridColumn();
                this.gridColumn2.Caption = "Address";
                this.gridColumn2.FieldName = "Address";
                this.gridColumn2.Name = "gridColumn" + Guid.NewGuid().ToString();
                this.gridColumn2.Visible = true;
                this.gridColumn2.OptionsColumn.AllowEdit = false;
                this.gridColumn2.VisibleIndex = 1;
                this.gridColumn2.Width = 66;
                //
                // gridColumn3
                //
                //this.gridColumn3 = new DevExpress.XtraGrid.Columns.GridColumn();
                //this.gridColumn3.Caption = "City";
                //this.gridColumn3.FieldName = "City";
                //this.gridColumn3.Name = "gridColumn" + Guid.NewGuid().ToString();
                //this.gridColumn3.Visible = true;
                //this.gridColumn3.OptionsColumn.AllowEdit = false;
                //this.gridColumn3.VisibleIndex = 2;
                //this.gridColumn3.Width = 66;
                //
                // gridColumn4
                //
                this.gridColumn4 = new DevExpress.XtraGrid.Columns.GridColumn();
                this.gridColumn4.Caption = "Telephone";
                this.gridColumn4.FieldName = "Telephone";
                this.gridColumn4.Name = "gridColumn" + Guid.NewGuid().ToString();
                this.gridColumn4.Visible = true;
                this.gridColumn4.OptionsColumn.AllowEdit = false;
                this.gridColumn4.VisibleIndex = 3;
                this.gridColumn4.Width = 66;
                //
                // gridColumn5
                //
                this.gridColumn5 = new DevExpress.XtraGrid.Columns.GridColumn();
                this.gridColumn5.Caption = "Email";
                this.gridColumn5.FieldName = "Email";
                this.gridColumn5.Name = "gridColumn" + Guid.NewGuid().ToString();
                this.gridColumn5.Visible = true;
                this.gridColumn5.OptionsColumn.AllowEdit = false;
                this.gridColumn5.VisibleIndex = 4;
                this.gridColumn5.Width = 70;
                //
                // gridColumn6
                //
                this.gridColumn6 = new DevExpress.XtraGrid.Columns.GridColumn();
                this.gridColumn6.Caption = "AccountID";
                this.gridColumn6.FieldName = "AccountID";
                this.gridColumn6.Name = "gridColumn" + Guid.NewGuid().ToString();
                this.gridColumn6.Visible = false;
                //
                // gridColumn7
                //
                this.gridColumn7 = new DevExpress.XtraGrid.Columns.GridColumn();
                this.gridColumn7.Caption = "ContactID";
                this.gridColumn7.FieldName = "ContactID";
                this.gridColumn7.Name = "gridColumn" + Guid.NewGuid().ToString();
                this.gridColumn7.Visible = false;

                //
                // gridView1
                //
                this.gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView();
                this.gridView1.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
                this.gridColumn1,
                this.gridColumn2,
                //this.gridColumn3,
                this.gridColumn4,
                this.gridColumn5,
                this.gridColumn6,
                this.gridColumn7});
                this.gridView1.GridControl = this.gridControl1;
                this.gridView1.Name = "gridView" + Guid.NewGuid().ToString();
                this.gridView1.OptionsFind.AlwaysVisible = false;
                this.gridView1.OptionsSelection.EnableAppearanceFocusedCell = false;
                this.gridView1.OptionsSelection.MultiSelect = true;
                this.gridView1.OptionsView.ShowGroupPanel = false;
                this.gridView1.OptionsView.ColumnAutoWidth = true;
                this.gridView1.DataSourceChanged += new EventHandler(gridView1_DataSourceChanged);
                //
                // gridControl1
                //
                this.gridControl1 = new DevExpress.XtraGrid.GridControl();
                this.gridControl1.LookAndFeel.UseDefaultLookAndFeel = false;
                this.gridControl1.MainView = this.gridView1;
                this.gridControl1.Name = "gridControl" + Guid.NewGuid().ToString();
                this.gridControl1.Size = new System.Drawing.Size(150, 74);
                this.gridControl1.TabIndex = 11;
                this.gridControl1.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
                this.gridView1});
                SetCurrentAttendies();
                var schedData = new ScheduleData()
                {
                    Required = answeroption.AttendiesRequired
                };
                if (gridView1.GridControl.DataSource != null)
                {
                    List<ContactAttendie> gvDs = gridView1.GridControl.DataSource as List<ContactAttendie>;
                    if (gvDs != null && gvDs.Count > 0)
                        schedData.HasValue = true;
                }
                this.gridView1.Tag = schedData;
                //
                // lciGridControl
                //
                this.lciGridControl = new LayoutControlItem();
                this.lciGridControl.Control = this.gridControl1;
                this.lciGridControl.Name = "layoutControlItem" + Guid.NewGuid().ToString();
                if (!string.IsNullOrEmpty(answeroption.AttendiesLabel))
                    this.lciGridControl.Text = answeroption.AttendiesLabel;
                else
                    this.lciGridControl.Text = "Attendies:";
                this.lciGridControl.TextLocation = DevExpress.Utils.Locations.Top;
                this.lciGridControl.TextSize = new System.Drawing.Size(108, 13);
                this.lciGridControl.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
                this.lciGridControl.MaxSize = new System.Drawing.Size(0, 90);
                this.lciGridControl.MinSize = new System.Drawing.Size(0, 90);
                this.lciGridControl.Size = new System.Drawing.Size(200, 90);
                this.lciGridControl.ShowInCustomizationForm = false;
                this.layoutControlGroupQuestion1.AddItem(this.lciGridControl);
                #endregion

                //
                // simpleButton1
                //
                this.simpleButton1 = new SimpleButton();
                this.simpleButton1.Name = "simpleButton" + Guid.NewGuid().ToString();
                this.simpleButton1.Size = new System.Drawing.Size(130, 22);
                this.simpleButton1.StyleController = this.StyleController;
                this.simpleButton1.Enabled = false;
                if (!string.IsNullOrEmpty(answeroption.AddCallerButtonLabel))
                    this.simpleButton1.Text = answeroption.AddCallerButtonLabel;
                else
                    this.simpleButton1.Text = "Add Caller";
                this.simpleButton1.Click += new EventHandler(AddCaller_Click);

                // lciAddCaller
                this.lciAddCaller = new LayoutControlItem();
                this.lciAddCaller.Name = "layoutControlItem" + Guid.NewGuid().ToString();
                this.lciAddCaller.Control = this.simpleButton1;
                this.lciAddCaller.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
                this.lciAddCaller.MaxSize = new System.Drawing.Size(80, 24);
                this.lciAddCaller.MinSize = new System.Drawing.Size(80, 24);
                this.lciAddCaller.Size = new System.Drawing.Size(80, 24);
                this.lciAddCaller.TextVisible = false;
                this.lciAddCaller.ShowInCustomizationForm = false;
                this.lciAddCaller.Click += new EventHandler(layoutControlGroupQuestion1_Click);
                this.layoutControlGroupQuestion1.AddItem(this.lciAddCaller);

                //
                // simpleButton2
                //
                this.simpleButton2 = new SimpleButton();
                this.simpleButton2.Name = "simpleButton" + Guid.NewGuid().ToString();
                this.simpleButton2.Size = new System.Drawing.Size(130, 22);
                this.simpleButton2.StyleController = this.StyleController;
                this.simpleButton2.Enabled = false;
                if (!string.IsNullOrEmpty(answeroption.AddAdditionalAttendieButtonLabel))
                    this.simpleButton2.Text = answeroption.AddAdditionalAttendieButtonLabel;
                else
                    this.simpleButton2.Text = "Add Additional";
                this.simpleButton2.Click += new EventHandler(AddAdditional_Click);

                // layoutControlItem1
                this.lciAddAdditional = new LayoutControlItem();
                this.lciAddAdditional.Name = "layoutControlItem" + Guid.NewGuid().ToString();
                this.lciAddAdditional.Control = this.simpleButton2;
                this.lciAddAdditional.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
                this.lciAddAdditional.MaxSize = new System.Drawing.Size(100, 24);
                this.lciAddAdditional.MinSize = new System.Drawing.Size(80, 24);
                this.lciAddAdditional.Size = new System.Drawing.Size(80, 24);
                this.lciAddAdditional.TextVisible = false;
                this.lciAddAdditional.ShowInCustomizationForm = false;
                this.lciAddAdditional.Click += new EventHandler(layoutControlGroupQuestion1_Click);
                this.layoutControlGroupQuestion1.AddItem(this.lciAddAdditional, this.lciAddCaller, DevExpress.XtraLayout.Utils.InsertType.Right);

                //
                // simpleButton3
                //
                this.simpleButton3 = new SimpleButton();
                this.simpleButton3.Name = "simpleButton" + Guid.NewGuid().ToString();
                this.simpleButton3.Size = new System.Drawing.Size(130, 22);
                this.simpleButton3.StyleController = this.StyleController;
                this.simpleButton3.Enabled = false;
                if (!string.IsNullOrEmpty(answeroption.DeleteAttendieButtonLabel))
                    this.simpleButton3.Text = answeroption.DeleteAttendieButtonLabel;
                else
                    this.simpleButton3.Text = "Delete";
                this.simpleButton3.Click += new EventHandler(DeleteAttendie_Click);

                // layoutControlItem2
                this.lciDeleteCaller = new LayoutControlItem();
                this.lciDeleteCaller.Name = "layoutControlItem" + Guid.NewGuid().ToString();
                this.lciDeleteCaller.Control = this.simpleButton3;
                this.lciDeleteCaller.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
                this.lciDeleteCaller.MaxSize = new System.Drawing.Size(70, 24);
                this.lciDeleteCaller.MinSize = new System.Drawing.Size(70, 24);
                this.lciDeleteCaller.Size = new System.Drawing.Size(70, 24);
                this.lciDeleteCaller.TextVisible = false;
                this.lciDeleteCaller.ShowInCustomizationForm = false;
                this.lciDeleteCaller.Click += new EventHandler(layoutControlGroupQuestion1_Click);
                this.layoutControlGroupQuestion1.AddItem(this.lciDeleteCaller, this.lciAddAdditional, DevExpress.XtraLayout.Utils.InsertType.Right);

                // emptySpaceItem1
                this.emptySpaceItem1 = new EmptySpaceItem();
                this.emptySpaceItem1.Name = "emptySpaceItem" + Guid.NewGuid().ToString();
                this.emptySpaceItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
                this.emptySpaceItem1.MaxSize = new System.Drawing.Size(0, 20);
                this.emptySpaceItem1.MinSize = new System.Drawing.Size(0, 20);
                this.emptySpaceItem1.Size = new System.Drawing.Size(200, 20);
                this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
                this.emptySpaceItem1.ShowInCustomizationForm = false;
                this.emptySpaceItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click);
                this.layoutControlGroupQuestion1.AddItem(this.emptySpaceItem1, this.lciDeleteCaller, DevExpress.XtraLayout.Utils.InsertType.Right);

                #endregion

                #region Other Choices
                idx = 0;
                //EmptySpaceItem esitem = new EmptySpaceItem();
                //esitem.Size = new Size(100, 20);
                //this.layoutControlGroupQuestion1.AddItem(esitem);
                foreach (OtherChoice oChoice in answeroption.OtherChoices)
                {
                    if (oChoice.Enabled)
                    {
                        //if (!string.IsNullOrEmpty(oChoice.TextPrefix)) {
                        //    // simpleLabelItem1
                        //    this.simpleLabelItem1 = new DevExpress.XtraLayout.SimpleLabelItem();

                        //    this.simpleLabelItem1.Name = "simpleLabelItem" + Guid.NewGuid().ToString();
                        //    //this.simpleLabelItem1.ShowInCustomizationForm = false;
                        //    //this.simpleLabelItem1.AppearanceItemCaption.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
                        //    this.simpleLabelItem1.Text = oChoice.TextPrefix;
                        //    //newSize = new System.Drawing.Size(100, 20);
                        //    newSize = new System.Drawing.Size(20, 20);
                        //    this.simpleLabelItem1.SizeConstraintsType = SizeConstraintsType.Custom;
                        //    this.simpleLabelItem1.MaxSize = newSize;
                        //    this.simpleLabelItem1.MinSize = newSize;
                        //    this.simpleLabelItem1.Size = newSize;
                        //    this.simpleLabelItem1.AppearanceItemCaption.BackColor = System.Drawing.Color.Transparent;
                        //    this.simpleLabelItem1.ShowInCustomizationForm = false;
                        //    this.simpleLabelItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click);
                        //    this.layoutControlGroupQuestion1.AddItem(this.simpleLabelItem1);
                        //} else {
                        //    this.simpleLabelItem1 = null;
                        //}
                        // layoutControlItem1
                        this.lciOtherChoice = new LayoutControlItem();
                        //add textEdit1 to layout
                        this.memoEdit1 = new MemoEdit();
                        this.memoEdit1.Tag = new ScheduleData()
                        {
                            ParentPositionIndex = "IndexPosition" + x.ToString(),
                            PositionIndex = "IndexPosition" + idx.ToString(),
                            ControlContainer = lciOtherChoice,
                            Required = oChoice.Required,
                            HasValue = !string.IsNullOrWhiteSpace(oChoice.DefaultInputValue) ? true : false,
                            ChoiceOption = oChoice
                        };
                        this.memoEdit1.Name = "textEdit" + Guid.NewGuid().ToString();
                        this.memoEdit1.Properties.ScrollBars = System.Windows.Forms.ScrollBars.None;
                        this.memoEdit1.StyleController = this.StyleController;
                        if (oChoice.DefaultInputValue != null)
                        {
                            this.memoEdit1.Text = oChoice.DefaultInputValue.Trim();
                            oChoice.InputValue = oChoice.DefaultInputValue.Trim();
                        }
                        memoEdit1.TextChanged += new EventHandler(memoEdit1_TextChanged);
                        memoEdit1.Resize += new EventHandler(memoEdit1_Resize);
                        memoEdit1.Click += new EventHandler(layoutControlGroupQuestion1_Click);

                        this.lciOtherChoice.Name = "layoutControlItem" + Guid.NewGuid().ToString();
                        this.lciOtherChoice.Control = this.memoEdit1;

                        if (!string.IsNullOrEmpty(oChoice.TextPrefix))
                        {
                            this.lciOtherChoice.Text = oChoice.TextPrefix;
                            this.lciOtherChoice.TextVisible = true;
                            this.lciOtherChoice.TextLocation = DevExpress.Utils.Locations.Top;
                            this.lciOtherChoice.MaxSize = new Size(0, 41);
                            this.lciOtherChoice.MinSize = new Size(0, 41);
                        }
                        else
                        {
                            this.lciOtherChoice.TextVisible = false;
                            this.lciOtherChoice.MaxSize = new Size(0, 24);
                            this.lciOtherChoice.MinSize = new Size(0, 24);
                        }
                        this.lciOtherChoice.SizeConstraintsType = SizeConstraintsType.Custom;
                        this.lciOtherChoice.Click += new EventHandler(layoutControlGroupQuestion1_Click);
                        this.lciOtherChoice.ShowInCustomizationForm = false;
                        this.layoutControlGroupQuestion1.AddItem(this.lciOtherChoice);
                        idx++;
                    }
                }
                #endregion

            }

            #region Footer
            //string prioText = oSettings.Priority;
            //if (oSettings.CustomerOwnership && oSettings.BVOwnership) {
            //    prioText += "(Cust+BV)";
            //} else if (oSettings.CustomerOwnership) {
            //    prioText += "(Cust)";
            //} else if (oSettings.BVOwnership) {
            //    prioText += "(BV)";
            //}
            //if (oSettings.PlotDoneStatus.Trim().ToLower() == "done") {
            //    prioText += " Done";
            //}

            //// simpleLabelItem1 status
            //this.emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem();
            //this.emptySpaceItem1.Name = "simpleLabelItem" + Guid.NewGuid().ToString();
            //this.emptySpaceItem1.AppearanceItemCaption.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
            //this.emptySpaceItem1.AppearanceItemCaption.Options.UseTextOptions = true;
            //this.emptySpaceItem1.ShowInCustomizationForm = false;
            //this.emptySpaceItem1.SizeConstraintsType = SizeConstraintsType.Custom;
            //this.emptySpaceItem1.Text = prioText;
            //this.emptySpaceItem1.TextVisible = true;
            //this.emptySpaceItem1.ShowInCustomizationForm = false;
            //this.emptySpaceItem1.Click += new EventHandler(layoutControlGroupQuestion1_Click);
            //this.layoutControlGroupQuestion1.AddItem(this.emptySpaceItem1);

            //if (!string.IsNullOrEmpty(oSettings.QuestionHelp)) {
            //    this.emptySpaceItem2 = new DevExpress.XtraLayout.EmptySpaceItem();
            //    this.emptySpaceItem2.Name = "simpleLabelItem" + Guid.NewGuid().ToString();
            //    this.emptySpaceItem2.AppearanceItemCaption.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
            //    this.emptySpaceItem2.AppearanceItemCaption.Options.UseTextOptions = true;
            //    this.emptySpaceItem2.ShowInCustomizationForm = false;
            //    this.emptySpaceItem2.Text = "Help";
            //    this.emptySpaceItem2.OptionsToolTip.ToolTip = oSettings.QuestionHelp.Trim();

            //    //apply tooltip controller from parent
            //    //if (this.ToolTipController != null && this.ToolTipController.DefaultController != null) {
            //    //    this.emptySpaceItem2.OptionsToolTip.ToolTipController = ToolTipController.DefaultController;
            //    //}

            //    this.emptySpaceItem2.TextVisible = true;
            //    this.emptySpaceItem2.Size = new Size(50, 20);
            //    this.emptySpaceItem2.MaxSize = new Size(50, 20);
            //    this.emptySpaceItem2.MinSize = new Size(50, 20);
            //    this.emptySpaceItem2.SizeConstraintsType = SizeConstraintsType.Custom;
            //    this.emptySpaceItem2.ShowInCustomizationForm = false;
            //    this.emptySpaceItem2.Click += new EventHandler(layoutControlGroupQuestion1_Click);
            //    this.emptySpaceItem2.AppearanceItemCaption.TextOptions.HAlignment = HorzAlignment.Far;
            //    this.layoutControlGroupQuestion1.AddItem(this.emptySpaceItem2, this.emptySpaceItem1, DevExpress.XtraLayout.Utils.InsertType.Right);
            //}
            #endregion

            this.layoutControlGroupQuestion1.Click += new EventHandler(layoutControlGroupQuestion1_Click);
            this.layoutControlGroupQuestion1.EndUpdate();
            Image bg = BGImage(this);
            if (bg != null)
            {
                this.layoutControlGroupQuestion1.BackgroundImage = bg;
                this.layoutControlGroupQuestion1.BackgroundImageVisible = true;
            }
            if (this.memoEdit1 != null)
                BackColor = this.memoEdit1.BackColor;

            //lookUpEdit2.EditValue = null;
            //lookUpEdit2.ItemIndex = 0;

            this.ControlGroup = this.layoutControlGroupQuestion1;
            this.ControlGroup.Tag = this;
            isLoaded = true;
        }
Example #45
0
        private void InitializeQuery()
        {
            List <Sys_Schema> sys_Schemas = InitializeField();

            if (gds.SelectedIndex < 0)
            {
                return;
            }
            GroupControl grid;

            if (gds.EditValue != null && gds.EditValue.GetType() == typeof(GroupControl))
            {
                grid = (GroupControl)gds.EditValue;
                LayoutControl eLayoutControl = (LayoutControl)iDesignerHost.CreateComponent(typeof(LayoutControl), "lyc");
                grid.Controls.Add(eLayoutControl);
                eLayoutControl.BeginUpdate();
                LayoutControlGroup eLayoutControlGroup = new LayoutControlGroup();
                eLayoutControlGroup.BeginUpdate();
                eLayoutControl.Dock     = System.Windows.Forms.DockStyle.Fill;
                eLayoutControl.Location = new System.Drawing.Point(2, 21);
                eLayoutControl.Name     = "eLayoutControl";
                eLayoutControl.Root     = eLayoutControlGroup;
                eLayoutControl.Size     = new System.Drawing.Size(1000, 500);
                eLayoutControl.TabIndex = 0;
                eLayoutControl.Text     = "QueryLayout";
                eLayoutControlGroup.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
                eLayoutControlGroup.GroupBordersVisible         = false;
                eLayoutControlGroup.Size        = new Size(1000, 500);
                eLayoutControlGroup.Location    = new Point(0, 0);
                eLayoutControlGroup.Name        = "eLayoutControlGroup";
                eLayoutControlGroup.TextVisible = false;
                List <BaseLayoutItem> baseLayoutItems = new List <BaseLayoutItem>();
                int curLeft = 0;
                int curTop  = 0;
                foreach (Sys_Schema sys_Schema in sys_Schemas)
                {
                    try
                    {
                        string   gn       = string.Format("f{0}", sys_Schema.FieldName);
                        BaseEdit baseEdit = null;
                        if (sys_Schema.SqlDbType.Equals("bit"))
                        {
                            baseEdit      = (CheckEdit)iDesignerHost.CreateComponent(typeof(CheckEdit), gn);
                            baseEdit.Text = string.Empty;
                        }
                        else if (sys_Schema.SqlDbType.Equals("datetime"))
                        {
                            baseEdit = (DateEdit)iDesignerHost.CreateComponent(typeof(DateEdit), gn);
                        }
                        else
                        {
                            baseEdit = (TextEdit)iDesignerHost.CreateComponent(typeof(TextEdit), gn);
                        }
                        baseEdit.Width = 250;
                        baseEdit.Properties.Appearance.Options.UseTextOptions = true;
                        LayoutControlItem eLayoutControlItem = new LayoutControlItem();
                        eLayoutControlItem.Location = new System.Drawing.Point(curLeft, curTop);
                        eLayoutControlItem.Name     = "oli_" + sys_Schema.FieldName;
                        eLayoutControlItem.Text     = sys_Schema.Description;
                        eLayoutControlItem.Size     = new Size(baseEdit.Width, baseEdit.Height);
                        eLayoutControlItem.Control  = baseEdit;
                        baseLayoutItems.Add(eLayoutControlItem);
                        curLeft += baseEdit.Width;
                        if (curLeft >= eLayoutControlGroup.Width)
                        {
                            curLeft = 0;
                            curTop += baseEdit.Height;
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                }
                if (curLeft < eLayoutControlGroup.Width && curLeft > 0)
                {
                    EmptySpaceItem emptySpaceItem = new EmptySpaceItem();
                    emptySpaceItem.AllowHotTrack = false;
                    emptySpaceItem.Location      = new System.Drawing.Point(curLeft, curTop);
                    emptySpaceItem.Name          = "oli_Space";
                    emptySpaceItem.Size          = new System.Drawing.Size(eLayoutControlGroup.Width - curLeft, 24);
                    baseLayoutItems.Add(emptySpaceItem);
                }
                EmptySpaceItem emptyBottom = new EmptySpaceItem();
                emptyBottom.AllowHotTrack = false;
                emptyBottom.Location      = new System.Drawing.Point(0, curTop + 24);
                emptyBottom.Name          = "oli_Space";
                emptyBottom.Size          = new System.Drawing.Size(eLayoutControlGroup.Width, 24);
                baseLayoutItems.Add(emptyBottom);
                eLayoutControlGroup.Items.AddRange(baseLayoutItems.ToArray());
                eLayoutControlGroup.EndUpdate();
                eLayoutControl.EndUpdate();
            }
        }
Example #46
0
 private void scaleApplyToSelectionLayoutItem(LayoutControlItem layoutControlItem)
 {
     layoutControlItem.MinSize = new Size(UIConstants.UI.APPLY_TO_SELECTION_WIDTH, scaleForScreenDPI(UIConstants.UI.APPLY_TO_SELECTION_HEIGHT));
     layoutControlItem.MaxSize = layoutControlItem.MinSize;
 }
Example #47
0
 private void scaleLegendLayoutItem(LayoutControlItem layoutControlItem)
 {
     layoutControlItem.MinSize = new Size(scaleForScreenDPI(UIConstants.UI.START_VALUES_LEGEND_WIDTH), scaleForScreenDPI(UIConstants.UI.START_VALUES_LEGEND_HEIGHT));
     layoutControlItem.MaxSize = layoutControlItem.MinSize;
 }
Example #48
0
        public Control AddInputControl(InputItem ii, string controlName)
        {
            LayoutControlItem lci = null;

            string ctlName = controlName;

            switch (ii.ControlType.ToUpper())
            {
            case FuncConstDefine.Cbx:
                ComboBox cbx = new ComboBox();
                cbx.Name = ctlName;

                //从数据源加载数据

                //设置默认值
                cbx.Text = ii.DefaultValue;

                lci      = lcDemo.Root.AddItem(ctlName, cbx);
                lci.Text = ii.Name;

                ii.LinkControl = cbx;

                return(cbx);

            case FuncConstDefine.Txt:
                TextBox tb = new TextBox();
                tb.Name = ctlName;
                tb.Text = ii.DefaultValue;    //设置默认值

                lci      = lcDemo.Root.AddItem(ctlName, tb);
                lci.Text = ii.Name;

                ii.LinkControl = tb;

                return(tb);

            case FuncConstDefine.RTxt:
                RichTextBox rtb = new RichTextBox();
                rtb.Name = ctlName;
                rtb.Text = ii.DefaultValue;    //设置默认值

                rtb.Height = 150;

                lci      = lcDemo.Root.AddItem(ctlName, rtb);
                lci.Text = ii.Name;

                lci.Height = rtb.Height;

                ii.LinkControl = rtb;

                return(rtb);

            case FuncConstDefine.Dtp:
                DateTimePicker dtp = new DateTimePicker();
                dtp.Name = ctlName;

                try
                {
                    if (string.IsNullOrEmpty(ii.DefaultValue) == false)
                    {
                        //设置默认值
                        dtp.Value = Convert.ToDateTime(ii.DefaultValue);
                    }
                }
                catch
                { }

                lci      = lcDemo.Root.AddItem(ctlName, dtp);
                lci.Text = ii.Name;

                ii.LinkControl = dtp;

                return(dtp);

            default:
                return(null);
            }
        }
Example #49
-1
        public void AddEvent()
        {
            LayoutControl lcMain = _data.FrmMain.Controls.Find("lcMain", true)[0] as LayoutControl;
            RadioGroup radioEdit1 = new RadioGroup();
            object[] itemValues = new object[] { 0, 1 };
            string[] itemDescriptions = new string[] { "Theo tháng", "Theo lần phát sinh" };
            for (int i = 0; i < itemValues.Length; i++)
            {
                radioEdit1.Properties.Items.Add(new RadioGroupItem(itemValues[i], itemDescriptions[i]));
            }
            radioEdit1.BackColor = System.Drawing.Color.Transparent;
            radioEdit1.Properties.Columns = 1;
            radioEdit1.BorderStyle = BorderStyles.NoBorder;
            radioEdit1.Name = "radioEdit1";
            LayoutControlItem item6 = GetElementByName(lcMain, "InputDate");
            item6.TextVisible = false;
            LayoutControlItem item7 = GetElementByName(lcMain, "KyBKBRTTDB");
            item7.TextVisible = false;
            LayoutControlItem item5 = new LayoutControlItem(lcMain, radioEdit1);
            item5.Parent = lcMain.Root;
            item5.Move(item7, InsertType.Left);
            item6.Move(item5, InsertType.Right);
            item7.Move(item6, InsertType.Top);
            item5.TextVisible = false;
            item5.Width = 120;
            item5.Height = 48;
            item5.Name = "radioEdit1";
            item5.AppearanceItemCaption.Options.UseBackColor = false;
            _data.FrmMain.Controls.Add(lcMain);
            item5 = lcMain.Root.AddItem();

            this._data.FrmMain.Load += new EventHandler(Frm_Load);
            radioEdit1.SelectedIndexChanged += new EventHandler(radioEdit1_SelectedIndexChanged);
            radioEdit1_SelectedIndexChanged(null, null);
            SpinEdit sepKy = _data.FrmMain.Controls.Find("KyBKBRTTDB", true)[0] as SpinEdit;
            DateEdit dtmInputDate = _data.FrmMain.Controls.Find("InputDate", true)[0] as DateEdit;
            sepKy.EditValueChanged += new EventHandler(sepKy_EditValueChanged);
            dtmInputDate.EditValueChanged += new EventHandler(dtmInputDate_EditValueChanged);
        }